/* ============================================================
   REELHOUSE — Promo Studio  ·  Design System
   Cool-neutral slate/blue · data-dense professional SaaS
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ---------- Tokens (light) ---------- */
:root {
  --font-sans: 'Hanken Grotesk', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --bg:        oklch(97.6% 0.005 255);
  --surface:   oklch(100%  0     0);
  --surface-2: oklch(98.4% 0.004 255);
  --surface-3: oklch(96.2% 0.007 255);
  --inset:     oklch(95.4% 0.008 255);
  --border:    oklch(91.5% 0.008 258);
  --border-2:  oklch(86%   0.012 258);

  --text:    oklch(27% 0.022 262);
  --text-2:  oklch(45% 0.02  262);
  --text-3:  oklch(58% 0.016 262);
  --text-4:  oklch(70% 0.012 262);

  --accent-h: 256;
  --accent-c: 0.155;
  --accent:        oklch(54% var(--accent-c) var(--accent-h));
  --accent-strong: oklch(47% calc(var(--accent-c) + 0.01) var(--accent-h));
  --accent-soft:   oklch(95.5% 0.035 var(--accent-h));
  --accent-soft-2: oklch(91% 0.055 var(--accent-h));
  --accent-text:   oklch(46% calc(var(--accent-c) + 0.02) var(--accent-h));
  --on-accent:     oklch(99% 0.01 var(--accent-h));

  --success:  oklch(58% 0.13 158);
  --success-soft: oklch(95% 0.04 158);
  --warning:  oklch(70% 0.13 72);
  --warning-soft: oklch(95% 0.05 72);
  --danger:   oklch(57% 0.19 25);
  --danger-soft: oklch(95% 0.045 25);

  --shadow-xs: 0 1px 2px oklch(45% 0.05 262 / 0.05);
  --shadow-sm: 0 1px 2px oklch(45% 0.05 262 / 0.06), 0 2px 5px oklch(45% 0.05 262 / 0.05);
  --shadow-md: 0 2px 6px oklch(45% 0.05 262 / 0.07), 0 10px 26px oklch(45% 0.05 262 / 0.07);
  --shadow-lg: 0 16px 50px oklch(40% 0.05 262 / 0.16);

  --r-xs: 5px; --r-sm: 7px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --r-pill: 999px;

  /* density-controlled */
  --pad: 18px;
  --gap: 18px;
  --card-pad: 18px;
  --ui: 13.5px;

  --sidebar-w: 248px;
  --topbar-h: 60px;
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg:        oklch(18.5% 0.014 262);
  --surface:   oklch(22.6% 0.017 262);
  --surface-2: oklch(25.4% 0.019 262);
  --surface-3: oklch(28.5% 0.021 262);
  --inset:     oklch(20.5% 0.016 262);
  --border:    oklch(31% 0.02 262);
  --border-2:  oklch(38% 0.024 262);

  --text:    oklch(96% 0.008 262);
  --text-2:  oklch(78% 0.016 262);
  --text-3:  oklch(64% 0.018 262);
  --text-4:  oklch(52% 0.018 262);

  --accent:        oklch(66% var(--accent-c) var(--accent-h));
  --accent-strong: oklch(72% var(--accent-c) var(--accent-h));
  --accent-soft:   oklch(34% 0.06 var(--accent-h));
  --accent-soft-2: oklch(40% 0.08 var(--accent-h));
  --accent-text:   oklch(78% calc(var(--accent-c) - 0.02) var(--accent-h));
  --on-accent:     oklch(16% 0.02 var(--accent-h));

  --success-soft: oklch(34% 0.05 158);
  --warning-soft: oklch(36% 0.06 72);
  --danger:   oklch(64% 0.18 25);
  --danger-soft: oklch(34% 0.06 25);

  --shadow-xs: 0 1px 2px oklch(0% 0 0 / 0.25);
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.3), 0 2px 5px oklch(0% 0 0 / 0.25);
  --shadow-md: 0 2px 6px oklch(0% 0 0 / 0.3), 0 12px 30px oklch(0% 0 0 / 0.35);
  --shadow-lg: 0 18px 54px oklch(0% 0 0 / 0.5);
}

/* ---------- Accent variants ---------- */
[data-accent="indigo"] { --accent-h: 274; --accent-c: 0.16; }
[data-accent="teal"]   { --accent-h: 195; --accent-c: 0.11; }
[data-accent="violet"] { --accent-h: 305; --accent-c: 0.15; }

