/* Shared styles — used by login, bidder, and admin pages */

:root {
  --bg: #fafaf7;
  --bg-card: #ffffff;
  --bg-soft: #f4f3ee;
  --bg-deeper: #e8e7e0;
  --ink: #1a1a1a;
  --ink-soft: #4a4a47;
  --ink-muted: #8a8a85;
  --accent: #1d4ed8;
  --accent-soft: #eaf0ff;
  --accent-deep: #1e3a8a;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --good: #15803d;
  --good-soft: #dcfce7;
  --border: #e5e4dd;
  --border-strong: #d1cfc4;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.08);
  --radius: 8px;
  --radius-sm: 4px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ─── HEADER ─── */
.app-header {
  background: var(--ink);
  color: #fff;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}
.app-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.app-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,.55);
  font-family: var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.user-info {
  text-align: right;
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.user-info strong {
  color: #fff;
  display: block;
  font-weight: 600;
}
.user-info .role-badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,.15);
  margin-top: 2px;
}
.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-logout:hover { background: rgba(255,255,255,.1); }

/* ─── PANELS ─── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.panel-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
}
.panel-body {
  padding: 20px;
}

/* ─── FORM ─── */
.field {
  margin-bottom: 18px;
}
.field:last-child { margin-bottom: 0; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field-required {
  color: var(--danger);
  margin-left: 2px;
}
.field-hint {
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 8px;
  font-style: italic;
}
.field-input,
.field-textarea,
.field-select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field-input:focus,
.field-textarea:focus,
.field-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}
.field-textarea.tall {
  min-height: 220px;
}
.field-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 36px;
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: #fff;
}
.btn-primary:hover { background: var(--accent); }
.btn-primary:disabled {
  background: var(--border-strong);
  color: var(--ink-muted);
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--bg-card);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: var(--bg-soft);
  border-color: var(--ink);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-soft);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-good {
  background: var(--good);
  color: #fff;
}
.btn-good:hover { background: #166534; }
.btn-small {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-block { width: 100%; }
.btn .btn-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ─── PROFILE PICKER ─── */
.profile-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 700px) {
  .profile-picker { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .profile-picker { grid-template-columns: 1fr; }
}
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 12px 14px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.profile-card:hover {
  border-color: var(--ink);
  background: var(--bg-soft);
}
.profile-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent);
}
.profile-card-name {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
  color: var(--ink);
  padding-right: 50px; /* space for the status badge */
}
.profile-card-niche {
  font-size: 11px;
  color: var(--ink-muted);
  font-family: var(--sans);
  line-height: 1.35;
}
.profile-card-status {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 10px;
  font-family: var(--mono);
  padding: 1px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.profile-card-status.ready {
  background: var(--good-soft);
  color: var(--good);
}
.profile-card-status.draft {
  background: var(--warn-soft);
  color: var(--warn);
}

/* ─── VALIDATION ─── */
.validation {
  background: var(--bg-soft);
  border-left: 3px solid var(--ink);
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.validation-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.validation.warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}
.validation.warn .validation-title { color: var(--warn); }
.validation.danger {
  background: var(--danger-soft);
  border-left-color: var(--danger);
}
.validation.danger .validation-title { color: var(--danger); }
.validation.good {
  background: var(--good-soft);
  border-left-color: var(--good);
}
.validation.good .validation-title { color: var(--good); }
.validation-list {
  font-size: 13px;
  list-style: none;
}
.validation-list li {
  padding: 3px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.validation-list li::before {
  content: "→";
  color: currentColor;
  flex-shrink: 0;
  opacity: 0.6;
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  transition: transform .25s ease;
  z-index: 1000;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.good { background: var(--good); }
.toast.warn { background: var(--warn); }
.toast.danger { background: var(--danger); }

/* ─── TABLES ─── */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  position: sticky;
  top: 0;
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:hover td { background: var(--bg-soft); }
.table .num {
  font-family: var(--mono);
  font-size: 12px;
  text-align: right;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--bg-deeper); color: var(--ink-soft); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

/* ─── HELPERS ─── */
.muted { color: var(--ink-muted); font-size: 12px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ─── MODAL ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}
.modal-body {
  padding: 24px;
}
.modal-pre {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  background: var(--bg-soft);
  padding: 16px;
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  word-wrap: break-word;
  border: 1px solid var(--border);
  max-height: 50vh;
  overflow-y: auto;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }
