/* LoveDesk — Admin console */
body { background: var(--ink-0); font-size: 14px; }

.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--line); background: var(--ink-1);
  display: flex; flex-direction: column;
}
.side-top { padding: 16px 14px 12px; display: flex; align-items: center; justify-content: space-between; }
.side-top .brand { font-size: 14.5px; }
.side-top .brand-mark { width: 22px; height: 22px; }
.env { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.side-search { margin: 4px 12px 12px; position: relative; }
.side-search input { width: 100%; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--ink-2); padding: 0 10px 0 30px; font-size: 13px; color: var(--text-2); }
.side-search input:focus { outline: none; border-color: var(--line-strong); }
.side-search svg { position: absolute; left: 10px; top: 9px; width: 14px; height: 14px; color: var(--text-4); }
.side-search kbd { position: absolute; right: 8px; top: 7px; font-family: var(--font-mono); font-size: 10.5px; color: var(--text-4); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }

.nav-group { padding: 6px 8px; }
.nav-label { font-size: 11.5px; color: var(--text-4); padding: 10px 8px 6px; font-weight: 500; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 8px; border-radius: 7px;
  color: var(--text-2); font-size: 13.5px; text-align: left;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-item svg { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.035); color: var(--text); }
.nav-item.active { background: rgba(255,255,255,0.06); color: var(--text); }
.nav-item.active svg { color: var(--text); }
.nav-item .count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.nav-item .count.hot { color: var(--accent); }
.nav-sub { padding-left: 26px; }
.nav-sub .nav-item { height: 28px; font-size: 13px; color: var(--text-3); }
.nav-sub .nav-item.active { color: var(--text); background: transparent; }
.nav-sub .nav-item.active::before { content: ''; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin-left: -12px; margin-right: 4px; }

.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #6e6a9a, #2d2b44); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.side-foot b { display: block; font-size: 13px; font-weight: 500; }
.side-foot span { font-size: 12px; color: var(--text-3); }

/* ---------- Main ---------- */
.main { min-width: 0; }
.topbar {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10; background: rgba(8,9,12,0.85); backdrop-filter: blur(12px);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-3); }
.crumbs b { color: var(--text); font-weight: 500; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { height: 26px; padding: 0 10px; border-radius: 6px; font-size: 12.5px; color: var(--text-3); }
.seg button.on { background: rgba(255,255,255,0.07); color: var(--text); }

.page { padding: 32px 28px 64px; max-width: 1320px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.page-head h1 { font-size: 24px; font-weight: 500; letter-spacing: -0.025em; }
.page-head p { color: var(--text-3); margin-top: 4px; }

/* ---------- KPI row ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ink-1); margin-bottom: 20px; }
.kpi { padding: 20px; border-left: 1px solid var(--line); }
.kpi:first-child { border-left: 0; }
.kpi-label { font-size: 12.5px; color: var(--text-3); display: flex; justify-content: space-between; }
.kpi-value { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; margin: 10px 0 4px; font-variant-numeric: tabular-nums; }
.delta { font-size: 12px; font-family: var(--font-mono); }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.spark { height: 28px; margin-top: 10px; width: 100%; }

/* ---------- Cards ---------- */
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 20px; }
.grid-2e { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.card { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--ink-1); overflow: hidden; }
.card-head { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 14px; font-weight: 500; }
.card-head span { font-size: 12.5px; color: var(--text-3); }
.card-body { padding: 20px; }

/* Chart */
.chart { width: 100%; height: 240px; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-3); }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* Funnel */
.funnel { display: grid; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 13px; }
.funnel-row span { color: var(--text-2); }
.funnel-row b { font-weight: 500; font-variant-numeric: tabular-nums; }
.funnel-row b small { color: var(--text-3); font-weight: 400; margin-left: 6px; font-family: var(--font-mono); font-size: 11.5px; }
.funnel-row .track { grid-column: 1 / -1; height: 6px; background: var(--ink-3); }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--ink-1); white-space: nowrap; }
.table td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background 0.15s var(--ease); }
.table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.who { display: flex; align-items: center; gap: 10px; }
.who b { display: block; font-weight: 500; }
.who span { font-size: 12px; color: var(--text-3); }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); }
.meter { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.meter .track { flex: 1; height: 4px; background: var(--ink-4); }
.meter span { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); white-space: nowrap; }
.row-act { opacity: 0; transition: opacity 0.15s; }
tr:hover .row-act { opacity: 1; }

.toolbar { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.toolbar .field { height: 32px; max-width: 260px; font-size: 13px; }
.chip { height: 28px; padding: 0 10px; border-radius: 7px; border: 1px dashed var(--line-strong); font-size: 12.5px; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
.chip.on { border-style: solid; color: var(--text); background: rgba(255,255,255,0.04); }

/* Activity */
.feed { display: grid; }
.feed-item { display: grid; grid-template-columns: 16px 1fr auto; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: start; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .dot { margin-top: 6px; }
.feed-item p { color: var(--text-2); }
.feed-item p b { color: var(--text); font-weight: 500; }
.feed-item time { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-4); white-space: nowrap; }

/* Prompt editor */
.prompt { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; min-height: 180px; background: var(--ink-0); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--text-3); }

/* Compose preview */
.notif-preview { border-radius: 18px; background: rgba(40,42,52,0.9); border: 1px solid var(--line); padding: 12px 14px; display: grid; grid-template-columns: 34px 1fr; gap: 12px; max-width: 360px; }
.notif-preview img { width: 34px; height: 34px; border-radius: 8px; }
.notif-preview b { font-size: 13px; display: flex; justify-content: space-between; }
.notif-preview b small { color: var(--text-3); font-weight: 400; }
.notif-preview p { font-size: 13px; color: var(--text-2); margin-top: 2px; }

.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }

@media (max-width: 1100px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .grid-2, .grid-2e { grid-template-columns: 1fr; }
}
