/* ============================================================
   PLAYGROUND OS — Back-office command center
   Design tokens + base + shared component styles
   ============================================================ */


:root {
  /* ---- Surfaces (deep navy command-center) ---- */
  --bg-0: oklch(0.15 0.028 268);   /* deepest backdrop */
  --bg-1: oklch(0.185 0.03 268);   /* app background */
  --panel: oklch(0.215 0.032 268); /* card */
  --panel-2: oklch(0.255 0.036 268);
  --panel-3: oklch(0.30 0.04 268);
  --hairline: oklch(0.42 0.04 268 / 0.35);
  --hairline-soft: oklch(0.42 0.04 268 / 0.18);

  /* ---- Text ---- */
  --tx: oklch(0.96 0.008 268);
  --tx-dim: oklch(0.74 0.02 268);
  --tx-faint: oklch(0.58 0.025 268);
  --tx-ghost: oklch(0.48 0.03 268);

  /* ---- OS accent (violet/electric) ---- */
  --accent: oklch(0.66 0.2 290);
  --accent-bright: oklch(0.74 0.18 290);
  --accent-dim: oklch(0.66 0.2 290 / 0.16);
  --cyan: oklch(0.78 0.14 210);

  /* ---- Channel neons ---- */
  --fb: oklch(0.64 0.18 256);
  --fb-bright: oklch(0.72 0.16 256);
  --tiktok: oklch(0.72 0.16 200);
  --tiktok-pink: oklch(0.68 0.21 350);
  --shopee: oklch(0.72 0.18 47);
  --ig: oklch(0.64 0.22 342);
  --yt: oklch(0.62 0.21 26);

  /* ---- Status ---- */
  --ok: oklch(0.74 0.16 152);
  --warn: oklch(0.80 0.15 78);
  --danger: oklch(0.66 0.2 27);
  --info: oklch(0.74 0.13 220);

  /* ---- Radii / shadow ---- */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow: 0 8px 30px -12px oklch(0.1 0.03 268 / 0.8);
  --shadow-lg: 0 24px 60px -20px oklch(0.08 0.03 268 / 0.9);

  --sans: "IBM Plex Sans Thai", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --pixel: "IBM Plex Mono", ui-monospace, monospace;
}

/* ============================================================
   LIGHT THEME (day) — softer paper UI, brighter accents
   ============================================================ */
:root[data-theme="light"] {
  --bg-0: oklch(0.93 0.012 264);
  --bg-1: oklch(0.96 0.008 264);
  --panel: oklch(0.995 0.003 264);
  --panel-2: oklch(0.965 0.008 264);
  --panel-3: oklch(0.93 0.012 264);
  --hairline: oklch(0.55 0.03 264 / 0.26);
  --hairline-soft: oklch(0.55 0.03 264 / 0.13);

  --tx: oklch(0.26 0.03 268);
  --tx-dim: oklch(0.42 0.03 268);
  --tx-faint: oklch(0.55 0.03 268);
  --tx-ghost: oklch(0.66 0.025 268);

  --accent: oklch(0.55 0.21 290);
  --accent-bright: oklch(0.5 0.23 290);
  --accent-dim: oklch(0.55 0.21 290 / 0.13);
  --cyan: oklch(0.6 0.13 210);

  --fb: oklch(0.55 0.19 256);
  --fb-bright: oklch(0.5 0.2 256);
  --tiktok: oklch(0.58 0.15 200);
  --tiktok-pink: oklch(0.6 0.22 350);
  --shopee: oklch(0.62 0.19 47);
  --ig: oklch(0.56 0.23 342);
  --yt: oklch(0.55 0.22 26);

  --ok: oklch(0.58 0.16 152);
  --warn: oklch(0.66 0.15 70);
  --danger: oklch(0.57 0.22 27);
  --info: oklch(0.58 0.14 220);

  --shadow: 0 8px 26px -14px oklch(0.5 0.05 268 / 0.4);
  --shadow-lg: 0 24px 56px -24px oklch(0.45 0.06 268 / 0.45);
}

/* light-theme overrides for components with hardcoded dark surfaces */
:root[data-theme="light"] .topbar { background: oklch(0.99 0.004 264 / 0.82); }
:root[data-theme="light"] .cmd { background: oklch(0.95 0.008 264 / 0.9); }
:root[data-theme="light"] .sidebar { background: oklch(0.97 0.006 264 / 0.7); }
:root[data-theme="light"] table.tbl tbody tr:hover { background: oklch(0.93 0.012 264 / 0.7); }
:root[data-theme="light"] .bld-card .bc-glyph { color: oklch(0.99 0.005 264); }

