/* ════════════════════════════════════════════════════════════
   Ticket Monitor v3 — Design system
   ════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Jakarta";
  src: url("../vendor/fonts/jakarta.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "JBMono";
  src: url("../vendor/fonts/jbmono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "JBMono";
  src: url("../vendor/fonts/jbmono-600.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: "Jakarta", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JBMono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --bg: #f3f5fa;
  --bg-glow-1: rgba(37, 99, 235, 0.10);
  --bg-glow-2: rgba(6, 182, 212, 0.08);
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --overlay: rgba(10, 16, 32, 0.42);
  --line: rgba(15, 23, 42, 0.08);
  --line-2: rgba(15, 23, 42, 0.14);
  --ink: #0b1220;
  --ink-2: #475467;
  --ink-3: #8390a6;

  --brand: #2563eb;
  --brand-ink: #1d4ed8;
  --brand-2: #06b6d4;
  --brand-soft: rgba(37, 99, 235, 0.09);
  --brand-grad: linear-gradient(135deg, #2563eb 0%, #1e90e8 55%, #06b6d4 100%);
  --focus: 0 0 0 3px rgba(37, 99, 235, 0.25);

  /* Status tiket — juga dipakai di grafik (palet tervalidasi CVD) */
  --st-check: #2a78d6;  --st-check-ink: #1b5aa6;  --st-check-soft: rgba(42, 120, 214, 0.11);
  --st-proc:  #eb6834;  --st-proc-ink:  #b4461a;  --st-proc-soft:  rgba(235, 104, 52, 0.12);
  --st-hold:  #eda100;  --st-hold-ink:  #8a5c00;  --st-hold-soft:  rgba(237, 161, 0, 0.14);
  --st-done:  #1baf7a;  --st-done-ink:  #0b7a52;  --st-done-soft:  rgba(27, 175, 122, 0.12);

  --pr-high: #d03b3b;  --pr-high-soft: rgba(208, 59, 59, 0.10);
  --pr-med:  #d9822b;  --pr-med-soft:  rgba(217, 130, 43, 0.12);
  --pr-low:  #7b8699;  --pr-low-soft:  rgba(123, 134, 153, 0.12);

  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.09);
  --ok: #0ca30c;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;

  --sh-1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 1px rgba(15, 23, 42, 0.03);
  --sh-2: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.10);
  --sh-pop: 0 24px 60px -12px rgba(15, 23, 42, 0.28), 0 2px 6px rgba(15, 23, 42, 0.06);

  --sb-bg: #0b1122;
  --sb-bg-2: #111a33;
  --sb-ink: #aeb8cc;
  --sb-ink-2: #6f7b94;
  --sb-line: rgba(255, 255, 255, 0.07);
  --sb-w: 252px;

  --chart-grid: #e6e9ef;
  --chart-axis: #8390a6;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b16;
  --bg-glow-1: rgba(59, 130, 246, 0.14);
  --bg-glow-2: rgba(6, 182, 212, 0.08);
  --surface: #0f1524;
  --surface-2: #131a2a;
  --surface-3: #1a2336;
  --overlay: rgba(2, 5, 12, 0.66);
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.13);
  --ink: #eef2f8;
  --ink-2: #a6b0c3;
  --ink-3: #6f7a90;

  --brand: #3b82f6;
  --brand-ink: #7fb0ff;
  --brand-soft: rgba(59, 130, 246, 0.15);
  --focus: 0 0 0 3px rgba(59, 130, 246, 0.35);

  --st-check: #3987e5;  --st-check-ink: #86b6ef;  --st-check-soft: rgba(57, 135, 229, 0.16);
  --st-proc:  #d95926;  --st-proc-ink:  #f29a74;  --st-proc-soft:  rgba(217, 89, 38, 0.18);
  --st-hold:  #c98500;  --st-hold-ink:  #f0c060;  --st-hold-soft:  rgba(201, 133, 0, 0.18);
  --st-done:  #199e70;  --st-done-ink:  #5fd3a5;  --st-done-soft:  rgba(25, 158, 112, 0.17);

  --pr-high: #e66767;  --pr-high-soft: rgba(230, 103, 103, 0.15);
  --pr-med:  #ec9a55;  --pr-med-soft:  rgba(236, 154, 85, 0.15);
  --pr-low:  #8a95a9;  --pr-low-soft:  rgba(138, 149, 169, 0.15);

  --danger: #f06464;
  --danger-soft: rgba(240, 100, 100, 0.13);

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 32px -12px rgba(0, 0, 0, 0.6);
  --sh-pop: 0 30px 80px -10px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);

  --sb-bg: #0a0f1d;
  --sb-bg-2: #0e1528;

  --chart-grid: #1f283b;
  --chart-axis: #6f7a90;
}

