/* ═══════════════════════════════════════════════════════════
   Colter's Admin — Pit Boss Edition
   Warm Texas editorial · Fraunces + DM Sans
   OKLCH color system · amber nav indicator · connected stats
═══════════════════════════════════════════════════════════ */

/* ── Design tokens ─────────────────────────────────────────── */
:root {
  /* Surfaces — charred oak warmth */
  --bg:           oklch(12.5% 0.019 52);
  --surface:      oklch(16.5% 0.021 52);
  --card:         oklch(20.0% 0.022 52);
  --elevated:     oklch(24.0% 0.022 52);
  --hover:        oklch(26.5% 0.022 52);

  /* Text — warm parchment */
  --text:         oklch(92%   0.018 72);
  --text-dim:     oklch(70%   0.015 62);
  --text-muted:   oklch(48%   0.012 57);

  /* Borders */
  --border:       oklch(23%   0.018 52);
  --border-mid:   oklch(30%   0.018 52);

  /* Brand red */
  --red:          oklch(48%   0.165 28);
  --red-hover:    oklch(43%   0.165 28);
  --red-subtle:   oklch(48%   0.165 28 / 0.13);

  /* Amber — fire glow · active + focus accent */
  --amber:        oklch(74%   0.155 65);
  --amber-subtle: oklch(74%   0.155 65 / 0.12);

  /* Semantic */
  --success:      oklch(63%   0.148 145);
  --warning:      oklch(76%   0.148 82);

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-sans:    'DM Sans', system-ui, sans-serif;
  /* Legacy aliases so any inline usage doesn't break */
  --font:         var(--font-sans);
  --font-serif:   var(--font-display);

  /* Layout */
  --sidebar-w: 220px;
  --topbar-h:  56px;
  --radius:    0.375rem;
  --radius-lg: 0.625rem;

  /* Legacy compat */
  --ab:          var(--bg);
  --ab-surface:  var(--surface);
  --ab-card:     var(--card);
  --ab-border:   var(--border);
  --ab-mid:      var(--border-mid);
  --cream:       var(--text);
  --cream-dim:   var(--text-dim);
  --cream-muted: var(--text-muted);
  --green:       var(--success);
  --yellow:      var(--warning);
  --nav-w:       var(--sidebar-w);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; font-kerning: normal; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, textarea, select, button { font-family: var(--font-sans); }

/* ── Sidebar ────────────────────────────────────────────────── */
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 50;
}

.admin-brand {
  padding: 1.75rem 1.5rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
}
.admin-brand img {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.85;
}
.admin-brand small {
  display: block;
  font-size: 0.575rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

/* Nav labels — editorial section markers */
.admin-nav { padding: 1.25rem 0; flex: 1; }
.admin-nav-label {
  font-size: 0.565rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 1rem 1.5rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.admin-nav-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Nav items — amber spring indicator */
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.58rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 400;
  transition: color 0.15s, background 0.15s;
  position: relative;
}
.admin-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 55%;
  background: var(--amber);
  border-radius: 0 2px 2px 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.admin-nav a:hover {
  color: var(--text);
  background: oklch(24% 0.020 52 / 0.7);
}
.admin-nav a.active {
  color: var(--text);
  background: oklch(24% 0.020 52 / 0.9);
  font-weight: 500;
}
.admin-nav a.active::before { transform: translateY(-50%) scaleY(1); }
.admin-nav svg { flex-shrink: 0; opacity: 0.6; transition: opacity 0.15s; }
.admin-nav a:hover svg,
.admin-nav a.active svg { opacity: 1; }

/* Theme toggle */
.theme-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 0.58rem 1.5rem;
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 400;
  transition: color 0.15s, background 0.15s;
  text-align: left;
}
.theme-btn:hover { color: var(--text); background: oklch(24% 0.020 52 / 0.7); }
.theme-btn-icon-dark  { flex-shrink: 0; opacity: 0.6; }
.theme-btn-icon-light { flex-shrink: 0; opacity: 0; width: 0; overflow: hidden; transition: opacity 0.2s, width 0.2s; }