/* ============================================================
   OFFICE HERO — pixel room banner at top of each office module
   ============================================================ */
.office-hero {
  position: relative; height: 184px; border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 18px; border: 1px solid var(--hairline);
  box-shadow: var(--shadow), inset 0 0 0 1px oklch(1 0 0 / 0.04);
  background: var(--panel-2);
}
.oh-art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: center 38%; image-rendering: pixelated;
  transform: scale(1.02); transition: transform 6s ease;
}
.office-hero:hover .oh-art { transform: scale(1.07); }
.oh-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, oklch(0.1 0.03 268 / 0.92) 0%, oklch(0.1 0.03 268 / 0.62) 34%, oklch(0.1 0.03 268 / 0.05) 62%),
    linear-gradient(0deg, oklch(0.1 0.03 268 / 0.7) 0%, transparent 45%);
}
.oh-grain {
  position: absolute; inset: 0; opacity: .5; mix-blend-mode: overlay; pointer-events: none;
  background: repeating-linear-gradient(0deg, oklch(0 0 0 / 0.16) 0 2px, transparent 2px 4px);
}
.oh-body { position: absolute; left: 22px; bottom: 18px; z-index: 2; max-width: 70%; }
.oh-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono);
  font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: oklch(0.92 0.02 268 / 0.85);
  margin-bottom: 8px;
}
.oh-ico {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: var(--oc); color: oklch(0.16 0.03 268); box-shadow: 0 0 16px -2px var(--oc);
}
.oh-title {
  font-size: 27px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; color: #fff;
  text-shadow: 0 2px 14px oklch(0 0 0 / 0.6);
}
.oh-sub { font-size: 12.5px; color: oklch(0.92 0.02 268 / 0.92); margin-top: 7px; text-shadow: 0 1px 8px oklch(0 0 0 / 0.7); }
.oh-status {
  position: absolute; top: 16px; right: 16px; z-index: 2; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .03em; color: #fff;
  padding: 7px 13px; border-radius: 99px;
  background: oklch(0.12 0.03 268 / 0.6); border: 1px solid oklch(1 0 0 / 0.18); backdrop-filter: blur(6px);
}
.oh-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--oc); box-shadow: 0 0 9px var(--oc); }
.oh-dot.live { background: var(--danger); box-shadow: 0 0 9px var(--danger); animation: ohpulse 1.4s infinite; }
.office-hero.is-live .oh-status { border-color: oklch(0.66 0.2 27 / 0.6); }
@keyframes ohpulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (max-width: 720px) {
  .office-hero { height: 150px; }
  .oh-title { font-size: 22px; }
  .oh-body { max-width: 78%; }
}
@media (prefers-reduced-motion: reduce) {
  .oh-art, .office-hero:hover .oh-art { transition: none; transform: none; }
  .oh-dot.live { animation: none; }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-0);
  color: var(--tx);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#root { height: 100%; }

::selection { background: var(--accent-dim); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--panel-3);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--hairline); background-clip: padding-box; }

/* utility */
.mono { font-family: var(--mono); font-feature-settings: "tnum"; }
.tnum { font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tx-faint);
}
.th { color: var(--tx-faint); font-size: 0.82em; font-weight: 400; }
.up { letter-spacing: 0.05em; }

button { font-family: inherit; cursor: pointer; color: inherit; }

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 700px at 78% -10%, oklch(0.66 0.2 290 / 0.10), transparent 60%),
    radial-gradient(1000px 600px at 10% 110%, oklch(0.78 0.14 210 / 0.07), transparent 55%),
    var(--bg-1);
}

/* ---- Top command bar ---- */
.topbar {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  border-bottom: 1px solid var(--hairline-soft);
  background: oklch(0.18 0.03 268 / 0.7);
  backdrop-filter: blur(10px);
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 248px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), oklch(0.58 0.2 256));
  box-shadow: 0 0 0 1px oklch(0.7 0.2 290 / 0.4), 0 6px 20px -6px var(--accent);
  flex: 0 0 auto;
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: 0.02em; line-height: 1.05; }
.brand-sub { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.2em; color: var(--tx-faint); text-transform: uppercase; }