/* ───────── Reset & base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 420px at 12% -8%, var(--bg-glow-1), transparent 70%),
    radial-gradient(700px 380px at 96% 0%, var(--bg-glow-2), transparent 70%);
}
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 1; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
::selection { background: rgba(37, 99, 235, 0.22); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.i.sm { width: 15px; height: 15px; }
.i.lg { width: 22px; height: 22px; }

/* ───────── Layout ───────── */
.app {
  display: grid;
  grid-template-columns: var(--sb-w) minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.25s ease;
}
.app.sb-collapsed { --sb-w: 76px; }

.sidebar {
  position: sticky;
  top: 12px;
  height: calc(100vh - 24px);
  margin: 12px 0 12px 12px;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--sb-bg-2), var(--sb-bg));
  color: var(--sb-ink);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  box-shadow: 0 20px 50px -20px rgba(8, 14, 32, 0.55);
  z-index: 40;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(160% 260px at 50% 115%, rgba(37, 99, 235, 0.30), transparent 70%);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 18px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; background: #fff; padding: 3px; }
.brand-name { font-weight: 800; color: #fff; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--sb-ink-2); white-space: nowrap; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--sb-ink-2); padding: 16px 12px 6px; white-space: nowrap; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--sb-ink);
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav a.active { background: rgba(59, 130, 246, 0.16); color: #fff; }
.nav a.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand-grad);
}
.nav a .count {
  font-style: normal;
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbe4f5;
}
.nav a .count.hot { background: rgba(230, 103, 103, 0.2); color: #ffb3b3; }
.sb-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.sb-user {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--sb-line); cursor: pointer; text-align: left; width: 100%;
}
.sb-user:hover { background: rgba(255, 255, 255, 0.07); }
.sb-user .who { min-width: 0; }
.sb-user .who b { display: block; color: #fff; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user .who small { color: var(--sb-ink-2); font-size: 11.5px; }
/* Teks sidebar dipotong rapi saat lebar berubah (sidebar tidak lagi overflow:hidden agar menu bisa keluar) */
.brand-text, .nav a span, .sb-collapse span { min-width: 0; overflow: hidden; text-overflow: clip; }
.nav, .brand, .sb-foot { position: relative; z-index: 1; }
.menu.user-menu { top: auto; bottom: calc(100% + 8px); left: 0; right: 0; min-width: 0; }
.app.sb-collapsed .menu.user-menu { left: calc(100% + 16px); right: auto; bottom: 0; width: 230px; }
.sb-collapse { background: none; border: 0; color: var(--sb-ink-2); display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.sb-collapse:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.app.sb-collapsed .brand-text, .app.sb-collapsed .nav-label, .app.sb-collapsed .nav a span,
.app.sb-collapsed .nav a .count, .app.sb-collapsed .sb-user .who, .app.sb-collapsed .sb-collapse span { display: none; }
.app.sb-collapsed .nav a, .app.sb-collapsed .sb-collapse { justify-content: center; }
.app.sb-collapsed .sb-user { justify-content: center; padding: 8px; }
.app.sb-collapsed .brand { justify-content: center; }

.sb-scrim { display: none; }
.main { min-width: 0; padding: 12px 24px 48px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 14px;
  margin: 0 -8px;
  padding-inline: 8px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.page-title { min-width: 0; }
.page-title h1 { font-size: 22px; font-weight: 800; }
.page-title p { font-size: 13px; color: var(--ink-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .spacer { flex: 1; }
.cmd-trigger {
  display: flex; align-items: center; gap: 10px; width: min(360px, 34vw); padding: 9px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--ink-3);
  cursor: pointer; box-shadow: var(--sh-1); font-size: 13px; transition: border-color 0.15s, box-shadow 0.15s;
}
.cmd-trigger:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.cmd-trigger span { flex: 1; text-align: left; }
kbd {
  font-family: var(--mono); font-size: 11px; padding: 2px 6px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--line); color: var(--ink-2); line-height: 1.4;
}
.btn.menu-btn { display: none; }

/* ───────── Buttons ───────── */
.btn {
  --b-bg: var(--surface);
  --b-ink: var(--ink);
  --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--b-line);
  background: var(--b-bg); color: var(--b-ink); font-weight: 650; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; text-decoration: none; user-select: none;
  transition: transform 0.08s, box-shadow 0.15s, background 0.15s, border-color 0.15s, opacity 0.15s;
  box-shadow: var(--sh-1);
}
.btn:hover { text-decoration: none; border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.primary {
  --b-ink: #fff; --b-line: transparent;
  background: var(--brand-grad);
  box-shadow: 0 6px 18px -6px rgba(37, 99, 235, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn.primary:hover { box-shadow: 0 10px 24px -8px rgba(37, 99, 235, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn.ghost { --b-bg: transparent; --b-line: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn.danger { --b-bg: var(--danger); --b-ink: #fff; --b-line: transparent; }
.btn.danger-soft { --b-bg: var(--danger-soft); --b-ink: var(--danger); --b-line: transparent; box-shadow: none; }
.btn .spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Forms ───────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: 0.01em; }
.field .hint { font-size: 11.5px; color: var(--ink-3); }
.field .err { font-size: 12px; color: var(--danger); font-weight: 600; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 11px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238390a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); background: var(--surface); }
.input.invalid, .select.invalid, .textarea.invalid { border-color: var(--danger); }
.input.sm, .select.sm { height: 34px; font-size: 13px; border-radius: 9px; }
.input-icon { position: relative; }
.input-icon > .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.input-icon > .input { padding-left: 36px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line); }
.seg button {
  border: 0; background: none; padding: 6px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 650;
  color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.seg.pick button { padding: 7px 10px; }
.seg.pick button .dot { width: 8px; height: 8px; }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; transition: background 0.2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 0.2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

/* ───────── Cards ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-2); min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; }
.card-h h3 { font-size: 14.5px; font-weight: 750; }
.card-h .sub { font-size: 12px; color: var(--ink-3); }
.card-h .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-b { padding: 16px 18px 18px; }

/* ───────── Pills / badges ───────── */
.pill {
  --c: var(--ink-3); --c-ink: var(--ink-2); --c-soft: var(--surface-3);
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px 0 8px;
  border-radius: 99px; background: var(--c-soft); color: var(--c-ink);
  font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; }
.pill.st-check, .st-check { --c: var(--st-check); --c-ink: var(--st-check-ink); --c-soft: var(--st-check-soft); }
.pill.st-proc,  .st-proc  { --c: var(--st-proc);  --c-ink: var(--st-proc-ink);  --c-soft: var(--st-proc-soft); }
.pill.st-hold,  .st-hold  { --c: var(--st-hold);  --c-ink: var(--st-hold-ink);  --c-soft: var(--st-hold-soft); }
.pill.st-done,  .st-done  { --c: var(--st-done);  --c-ink: var(--st-done-ink);  --c-soft: var(--st-done-soft); }
.st-proc .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 45%, transparent); } 50% { box-shadow: 0 0 0 4px transparent; } }

.prio { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.prio .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.prio .bars i { width: 3px; border-radius: 2px; background: var(--line-2); }
.prio .bars i:nth-child(1) { height: 5px; }
.prio .bars i:nth-child(2) { height: 8px; }
.prio .bars i:nth-child(3) { height: 12px; }
.prio.p-low .bars i:nth-child(-n+1) { background: var(--pr-low); }
.prio.p-med .bars i:nth-child(-n+2) { background: var(--pr-med); }
.prio.p-high .bars i { background: var(--pr-high); }
.prio.p-high { color: var(--pr-high); }

.sys { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 7px; font-family: var(--mono); font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--ink-2); border: 1px solid var(--line); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.overdue-chip { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 750; background: var(--pr-high-soft); color: var(--pr-high); white-space: nowrap; }
.overdue-chip .i { width: 13px; height: 13px; }
.code { font-family: var(--mono); font-weight: 600; font-size: 12.5px; color: var(--ink); letter-spacing: -0.01em; }

.avatar {
  --h: 220;
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: 0.02em;
  color: hsl(var(--h) 70% 30%); background: hsl(var(--h) 85% 90%);
  border: 2px solid var(--surface);
}
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 90% 82%); background: hsl(var(--h) 45% 24%); }
.avatar.lg { width: 38px; height: 38px; font-size: 13px; }
.avatar.xs { width: 22px; height: 22px; font-size: 9.5px; border-width: 1.5px; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 13px; }
.person span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────── Dashboard ───────── */
.filters-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.bento > * { grid-column: span 12; }
.span-3 { grid-column: span 3 !important; }
.span-4 { grid-column: span 4 !important; }
.span-5 { grid-column: span 5 !important; }
.span-6 { grid-column: span 6 !important; }
.span-7 { grid-column: span 7 !important; }
.span-8 { grid-column: span 8 !important; }

.hero {
  position: relative; overflow: hidden; color: #fff; border: 0;
  background:
    radial-gradient(600px 240px at 100% 0%, rgba(6, 182, 212, 0.55), transparent 60%),
    radial-gradient(500px 300px at 0% 100%, rgba(99, 102, 241, 0.45), transparent 60%),
    linear-gradient(135deg, #1d3fb8, #2563eb 50%, #0e7fc4);
  box-shadow: 0 24px 50px -20px rgba(37, 99, 235, 0.6);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.18;
  background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(90deg, transparent 30%, #000);
}
.hero .card-b { position: relative; z-index: 1; padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; height: 100%; }
.hero .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.8; }
.hero .big { font-size: 56px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
.hero .big small { font-size: 16px; font-weight: 600; opacity: 0.8; letter-spacing: 0; margin-left: 8px; }
.hero .segbar { display: flex; gap: 3px; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.15); }
.hero .segbar i { display: block; height: 100%; transition: width 0.6s cubic-bezier(.2,.8,.2,1); }
.hero .legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; }
.hero .legend span { display: inline-flex; align-items: center; gap: 7px; opacity: 0.95; }
.hero .legend b { font-weight: 800; }
.hero .legend .dot { box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.hero .h-foot { margin-top: auto; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.hero .h-foot div { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.hero .h-foot small { display: block; font-size: 11.5px; opacity: .8; font-weight: 600; }
.hero .h-foot b { font-size: 18px; font-weight: 800; }

.kpi { padding: 18px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 12.5px; font-weight: 700; }
.kpi .k-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--c-soft, var(--brand-soft)); color: var(--c, var(--brand)); }
.kpi .k-val { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.kpi .k-val small { font-size: 14px; font-weight: 650; color: var(--ink-3); letter-spacing: 0; margin-left: 4px; }
.kpi .k-foot { font-size: 12px; color: var(--ink-3); }
.kpi.alert { --c: var(--pr-high); --c-soft: var(--pr-high-soft); }
.kpi.alert .k-val { color: var(--pr-high); }
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.ring { --p: 0; --c: var(--st-done); width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; position: absolute; right: 16px; top: 16px; }
.ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.ring b { position: relative; font-size: 13px; font-weight: 800; }

.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 220px; }
.chart-box.xs { height: 180px; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.legend-row span { display: inline-flex; align-items: center; gap: 7px; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.legend-row .sw.line { height: 3px; width: 14px; border-radius: 2px; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.feed li:first-child { border-top: 0; padding-top: 0; }
.feed .f-body { min-width: 0; flex: 1; }
.feed .f-body p { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed .f-time { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.feed a.code { cursor: pointer; }

.mini-list { display: flex; flex-direction: column; gap: 4px; }
.mini-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.mini-item:hover { background: var(--surface-2); border-color: var(--line); }
.mini-item .grow { flex: 1; min-width: 0; }
.mini-item .grow p { font-size: 12.5px; color: var(--ink-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ───────── Tickets toolbar ───────── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.toolbar .grow { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px;
  border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2);
  font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip .n { font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); font-size: 11.5px; }
.chip.on { background: var(--c-soft); border-color: color-mix(in srgb, var(--c) 45%, transparent); color: var(--c-ink, var(--ink)); }
.chip.on .n { background: var(--surface); }
.chip.danger { --c: var(--pr-high); --c-soft: var(--pr-high-soft); --c-ink: var(--pr-high); }

.dropdown { position: relative; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--sh-pop);
  display: none; flex-direction: column; gap: 2px; max-height: 360px; overflow: auto;
}
.menu.right { left: auto; right: 0; }
.dropdown.open .menu { display: flex; animation: pop 0.14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.menu button, .menu label, .menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px;
  background: none; border: 0; text-align: left; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; text-decoration: none;
}
.menu button:hover, .menu label:hover, .menu a:hover { background: var(--surface-3); }
.menu .sep { height: 1px; background: var(--line); margin: 4px 2px; }
.menu .danger { color: var(--danger); }
.menu input[type="checkbox"] { accent-color: var(--brand); width: 15px; height: 15px; }
.filter-panel { padding: 12px; gap: 12px; min-width: 300px; }
.filter-panel .field { gap: 5px; }

/* ───────── Table ───────── */
.table-wrap { overflow: auto; border-radius: var(--r-lg); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.t thead th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left;
  font-size: 11.5px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3);
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.t thead th:first-child { border-top-left-radius: var(--r-lg); }
table.t thead th:last-child { border-top-right-radius: var(--r-lg); }
table.t tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tbody tr { transition: background 0.12s; cursor: pointer; }
table.t tbody tr:hover { background: var(--surface-2); }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t .complaint { max-width: 420px; }
table.t .complaint b { display: block; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
table.t .complaint small { display: flex; gap: 10px; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
table.t .complaint small span { display: inline-flex; align-items: center; gap: 4px; }
table.t .date { white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: 13px; }
table.t .date small { display: block; color: var(--ink-3); font-size: 11.5px; }
table.t .acts { display: flex; gap: 2px; justify-content: flex-end; opacity: 0.5; transition: opacity 0.15s; }
table.t tr:hover .acts { opacity: 1; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink); }
.row-overdue td:first-child { box-shadow: inset 3px 0 0 var(--pr-high); }

.pager { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager .info { font-size: 12.5px; color: var(--ink-3); }
.pager .pages { margin-left: auto; display: flex; gap: 4px; }
.pager .pages button { min-width: 32px; height: 32px; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer; font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.pager .pages button:hover { background: var(--surface-3); }
.pager .pages button.on { background: var(--ink); color: var(--surface); }
.pager .pages button:disabled { opacity: 0.35; cursor: default; }

/* ───────── Board (kanban) ───────── */
.board { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100vh - 230px); min-height: 200px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 750; font-size: 13px; }
.col-h .n { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.col-h .dot { width: 9px; height: 9px; }
.col-body { padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; flex: 1; transition: background 0.15s; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.col.drop .col-body { background: color-mix(in srgb, var(--c) 9%, transparent); outline: 2px dashed color-mix(in srgb, var(--c) 55%, transparent); outline-offset: -6px; }
.kcard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px;
  box-shadow: var(--sh-1); cursor: grab; display: flex; flex-direction: column; gap: 8px; position: relative;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.kcard:hover { box-shadow: var(--sh-2); border-color: var(--line-2); transform: translateY(-1px); }
.kcard.dragging { opacity: 0.5; transform: rotate(1.5deg); }
.kcard .k-row { display: flex; align-items: center; gap: 8px; }
.kcard .k-row .right { margin-left: auto; }
.kcard p { font-size: 13px; font-weight: 550; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .k-foot { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.kcard .k-foot .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.kcard .k-foot span { display: inline-flex; align-items: center; gap: 3px; }
.kcard.overdue { border-color: color-mix(in srgb, var(--pr-high) 35%, var(--line)); }
.kcard.overdue::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pr-high); }
.col-empty { font-size: 12.5px; color: var(--ink-3); text-align: center; padding: 24px 8px; border: 1px dashed var(--line-2); border-radius: 12px; }

/* ───────── Drawer ───────── */
.scrim { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); z-index: 80; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 10px; right: 10px; bottom: 10px; width: min(640px, calc(100vw - 20px)); z-index: 90;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-pop);
  display: flex; flex-direction: column; transform: translateX(calc(100% + 24px)); transition: transform 0.28s cubic-bezier(.2,.8,.2,1);
  overflow: hidden;
}
.drawer.show { transform: none; }
.drawer-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer-h .title { min-width: 0; flex: 1; }
.drawer-h .title .code { font-size: 15px; }
.drawer-h .title small { display: block; color: var(--ink-3); font-size: 12px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.drawer-b > * { flex-shrink: 0; }
.drawer-f { border-top: 1px solid var(--line); padding: 12px 16px; display: flex; gap: 8px; align-items: flex-end; background: var(--surface-2); }
.drawer-f .textarea { min-height: 44px; height: 44px; max-height: 160px; resize: none; background: var(--surface); }

.status-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.status-picker button {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px;
  border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 700; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; transition: all 0.15s;
}
.status-picker button:hover:not(:disabled) { border-color: var(--c); color: var(--ink); }
.status-picker button.on { background: var(--c-soft); color: var(--c-ink); border-color: color-mix(in srgb, var(--c) 50%, transparent); }
.status-picker button:disabled { cursor: default; }

.meta-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.meta-grid > div { background: var(--surface); padding: 10px 12px; min-width: 0; }
.meta-grid small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.meta-grid b { font-weight: 650; font-size: 13px; }
.block h4 { font-size: 12px; font-weight: 750; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.block h4 .right { margin-left: auto; text-transform: none; letter-spacing: 0; }
.prose { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.65; }
.prose.empty { color: var(--ink-3); font-style: italic; }
.box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }

.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.file {
  position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2);
  display: flex; flex-direction: column; text-decoration: none; color: inherit; aspect-ratio: 1 / 1;
}
.file:hover { text-decoration: none; border-color: var(--line-2); }
.file .thumb { flex: 1; display: grid; place-items: center; background: var(--surface-3); overflow: hidden; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .thumb .i { width: 28px; height: 28px; color: var(--ink-3); }
.file .fn { font-size: 11.5px; padding: 6px 8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file .fn small { display: block; color: var(--ink-3); font-weight: 500; }
.file .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 8px; border: 0; background: rgba(10, 15, 30, 0.7); color: #fff; display: none; place-items: center; cursor: pointer; }
.file:hover .x { display: grid; }
.dropzone {
  border: 1.5px dashed var(--line-2); border-radius: 12px; display: grid; place-items: center; text-align: center;
  font-size: 12px; color: var(--ink-3); cursor: pointer; aspect-ratio: 1 / 1; padding: 8px; transition: all 0.15s; font-weight: 600;
}
.dropzone:hover, .dropzone.over { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.dropzone .i { width: 22px; height: 22px; margin: 0 auto 4px; display: block; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.timeline .t-ico { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); border: 3px solid var(--surface); }
.timeline .t-ico .i { width: 13px; height: 13px; }
.timeline .t-body { min-width: 0; flex: 1; padding-top: 3px; font-size: 13px; }
.timeline .t-body .who { font-weight: 700; }
.timeline .t-body time { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.timeline .bubble { margin-top: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px 14px 14px 14px; padding: 9px 12px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.timeline .changes { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.timeline .changes div { color: var(--ink-2); }
.timeline .changes s { color: var(--ink-3); }
.timeline .t-comment .t-ico { background: var(--brand-soft); color: var(--brand-ink); }
.timeline .t-status .t-ico { background: var(--c-soft); color: var(--c-ink); }
.timeline .t-created .t-ico { background: var(--st-done-soft); color: var(--st-done-ink); }

/* ───────── Modal ───────── */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: var(--overlay); backdrop-filter: blur(4px); animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--sh-pop);
  animation: rise 0.2s cubic-bezier(.2,.8,.2,1);
}
.modal.lg { width: min(760px, 100%); }
.modal.sm { width: min(420px, 100%); }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.modal-h { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 6px; }
.modal-h h3 { font-size: 17px; font-weight: 800; }
.modal-h p { font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.modal-h .btn { margin-left: auto; margin-top: -4px; }
.modal-b { padding: 14px 22px; overflow-y: auto; }
.modal-f { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; align-items: center; }
.modal-f .left { margin-right: auto; }
.confirm-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); flex: none; }

/* ───────── Command palette ───────── */
.cmdk { width: min(620px, 100%); align-self: start; margin-top: 12vh; padding: 0; overflow: hidden; }
.cmdk-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cmdk-in input { flex: 1; border: 0; background: none; font-size: 16px; outline: none; height: 30px; }
.cmdk-in input:focus-visible { box-shadow: none; }
.cmdk-list { max-height: 420px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 11px; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 6px; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 11px; cursor: pointer; font-size: 13.5px; font-weight: 600; }
.cmdk-item .grow { flex: 1; min-width: 0; }
.cmdk-item .grow small { display: block; color: var(--ink-3); font-weight: 500; font-size: 12px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cmdk-item.on { background: var(--brand-soft); }
.cmdk-item .i { color: var(--ink-3); }
.cmdk-item.on .i { color: var(--brand-ink); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-3); background: var(--surface-2); }

/* ───────── Toasts ───────── */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 420px;
  padding: 12px 14px; border-radius: 14px; background: #0f172a; color: #f1f5f9; font-size: 13.5px; font-weight: 600;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.45); animation: toastIn 0.3s cubic-bezier(.2,.8,.2,1);
}
:root[data-theme="dark"] .toast { background: #1d2740; }
.toast .i { flex: none; }
.toast.ok .i { color: #4ade80; }
.toast.err .i { color: #f87171; }
.toast.warn .i { color: #fbbf24; }
.toast.info .i { color: #7dd3fc; }
.toast.out { animation: toastOut 0.2s ease-in forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ───────── States ───────── */
.skel { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 48px 16px; color: var(--ink-3); }
.empty .e-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); margin-bottom: 6px; }
.empty h3 { font-size: 15px; color: var(--ink); }
.empty p { font-size: 13px; max-width: 360px; }
.view-enter { animation: viewIn 0.28s cubic-bezier(.2,.8,.2,1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } }

/* ───────── Settings ───────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 700; font-size: 13.5px; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-color: var(--brand); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.list-rows { display: flex; flex-direction: column; }
.list-rows .r { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.list-rows .r:first-child { border-top: 0; }
.list-rows .r .grow { flex: 1; min-width: 0; font-weight: 600; }
.list-rows .r .grow small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.list-rows .r.off .grow { color: var(--ink-3); text-decoration: line-through; }
.linkbox { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.linkbox code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--ink-2); font-size: 13px; }
.note .i { color: var(--brand-ink); margin-top: 1px; }
.note.warn { background: var(--st-hold-soft); }
.note.warn .i { color: var(--st-hold-ink); }
.import-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.import-stats div { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.import-stats b { display: block; font-size: 22px; font-weight: 800; }
.import-stats small { color: var(--ink-3); font-weight: 600; }
.state { font-size: 11.5px; font-weight: 750; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.state.new { background: var(--st-done-soft); color: var(--st-done-ink); }
.state.duplicate { background: var(--st-hold-soft); color: var(--st-hold-ink); }
.state.invalid { background: var(--pr-high-soft); color: var(--pr-high); }

/* ───────── Auth / public ───────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(700px 400px at 100% 0%, rgba(6, 182, 212, 0.55), transparent 60%),
    radial-gradient(600px 500px at 0% 100%, rgba(99, 102, 241, 0.5), transparent 60%),
    linear-gradient(150deg, #0b1a4a, #1d3fb8 45%, #0e7fc4);
}
.auth-art::after { content: ""; position: absolute; inset: 0; opacity: 0.16; background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1px); background-size: 22px 22px; mask-image: radial-gradient(circle at 70% 40%, #000, transparent 70%); pointer-events: none; }
.auth-art > * { position: relative; z-index: 1; }
.auth-art .logo { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; }
.auth-art .logo img { width: 48px; height: 48px; border-radius: 14px; background: #fff; padding: 4px; }
.auth-art h2 { font-size: 40px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; max-width: 520px; }
.auth-art .lead { font-size: 15.5px; opacity: 0.85; max-width: 460px; margin-top: 14px; line-height: 1.6; }
.float-cards { display: flex; flex-direction: column; gap: 12px; max-width: 360px; }
.float-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(10px); font-size: 13px; }
.float-card:nth-child(2) { margin-left: 40px; }
.float-card .dot { width: 10px; height: 10px; box-shadow: 0 0 0 3px rgba(255,255,255,.2); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-form h1 { font-size: 26px; font-weight: 800; }
.auth-form .alert { padding: 11px 14px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 13px; display: flex; gap: 8px; align-items: center; }
.auth-form .btn { height: 44px; }
.pw-wrap { position: relative; }
.pw-wrap .btn { position: absolute; right: 4px; top: 4px; height: 32px; width: 32px; }

.pub-head { display: flex; align-items: center; gap: 14px; padding: 20px 0; flex-wrap: wrap; }
.pub-head img { width: 44px; height: 44px; border-radius: 12px; background: #fff; padding: 3px; box-shadow: var(--sh-1); }
.pub-head h1 { font-size: 22px; font-weight: 800; }
.pub-wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px 40px; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(12,163,12,.5); animation: live 2s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.stat-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-strip .card { padding: 14px 16px; }
.stat-strip small { font-size: 12px; font-weight: 700; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.stat-strip b { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; display: block; margin-top: 4px; }

/* ───────── Login: animasi interaktif ───────── */
.auth-art { --mx: 70%; --my: 35%; --px: 0; --py: 0; isolation: isolate; }
.auth-art > .logo, .auth-art > .art-copy, .auth-art > .float-cards, .art-orb {
  transform: translate3d(calc(var(--px) * var(--d, 0) * 1px), calc(var(--py) * var(--d, 0) * 1px), 0);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.art-canvas { position: absolute !important; inset: 0; width: 100%; height: 100%; z-index: 0 !important; pointer-events: none; }
.art-spot {
  position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none;
  background: radial-gradient(520px circle at var(--mx) var(--my), rgba(125, 211, 252, 0.26), rgba(99, 102, 241, 0.10) 40%, transparent 70%);
  transition: opacity 0.5s;
}
.auth-art::after { mask-image: radial-gradient(320px circle at var(--mx) var(--my), #000, transparent 75%) !important; opacity: 0.28 !important; }
.art-orb { position: absolute !important; z-index: 0 !important; border-radius: 50%; filter: blur(40px); pointer-events: none; opacity: 0.55; }
.art-orb.o1 { width: 340px; height: 340px; right: -80px; top: 12%; background: radial-gradient(circle, #22d3ee, transparent 70%); animation: orb 14s ease-in-out infinite; }
.art-orb.o2 { width: 280px; height: 280px; left: 8%; bottom: 6%; background: radial-gradient(circle, #818cf8, transparent 70%); animation: orb 18s ease-in-out infinite reverse; }
@keyframes orb { 0%, 100% { margin: 0; } 33% { margin: -30px 0 0 40px; } 66% { margin: 25px 0 0 -30px; } }
.art-copy h2 .shine {
  background: linear-gradient(100deg, #fff 20%, #a5f3fc 40%, #fff 60%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s ease-in-out infinite;
}
@keyframes shine { 0% { background-position: 100% 0; } 60%, 100% { background-position: -100% 0; } }
.float-card { animation: floaty 6s ease-in-out infinite; transition: background 0.3s, border-color 0.3s; }
.float-card:nth-child(2) { animation-delay: -2s; }
.float-card:nth-child(3) { animation-delay: -4s; }
@keyframes floaty { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.float-card.flash { background: rgba(255, 255, 255, 0.22); border-color: rgba(255, 255, 255, 0.4); }
.float-card .fc-text { transition: opacity 0.35s, transform 0.35s; }
.float-card .fc-text.out { opacity: 0; transform: translateY(6px); }
.float-card .dot { animation: pulseDot 2.2s ease-in-out infinite; }
@keyframes pulseDot { 0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,.2); } 50% { box-shadow: 0 0 0 6px rgba(255,255,255,.06); } }
.auth-art > .logo, .auth-art > .art-copy, .auth-art > .float-cards { animation: artIn 0.9s cubic-bezier(.2,.8,.2,1) both; }
.auth-art > .art-copy { animation-delay: 0.12s; }
.auth-art > .float-cards { animation-delay: 0.26s; }
@keyframes artIn { from { opacity: 0; translate: 0 18px; } }
.auth-form form > * { animation: formIn 0.6s cubic-bezier(.2,.8,.2,1) both; }
.auth-form form > *:nth-child(2) { animation-delay: .05s; } .auth-form form > *:nth-child(3) { animation-delay: .1s; }
.auth-form form > *:nth-child(4) { animation-delay: .15s; } .auth-form form > *:nth-child(5) { animation-delay: .2s; }
.auth-form form > *:nth-child(6) { animation-delay: .25s; } .auth-form form > *:nth-child(7) { animation-delay: .3s; }
.auth-form form > *:nth-child(n+8) { animation-delay: .35s; }
@keyframes formIn { from { opacity: 0; transform: translateY(10px); } }
.auth-form .btn.primary { position: relative; overflow: hidden; }
.auth-form .btn.primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg);
  animation: btnShine 4.5s ease-in-out 1.2s infinite;
}
@keyframes btnShine { 0% { left: -60%; } 25%, 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) {
  .art-canvas { display: none; }
  .auth-art > .logo, .auth-art > .art-copy, .auth-art > .float-cards, .art-orb { transform: none !important; }
}

/* ───────── Footer ───────── */
.app-foot { text-align: center; font-size: 12px; color: var(--ink-3); padding: 28px 0 6px; font-weight: 500; letter-spacing: 0.01em; }
.auth-form .app-foot { padding-top: 12px; }
.access-note { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  padding: 9px 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); margin: 0; }
.access-note .i { color: var(--brand-ink); }

/* ───────── Responsive ───────── */
@media (max-width: 1180px) {
  .span-3 { grid-column: span 6 !important; }
  .span-4, .span-5, .span-7, .span-8 { grid-column: span 12 !important; }
  .stat-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app, .app.sb-collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; height: auto; margin: 10px; width: 264px; transform: translateX(-110%); transition: transform 0.25s ease; }
  .app.sb-open .sidebar { transform: none; }
  .app.sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .sb-scrim { display: block; position: fixed; inset: 0; background: var(--overlay); z-index: 35; opacity: 0; pointer-events: none; transition: opacity 0.2s; }
  .sb-collapse { display: none !important; }
  .btn.menu-btn { display: inline-flex; }
  .main { padding: 8px 14px 40px; }
  .cmd-trigger { width: auto; }
  .cmd-trigger span, .cmd-trigger kbd { display: none; }
  .span-3, .span-6 { grid-column: span 12 !important; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .hide-sm { display: none !important; }
  .import-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-title h1 { font-size: 19px; }
  .topbar .btn.primary span { display: none; }
  .topbar .btn.primary { width: 38px; padding: 0; }
}
@media (max-width: 640px) {
  table.t.responsive thead { display: none; }
  table.t.responsive, table.t.responsive tbody, table.t.responsive tr, table.t.responsive td { display: block; width: 100%; }
  table.t.responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; }
  table.t.responsive td { padding: 0; border: 0; }
  table.t.responsive td[data-m="hide"] { display: none; }
  table.t.responsive td[data-m="full"] { grid-column: 1 / -1; }
  table.t .complaint { max-width: none; }
  table.t.responsive td:first-child > div { flex-direction: row !important; align-items: center !important; }
  .board { grid-template-columns: repeat(4, 84vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ───────── Print report ───────── */
.report { max-width: 1100px; margin: 0 auto; padding: 28px; background: #fff; color: #0b1220; }
.report-head { display: flex; align-items: center; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid #0b1220; }
.report-head img { height: 54px; width: auto; }
.report-head .r-title { margin-left: auto; text-align: right; }
.report-head h1 { font-size: 20px; }
.report-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: #475467; margin: 14px 0; }
.report-kpi { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 16px; }
.report-kpi div { border: 1px solid #d8dee8; border-radius: 10px; padding: 8px 10px; }
.report-kpi small { font-size: 10.5px; color: #475467; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.report-kpi b { display: block; font-size: 20px; }
table.rt { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.rt th { background: #eef2f8; text-align: left; padding: 7px 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #c9d1de; }
table.rt td { padding: 7px 8px; border-bottom: 1px solid #e3e8ef; vertical-align: top; }
table.rt tr { break-inside: avoid; }
.report-foot { margin-top: 20px; font-size: 11px; color: #8390a6; display: flex; justify-content: space-between; }
.print-bar { position: sticky; top: 0; display: flex; gap: 8px; justify-content: center; padding: 12px; background: rgba(243,245,250,.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); z-index: 5; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff !important; }
  body::before { display: none; }
  .print-bar { display: none; }
  .report { padding: 0; max-width: none; }
  .pill { border: 1px solid currentColor; background: none !important; }
}