/* Sidebar footer */
.admin-sidebar-footer {
  padding: 1.1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.sidebar-user-label {
  font-size: 0.565rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}
.sidebar-user-name  { color: var(--text); font-size: 0.84rem; font-weight: 500; margin-top: 0.1rem; }
.sidebar-footer-row { display: flex; align-items: center; justify-content: space-between; margin-top: 0.5rem; }
.sidebar-signout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  transition: color 0.15s;
  margin-top: 0.55rem;
}
.sidebar-signout:hover { color: var(--red); }

/* ── Main layout ───────────────────────────────────────────── */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 2.25rem;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}
.admin-topbar h1 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.015em;
}
.admin-topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.admin-content { padding: 2rem 2.25rem; flex: 1; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.card-header h2 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.card-body { padding: 1.5rem; }

/* ── Stats — connected newspaper grid ──────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--card);
  padding: 1.5rem 1.75rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  position: relative;
  transition: background 0.15s;
}
.stat-card:hover { background: var(--elevated); }
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.stat-card:hover::after { transform: scaleX(1); }
.stat-card .stat-val {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.stat-card .stat-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.stat-card .stat-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table, .admin-table { width: 100%; border-collapse: collapse; }

thead tr { border-bottom: 1px solid var(--border-mid); }
th {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 0.88rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.84rem;
  color: var(--text-dim);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover td { background: var(--hover); color: var(--text); }

.td-name  { font-weight: 550; color: var(--text) !important; }
.td-price { font-family: var(--font-display); font-weight: 600; color: var(--text) !important; }
.td-muted { color: var(--text-muted) !important; font-size: 0.78rem; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.22rem 0.55rem;
  border-radius: 2rem;
}
.badge-green  { background: oklch(63% 0.148 145 / 0.12); color: oklch(65% 0.148 145); border: 1px solid oklch(63% 0.148 145 / 0.22); }
.badge-red    { background: var(--red-subtle); color: oklch(60% 0.175 28); border: 1px solid oklch(48% 0.165 28 / 0.22); }
.badge-yellow { background: oklch(76% 0.148 82 / 0.12); color: oklch(66% 0.148 82); border: 1px solid oklch(76% 0.148 82 / 0.22); }
.badge-gray   { background: oklch(26% 0.016 52); color: var(--text-muted); border: 1px solid var(--border-mid); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  font-weight: 550;
  letter-spacing: 0.03em;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--red);
  color: oklch(95% 0.010 38);
  box-shadow: 0 1px 4px oklch(48% 0.165 28 / 0.28);
}
.btn-primary:hover {
  background: var(--red-hover);
  box-shadow: 0 2px 10px oklch(48% 0.165 28 / 0.35);
}
.btn-outline {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-mid);
}
.btn-outline:hover { color: var(--text); background: var(--elevated); border-color: var(--border-mid); }
.btn-ghost  { background: transparent; color: var(--text-muted); padding-left: 0; padding-right: 0; }
.btn-ghost:hover { color: var(--text); }
.btn-danger {
  background: oklch(48% 0.165 28 / 0.1);
  color: oklch(62% 0.175 28);
  border: 1px solid oklch(48% 0.165 28 / 0.2);
}
.btn-danger:hover  { background: oklch(48% 0.165 28 / 0.2); }
.btn-success {
  background: oklch(63% 0.148 145 / 0.1);
  color: oklch(63% 0.148 145);
  border: 1px solid oklch(63% 0.148 145 / 0.2);
}
.btn-success:hover { background: oklch(63% 0.148 145 / 0.2); }
.btn-sm   { font-size: 0.7rem; padding: 0.37rem 0.75rem; }
.btn-icon { padding: 0.45rem; border-radius: var(--radius); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-input, .form-select, .form-textarea {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px oklch(74% 0.155 65 / 0.13);
}
.form-select    { cursor: pointer; }
.form-textarea  { resize: vertical; min-height: 80px; }
.form-row       { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions   { display: flex; gap: 0.75rem; align-items: center; padding-top: 0.5rem; }
.form-hint      { font-size: 0.72rem; color: var(--text-muted); }
.form-error     { font-size: 0.72rem; color: oklch(62% 0.175 28); }

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(8% 0.015 45 / 0.80);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(10px) scale(0.99);
  transition: transform 0.22s cubic-bezier(0.34, 1.1, 0.64, 1);
  box-shadow: 0 20px 60px oklch(8% 0.015 45 / 0.55);
}
.modal-overlay.open .modal { transform: none; }
.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.15s;
  border-radius: var(--radius);
}
.modal-close:hover { color: var(--text); }
.modal-body   { padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; display: flex; flex-direction: column; gap: 0.45rem; }
.toast {
  background: var(--elevated);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  font-size: 0.84rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 255px;
  animation: toastIn 0.26s cubic-bezier(0.34, 1.1, 0.64, 1);
  box-shadow: 0 8px 28px oklch(8% 0.015 45 / 0.5);
}
.toast.toast-success { border-left: 3px solid oklch(63% 0.148 145); }
.toast.toast-error   { border-left: 3px solid oklch(55% 0.19 25); }
.toast.toast-info    { border-left: 3px solid var(--amber); }
.toast.removing      { animation: toastOut 0.22s ease-in forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(14px) } to { opacity: 1; transform: none } }
@keyframes toastOut { from { opacity: 1; transform: none } to { opacity: 0; transform: translateX(14px) } }

/* ── Tabs ───────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.admin-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.68rem 1.1rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 550;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}
.admin-tab-btn:hover { color: var(--text-dim); }
.admin-tab-btn.active { color: var(--text); border-bottom-color: var(--red); }
.admin-tab-panel { display: none; }
.admin-tab-panel.active { display: block; }

/* Mobile category/filter selects — hidden on desktop */
.admin-cat-select, .admin-inq-filter-select {
  display: none;
  width: 100%;
  padding: 0.7rem 2.25rem 0.7rem 1rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2396897a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 0.85rem center / 14px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 550;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  margin-bottom: 1.25rem;
  outline: none;
}

/* ── Inquiry detail ─────────────────────────────────────────── */
.inq-modal-inner  { max-width: 640px; }
.inq-detail-rows  { display: flex; flex-direction: column; }
.inq-detail-row   { display: flex; gap: 1rem; padding: 0.5rem 0.75rem; align-items: baseline; }
.inq-row-alt      { background: oklch(24% 0.022 52 / 0.55); }
.inq-detail-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 130px;
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.inq-detail-value { color: var(--text); font-size: 0.875rem; line-height: 1.6; word-break: break-word; }

/* ── Audit log ──────────────────────────────────────────────── */
.audit-row td:first-child { font-variant-numeric: tabular-nums; font-size: 0.72rem; color: var(--text-muted); }
.audit-action { font-weight: 600; color: var(--text); }
.audit-note   { font-size: 0.78rem; color: var(--text-muted); max-width: 280px; white-space: pre-wrap; }

/* ── Login page ─────────────────────────────────────────────── */
.admin-login-page {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  /* Subtle warm ambient glow behind the card */
  background-image: radial-gradient(ellipse 60% 50% at 50% 45%, oklch(20% 0.025 52) 0%, transparent 70%);
}
.admin-login-card {
  background: var(--card);
  border: 1px solid var(--border-mid);
  border-top: 2px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  width: 100%;
  max-width: 374px;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  box-shadow: 0 28px 72px oklch(8% 0.015 45 / 0.55);
}
.admin-login-brand {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
}
.admin-login-brand img {
  height: 56px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.88;
}
.admin-login-brand p {
  font-size: 0.63rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}
.login-error {
  background: var(--red-subtle);
  border: 1px solid oklch(48% 0.165 28 / 0.22);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: oklch(62% 0.175 28);
}

/* ── Notes ──────────────────────────────────────────────────── */
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s;
}
.note-card:hover { border-color: var(--border-mid); }
.note-meta    { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.note-author  { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.note-date    { font-size: 0.7rem; color: var(--text-muted); }
.note-body    { font-size: 0.875rem; color: var(--text-dim); line-height: 1.7; white-space: pre-wrap; }
.note-actions { display: flex; gap: 0.5rem; }

/* ── Specials ───────────────────────────────────────────────── */
.specials-admin { display: flex; flex-direction: column; gap: 1rem; }
.specials-list  { display: flex; flex-direction: column; gap: 0.5rem; }
.special-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  transition: border-color 0.15s, background 0.15s;
}
.special-row:hover { border-color: var(--border-mid); background: var(--elevated); }
.special-row.inactive { opacity: 0.48; }
.special-row-drag {
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: grab;
  user-select: none;
  padding-top: 0.15rem;
  flex-shrink: 0;
}
.special-row-body    { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.special-row-head    { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.special-badge {
  display: inline-flex;
  align-items: center;
  background: var(--red-subtle);
  border: 1px solid oklch(48% 0.165 28 / 0.2);
  color: var(--red);
  border-radius: 2rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.18rem 0.65rem;
}
.special-row-title   { font-weight: 550; font-size: 0.9rem; color: var(--text); line-height: 1.3; }
.special-row-desc    { font-size: 0.78rem; color: var(--text-muted); line-height: 1.55; }
.special-row-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; flex-wrap: wrap; padding-top: 0.1rem; }
.specials-admin-footer { margin-top: 0.5rem; }
.hint-text { font-size: 0.76rem; color: var(--text-muted); font-style: italic; }

.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.empty-state h3   { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-dim); font-weight: 600; }
.empty-state p    { font-size: 0.875rem; }
.empty-state svg  { opacity: 0.28; }

/* ── Mobile topbar ──────────────────────────────────────────── */
.admin-mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 54px;
  z-index: 60;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
}
.admin-mobile-topbar img { height: 26px; width: auto; filter: brightness(0) invert(1); opacity: 0.85; }
.admin-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.admin-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.22s, opacity 0.22s;
}
.admin-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.admin-hamburger.open span:nth-child(2) { opacity: 0; }
.admin-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Sidebar backdrop ───────────────────────────────────────── */
.admin-sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 65;
  background: oklch(8% 0.015 45 / 0.65);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.admin-sidebar-backdrop.open { opacity: 1; pointer-events: all; }