.cmd {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 11px;
  background: oklch(0.16 0.025 268 / 0.8);
  border: 1px solid var(--hairline-soft);
  color: var(--tx-faint);
  font-size: 13.5px;
  max-width: 720px;
  transition: border-color .15s, box-shadow .15s;
}
.cmd:hover { border-color: var(--hairline); }
.cmd .kbd {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--tx-faint);
  border: 1px solid var(--hairline-soft);
}
.topbar-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--tx-dim);
  position: relative;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: var(--panel-2); color: var(--tx); border-color: var(--hairline-soft); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px;
  width: 7px; height: 7px; border-radius: 99px;
  background: var(--danger); box-shadow: 0 0 0 2px var(--bg-1);
}
.profile-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: 11px;
  border: 1px solid var(--hairline-soft);
  background: var(--panel);
}
.profile-chip .pname { font-size: 12.5px; font-weight: 600; line-height: 1.15; }
.profile-chip .prole { font-size: 10px; color: var(--tx-faint); font-family: var(--mono); letter-spacing: .04em; }

.lang-toggle { display: flex; border: 1px solid var(--hairline-soft); border-radius: 9px; overflow: hidden; }
.lang-toggle button {
  padding: 7px 11px; font-size: 11.5px; font-weight: 600; background: transparent; color: var(--tx-faint);
  border: none; font-family: var(--mono); letter-spacing: .05em;
}
.lang-toggle button.on { background: var(--accent); color: white; }

.theme-toggle { display: flex; border: 1px solid var(--hairline-soft); border-radius: 9px; overflow: hidden; }
.theme-toggle button {
  width: 34px; height: 32px; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--tx-faint); border: none; transition: background .15s, color .15s;
}
.theme-toggle button:hover { color: var(--tx); }
.theme-toggle button.on { background: var(--accent); color: white; }

/* ---- Body split ---- */
.body-split { flex: 1; display: flex; min-height: 0; }

/* ---- Sidebar widgets (Office Status / Day & Time / Happiness) ---- */
.side-widgets { display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 10px; }
.side-card {
  background: var(--panel-2); border: 1px solid var(--hairline-soft); border-radius: 12px; padding: 11px 13px;
}
.sw-label { margin-bottom: 8px; }
.sw-status { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ok); font-weight: 600; }
.sw-time-row { display: flex; align-items: center; gap: 11px; }
.sw-tod { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 9px;
  background: oklch(0.7 0.16 80 / 0.14); color: var(--warn); }
.sw-tod[data-night="1"] { background: oklch(0.6 0.18 280 / 0.16); color: oklch(0.8 0.12 285); }
.sw-time { font-family: var(--mono); font-size: 21px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.sw-date { font-size: 10.5px; color: var(--tx-faint); margin-top: 3px; }
.sw-happy-row { display: flex; align-items: center; gap: 8px; }
.sw-heart { color: var(--ig); font-size: 18px; animation: swbeat 1.7s ease-in-out infinite; }
.sw-happy-val { font-family: var(--mono); font-size: 19px; font-weight: 700; }
.sw-happy-delta { font-size: 11px; color: var(--ok); font-family: var(--mono); margin-left: auto; }
.sw-bar { height: 7px; border-radius: 99px; background: var(--panel-3); margin-top: 8px; overflow: hidden; }
.sw-bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, oklch(0.66 0.2 342), oklch(0.78 0.16 350)); }
@keyframes swbeat { 0%, 100% { transform: scale(1); } 18% { transform: scale(1.22); } 32% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .sw-heart { animation: none; } }

