/* ════════════════════════════════════════════════════════════════
   SYNORA — Admin Console
   The studio operating dashboard. Inherits tokens from synora.css.
   ════════════════════════════════════════════════════════════════ */

.admin-body { background: var(--bg); }
.admin-body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(800px 500px at 12% -8%, rgba(108,92,231,.16), transparent 60%),
    radial-gradient(700px 500px at 100% 0%, rgba(39,245,255,.1), transparent 55%);
}

.admin-shell { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; position: relative; z-index: 1; }

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: rgba(11,16,32,.72); backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px;
}
.sidebar-logo { display: flex; align-items: center; gap: 11px; padding: 6px 10px 22px; }
.sidebar-logo .logo-word { font-size: 1.15rem; }
.sidebar-logo .logo-mark { width: 30px; height: 30px; }
.nav-group { margin-top: 18px; }
.nav-group-label { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-mute); padding: 0 12px 10px; font-family: var(--font-display); }
.side-link {
  display: flex; align-items: center; gap: 13px; padding: 11px 13px; border-radius: var(--r-md);
  color: var(--text-dim); font-weight: 500; font-size: .93rem; margin-bottom: 3px;
  transition: background .2s, color .2s; position: relative;
}
.side-link svg { width: 19px; height: 19px; flex-shrink: 0; opacity: .8; }
.side-link:hover { background: rgba(255,255,255,.05); color: var(--text); }
.side-link.active { color: var(--text); background: var(--aurora-soft); }
.side-link.active::before { content: ""; position: absolute; left: -16px; top: 50%; transform: translateY(-50%); width: 3px; height: 22px; border-radius: 3px; background: var(--aurora); box-shadow: var(--glow-cyan); }
.side-link.active svg { opacity: 1; color: var(--cyan); }
.side-badge { margin-left: auto; font-size: .7rem; background: var(--cyan); color: #04121b; border-radius: 99px; padding: 1px 8px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 16px 12px 4px; border-top: 1px solid var(--line); }
.sidebar-user { display: flex; align-items: center; gap: 11px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--aurora); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #04121b; flex-shrink: 0; }
.sidebar-user .u-name { font-size: .9rem; font-weight: 600; }
.sidebar-user .u-role { font-size: .76rem; color: var(--text-mute); }

/* ── Main column ───────────────────────────────────────────── */
.admin-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 18px 34px; background: rgba(7,10,20,.7); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.topbar .t-title h1 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.topbar .t-title p { font-size: .9rem; color: var(--text-mute); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.live-pill { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text-dim); padding: 7px 13px; border-radius: 99px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); }
.live-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: pulse-dot 2s infinite; }
.menu-burger { display: none; background: none; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px; color: var(--text); }
.menu-burger svg { width: 22px; height: 22px; }

