/* Shared dashboard chrome — links to ../../colors_and_type.css for tokens */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink-900);
  background: var(--cream-100);
  background-image:
    radial-gradient(rgba(14,31,51,0.022) 1px, transparent 1px),
    radial-gradient(rgba(138,111,61,0.020) 1px, transparent 1px);
  background-size: 3px 3px, 7px 7px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-800); text-decoration: none; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--navy-950);
  color: var(--cream-200);
  padding: 24px 14px;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--navy-900);
}
.sidebar .brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 500; font-size: 14px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--cream-50);
  padding: 0 8px 22px;
  border-bottom: 1px solid rgba(245,241,232,0.10);
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.sidebar .brand img { width: 26px; height: 26px; }
.sidebar .group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold-400); padding: 16px 10px 8px;
}
.sidebar a.nav {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 6px;
  font-size: 13.5px; color: rgba(245,241,232,0.72);
  transition: all 120ms;
}
.sidebar a.nav:hover { background: rgba(245,241,232,0.06); color: var(--cream-50); }
.sidebar a.nav.active { background: var(--navy-800); color: var(--cream-50); }
.sidebar a.nav [data-lucide] { width: 16px; height: 16px; }
.sidebar a.nav .count {
  margin-left: auto; font-family: var(--font-mono); font-size: 11px;
  background: rgba(245,241,232,0.10); color: var(--cream-200);
  padding: 1px 7px; border-radius: 999px;
}
.sidebar a.nav.active .count { background: var(--gold-500); color: var(--navy-950); }
.sidebar .footer {
  margin-top: auto; padding: 14px 10px; border-top: 1px solid rgba(245,241,232,0.10);
  font-size: 12px; color: rgba(245,241,232,0.55); display: flex; gap: 10px; align-items: center;
}
.sidebar .footer .dot { width: 7px; height: 7px; border-radius: 50%; background: #2D7A5F; box-shadow: 0 0 0 3px rgba(45,122,95,0.25); }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 32px; border-bottom: 1px solid var(--border-1);
  background: rgba(251,249,242,0.92);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 5;
}
.topbar .crumb { font-size: 12.5px; color: var(--ink-500); }
.topbar h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: -0.015em; margin: 2px 0 0; color: var(--navy-950);
}
.topbar .search {
  margin-left: auto;
  position: relative; width: 280px;
}
.topbar .search input {
  width: 100%; padding: 8px 12px 8px 32px;
  font-family: var(--font-body); font-size: 13px;
  border: 1px solid var(--border-1);
  border-radius: 8px; background: var(--cream-50);
  color: var(--ink-900);
}
.topbar .search input:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(30,58,95,0.15); }
.topbar .search [data-lucide] { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--ink-400); }
.topbar .topbar-actions { display: flex; gap: 8px; align-items: center; }

.content { padding: 28px 32px 64px; max-width: 1280px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-weight: 600; font-size: 13px;
  padding: 8px 14px; border-radius: 7px; border: 1px solid transparent;
  cursor: pointer; transition: all 120ms; line-height: 1;
  white-space: nowrap;
}
.btn [data-lucide] { width: 14px; height: 14px; }
.btn.lg { font-size: 14px; padding: 11px 18px; }
.btn.sm { font-size: 12px; padding: 6px 10px; }
.btn.primary { background: var(--navy-800); color: var(--cream-50); border-color: var(--navy-800); }
.btn.primary:hover { background: var(--navy-900); border-color: var(--navy-900); }
.btn.secondary { background: var(--cream-50); color: var(--navy-900); border-color: var(--border-2); }
.btn.secondary:hover { background: var(--cream-200); }
.btn.ghost { background: transparent; color: var(--navy-900); }
.btn.ghost:hover { background: rgba(14,31,51,0.06); }
.btn.danger { color: var(--danger); border-color: rgba(178,58,58,0.3); background: transparent; }
.btn.danger:hover { background: var(--danger-bg); }

/* ---------- Cards ---------- */
.card {
  background: var(--cream-50);
  border: 1px solid var(--border-1);
  border-radius: 10px;
  box-shadow: var(--shadow-xs);
}
.card .card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border-1);
  display: flex; align-items: center; justify-content: space-between;
}
.card .card-head h3 {
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  margin: 0; letter-spacing: -0.01em; color: var(--navy-950);
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat {
  background: var(--cream-50); border: 1px solid var(--border-1);
  border-radius: 10px; padding: 18px 18px 16px;
  position: relative; overflow: hidden;
}
.stat::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--gold-500); opacity: 0;
}
.stat.featured::before { opacity: 1; }
.stat .label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-500); margin-bottom: 8px;
}
.stat .value {
  font-family: var(--font-display); font-weight: 500; font-size: 30px;
  color: var(--navy-950); letter-spacing: -0.022em; line-height: 1;
}
.stat .value .unit { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink-500); margin-left: 6px; }
.stat .delta { font-size: 12px; color: var(--success); margin-top: 8px; font-weight: 600; }
.stat .delta.down { color: var(--danger); }
.stat .sub { font-size: 12px; color: var(--ink-500); margin-top: 6px; }

/* ---------- Table ---------- */
table.t {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--cream-50); border: 1px solid var(--border-1);
  border-radius: 10px; overflow: hidden;
}
table.t thead th {
  text-align: left; font-size: 11px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-500);
  padding: 12px 16px; background: var(--cream-100);
  border-bottom: 1px solid var(--border-1);
}
table.t tbody td {
  padding: 14px 16px; border-bottom: 1px solid var(--border-1);
  font-size: 13.5px; color: var(--ink-700); vertical-align: middle;
}
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tbody tr:hover { background: var(--cream-100); cursor: pointer; }
table.t .key { font-family: var(--font-mono); font-size: 12.5px; color: var(--navy-900); font-weight: 600; }
table.t .product { font-weight: 600; color: var(--navy-950); }
table.t .meta { color: var(--ink-500); font-size: 12px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; line-height: 1.5; border: 1px solid transparent;
}
.b-success { background: var(--success-bg); color: #205c47; border-color: rgba(45,122,95,0.25); }
.b-warning { background: var(--warning-bg); color: #7a5814; border-color: rgba(184,134,31,0.3); }
.b-danger  { background: var(--danger-bg); color: #8a2828; border-color: rgba(178,58,58,0.25); }
.b-info    { background: var(--navy-100); color: var(--navy-800); border-color: rgba(30,58,95,0.20); }
.b-neutral { background: var(--cream-200); color: var(--ink-700); border-color: var(--border-1); }
.b-gold    { background: transparent; color: var(--gold-700); border-color: var(--gold-500); }
.dot { width: 6px; height: 6px; border-radius: 50%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label.lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--ink-500); margin-top: 5px; }
.input, .select {
  width: 100%; padding: 9px 12px; font-family: var(--font-body); font-size: 13.5px;
  border: 1px solid var(--border-2); border-radius: 7px; background: #FFFFFF;
  color: var(--ink-900); transition: all 120ms;
}
.input:focus, .select:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px rgba(30,58,95,0.18); }
.input.mono { font-family: var(--font-mono); font-size: 13px; }

.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold-700);
}