/* ---- Sidebar ---- */
.sidebar {
  width: 248px; flex: 0 0 248px;
  border-right: 1px solid var(--hairline-soft);
  background: oklch(0.175 0.028 268 / 0.6);
  padding: 14px 12px;
  display: flex; flex-direction: column; gap: 3px;
  overflow-y: auto;
  transition: width .24s ease, flex-basis .24s ease, padding .24s ease;
}
/* collapse toggle */
.nav-collapse-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; margin-bottom: 8px;
  background: transparent; border: 1px solid var(--hairline-soft); border-radius: 10px;
  color: var(--tx-faint); cursor: pointer; font-size: 12px; transition: background .14s, color .14s;
}
.nav-collapse-btn:hover { color: var(--tx); background: var(--panel-2); }
.nav-collapse-btn .ncb-ico { display: grid; place-items: center; transform: rotate(180deg); transition: transform .24s ease; }
.nav-collapse-btn .ncb-label { white-space: nowrap; }
/* collapsed rail */
.sidebar.collapsed { width: 66px; flex: 0 0 66px; padding: 12px 9px; }
.sidebar.collapsed .side-widgets,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-txt,
.sidebar.collapsed .ncb-label { display: none; }
.sidebar.collapsed .nav-collapse-btn { justify-content: center; }
.sidebar.collapsed .nav-collapse-btn .ncb-ico { transform: rotate(0deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; position: relative; }
.sidebar.collapsed .nav-badge {
  position: absolute; top: 4px; right: 9px; min-width: 9px; width: 9px; height: 9px; padding: 0;
  border-radius: 50%; font-size: 0; box-shadow: 0 0 0 2px var(--bg-1);
}
.nav-group-label { padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--tx-dim); border: 1px solid transparent;
  text-align: left; width: 100%; background: transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.nav-item:hover { background: var(--panel); color: var(--tx); }
.nav-item.on {
  background: linear-gradient(100deg, var(--accent-dim), transparent 70%);
  color: var(--tx);
  border-color: oklch(0.66 0.2 290 / 0.4);
}
.nav-item.on .nav-ico { color: var(--accent-bright); }
.nav-ico { width: 22px; flex: 0 0 22px; display: grid; place-items: center; color: var(--tx-faint); }
.nav-txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.nav-en { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.nav-th { font-size: 10.5px; color: var(--tx-faint); white-space: nowrap; }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 99px; display: grid; place-items: center;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  background: var(--danger); color: white;
}
.nav-badge.warn { background: var(--warn); color: oklch(0.25 0.05 78); }

/* ---- Main scroll area ---- */
.main {
  flex: 1; min-width: 0; overflow-y: auto;
  padding: 22px 26px 60px;
}
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.page-title .th-title { font-weight: 400; color: var(--tx-faint); font-size: 15px; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 11px; color: var(--tx-faint); letter-spacing: .04em; }
.breadcrumb a { color: var(--tx-faint); text-decoration: none; cursor: pointer; }
.breadcrumb a:hover { color: var(--accent-bright); }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em;
  color: var(--ok); text-transform: uppercase;
}
.live-pill .blip { width: 7px; height: 7px; border-radius: 99px; background: var(--ok); box-shadow: 0 0 8px var(--ok); animation: blip 1.8s infinite; }
@keyframes blip { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ============================================================
   PANELS / CARDS
   ============================================================ */
.panel {
  background: var(--panel);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.panel-pad { padding: 18px 20px; }
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--hairline-soft);
}
.panel-head h3 { margin: 0; font-size: 14px; font-weight: 600; display: flex; align-items: baseline; gap: 8px; }
.panel-head .th { font-size: 12px; }
.panel-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.grid { display: grid; gap: 16px; }

/* ---- Stat card ---- */
.stat {
  background: var(--panel); border: 1px solid var(--hairline-soft);
  border-radius: var(--r); padding: 16px 18px; position: relative; overflow: hidden;
}
.stat .stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat .label { font-size: 11.5px; color: var(--tx-faint); font-weight: 500; }
.stat .label .th { display: block; font-size: 10px; margin-top: 1px; }
.stat .val { font-size: 27px; font-weight: 700; letter-spacing: -0.02em; margin-top: 8px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .val small { font-size: 14px; color: var(--tx-faint); font-weight: 500; }
.stat .delta { font-family: var(--mono); font-size: 11px; margin-top: 8px; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--tx-faint); }
.stat .spark { position: absolute; right: 0; bottom: 0; width: 92px; height: 40px; opacity: .55; }
.stat-accent::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}