/* ---------- Density variants ---------- */
[data-density="compact"] { --pad: 13px; --gap: 12px; --card-pad: 14px; --ui: 13px; }
[data-density="comfy"]   { --pad: 24px; --gap: 24px; --card-pad: 22px; --ui: 14px; }

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--ui);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.45;
}
::selection { background: var(--accent-soft-2); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.tnum { font-variant-numeric: tabular-nums; }

/* scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); border: 3px solid transparent; background-clip: content-box; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ----- Sidebar ----- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 20;
}
.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px; height: var(--topbar-h);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-logo {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  display: grid; place-items: center; color: var(--on-accent);
  box-shadow: var(--shadow-sm), inset 0 1px 0 oklch(100% 0 0 / 0.25);
}
.sb-brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.sb-brand-sub { font-size: 10.5px; color: var(--text-4); font-weight: 500; letter-spacing: 0.02em; }

.sb-scroll { flex: 1; overflow-y: auto; padding: 12px 12px 8px; }
.sb-group + .sb-group { margin-top: 14px; }
.sb-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-4); padding: 4px 10px 7px;
}
.sb-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  text-align: left; transition: background .13s, color .13s;
  position: relative;
}
.sb-item:hover { background: var(--surface-3); color: var(--text); }
.sb-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
[data-theme="dark"] .sb-item.active { background: var(--accent-soft); color: var(--accent-text); }
.sb-item > span:not(.sb-count) { white-space: nowrap; flex: 1; }
.sb-item .ico { flex-shrink: 0; opacity: .85; }
.sb-item.active .ico { opacity: 1; }
.sb-item .sb-count {
  margin-left: auto; font-size: 11px; font-weight: 600;
  background: var(--surface-3); color: var(--text-3);
  padding: 1px 7px; border-radius: var(--r-pill); font-family: var(--font-mono);
}
.sb-item.active .sb-count { background: var(--accent-soft-2); color: var(--accent-text); }

.sb-foot { padding: 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-sm); }
.sb-user:hover { background: var(--surface-3); }
.sb-avatar {
  width: 30px; height: 30px; border-radius: var(--r-pill); flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
  background: var(--accent-soft-2); color: var(--accent-text);
}
.sb-user-name { font-weight: 600; font-size: 12.5px; }
.sb-user-org { font-size: 11px; color: var(--text-4); }

/* ----- Main column ----- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100%; }

.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 82%, transparent);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; z-index: 10;
}
.tb-title { display: flex; flex-direction: column; }
.tb-title h1 { font-size: 17px; font-weight: 700; letter-spacing: -0.015em; white-space: nowrap; }
.tb-bc { font-size: 11.5px; color: var(--text-4); font-weight: 500; }
.tb-search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  width: 280px; max-width: 30vw; height: 36px; padding: 0 12px;
  background: var(--surface-3); border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--text-3);
}
.tb-search:focus-within { border-color: var(--border-2); background: var(--surface); }
.tb-search input { flex: 1; border: none; background: none; outline: none; font-size: 13px; }
.tb-search kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--text-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
}
.tb-icon-btn {
  width: 36px; height: 36px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-3); position: relative;
}
.tb-icon-btn:hover { background: var(--surface-3); color: var(--text); }
.tb-dot { position: absolute; top: 8px; right: 8px; width: 7px; height: 7px; border-radius: 99px; background: var(--danger); border: 1.5px solid var(--surface); }

.content { flex: 1; overflow-y: auto; padding: 24px; }
.content-inner { max-width: 1280px; margin: 0 auto; }
[data-density="comfy"] .content { padding: 30px; }
[data-density="compact"] .content { padding: 18px; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-xs);
}
.card-pad { padding: var(--card-pad); }
.card-hd {
  display: flex; align-items: center; gap: 12px;
  padding: 14px var(--card-pad); border-bottom: 1px solid var(--border);
}
.card-hd h3 { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.card-hd .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-hd .sub { font-size: 11.5px; color: var(--text-4); font-weight: 500; }
.card-hd-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-3); }
.faint { color: var(--text-4); }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-4); }
.sec-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 13px; white-space: nowrap;
  border: 1px solid transparent; transition: background .13s, border-color .13s, transform .06s;
}
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-xs); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.btn-soft { background: var(--surface-3); color: var(--text-2); }
.btn-soft:hover { background: var(--inset); color: var(--text); }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

/* badges & tags */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 21px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge-soft { background: var(--surface-3); color: var(--text-2); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: oklch(48% 0.13 72); }
[data-theme="dark"] .badge-warning { color: var(--warning); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-accent  { background: var(--accent-soft); color: var(--accent-text); }
.badge-outline { border: 1px solid var(--border-2); color: var(--text-3); }

.cat-tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px 0 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--cat-soft); color: var(--cat-text);
}
.cat-tag .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--cat); }