.admin-content { padding: 30px 34px 70px; }
.admin-content > * + .block { margin-top: 26px; }
.block { margin-bottom: 26px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.block-head h2 { font-size: 1.15rem; }
.block-head .sub { font-size: .85rem; color: var(--text-mute); }

/* ── KPI cards ─────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.kpi {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.012));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; position: relative; overflow: hidden;
  transition: transform .35s var(--ease), border-color .3s;
}
.kpi:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.kpi-label { font-size: .82rem; color: var(--text-dim); font-weight: 500; }
.kpi-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--aurora-soft); color: var(--cyan); }
.kpi-ic svg { width: 19px; height: 19px; }
.kpi-value { font-family: var(--font-display); font-size: clamp(1.7rem, 2.6vw, 2.15rem); font-weight: 700; line-height: 1; }
.kpi-value .unit { font-size: 1rem; color: var(--text-mute); margin-left: 3px; }
.kpi-meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: .82rem; }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; padding: 2px 8px; border-radius: 99px; font-size: .76rem; }
.delta svg { width: 12px; height: 12px; }
.delta.up { color: var(--green); background: rgba(74,222,128,.12); }
.delta.down { color: var(--rose); background: rgba(255,107,139,.12); }
.delta.flat { color: var(--text-mute); background: rgba(170,180,197,.1); }
.kpi-meta .cmp { color: var(--text-mute); }
.kpi-spark { position: absolute; right: 0; bottom: 0; left: 0; height: 42px; opacity: .55; }

.kpi.accent-cyan   { box-shadow: inset 0 0 0 1px rgba(39,245,255,.0); }
.kpi.accent-cyan::after,
.kpi.accent-violet::after { content:""; position:absolute; top:0; left:0; right:0; height:2px; }
.kpi.accent-cyan::after   { background: var(--cyan); }
.kpi.accent-violet::after { background: var(--violet); }

/* ── Panels & charts ───────────────────────────────────────── */
.panel { background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.008)); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; position: relative; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.panel-head h3 { font-size: 1.05rem; }
.panel-head .ph-sub { font-size: .82rem; color: var(--text-mute); margin-top: 3px; }
.panel-head .ph-val { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.chart-wrap { position: relative; width: 100%; }
.chart-wrap canvas { width: 100% !important; }

.cols { display: grid; gap: 18px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-2-1 { grid-template-columns: 2fr 1fr; }
.cols-1-2 { grid-template-columns: 1fr 2fr; }
.cols-3-2 { grid-template-columns: 3fr 2fr; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; font-size: .82rem; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; }

/* ── Stat rows / mini metrics ──────────────────────────────── */
.statline { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.statline:last-child { border-bottom: none; }
.statline .sl-label { color: var(--text-dim); font-size: .9rem; display: flex; align-items: center; gap: 9px; }
.statline .sl-value { font-family: var(--font-display); font-weight: 600; }
.dotc { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* ── Progress / bars / gauges ──────────────────────────────── */
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--aurora); transition: width 1s var(--ease-out); }
.bar.green > span { background: linear-gradient(90deg, #2fbf6f, var(--green)); }
.bar.amber > span { background: linear-gradient(90deg, #d98a2b, var(--amber)); }
.bar.rose  > span { background: linear-gradient(90deg, #d6476a, var(--rose)); }

.gauge { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.gauge svg { transform: rotate(-90deg); }
.gauge .g-track { fill: none; stroke: var(--surface-3); }
.gauge .g-fill { fill: none; stroke: url(#gaugeGrad); stroke-linecap: round; transition: stroke-dashoffset 1.2s var(--ease-out); }
.gauge .g-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge .g-center .gv { font-family: var(--font-display); font-size: 1.7rem; font-weight: 700; }
.gauge .g-center .gl { font-size: .72rem; color: var(--text-mute); }

/* ── Target meter (value vs goal) ──────────────────────────── */
.meter { margin: 16px 0; }
.meter-head { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: 8px; }
.meter-head .mh-label { color: var(--text-dim); }
.meter-head .mh-val { font-family: var(--font-display); font-weight: 600; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; min-width: 560px; }
.tbl th { text-align: left; font-family: var(--font-display); font-weight: 600; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-mute); padding: 14px 16px; background: rgba(255,255,255,.02); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--text-dim); }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .2s; }
.tbl tbody tr:hover { background: rgba(255,255,255,.025); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .cell-strong { color: var(--text); font-weight: 600; font-family: var(--font-display); }

/* pill statuses in tables */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .74rem; font-weight: 600; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-green { color: var(--green); background: rgba(74,222,128,.12); }
.pill-cyan  { color: var(--cyan); background: rgba(39,245,255,.1); }
.pill-amber { color: var(--amber); background: rgba(255,180,84,.12); }
.pill-rose  { color: var(--rose); background: rgba(255,107,139,.12); }
.pill-gray  { color: var(--text-dim); background: rgba(170,180,197,.1); }
.pill-violet{ color: #b7aeff; background: rgba(108,92,231,.14); }

/* ── Funnel ────────────────────────────────────────────────── */
.funnel { display: flex; flex-direction: column; gap: 10px; }
.funnel-step { position: relative; }
.funnel-bar { height: 48px; border-radius: 12px; background: var(--aurora-soft); border: 1px solid var(--line); display: flex; align-items: center; padding: 0 18px; position: relative; overflow: hidden; transition: width 1s var(--ease-out); }
.funnel-bar .fb-fill { position: absolute; inset: 0; background: var(--aurora); opacity: .14; }
.funnel-step .fs-label { position: relative; z-index: 1; font-weight: 600; font-size: .9rem; }
.funnel-step .fs-meta { display: flex; justify-content: space-between; font-size: .8rem; color: var(--text-mute); margin: 4px 2px 0; }
.funnel-step .fs-meta .v { color: var(--text); font-family: var(--font-display); }

/* ── Decision gates ────────────────────────────────────────── */
.gate { display: flex; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,255,255,.02); margin-bottom: 14px; align-items: center; }
.gate-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.gate-body { flex: 1; min-width: 0; }
.gate-body h4 { font-size: 1rem; margin-bottom: 4px; }
.gate-body .crit { font-size: .85rem; color: var(--text-mute); }
.gate-prog { min-width: 180px; }
.gate-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; min-width: 110px; }

/* checklist */
.check-group { margin-bottom: 22px; }
.check-group h4 { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-mute); margin-bottom: 12px; font-family: var(--font-display); }
.check-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check-item:last-child { border-bottom: none; }
.check-box { width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line-strong); display: grid; place-items: center; background: var(--surface-2); flex-shrink: 0; cursor: pointer; transition: all .2s; }
.check-box svg { width: 14px; height: 14px; opacity: 0; transition: opacity .2s; }
.check-item.done .check-box { background: var(--green); border-color: var(--green); color: #04121b; }
.check-item.done .check-box svg { opacity: 1; }
.check-item.done .ci-label { color: var(--text-mute); text-decoration: line-through; }
.ci-label { font-size: .9rem; color: var(--text-dim); flex: 1; }
.check-form { display: contents; }

/* ── Activity feed ─────────────────────────────────────────── */
.feed-item { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: none; }
.feed-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--cyan); flex-shrink: 0; }
.feed-ic svg { width: 17px; height: 17px; }
.feed-body { flex: 1; min-width: 0; }
.feed-body .ft { font-size: .9rem; color: var(--text); }
.feed-body .fm { font-size: .78rem; color: var(--text-mute); margin-top: 2px; }

/* ── Portfolio matrix ──────────────────────────────────────── */
.matrix { position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; min-height: 380px; background: linear-gradient(180deg, rgba(255,255,255,.02), transparent); overflow: hidden; }
.matrix-axes { position: absolute; inset: 28px; }
.matrix-axis-x, .matrix-axis-y { position: absolute; color: var(--text-mute); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.matrix-dot { position: absolute; transform: translate(-50%, 50%); }
.matrix-bubble { border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: .8rem; color: #04121b; cursor: default; transition: transform .3s; }
.matrix-bubble:hover { transform: scale(1.08); }

/* ── login ─────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; }
.login-card { width: 100%; max-width: 420px; padding: 40px; border-radius: var(--r-xl); position: relative; z-index: 2; }
.login-card .logo { justify-content: center; margin-bottom: 8px; }
.login-card h1 { font-size: 1.6rem; text-align: center; margin-bottom: 6px; }
.login-card .sub { text-align: center; color: var(--text-mute); margin-bottom: 28px; font-size: .92rem; }
.login-hint { margin-top: 18px; padding: 12px 14px; border-radius: var(--r-md); background: rgba(39,245,255,.06); border: 1px solid rgba(39,245,255,.18); font-size: .82rem; color: var(--text-dim); text-align: center; }
.login-hint code { color: var(--cyan); font-family: var(--font-display); }

/* integrations */
.integ { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(255,255,255,.02); }
.integ .ig-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; color: var(--cyan); font-family: var(--font-display); font-weight: 700; flex-shrink: 0; }
.integ .ig-body { flex: 1; min-width: 0; }
.integ .ig-name { font-weight: 600; font-size: .95rem; }
.integ .ig-purpose { font-size: .8rem; color: var(--text-mute); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cols-2, .cols-2-1, .cols-1-2, .cols-3-2 { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 920px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 200;
    transform: translateX(-100%); transition: transform .35s var(--ease);
  }
  .admin-body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .admin-body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 150; }
  .menu-burger { display: grid; }
  .admin-content { padding: 22px 18px 60px; }
  .topbar { padding: 16px 18px; }
}
@media (max-width: 640px) {
  .kpi-grid, .cols-3 { grid-template-columns: 1fr; }
  .gate { flex-direction: column; align-items: flex-start; }
  .gate-status { align-items: flex-start; }
}