/* ---- Badges & dots ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 99px; letter-spacing: .03em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge.ok { color: var(--ok); background: oklch(0.74 0.16 152 / 0.13); border-color: oklch(0.74 0.16 152 / 0.3); }
.badge.warn { color: var(--warn); background: oklch(0.80 0.15 78 / 0.13); border-color: oklch(0.80 0.15 78 / 0.3); }
.badge.danger { color: var(--danger); background: oklch(0.66 0.2 27 / 0.14); border-color: oklch(0.66 0.2 27 / 0.32); }
.badge.info { color: var(--info); background: oklch(0.74 0.13 220 / 0.13); border-color: oklch(0.74 0.13 220 / 0.3); }
.badge.neutral { color: var(--tx-dim); background: var(--panel-2); border-color: var(--hairline-soft); }
.badge.accent { color: var(--accent-bright); background: var(--accent-dim); border-color: oklch(0.66 0.2 290 / 0.35); }

.sdot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; flex: 0 0 auto; }
.sdot.ok { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.sdot.warn { background: var(--warn); box-shadow: 0 0 7px var(--warn); }
.sdot.danger { background: var(--danger); box-shadow: 0 0 7px var(--danger); }
.sdot.off { background: var(--tx-ghost); }

/* ---- Pills / chips / segmented ---- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-0); border: 1px solid var(--hairline-soft); border-radius: 10px; }
.seg button { padding: 6px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 500; background: transparent; border: none; color: var(--tx-faint); }
.seg button.on { background: var(--panel-2); color: var(--tx); box-shadow: var(--shadow); }

.chip {
  padding: 7px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 500;
  background: var(--panel); border: 1px solid var(--hairline-soft); color: var(--tx-dim);
  display: inline-flex; align-items: center; gap: 7px;
}
.chip:hover { border-color: var(--hairline); color: var(--tx); }
.chip.on { background: var(--accent-dim); border-color: oklch(0.66 0.2 290 / 0.4); color: var(--tx); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--hairline-soft); color: var(--tx);
  transition: background .14s, border-color .14s, transform .08s;
}
.btn:hover { background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: transparent; color: white; box-shadow: 0 6px 20px -8px var(--accent); }
.btn.primary:hover { background: var(--accent-bright); }
.btn.ghost { background: transparent; }

/* ============================================================
   DATA TABLE
   ============================================================ */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl thead th {
  text-align: left; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tx-faint); font-weight: 500; padding: 11px 14px; border-bottom: 1px solid var(--hairline-soft);
  white-space: nowrap; background: var(--panel); position: sticky; top: 0; z-index: 1;
}
table.tbl thead th.sortable { cursor: pointer; }
table.tbl thead th.sortable:hover { color: var(--tx); }
table.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--hairline-soft); color: var(--tx-dim); vertical-align: middle; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: oklch(0.255 0.036 268 / 0.5); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl .strong { color: var(--tx); font-weight: 600; }
table.tbl .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.th-cell { display: flex; flex-direction: column; gap: 1px; }
.th-cell .sub { font-size: 10.5px; color: var(--tx-faint); }
.arrow-row { color: var(--tx-ghost); }

/* ============================================================
   AVATAR placeholder slot (for real art later)
   ============================================================ */
.avatar {
  border-radius: 11px; position: relative; overflow: hidden; flex: 0 0 auto;
  background:
    repeating-linear-gradient(135deg, oklch(0.3 0.04 268 / 0.6) 0 6px, transparent 6px 12px),
    linear-gradient(150deg, var(--ac1, var(--accent)), var(--ac2, var(--cyan)));
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.08);
}
.avatar .ini { font-family: var(--mono); font-weight: 700; color: oklch(0.18 0.03 268); font-size: 0.85em; letter-spacing: .02em; mix-blend-mode: screen; opacity: .92; }
.avatar.round { border-radius: 99px; }
.avatar .slot-tag {
  position: absolute; bottom: 2px; left: 0; right: 0; text-align: center;
  font-family: var(--mono); font-size: 7px; letter-spacing: .1em; color: oklch(0.2 0.03 268 / 0.8); text-transform: uppercase;
}

/* ============================================================
   CHARTS
   ============================================================ */
.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--tx-dim); }
.legend .lg i { width: 9px; height: 9px; border-radius: 3px; }
.axis-label { font-family: var(--mono); font-size: 9.5px; fill: var(--tx-faint); }
.grid-line { stroke: var(--hairline-soft); stroke-width: 1; }

/* ============================================================
   placeholder image block
   ============================================================ */
.imgph {
  border-radius: var(--r); border: 1px dashed var(--hairline);
  background: repeating-linear-gradient(135deg, oklch(0.22 0.03 268) 0 10px, oklch(0.2 0.03 268) 10px 20px);
  display: grid; place-items: center; color: var(--tx-faint);
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
}

.empty-hint { color: var(--tx-faint); font-size: 12.5px; text-align: center; padding: 30px; }

/* fade-in for page transitions (transform-only so content stays visible if animation is paused) */
.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { transform: translateY(8px); } to { transform: none; } }