/* progress */
.bar { height: 6px; border-radius: 99px; background: var(--inset); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s cubic-bezier(.3,.7,.4,1); }
.bar.success > i { background: var(--success); }
.bar.thin { height: 4px; }

/* score ring */
.ring { position: relative; display: grid; place-items: center; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring-val { position: absolute; font-family: var(--font-mono); font-weight: 600; }

/* table */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-4); padding: 9px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* stat card */
.stat { display: flex; flex-direction: column; gap: 10px; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-ico { width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.stat-label { font-size: 12px; color: var(--text-3); font-weight: 600; }
.stat-val { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-val .unit { font-size: 15px; color: var(--text-3); font-weight: 600; }
.stat-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* grids */
.grid { display: grid; gap: var(--gap); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }

/* media placeholder (striped) */
.ph {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background:
    repeating-linear-gradient(135deg,
      var(--cat-soft) 0 11px,
      color-mix(in oklab, var(--cat-soft) 70%, var(--surface)) 11px 22px);
  display: grid; place-items: center;
}
.ph.has-media::after { display: none; }
.ph::after {
  content: attr(data-label);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: var(--cat-text); opacity: .85; letter-spacing: 0.02em;
  text-transform: uppercase; padding: 3px 8px;
  background: color-mix(in oklab, var(--surface) 70%, transparent);
  border-radius: 99px;
}

/* segmented control (in-page) */
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: var(--r-sm); gap: 2px; }
.seg button { padding: 5px 11px; border-radius: var(--r-xs); font-size: 12.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
[data-theme="dark"] .seg button.on { background: var(--surface-2); }

/* chip filter */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: var(--r-pill); border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap;
}
.chip:hover { border-color: var(--border-2); }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .dot { width: 8px; height: 8px; border-radius: 99px; }

/* inputs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 11px; color: var(--text-4); }
.input, .select, .textarea {
  height: 38px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text);
  font-size: 13.5px; outline: none; transition: border-color .13s, box-shadow .13s; width: 100%;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--text-4); }
.input-group { display: flex; align-items: center; border: 1px solid var(--border-2); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-group .pre { padding: 0 4px 0 12px; color: var(--text-4); font-weight: 600; }
.input-group input { border: none; outline: none; background: none; height: 38px; flex: 1; min-width: 0; padding: 0 12px 0 4px; }

/* avatar / thumb */
.thumb {
  border-radius: var(--r-md); overflow: hidden; flex-shrink: 0;
  background:
    repeating-linear-gradient(135deg,
      var(--cat-soft, var(--surface-3)) 0 9px,
      color-mix(in oklab, var(--cat-soft, var(--surface-3)) 70%, var(--surface)) 9px 18px);
}

/* divider */
.hr { height: 1px; background: var(--border); border: none; }
.vr { width: 1px; align-self: stretch; background: var(--border); }

/* tooltip-ish meta line */
.meta { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-4); font-weight: 500; }
.meta + .meta::before { content: "·"; margin-right: 5px; color: var(--border-2); }

/* live pulse */
.pulse { width: 8px; height: 8px; border-radius: 99px; background: var(--success); position: relative; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 99px; background: var(--success); opacity: .35; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(1.8); opacity: 0; } }

/* skeleton shimmer for processing items */
.shimmer { background: linear-gradient(100deg, var(--surface-3) 30%, var(--inset) 50%, var(--surface-3) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

@keyframes fadeUp { from { transform: translateY(7px); } to { transform: none; } }
.fade-up { animation: fadeUp .35s cubic-bezier(.3,.7,.4,1) both; }

/* page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { font-size: 13px; color: var(--text-3); margin-top: 3px; }

/* responsive */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g5 { grid-template-columns: repeat(3, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .sidebar { display: none; }
  .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; }
}

/* live: demó-jelölés a még be nem kötött képernyőkön */
.demo-banner { display:flex; gap:10px; align-items:center; padding:10px 14px; border-radius: var(--r-md); background: var(--warning-soft); color: oklch(45% 0.1 72); font-size: 12.5px; font-weight: 600; }