/* ── Light mode ─────────────────────────────────────────────── */
body.light-mode {
  --bg:           oklch(96%  0.012 72);
  --surface:      oklch(92%  0.014 72);
  --card:         oklch(99%  0.006 72);
  --elevated:     oklch(93%  0.013 72);
  --hover:        oklch(91%  0.013 72);
  --text:         oklch(18%  0.025 52);
  --text-dim:     oklch(32%  0.020 55);
  --text-muted:   oklch(52%  0.015 58);
  --border:       oklch(88%  0.010 72);
  --border-mid:   oklch(82%  0.012 68);
  --red-subtle:   oklch(48%  0.165 28 / 0.08);
  --amber-subtle: oklch(74%  0.155 65 / 0.10);
}
body.light-mode .admin-brand img { filter: none; opacity: 1; }
body.light-mode .admin-mobile-topbar img { filter: none; opacity: 1; }
body.light-mode .admin-nav a::before { background: var(--red); }
body.light-mode .admin-nav a:hover  { background: oklch(88% 0.011 70 / 0.7); }
body.light-mode .admin-nav a.active { background: oklch(88% 0.011 70); }
body.light-mode .theme-btn:hover    { background: oklch(88% 0.011 70 / 0.7); }
body.light-mode .theme-btn-icon-dark  { opacity: 0; width: 0; overflow: hidden; }
body.light-mode .theme-btn-icon-light { opacity: 0.75; width: 15px; }
body.light-mode .theme-btn { color: var(--text-dim); }
body.light-mode .badge-red    { background: oklch(48% 0.165 28 / 0.10); color: oklch(38% 0.165 28); border-color: oklch(48% 0.165 28 / 0.22); }
body.light-mode .badge-yellow { background: oklch(76% 0.148 82 / 0.12); color: oklch(44% 0.148 82); border-color: oklch(76% 0.148 82 / 0.22); }
body.light-mode .badge-green  { background: oklch(63% 0.148 145 / 0.10); color: oklch(38% 0.148 145); border-color: oklch(63% 0.148 145 / 0.22); }
body.light-mode .badge-gray   { background: oklch(89% 0.008 70); color: var(--text-muted); border-color: var(--border); }
body.light-mode .modal-overlay { background: oklch(22% 0.022 52 / 0.58); }
body.light-mode .sidebar-signout { color: var(--text-muted); }
body.light-mode .sidebar-signout:hover { color: var(--red); }
body.light-mode .admin-login-page {
  background-image: radial-gradient(ellipse 60% 50% at 50% 45%, oklch(91% 0.016 72) 0%, transparent 70%);
}
body.light-mode .stat-card { background: var(--card); }
body.light-mode .special-row { background: var(--card); }
body.light-mode .note-card { background: var(--surface); }

