/* PrabuAds Console - Design System
   Dikembangkan oleh PrabuWeb Developer. Font: Plus Jakarta Sans + JetBrains Mono. */
:root {
  --ink: #0b1220; --ink-2: #101a2f; --ink-3: #18243f; --ink-line: #24314f;
  --bg: #f3f5fa; --surface: #ffffff; --surface-2: #f8fafd; --surface-3: #eef2f8;
  --line: #e2e7f0; --line-2: #edf0f6;
  --text: #0b1220; --text-2: #39445e; --muted: #6a7590; --muted-2: #98a2b8;
  --brand: #1463ff; --brand-600: #0d4fd8; --brand-700: #0a3fb0; --brand-50: #edf3ff; --brand-100: #d9e6ff; --brand-glow: rgba(20, 99, 255, .28);
  --lime: #c8f53c;
  --ok: #10a861; --ok-50: #e7f7ef; --warn: #e88a06; --warn-50: #fef3e2; --bad: #e5392d; --bad-50: #fdecea; --info: #0b97d9; --info-50: #e6f5fc;
  --radius: 14px; --radius-sm: 10px; --radius-xs: 7px;
  --shadow-xs: 0 1px 2px rgba(11, 18, 32, .05);
  --shadow-sm: 0 1px 3px rgba(11, 18, 32, .06), 0 1px 2px rgba(11, 18, 32, .04);
  --shadow-md: 0 8px 24px -8px rgba(11, 18, 32, .14), 0 2px 6px rgba(11, 18, 32, .05);
  --shadow-lg: 0 24px 60px -18px rgba(11, 18, 32, .32);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-w: 268px; --topbar-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
h1, h2, h3 { margin: 0; letter-spacing: -.015em; line-height: 1.25; }
h2 { font-size: 16.5px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 12.5px; }
.center { text-align: center; }
.right { text-align: right; }
.block { display: block; }
.grow { flex: 1; }
.strong { font-weight: 700; color: var(--text); }
.text-bad { color: var(--bad); }
.text-warn { color: var(--warn); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
::selection { background: var(--brand-100); }

/* ===== Shell ===== */
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--ink); color: #c9d2e6; display: flex; flex-direction: column; z-index: 60; border-right: 1px solid var(--ink-line); }
.sidebar::before { content: ""; position: absolute; inset: 0; background: radial-gradient(420px 260px at -10% -5%, rgba(20, 99, 255, .28), transparent 70%), radial-gradient(300px 200px at 120% 105%, rgba(200, 245, 60, .07), transparent 70%); pointer-events: none; }
.sidebar-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 14px; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(140deg, var(--brand), #3f86ff 60%, #63a1ff); color: #fff; box-shadow: 0 6px 18px -4px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.25); }
.brand-mark .ic { width: 19px; height: 19px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.brand-text small { font-size: 11px; color: #7f8baa; font-weight: 500; }
.sidebar .sidebar-close { display: none; color: #c9d2e6; }
.nav { position: relative; flex: 1; overflow-y: auto; padding: 6px 12px 12px; scrollbar-width: thin; scrollbar-color: var(--ink-line) transparent; }
.nav-section { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #66728f; font-weight: 700; padding: 16px 10px 6px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 10px; color: #b7c1d8; font-weight: 600; font-size: 13.8px; transition: background .2s var(--ease), color .2s; }
.nav-link .ic { width: 18px; height: 18px; color: #7f8baa; transition: color .2s; }
.nav-link:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-link:hover .ic { color: #fff; }
.nav-link.is-active { background: linear-gradient(90deg, rgba(20,99,255,.26), rgba(20,99,255,.06)); color: #fff; box-shadow: inset 0 0 0 1px rgba(99, 150, 255, .22); }
.nav-link.is-active .ic { color: #8fb6ff; }
.nav-link.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--lime); }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--lime); color: var(--ink); }
.sidebar-foot { position: relative; padding: 14px; border-top: 1px solid var(--ink-line); }
.mode-card { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--ink-line); }
.mode-card strong { display: block; color: #fff; font-size: 13px; }
.mode-card small { display: block; color: #7f8baa; font-size: 11.5px; line-height: 1.35; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex-shrink: 0; box-shadow: 0 0 0 0 rgba(16,168,97,.6); animation: pulse 2s infinite; }
.mode-card.is-sim .pulse { background: var(--warn); box-shadow: 0 0 0 0 rgba(232,138,6,.6); animation-name: pulse-warn; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(16,168,97,.55); } 70% { box-shadow: 0 0 0 9px rgba(16,168,97,0); } 100% { box-shadow: 0 0 0 0 rgba(16,168,97,0); } }
@keyframes pulse-warn { 0% { box-shadow: 0 0 0 0 rgba(232,138,6,.55); } 70% { box-shadow: 0 0 0 9px rgba(232,138,6,0); } 100% { box-shadow: 0 0 0 0 rgba(232,138,6,0); } }
.sidebar-backdrop { display: none; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(243, 245, 250, .82); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line-2); }
.menu-btn { display: none; }
.topbar-title { min-width: 0; flex: 1; }
.topbar-title h1 { font-size: 19px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.ctx-switch { min-width: 230px; max-width: 300px; }
.ctx-chip { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: 13px; max-width: 260px; }
.ctx-chip span:first-of-type { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.avatar-btn { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: linear-gradient(140deg, var(--ink-3), var(--ink)); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; overflow: hidden; display: grid; place-items: center; padding: 0; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.content { flex: 1; padding: 26px 28px 40px; display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 1480px; margin: 0 auto; min-width: 0; }
.foot { display: flex; justify-content: space-between; gap: 12px; padding: 16px 28px 22px; color: var(--muted-2); font-size: 12px; flex-wrap: wrap; }

/* ===== Buttons ===== */
.btn { --b-bg: var(--surface); --b-fg: var(--text); --b-bd: var(--line); display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--b-bd); background: var(--b-bg); color: var(--b-fg); font-weight: 650; font-size: 13.8px; cursor: pointer; white-space: nowrap; transition: transform .12s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s; text-decoration: none; user-select: none; }
.btn:hover { color: var(--b-fg); border-color: #cfd6e3; box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--brand-100); }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.btn-primary { --b-bg: var(--brand); --b-fg: #fff; --b-bd: var(--brand); box-shadow: 0 6px 16px -6px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { --b-bg: var(--brand-600); --b-bd: var(--brand-600); color: #fff; box-shadow: 0 10px 22px -8px var(--brand-glow); }
.btn-soft { --b-bg: var(--brand-50); --b-fg: var(--brand-700); --b-bd: transparent; }
.btn-soft:hover { --b-bg: var(--brand-100); border-color: transparent; }
.btn-ghost { --b-bg: transparent; --b-bd: transparent; --b-fg: var(--text-2); }
.btn-ghost:hover { --b-bg: var(--surface-3); box-shadow: none; border-color: transparent; }
.btn-danger { --b-bg: var(--bad); --b-fg: #fff; --b-bd: var(--bad); }
.btn-light { --b-bg: #fff; --b-fg: var(--ink); --b-bd: #fff; }
.btn-link { background: none; border: 0; color: var(--brand); font-weight: 650; cursor: pointer; padding: 6px; }
.btn-link[disabled] { color: var(--muted); cursor: default; }
.btn-google { --b-bg: #fff; --b-fg: var(--text); --b-bd: var(--line); font-weight: 700; }
.btn-google .ic { color: #4285f4; width: 20px; height: 20px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.8px; border-radius: 8px; gap: 6px; }
.btn-sm .ic { width: 15px; height: 15px; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn.is-loading { pointer-events: none; color: transparent !important; position: relative; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--b-fg) transparent var(--b-fg) transparent; animation: spin .7s linear infinite; }
.btn-primary.is-loading::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); cursor: pointer; transition: background .2s, color .2s; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; }
.icon-btn .ic { width: 18px; height: 18px; }

/* ===== Cards ===== */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-xs); min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card > h2 + * { margin-top: 12px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head .muted { font-size: 13px; margin-top: 3px; }
.card-head h2 em.count { font-style: normal; font-size: 12px; background: var(--brand-50); color: var(--brand-700); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-xs); min-width: 0; }
.stat > div:last-child { min-width: 0; }
.stat span { display: block; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat strong { display: block; font-size: clamp(19px, 1.7vw, 26px); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin-top: 2px; overflow-wrap: anywhere; }
.stat strong.sm { font-size: 18px; margin-top: 6px; }
.stat small { display: block; font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.stat-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-ic .ic { width: 20px; height: 20px; }
.tone-brand { background: var(--brand-50); color: var(--brand); }
.tone-ok { background: var(--ok-50); color: var(--ok); }
.tone-warn { background: var(--warn-50); color: var(--warn); }
.tone-info { background: var(--info-50); color: var(--info); }
.tone-bad { background: var(--bad-50); color: var(--bad); }

.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.quick-card { display: flex; align-items: center; gap: 13px; padding: 15px 16px; border-radius: var(--radius); background: var(--surface); border: 1px dashed #cdd5e3; color: var(--text); transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.quick-card:hover { border-style: solid; border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-1px); color: var(--text); }
.quick-card > .ic { width: 38px; height: 38px; padding: 9px; border-radius: 11px; background: var(--ink); color: var(--lime); }
.quick-card strong { display: block; font-size: 14px; }
.quick-card small { display: block; color: var(--muted); font-size: 12px; }

.hero-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; padding: 26px 28px; border-radius: 18px; color: #fff; background: radial-gradient(600px 300px at 100% 0%, rgba(20,99,255,.55), transparent 60%), linear-gradient(135deg, var(--ink) 0%, var(--ink-3) 100%); position: relative; overflow: hidden; }
.hero-card::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000 60%); pointer-events: none; }
.hero-card > * { position: relative; z-index: 1; }
.hero-card h2 { font-size: 24px; font-weight: 800; margin-top: 4px; }
.hero-card p { color: #a9b6d3; margin-top: 4px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--lime); }

/* ===== Rows / lists ===== */
.rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rows li + li { border-top: 1px solid var(--line-2); }
.row-link, .row-static { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: var(--text); border-radius: 10px; transition: background .2s; }
.row-link:hover { background: var(--surface-2); color: var(--text); }
.row-main { flex: 1; min-width: 0; }
.row-main strong { display: block; font-size: 13.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-main small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.int-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-3); color: var(--text-2); flex-shrink: 0; }
.avatar { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(140deg, var(--brand-50), var(--brand-100)); color: var(--brand-700); font-weight: 800; font-size: 13px; flex-shrink: 0; overflow: hidden; }
.avatar.sm { width: 36px; height: 36px; font-size: 12.5px; }
.avatar.xs { width: 26px; height: 26px; border-radius: 8px; font-size: 10.5px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Badges & dots ===== */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-50); color: var(--ok); }
.badge-warn { background: var(--warn-50); color: #b86b00; }
.badge-bad { background: var(--bad-50); color: var(--bad); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }
.dot-connected { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-50); }
.dot-partial { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-50); }
.dot-disconnected { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-50); }
.dot-unchecked { background: var(--muted-2); box-shadow: 0 0 0 3px var(--surface-3); }
.chip-sm { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--text-2); margin-right: 4px; }
.chip-brand { background: var(--brand-50); color: var(--brand-700); }
.pill { display: inline-grid; place-items: center; height: 22px; min-width: 30px; padding: 0 6px; font-size: 10.5px; font-weight: 800; border-radius: 6px; background: var(--surface-3); color: var(--muted-2); letter-spacing: .03em; }
.pill.on { background: var(--ink); color: var(--lime); }
.asset-pills { display: flex; gap: 4px; flex-wrap: wrap; }
.obj-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.obj-chip .ic { width: 16px; height: 16px; color: var(--brand); }
.legend { display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }

/* ===== Alerts ===== */
.alert { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; border: 1px solid transparent; }
.alert > span { flex: 1; }
.alert .ic { width: 19px; height: 19px; }
.alert-ok { background: var(--ok-50); color: #0a7a46; border-color: #c4ecd7; }
.alert-warn { background: var(--warn-50); color: #8f5400; border-color: #fbdcaa; }
.alert-bad { background: var(--bad-50); color: #b42318; border-color: #f9cbc6; }
.alert-info { background: var(--info-50); color: #06709f; border-color: #bfe6f7; }
.note { display: flex; gap: 10px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; color: var(--muted); font-size: 12.8px; }
.note .ic { width: 17px; height: 17px; margin-top: 2px; color: var(--brand); }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.8px; font-weight: 700; color: var(--text-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field-label b { color: var(--bad); }
.field-help { font-size: 12px; color: var(--muted); }
.input { width: 100%; height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .2s, box-shadow .2s; outline: none; font-size: 14px; }
textarea.input { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input:hover { border-color: #cdd5e2; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
.input::placeholder { color: var(--muted-2); }
.input.is-invalid { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-50); }
.input.is-valid { border-color: var(--ok); }
input[type="date"].input, input[type="datetime-local"].input, input[type="time"].input { padding-right: 8px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .ic { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--muted-2); pointer-events: none; }
.input-icon > .input { padding-left: 40px; }
.input-affix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .2s, box-shadow .2s; overflow: hidden; }
.input-affix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.input-affix em { font-style: normal; display: grid; place-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 12.5px; border-right: 1px solid var(--line); }
.input-affix em.after { border-right: 0; border-left: 1px solid var(--line); }
.input-affix .input { border: 0; box-shadow: none !important; border-radius: 0; }
.input-status { position: relative; display: block; }
.input-status .input { padding-right: 36px; }
.id-ind { position: absolute; right: 12px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--line); transition: background .2s, box-shadow .2s; }
.id-ind.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-50); }
.id-ind.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-50); }
.reveal-wrap { position: relative; display: block; }
.reveal-wrap .input { padding-right: 44px; }
.reveal-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.check.sm { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.check input, .check-card input { appearance: none; -webkit-appearance: none; width: 19px; height: 19px; border: 1.6px solid #c4ccdb; border-radius: 6px; background: var(--surface); display: grid; place-items: center; cursor: pointer; transition: all .15s; flex-shrink: 0; margin: 0; }
.check input:checked, .check-card input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after, .check-card input:checked::after { content: ""; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check input:focus-visible { box-shadow: 0 0 0 3px var(--brand-100); }

/* Switch */
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 42px; height: 24px; border-radius: 999px; background: #d3d9e5; cursor: pointer; transition: background .25s var(--ease); flex-shrink: 0; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(11,18,32,.25); transition: transform .25s var(--ease); }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { box-shadow: 0 0 0 3px var(--brand-100); outline: none; }
.switch-row { display: flex; align-items: flex-start; gap: 13px; padding: 12px 0; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line-2); }
.switch-row > span strong { display: block; font-size: 13.8px; }
.switch-row > span small { display: block; font-size: 12.3px; color: var(--muted); }
.switch-row.inline { padding: 0; align-items: center; }

/* Segmented */
.segmented { display: inline-flex; padding: 4px; gap: 3px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-2); flex-wrap: wrap; max-width: 100%; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 9px; font-size: 13px; font-weight: 650; color: var(--muted); transition: all .2s var(--ease); white-space: nowrap; }
.segmented span em { font-style: normal; font-size: 11px; color: var(--muted-2); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--brand-100); }
.segmented.block { display: flex; }
.segmented.block label { flex: 1; }
.segmented.block span { width: 100%; justify-content: center; }

/* Radio cards */
.radio-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.radio-cards.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.radio-cards.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.radio-cards.vertical { grid-template-columns: 1fr; gap: 8px; }
.radio-card { position: relative; cursor: pointer; display: block; }
.radio-card > input { position: absolute; opacity: 0; pointer-events: none; }
.rc-body { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 15px 16px 15px 46px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface); transition: border-color .2s, box-shadow .2s, background .2s; position: relative; }
.rc-body::before { content: ""; position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; border-radius: 50%; border: 1.6px solid #c4ccdb; background: var(--surface); transition: all .2s; }
.radio-card > input[type="checkbox"] + .rc-body::before { border-radius: 6px; }
.rc-body strong { font-size: 14px; }
.rc-body small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.rc-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); margin-bottom: 6px; transition: all .2s; }
.radio-card:hover .rc-body { border-color: #c6cfde; }
.radio-card > input:checked + .rc-body { border-color: var(--brand); background: linear-gradient(180deg, var(--brand-50), #fff 70%); box-shadow: 0 0 0 4px var(--brand-50); }
.radio-card > input:checked + .rc-body::before { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 4px #fff; }
.radio-card > input[type="checkbox"]:checked + .rc-body::before { box-shadow: none; background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/12px no-repeat; }
.radio-card > input:checked + .rc-body .rc-ic { background: var(--brand); color: #fff; }
.radio-card > input:focus-visible + .rc-body { box-shadow: 0 0 0 4px var(--brand-100); }
.radio-card > input:disabled + .rc-body { opacity: .45; cursor: not-allowed; }
.radio-card.compact .rc-body { padding: 13px 14px 13px 42px; flex-direction: row; align-items: center; gap: 10px; }
.radio-card.compact .rc-body::before { top: 50%; margin-top: -9px; left: 14px; }
.radio-card.compact .rc-ic { margin: 0; width: 30px; height: 30px; }
.radio-card.big .rc-body { padding: 18px 18px 18px 18px; }
.radio-card.big .rc-body::before { left: auto; right: 16px; top: 18px; }
.rc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.rc-tags span { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-weight: 600; }

/* Check cards (multi) */
.check-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.check-card { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 11px; cursor: pointer; transition: border-color .2s, background .2s; font-size: 13.3px; font-weight: 600; background: var(--surface); }
.check-card:hover { border-color: #c6cfde; }
.check-card:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.check-card:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.check-card small { display: block; font-weight: 500; color: var(--muted); font-size: 11.5px; }

/* Modern select (enhanced) */
.mselect { position: relative; min-width: 0; }
.mselect-btn { width: 100%; height: 42px; display: flex; align-items: center; gap: 9px; padding: 0 12px 0 13px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .2s, box-shadow .2s; font-size: 14px; }
.mselect-btn:hover { border-color: #cdd5e2; }
.mselect.open .mselect-btn, .mselect-btn:focus-visible { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); outline: none; }
.mselect-btn .val { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mselect-btn .val.placeholder { color: var(--muted-2); font-weight: 500; }
.mselect-btn .chev { width: 16px; height: 16px; color: var(--muted); transition: transform .2s var(--ease); }
.mselect.open .chev { transform: rotate(180deg); }
.mselect-pop { position: absolute; z-index: 80; left: 0; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top; pointer-events: none; transition: opacity .16s, transform .18s var(--ease); }
.mselect.open .mselect-pop { opacity: 1; transform: none; pointer-events: auto; }
.mselect.up .mselect-pop { top: auto; bottom: calc(100% + 6px); transform-origin: bottom; }
.mselect-search { padding: 4px 4px 6px; }
.mselect-search .input { height: 36px; font-size: 13.5px; }
.mselect-list { max-height: 280px; overflow-y: auto; list-style: none; margin: 0; padding: 0; scrollbar-width: thin; }
.mselect-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13.8px; font-weight: 550; }
.mselect-opt:hover, .mselect-opt.active { background: var(--surface-3); }
.mselect-opt.selected { color: var(--brand-700); background: var(--brand-50); }
.mselect-opt.selected::after { content: ""; margin-left: auto; width: 12px; height: 7px; border: 2px solid var(--brand); border-top: 0; border-right: 0; transform: rotate(-45deg) translateY(-2px); }
.mselect-opt small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.mselect-empty { padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }
.ctx-switch .mselect-btn { border-radius: 999px; height: 40px; }
.ctx-switch .mselect-pop { min-width: 280px; left: auto; }

/* Chips input (async) */
.chips { position: relative; }
.chips-box { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .2s, box-shadow .2s; cursor: text; }
.chips-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.chips-box input { flex: 1; min-width: 140px; border: 0; outline: none; background: transparent; height: 30px; padding: 0 6px; font-size: 13.8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 11px; border-radius: 8px; background: var(--brand-50); color: var(--brand-700); font-size: 12.8px; font-weight: 650; max-width: 100%; }
.chip > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.chip small { color: var(--muted); font-weight: 500; font-size: 11px; }
.chip button { width: 20px; height: 20px; border: 0; border-radius: 6px; background: transparent; color: inherit; display: grid; place-items: center; cursor: pointer; padding: 0; }
.chip button:hover { background: rgba(20,99,255,.14); }
.chip button .ic { width: 13px; height: 13px; }
.chip.ex { background: var(--bad-50); color: #b42318; }
.chip.dark { background: var(--ink); color: #fff; }
.chip input.radius { width: 54px; height: 22px; border: 1px solid var(--brand-100); border-radius: 5px; font-size: 11.5px; padding: 0 4px; background: #fff; min-width: 0; flex: none; }
.chips-pop { position: absolute; z-index: 70; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 320px; overflow-y: auto; }
.chips-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.chips-opt:hover, .chips-opt.active { background: var(--surface-3); }
.chips-opt .t { flex: 1; min-width: 0; }
.chips-opt strong { display: block; font-size: 13.5px; }
.chips-opt small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips-opt .tag { font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.chips-opt .size { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* Range dual */
.range-dual { position: relative; height: 38px; }
.range-dual input[type=range] { position: absolute; left: 0; right: 0; top: 10px; width: 100%; margin: 0; pointer-events: none; appearance: none; -webkit-appearance: none; background: transparent; height: 18px; }
.range-dual input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); box-shadow: var(--shadow-sm); cursor: grab; }
.range-dual input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); cursor: grab; }
.range-track { position: absolute; left: 0; right: 0; top: 17px; height: 5px; border-radius: 9px; background: var(--surface-3); }
.range-fill { position: absolute; top: 17px; height: 5px; border-radius: 9px; background: var(--brand); }
.range-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.tab { padding: 10px 14px; font-weight: 650; font-size: 13.5px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab em { font-style: normal; font-size: 11px; background: var(--surface-3); padding: 1px 7px; border-radius: 999px; color: var(--text-2); }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.tab.is-active em { background: var(--brand-50); color: var(--brand-700); }

/* Toolbar */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-filters { display: flex; gap: 10px; flex: 1; flex-wrap: wrap; min-width: 0; }
.toolbar-filters .mselect { width: 180px; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px; }
.filters .mselect { width: 170px; }
.filters input[type=date] { width: 160px; }
.page-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.page-actions form { margin: 0; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #fafbfe; }
.table th.right, .table td.right { text-align: right; }
.cell-client { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.cell-client small { display: block; color: var(--muted); }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.lvl-bar { display: inline-block; width: 4px; height: 14px; border-radius: 3px; margin-right: 8px; vertical-align: -2px; background: var(--muted-2); }
.lvl-success .lvl-bar { background: var(--ok); } .lvl-warning .lvl-bar { background: var(--warn); } .lvl-danger .lvl-bar { background: var(--bad); } .lvl-info .lvl-bar { background: var(--info); }
details.mini summary { cursor: pointer; font-size: 12px; color: var(--brand); margin-top: 4px; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 13px; color: var(--muted); }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 90; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .15s, transform .18s var(--ease); text-align: left; }
.dropdown.open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; border: 0; background: none; color: var(--text); font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); }
.dropdown-menu .ic { width: 16px; height: 16px; color: var(--muted); }
.dropdown-menu .danger { color: var(--bad); }
.dropdown-menu .danger .ic { color: var(--bad); }
.dropdown-menu form { margin: 0; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.dropdown-head strong { display: block; font-size: 13.5px; }
.dropdown-head small { color: var(--muted); font-size: 12px; }

/* Empty / skeleton */
.empty { text-align: center; padding: 34px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 4px; }
.empty-ic .ic { width: 24px; height: 24px; }
.empty p { color: var(--muted); max-width: 420px; font-size: 13.5px; }
.empty .btn { margin-top: 8px; }
.skeleton-rows { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.skeleton-rows span, .skel { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--surface-3), var(--line-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-rows span:nth-child(2) { width: 80%; } .skeleton-rows span:nth-child(3) { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); border-radius: 2px; }
.tl-item { position: relative; display: flex; gap: 13px; padding: 9px 0; }
.tl-item.is-new { animation: tl-in .5s var(--ease); }
@keyframes tl-in { from { opacity: 0; transform: translateY(-6px); background: var(--brand-50); } to { opacity: 1; transform: none; } }
.tl-ic { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--info); flex-shrink: 0; }
.tl-ic .ic { width: 15px; height: 15px; }
.tl-success .tl-ic { color: var(--ok); background: var(--ok-50); border-color: #c4ecd7; }
.tl-warning .tl-ic { color: var(--warn); background: var(--warn-50); border-color: #fbdcaa; }
.tl-danger .tl-ic { color: var(--bad); background: var(--bad-50); border-color: #f9cbc6; }
.tl-body { min-width: 0; flex: 1; padding-top: 4px; }
.tl-body p { font-size: 13.5px; color: var(--text-2); word-break: break-word; }
.tl-body p strong { color: var(--text); }
.tl-body small { display: block; margin-top: 3px; font-size: 11.8px; color: var(--muted); }

/* Connection list */
.conn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.conn-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.conn-item > div { flex: 1; min-width: 0; }
.conn-item strong { display: block; font-size: 13.5px; }
.conn-item small { display: block; font-size: 12px; color: var(--muted); word-break: break-word; }
.conn-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.conn-ic .ic { width: 16px; height: 16px; }
.conn-ok .conn-ic { background: var(--ok-50); color: var(--ok); }
.conn-warn .conn-ic { background: var(--warn-50); color: var(--warn); }
.conn-fail .conn-ic { background: var(--bad-50); color: var(--bad); }
.conn-skip .conn-ic { background: var(--surface-3); color: var(--muted-2); }
.conn-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.conn-ok .conn-tag { color: var(--ok); } .conn-warn .conn-tag { color: var(--warn); } .conn-fail .conn-tag { color: var(--bad); }
.conn + .hint, .conn .hint { margin-top: 10px; }

/* KV & lists */
.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 9px 14px; margin: 12px 0 0; font-size: 13.3px; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.perm-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.perm-list li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--muted); }
.perm-list li .ic { width: 16px; height: 16px; padding: 2px; border-radius: 5px; background: var(--surface-3); }
.perm-list li.on { color: var(--text); font-weight: 600; }
.perm-list li.on .ic { background: var(--ok-50); color: var(--ok); }
.user-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.user-list li { display: flex; align-items: center; gap: 10px; font-size: 13.3px; }
.user-list li span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.user-list li small { color: var(--muted); font-size: 11.5px; }
.disclosure { border: 1px dashed var(--line); border-radius: 12px; padding: 4px 14px; }
.disclosure[open] { padding-bottom: 14px; }
.disclosure summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 13.5px; padding: 10px 0; color: var(--text-2); }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary .ic { width: 17px; height: 17px; color: var(--brand); }
.disclosure > *:not(summary) { margin-top: 8px; }
.code { font-family: var(--mono); font-size: 12px; line-height: 1.6; background: var(--ink); color: #d6def0; padding: 14px 16px; border-radius: 12px; overflow: auto; max-height: 460px; margin: 6px 0 0; white-space: pre; }
.code .k { color: #8fb6ff; } .code .s { color: #c8f53c; } .code .n { color: #ffb86b; } .code .b { color: #ff8fa3; }
.copy-box { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.copy-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.copy-row code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; font-family: var(--mono); font-size: 12.5px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }

/* Form layout */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.form-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.form-side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.form-side .card h2 { margin-bottom: 4px; }
.form-side .card .muted { font-size: 12.8px; margin-bottom: 6px; }
.sticky-actions { display: flex; flex-direction: column; gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }
.discover-result { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.discover-result h4 { margin: 0 0 8px; font-size: 13px; }
.discover-result .opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.discover-result .opts button { border: 1px solid var(--brand-100); background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.discover-result .opts button:hover { border-color: var(--brand); }
.discover-result .opts button small { display: block; font-family: var(--mono); color: var(--muted); font-size: 11px; font-weight: 500; }

/* Settings */
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--topbar-h) + 20px); background: var(--surface); padding: 8px; border-radius: var(--radius); border: 1px solid var(--line-2); }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 650; font-size: 13.5px; white-space: nowrap; }
.settings-nav a:hover { background: var(--surface-3); color: var(--text); }
.settings-nav a.is-active { background: var(--ink); color: #fff; }
.settings-nav a.is-active .ic { color: var(--lime); }
.settings-body { min-width: 0; }
.settings-body h3 { margin-top: 10px; }
.slot-card { border: 1px solid var(--line); border-radius: 13px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.slot-head { display: flex; justify-content: space-between; align-items: center; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-stats div { padding: 12px; border-radius: 11px; background: var(--surface-2); }
.mini-stats small { display: block; color: var(--muted); font-size: 12px; }
.test-result { margin-top: 4px; }

/* Export */
.export-form { display: flex; flex-direction: column; gap: 6px; max-width: 620px; }
.export-form .btn { align-self: flex-start; margin-top: 8px; }

/* ===== Builder ===== */
.builder { display: grid; grid-template-columns: 236px minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.b-steps { position: sticky; top: calc(var(--topbar-h) + 20px); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.b-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted-2); font-weight: 800; padding: 12px 10px 6px; display: flex; align-items: center; gap: 8px; }
.b-group .ic { width: 14px; height: 14px; }
.b-step { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px; border: 0; background: none; cursor: pointer; text-align: left; color: var(--text-2); font-weight: 650; font-size: 13.4px; transition: background .2s, color .2s; }
.b-step:hover { background: var(--surface-3); }
.b-step .num { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--surface-3); color: var(--muted); flex-shrink: 0; transition: all .2s; }
.b-step .num .ic { width: 13px; height: 13px; }
.b-step.is-active { background: var(--ink); color: #fff; }
.b-step.is-active .num { background: var(--lime); color: var(--ink); }
.b-step.is-done .num { background: var(--ok-50); color: var(--ok); }
.b-step.has-error .num { background: var(--bad-50); color: var(--bad); }
.b-step.is-active.has-error .num { background: var(--bad); color: #fff; }
.b-body { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.b-sections { min-width: 0; }
.b-section { display: none; flex-direction: column; gap: 16px; animation: b-in .3s var(--ease); }
.b-section.is-active { display: flex; }
@keyframes b-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.b-section > .card { display: flex; flex-direction: column; gap: 16px; }
.b-section > .card > .card-head { margin-bottom: 0; }
.b-title { display: flex; align-items: center; gap: 12px; }
.b-title .ic-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); flex-shrink: 0; }
.b-title h2 { font-size: 18px; }
.b-title p { color: var(--muted); font-size: 13px; }
.b-footer { position: sticky; bottom: 14px; z-index: 30; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px; border-radius: 16px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.b-save { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.b-save.saving .dot { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-50); }
.b-save.saved .dot { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-50); }
.b-save.error .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-50); }
.b-side { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - var(--topbar-h) - 40px); overflow-y: auto; scrollbar-width: thin; padding-bottom: 4px; }
.sum-card { background: var(--ink); color: #c9d2e6; border-radius: var(--radius); padding: 18px; position: relative; overflow: hidden; }
.sum-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(260px 160px at 100% 0, rgba(20,99,255,.45), transparent 70%); pointer-events: none; }
.sum-card > * { position: relative; }
.sum-card h3 { color: #fff; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.sum-card h3 .ic { color: var(--lime); width: 16px; height: 16px; }
.sum-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.sum-list li { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.sum-list li span { color: #8592b0; flex-shrink: 0; }
.sum-list li strong { color: #fff; text-align: right; font-weight: 650; word-break: break-word; }
.gauge { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ink-line); }
.gauge-bar { height: 8px; border-radius: 8px; background: linear-gradient(90deg, #f04438, #f79009 35%, #12b76a 55%, #f79009 80%, #f04438); position: relative; margin: 10px 0 6px; }
.gauge-bar i { position: absolute; top: -4px; width: 4px; height: 16px; border-radius: 3px; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.2); transition: left .5s var(--ease); }
.gauge-labels { display: flex; justify-content: space-between; font-size: 10.5px; color: #7d89a7; }
.gauge strong.big { display: block; color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.v-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 16px; }
.v-card h3 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.v-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.v-list li { display: flex; gap: 8px; font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.v-list li .ic { width: 15px; height: 15px; margin-top: 1px; }
.v-list li.err { background: var(--bad-50); color: #b42318; }
.v-list li.warn { background: var(--warn-50); color: #8f5400; }
.v-list li.ok { background: var(--ok-50); color: #0a7a46; cursor: default; }
.ai-card { background: linear-gradient(140deg, var(--brand-50), #fff); border: 1px solid var(--brand-100); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-card h3 { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.ai-card h3 .ic { color: var(--brand); }
.ai-card p { font-size: 12.5px; color: var(--muted); }

.sub-card { border: 1px solid var(--line); border-radius: 13px; padding: 16px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.sub-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sub-card-head h3 { font-size: 14px; }
.sub-card-head p { font-size: 12.5px; color: var(--muted); }
.place-group { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.place-group + .place-group { margin-top: 10px; }
.place-head { display: flex; align-items: center; gap: 12px; padding: 13px 14px; background: var(--surface-2); cursor: pointer; }
.place-head strong { display: block; font-size: 13.8px; }
.place-head small { display: block; font-size: 12px; color: var(--muted); }
.place-head > div { flex: 1; }
.place-head .count { font-size: 11.5px; font-weight: 700; color: var(--brand-700); background: var(--brand-50); padding: 3px 9px; border-radius: 999px; }
.place-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 12px; }
.place-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-2); cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s; }
.place-item:hover { border-color: #c6cfde; }
.place-item:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.place-item.is-disabled { opacity: .4; pointer-events: none; }
.place-item .plat { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: var(--ink); color: var(--lime); letter-spacing: .04em; }
.place-item .plat.ig { background: #e1306c; color: #fff; } .place-item .plat.ms { background: #0084ff; color: #fff; } .place-item .plat.an { background: #6a7590; color: #fff; } .place-item .plat.th { background: #000; color: #fff; }
.daypart { display: flex; flex-direction: column; gap: 10px; }
.daypart-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; padding: 10px; border-radius: 11px; background: var(--surface-2); }
.days { display: flex; gap: 4px; flex-wrap: wrap; }
.days label input { position: absolute; opacity: 0; }
.days label { position: relative; }
.days label span { display: grid; place-items: center; width: 36px; height: 32px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--surface); border: 1px solid var(--line); color: var(--muted); cursor: pointer; }
.days label input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.daypart-row input[type=time] { width: 110px; height: 34px; }
.media-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.media-pick button { position: relative; border: 2px solid transparent; border-radius: 12px; overflow: hidden; padding: 0; background: var(--surface-3); cursor: pointer; aspect-ratio: 1; transition: border-color .2s, transform .2s var(--ease); }
.media-pick button:hover { transform: translateY(-1px); }
.media-pick button.sel { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.media-pick button img, .media-pick button video { width: 100%; height: 100%; object-fit: cover; }
.media-pick button .mtag { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: rgba(11,18,32,.75); color: #fff; }
.media-pick button .msel { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: none; place-items: center; }
.media-pick button.sel .msel { display: grid; }
.media-pick button .msel .ic { width: 13px; height: 13px; }
.media-pick .mname { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 6px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(11,18,32,.8)); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-slot { border: 1px solid var(--line); border-radius: 13px; padding: 14px; display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.card-slot .thumb { width: 92px; aspect-ratio: 1; border-radius: 10px; background: var(--surface-3); overflow: hidden; display: grid; place-items: center; cursor: pointer; border: 1.5px dashed var(--line); color: var(--muted); }
.card-slot .thumb img, .card-slot .thumb video { width: 100%; height: 100%; object-fit: cover; }
.counter { font-size: 11.5px; color: var(--muted-2); font-weight: 600; margin-left: auto; }
.counter.over { color: var(--warn); }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-suggest button { border: 1px dashed var(--brand-100); background: var(--brand-50); color: var(--brand-700); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; cursor: pointer; text-align: left; max-width: 100%; }
.ai-suggest button:hover { border-style: solid; }

/* Ad preview */
.ad-preview { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; max-width: 360px; margin: 0 auto; box-shadow: var(--shadow-sm); }
.ap-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.ap-head .ap-av { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--lime); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.ap-head strong { display: block; font-size: 13px; }
.ap-head small { display: block; font-size: 11px; color: var(--muted); }
.ap-text { padding: 0 12px 10px; font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.ap-media { aspect-ratio: 1; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); overflow: hidden; }
.ap-media img, .ap-media video { width: 100%; height: 100%; object-fit: cover; }
.ap-carousel { display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 10px; scroll-snap-type: x mandatory; }
.ap-carousel > div { flex: 0 0 72%; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ap-carousel .ap-media { aspect-ratio: 1; }
.ap-foot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.ap-foot > div { flex: 1; min-width: 0; }
.ap-foot small { display: block; font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-foot strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-cta { padding: 7px 12px; border-radius: 7px; background: var(--surface-3); font-size: 12px; font-weight: 700; white-space: nowrap; }
.preview-switch { display: flex; justify-content: center; margin-bottom: 10px; }

/* Review */
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.review-block { border: 1px solid var(--line); border-radius: 13px; padding: 14px 16px; }
.review-block h4 { margin: 0 0 8px; font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.review-block h4 button { font-size: 12px; }
.publish-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.publish-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 13.5px; }
.publish-steps li .st { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex-shrink: 0; }
.publish-steps li .st .ic { width: 15px; height: 15px; }
.publish-steps li > div { flex: 1; min-width: 0; }
.publish-steps li small { display: block; color: var(--muted); font-size: 12px; word-break: break-word; }
.publish-steps li.run .st { background: var(--brand-50); color: var(--brand); }
.publish-steps li.run .st .ic { animation: spin 1s linear infinite; }
.publish-steps li.ok { border-color: #c4ecd7; background: var(--ok-50); }
.publish-steps li.ok .st { background: var(--ok); color: #fff; }
.publish-steps li.skip .st { background: var(--info-50); color: var(--info); }
.publish-steps li.fail { border-color: #f9cbc6; background: var(--bad-50); }
.publish-steps li.fail .st { background: var(--bad); color: #fff; }
.payload-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.status-strip { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13px; }
.status-strip .mono { font-size: 12px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(11, 18, 32, .55); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-box { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .25s var(--ease); }
.modal.open .modal-box { transform: none; }
.modal-box.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { font-size: 16px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }

/* Toast */
.toast-stack { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: min(400px, calc(100vw - 40px)); }
.toast { display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border-radius: 13px; background: var(--ink); color: #e3e9f6; box-shadow: var(--shadow-lg); font-size: 13.3px; animation: toast-in .3s var(--ease); border-left: 3px solid var(--info); }
.toast .ic { width: 18px; height: 18px; margin-top: 1px; }
.toast.ok { border-left-color: var(--ok); } .toast.ok .ic { color: #4ade80; }
.toast.bad { border-left-color: var(--bad); } .toast.bad .ic { color: #ff8a80; }
.toast.warn { border-left-color: var(--warn); } .toast.warn .ic { color: #fbbf24; }
.toast.out { animation: toast-out .25s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* Media library */
.dropzone { border: 2px dashed #c7d0df; border-radius: 16px; padding: 34px 20px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: border-color .2s, background .2s; background: var(--surface-2); }
.dropzone:hover, .dropzone.over { border-color: var(--brand); background: var(--brand-50); }
.dropzone p { color: var(--muted); font-size: 13px; max-width: 520px; }
.dropzone .btn { margin-top: 6px; }
.dz-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--ink); color: var(--lime); }
.dz-ic .ic { width: 26px; height: 26px; }
.upload-queue { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.upload-queue li { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); font-size: 13px; }
.upload-queue .bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.upload-queue .bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.upload-queue li.done .bar i { background: var(--ok); }
.upload-queue li.fail .bar i { background: var(--bad); }
.spec-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.spec-grid div { padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); }
.spec-grid strong { display: block; font-size: 12.5px; }
.spec-grid small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.m-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-xs); transition: box-shadow .2s, transform .2s var(--ease); }
.m-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.m-thumb { position: relative; aspect-ratio: 4 / 3; background: var(--surface-3); overflow: hidden; display: grid; place-items: center; }
.m-thumb img, .m-thumb video { width: 100%; height: 100%; object-fit: cover; }
.m-thumb .mtag { position: absolute; left: 8px; top: 8px; font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 6px; background: rgba(11,18,32,.78); color: #fff; letter-spacing: .04em; }
.m-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.m-body strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-body small { color: var(--muted); font-size: 11.8px; }
.m-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-actions { display: flex; gap: 6px; padding: 0 10px 10px; }

/* AI page */
.ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.ai-result { position: sticky; top: calc(var(--topbar-h) + 20px); }
.ai-slots { display: flex; gap: 6px; }
.ai-slots .slot { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 7px; background: var(--surface-3); color: var(--muted-2); }
.ai-slots .slot.on { background: var(--ink); color: var(--lime); }
.plan-sec { border-top: 1px solid var(--line-2); padding-top: 14px; margin-top: 14px; }
.plan-sec h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-2); }
.plan-kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-kv div { padding: 10px 12px; border-radius: 11px; background: var(--surface-2); }
.plan-kv small { display: block; color: var(--muted); font-size: 11.5px; }
.plan-kv strong { font-size: 13.3px; }
.plan-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.resolve-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 12.5px; }

/* Monitor */
.monitor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 20px; align-items: start; }
.online-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.online-list li { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
.online-list li > div { flex: 1; min-width: 0; }
.online-list strong { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.online-list small { display: block; font-size: 12px; color: var(--muted); }
.online-list .stage { display: inline-flex; margin-top: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: var(--brand-50); color: var(--brand-700); }
.live-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ok); background: var(--ok-50); padding: 5px 11px; border-radius: 999px; }

/* Auth */
.auth { background: var(--surface); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; background: var(--ink); color: #c9d2e6; overflow: hidden; display: flex; align-items: center; padding: 48px; }
.auth-brand::before { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 420px at 10% 0%, rgba(20, 99, 255, .45), transparent 65%), radial-gradient(500px 360px at 100% 100%, rgba(200, 245, 60, .12), transparent 60%); }
.auth-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(circle at 30% 40%, #000, transparent 75%); pointer-events: none; }
.auth-brand-inner { position: relative; z-index: 1; max-width: 520px; }
.brand-lg .brand-mark { width: 44px; height: 44px; border-radius: 13px; }
.brand-lg .brand-text strong { font-size: 18px; }
.auth-brand h2 { margin: 40px 0 26px; font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; color: #fff; letter-spacing: -.03em; line-height: 1.15; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-points li { display: flex; align-items: center; gap: 13px; font-size: 14.5px; }
.auth-points li .ic { width: 36px; height: 36px; padding: 8px; border-radius: 11px; background: rgba(255,255,255,.06); border: 1px solid var(--ink-line); color: var(--lime); }
.auth-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; padding: 32px; box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 18px; }
.auth-card h1 { font-size: 24px; font-weight: 800; }
.auth-card > .muted { margin-top: -12px; font-size: 13.8px; }
.auth-foot { margin-top: 18px; font-size: 12px; color: var(--muted-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.link-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); align-self: center; }
.link-back .ic { width: 15px; height: 15px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { width: 100%; height: 56px; text-align: center; font-size: 22px; font-weight: 800; font-family: var(--mono); border: 1.5px solid var(--line); border-radius: 12px; outline: none; transition: border-color .2s, box-shadow .2s; background: var(--surface); }
.otp input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.otp input.filled { border-color: var(--ink); background: var(--surface-2); }
.turnstile-wrap { display: flex; justify-content: center; min-height: 65px; }
.pending-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px; border-radius: 14px; background: var(--surface-2); }
.pending-ic { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--warn-50); color: var(--warn); }
.pending-ic .ic { width: 26px; height: 26px; }
.pending-card .kv { width: 100%; }

/* Installer */
.install-steps { display: flex; gap: 8px; margin-bottom: 4px; }
.install-steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--surface-3); }
.install-steps span.on { background: var(--brand); }
.req-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.req-list li { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); }
.req-list li.bad { background: var(--bad-50); color: #b42318; }

/* ===== Responsive ===== */
@media (max-width: 1360px) {
  .builder { grid-template-columns: 220px minmax(0, 1fr); }
  .b-side { grid-column: 1 / -1; position: static; max-height: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; }
}
@media (max-width: 1180px) {
  .stats, .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .ai-layout, .monitor { grid-template-columns: 1fr; }
  .ai-result { position: static; }
  .form-layout { grid-template-columns: 1fr; }
  .form-side { position: static; }
  .spec-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(11,18,32,.5); z-index: 55; backdrop-filter: blur(2px); }
  body.sidebar-open { overflow: hidden; }
  .sidebar .sidebar-close { display: inline-grid; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .content { padding: 20px 16px 32px; }
  .foot { padding: 14px 16px 20px; }
  .builder { grid-template-columns: 1fr; }
  .b-steps { position: sticky; top: var(--topbar-h); z-index: 35; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; scrollbar-width: none; border-radius: 14px; margin: 0 -2px; box-shadow: var(--shadow-sm); }
  .b-steps::-webkit-scrollbar { display: none; }
  .b-group { display: none; }
  .b-step { flex: 0 0 auto; width: auto; white-space: nowrap; padding: 8px 12px; }
  .b-side { grid-template-columns: 1fr 1fr; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .settings-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 22px 30px; }
  .auth-brand h2 { margin: 22px 0 16px; font-size: 24px; }
  .auth-points { gap: 10px; }
  .auth-points li { font-size: 13px; }
  .auth-points li .ic { width: 30px; height: 30px; padding: 6px; }
  .auth-points li:nth-child(n+3) { display: none; }
  .auth-panel { padding: 24px 16px 32px; justify-content: flex-start; }
  .auth-card { padding: 24px 20px; border-radius: 18px; }
  .review-grid { grid-template-columns: 1fr; }
  /* Tabel menjadi kartu di layar kecil */
  .rtable thead { display: none; }
  .rtable, .rtable tbody, .rtable tr, .rtable td { display: block; width: 100%; }
  .rtable tr { padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
  .rtable tbody tr:last-child { border-bottom: 0; }
  .rtable td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 14px; text-align: right; }
  .rtable td::before { content: attr(data-label); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: left; flex-shrink: 0; padding-top: 2px; }
  .rtable td > * { min-width: 0; }
  .rtable td:first-child { display: block; text-align: left; padding-bottom: 8px; }
  .rtable td:first-child::before { display: none; }
  .rtable td.right { justify-content: space-between; }
  .rtable .row-actions { justify-content: flex-end; }
  .cell-client { min-width: 0; }
  .camp-table td[colspan] { display: block; }
}
@media (max-width: 680px) {
  body { font-size: 14px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; gap: 10px; flex-direction: column; }
  .stat strong { font-size: 21px; }
  .stat-ic { width: 36px; height: 36px; border-radius: 10px; }
  .quick { grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-card { flex-direction: column; align-items: flex-start; gap: 8px; padding: 13px; }
  .grid-2, .grid-3, .plan-kv, .mini-stats { grid-template-columns: 1fr; }
  .radio-cards.cols-2 { grid-template-columns: 1fr; }
  .radio-cards.cols-3 { grid-template-columns: 1fr 1fr; }
  .card { padding: 16px; border-radius: 13px; }
  .topbar-title h1 { font-size: 16.5px; }
  .topbar-title p { display: none; }
  .ctx-switch { min-width: 0; width: 150px; }
  .ctx-chip { max-width: 140px; padding: 0 10px; }
  .ctx-chip .ic { display: none; }
  .hero-card { padding: 20px; }
  .hero-card h2 { font-size: 20px; }
  .toolbar-filters .mselect, .filters .mselect, .filters input[type=date] { width: 100%; }
  .toolbar-filters > *, .filters > * { flex: 1 1 100%; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions > * { flex: 1; }
  .b-side { grid-template-columns: 1fr; }
  .b-footer { bottom: 8px; padding: 8px; border-radius: 14px; }
  .b-footer .btn span { display: none; }
  .b-footer .btn { width: 46px; padding: 0; }
  .b-save { font-size: 11.5px; }
  .card-slot { grid-template-columns: 72px minmax(0, 1fr); }
  .card-slot .thumb { width: 72px; }
  .card-slot > :last-child { grid-column: 1 / -1; justify-self: end; }
  .daypart-row { grid-template-columns: 1fr 1fr auto; }
  .daypart-row .days { grid-column: 1 / -1; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
  .segmented { width: 100%; }
  .segmented label { flex: 1; }
  .segmented span { width: 100%; justify-content: center; padding: 0 8px; }
  .modal { padding: 0; align-items: end; }
  .modal-box { border-radius: 20px 20px 0 0; max-height: 92vh; }
  .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .otp input { height: 50px; font-size: 20px; }
  .foot { justify-content: center; text-align: center; }
  .place-items { grid-template-columns: 1fr; }
  .check-cards { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .stats, .quick { grid-template-columns: 1fr; }
  .ctx-switch { width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.b-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.b-fieldset[disabled] .input, .b-fieldset[disabled] .mselect-btn, .b-fieldset[disabled] .rc-body, .b-fieldset[disabled] .check-card, .b-fieldset[disabled] .chips-box { opacity: .75; cursor: not-allowed; }
.inline-fields { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-fields .field { flex: 1 1 160px; }
.lock-note { display: flex; align-items: center; gap: 10px; }
.json-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.json-tabs button { border: 1px solid var(--line); background: var(--surface); padding: 6px 11px; border-radius: 8px; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.json-tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.endpoint { font-family: var(--mono); font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.score { display: flex; align-items: center; gap: 14px; }
.score strong { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.issue { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--muted-2); font-size: 13px; }
.issue.tinggi { border-left-color: var(--bad); } .issue.sedang { border-left-color: var(--warn); } .issue.rendah { border-left-color: var(--info); }
.issue small { display: block; color: var(--muted); margin-top: 3px; }
.aud-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); }
.aud-row + .aud-row { margin-top: 8px; }
.aud-row strong { display: block; font-size: 13.3px; }
.aud-row small { color: var(--muted); font-size: 11.5px; }
.aud-row .segmented span { height: 28px; padding: 0 10px; font-size: 12px; }
@media (max-width: 680px) { .aud-row { grid-template-columns: 1fr; } .inline-fields .field { flex-basis: 100%; } }

/* review blocks: label di atas nilai agar tidak terpotong pada kolom sempit */
.review-block dl { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 10px 0 0; }
.review-block dt { color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 8px; }
.review-block dt:first-child { margin-top: 0; }
.review-block dd { margin: 0; font-weight: 600; font-size: 13.5px; text-align: left; word-break: break-word; }