/* ── Mobile layout ──────────────────────────────────────────── */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
  .admin-mobile-topbar { display: flex; }
  .admin-sidebar-backdrop { display: block; }

  .admin-sidebar {
    left: -240px;
    transition: left 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 70;
    box-shadow: none;
  }
  .admin-sidebar.mobile-open {
    left: 0;
    box-shadow: 12px 0 48px oklch(8% 0.015 45 / 0.6);
  }

  .admin-main  { margin-left: 0; margin-top: 54px; }
  .admin-topbar { position: sticky; top: 0; z-index: 40; }
  .admin-content { padding: 1.25rem 1rem; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row   { grid-template-columns: 1fr; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .card-header { flex-wrap: wrap; gap: 0.75rem; }
  .modal-overlay { padding: 0.5rem; }
  .modal { max-height: 96vh; }
  .admin-inq-tabs { display: none; }
  .admin-inq-filter-select { display: block; }
}

@media (max-width: 600px), (hover: none) and (pointer: coarse) and (max-width: 1400px) {
  .admin-content { padding: 1rem 0.75rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 1px; }
  .stat-card  { padding: 1.1rem 1.25rem; }
  .stat-card .stat-val { font-size: 1.75rem; }
  .admin-topbar { padding: 0 1rem; }
  .admin-topbar h1 { font-size: 1rem; }

  .table-card-mobile table,
  .table-card-mobile thead,
  .table-card-mobile tbody,
  .table-card-mobile th,
  .table-card-mobile td,
  .table-card-mobile tr { display: block; }
  .table-card-mobile thead { display: none; }
  .table-card-mobile tbody tr {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }
  .table-card-mobile td {
    padding: 0; border: none; font-size: 0.82rem;
    display: flex; align-items: flex-start; gap: 0.5rem;
  }
  .table-card-mobile td::before {
    content: attr(data-label);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    min-width: 80px;
    flex-shrink: 0;
    padding-top: 0.1rem;
  }
  .table-card-mobile td:last-child { margin-top: 0.5rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }

  .admin-tabs { display: none; }
  .admin-cat-select { display: block; }

  .inq-detail-row { flex-direction: column; gap: 0.2rem; }
  .inq-detail-label { min-width: 0; }
  .inq-modal-inner { max-width: 100%; }

  .special-row { flex-direction: column; }
  .special-row-actions { padding-top: 0.5rem; border-top: 1px solid var(--border); width: 100%; justify-content: flex-start; }
}

@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr; }
  .btn { font-size: 0.72rem; padding: 0.5rem 0.9rem; }
}

/* ── Bulk inline edit ──────────────────────────────────────────── */
.be-input-sm {
  padding: 0.28rem 0.5rem;
  font-size: 0.82rem;
  height: 32px;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

/* ── Drag-and-drop reorder ─────────────────────────────────────── */
.special-row.dragging { opacity: 0.35; background: var(--elevated); }
.special-row.drag-over { box-shadow: inset 0 3px 0 var(--red); }
.drag-handle-cell {
  width: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: grab;
  user-select: none;
  padding: 0 0.25rem;
}
tr[draggable="true"] { cursor: default; }
tr[draggable="true"]:hover .drag-handle-cell { color: var(--text); }
tr.dragging { opacity: 0.35; }
tr.drag-over td { box-shadow: inset 0 3px 0 var(--red); }
