/* IDEAX CRM Standalone — admin UI */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --ink: #1c1b19;
  --ink-2: #45423c;
  --muted: #8c877d;
  --line: #e7e4dd;
  --line-2: #d9d5cc;
  --gold: #cabe8e;
  --gold-ink: #8a6d2f;
  --gold-soft: #f4efe0;
  --side: #161513;
  --side-ink: #d8d4ca;
  --side-muted: #8a857b;
  --ok: #15803d;   --ok-soft: #e8f5ec;
  --warn: #b45309; --warn-soft: #fdf3e2;
  --bad: #b91c1c;  --bad-soft: #fcebea;
  --info: #1d4ed8; --info-soft: #e8eefc;
  --r: 10px;
  --r-sm: 6px;
  --shadow: 0 1px 2px rgba(28,27,25,.05), 0 2px 8px rgba(28,27,25,.04);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.55 var(--font); }
a { color: var(--gold-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 10px; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
small, .muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ── Shell ─────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; color: #fff; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #e3d7aa, #a8935a); display: grid; place-items: center; color: #161513; font-weight: 800; font-size: 14px; }
.brand-text { font-weight: 700; letter-spacing: .02em; font-size: 14px; }
.brand-text small { display: block; color: var(--side-muted); font-weight: 500; font-size: 11px; letter-spacing: 0; }
.nav-group { margin: 10px 0 4px; padding: 0 10px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; color: var(--side-ink); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; color: #fff; }
.nav a.on { background: rgba(202,190,142,.14); color: #f1e9cc; }
.nav a.on svg { color: var(--gold); }
.nav-count { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; background: var(--gold); color: #161513; border-radius: 99px; padding: 1px 7px; }
.nav svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--side-muted); }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: var(--side-muted); }
.side-foot a { color: var(--side-ink); }
.side-foot form { display: inline; }
.side-foot button { background: none; border: 0; color: var(--side-ink); cursor: pointer; padding: 0; font: inherit; }
.side-foot button:hover { text-decoration: underline; }

.main { min-width: 0; }
.topbar { display: none; }
.page { padding: 26px 32px 60px; max-width: 1240px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 4px 0 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.crumb a { color: var(--muted); }

/* ── Cards ─────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .split > .card + .card, .grid > * + *, .split > * + * { margin-top: 0; }
.grid > *, .split > * { min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.stack > * + * { margin-top: 16px; }

.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat .sub .up { color: var(--ok); }
.stat .sub .down { color: var(--bad); }

/* ── Buttons ───────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: 600 13px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: #c9c4b8; }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #33312d; border-color: #33312d; }
.btn-gold { background: var(--gold); border-color: #b9ab76; color: #1c1b19; }
.btn-gold:hover { background: #d6cb9f; }
.btn-danger { color: var(--bad); border-color: #efc9c6; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: rgba(28,27,25,.05); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-xs { height: 26px; padding: 0 8px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; }

/* ── Forms ─────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { display: block; font-weight: 600; font-size: 12.5px; margin-bottom: 6px; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.input, .select, .textarea { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--ink); font: 14px var(--font); transition: border-color .15s, box-shadow .15s; }
.textarea { height: auto; min-height: 96px; padding: 9px 11px; line-height: 1.55; resize: vertical; }
.textarea.code { font-family: var(--mono); font-size: 12.5px; min-height: 280px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold-ink); box-shadow: 0 0 0 3px rgba(202,190,142,.35); }
.input-sm { height: 32px; font-size: 13px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-weight: 500; }
.check input { margin-top: 3px; accent-color: var(--ink); }
.checks { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12.5px; cursor: pointer; background: #fff; user-select: none; }
.chip-check span i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.chip-check input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-check input:focus-visible + span { box-shadow: 0 0 0 3px rgba(202,190,142,.5); }
input[type="color"] { width: 44px; height: 38px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; cursor: pointer; }
.form-foot { display: flex; gap: 8px; justify-content: flex-end; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r) var(--r); flex-wrap: wrap; }

/* ── Tables ────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #fcfbf8; }
.t .r { text-align: right; }
.t th a { color: inherit; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--muted); }
.t input[type="checkbox"] { accent-color: var(--ink); width: 15px; height: 15px; }

/* ── Badges ────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #efede8; color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.plain::before { display: none; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-bad { background: var(--bad-soft); color: var(--bad); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-gold { background: var(--gold-soft); color: var(--gold-ink); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 5px; font-size: 11.5px; font-weight: 600; background: #f1efea; color: var(--ink-2); margin: 1px 2px 1px 0; max-width: 100%; line-height: 1.4; vertical-align: middle; }
.tag i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.score { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 8px; border-radius: 999px; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.score small { font-weight: 500; font-size: 10.5px; color: inherit; opacity: .8; }
.score--cold { background: #f1f1ef; color: #6b675f; }
.score--warm { background: #e8eefc; color: #1d4ed8; }
.score--hot { background: #fdf0e3; color: #c2410c; }
.score--vip { background: #1c1b19; color: #e9dcae; }

/* ── Alerts ────────────────────────────────────────── */
.alert { padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 14px; border: 1px solid transparent; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: var(--ok-soft); border-color: #c6e6cf; color: #14532d; }
.alert-error { background: var(--bad-soft); border-color: #f2c9c5; color: #7f1d1d; }
.alert-info { background: var(--info-soft); border-color: #c9d6f7; color: #1e3a8a; }
.alert-warn { background: var(--warn-soft); border-color: #f3dcb4; color: #78350f; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ── Misc ──────────────────────────────────────────── */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 6px; font-size: 15px; }
.empty .btn { margin-top: 14px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.filters .input, .filters .select { height: 34px; font-size: 13px; width: auto; }
.filters .input[type="search"] { min-width: 220px; flex: 1; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.pager .btn-row { gap: 4px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.bar { height: 8px; border-radius: 99px; background: #efede8; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--gold-ink); border-radius: 99px; }
.copy-box { position: relative; }
.copy-box textarea { font-family: var(--mono); font-size: 12px; min-height: 84px; background: var(--surface-2); }
.copy-box .btn { position: absolute; top: 8px; right: 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--gold-ink); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }
.seg a { padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); border-right: 1px solid var(--line-2); }
.seg a:last-child { border-right: 0; }
.seg a.on { background: var(--ink); color: #fff; }
.seg a:hover { text-decoration: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--muted); font-size: 12px; white-space: nowrap; margin-left: auto; }
.pts-pos { color: var(--ok); font-weight: 700; }
.pts-neg { color: var(--bad); font-weight: 700; }
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: grid; grid-template-columns: 36px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: 0; }
.step-num { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); display: grid; place-items: center; font-weight: 700; }
.step-delay svg { width: 13px; height: 13px; flex: 0 0 13px; }
.step-delay { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok { background: var(--ok); } .dot-bad { background: var(--bad); } .dot-warn { background: var(--warn); }

/* Editor */
.editor { border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; }
.editor:focus-within { border-color: var(--gold-ink); box-shadow: 0 0 0 3px rgba(202,190,142,.35); }
.editor-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm) var(--r-sm) 0 0; }
.editor-bar button { height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid transparent; border-radius: 5px; background: transparent; font: 600 12.5px var(--font); color: var(--ink-2); cursor: pointer; }
.editor-bar button:hover { background: #fff; border-color: var(--line-2); }
.editor-bar .sep { width: 1px; background: var(--line-2); margin: 4px 4px; }
.editor-bar select { height: 28px; border: 1px solid var(--line-2); border-radius: 5px; background: #fff; font: 12.5px var(--font); padding: 0 6px; }
.editor textarea { border: 0; border-radius: 0 0 var(--r-sm) var(--r-sm); width: 100%; min-height: 360px; padding: 12px; font: 13px/1.6 var(--mono); resize: vertical; outline: none; display: block; }
.preview-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #f4f4f2; display: block; }
.merge-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.merge-tags button { font: 11.5px var(--mono); padding: 3px 7px; border: 1px dashed var(--line-2); border-radius: 4px; background: var(--surface-2); color: var(--ink-2); cursor: pointer; }
.merge-tags button:hover { border-style: solid; background: #fff; }

/* Chart */
.chart { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.chart .col { flex: 1; background: #ebe6d6; border-radius: 3px 3px 0 0; position: relative; min-height: 2px; }
.chart .col.has { background: var(--gold-ink); }
.chart .col:hover { background: var(--ink); }
.chart .col:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 4px; white-space: nowrap; z-index: 2; }
.chart-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.dist { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: #efede8; }
.dist span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12.5px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Dialog */
dialog { border: 0; border-radius: var(--r); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--ink); }
dialog::backdrop { background: rgba(22,21,19,.45); }
dialog .card-head { border-bottom: 1px solid var(--line); }
dialog .card-body { max-height: 70vh; overflow-y: auto; }

/* Bulk bar */
.bulk { display: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: var(--gold-soft); border-bottom: 1px solid #e8dfc4; font-size: 13px; }
.bulk.on { display: flex; }
.bulk .select, .bulk .input { height: 32px; font-size: 12.5px; width: auto; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(circle at 20% 0%, #fbf7ea 0, transparent 45%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card.wide { max-width: 720px; }
.auth .brand { color: var(--ink); justify-content: center; padding-bottom: 22px; }
.auth .brand-text small { color: var(--muted); }
.req-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.req-list li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }


/* ── Form builder & leads (v2.1) ───────────────────── */
.tpl-list { display: grid; gap: 8px; }
.tpl { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 8px; cursor: pointer; }
.tpl:has(input:checked) { border-color: var(--gold-ink); background: var(--gold-soft); }
.tpl input { margin-top: 3px; accent-color: var(--ink); }
.tpl strong { display: block; }
.tpl small { color: var(--muted); }
.radios { display: grid; gap: 6px; }
.embed-card > summary { list-style: none; cursor: pointer; }
.embed-card > summary::-webkit-details-marker { display: none; }
.embed-card:not([open]) > summary { border-bottom: 0; }
.builder-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.builder-side { position: sticky; top: 16px; }
.pv-surface { background: #fff; max-height: calc(100vh - 220px); overflow-y: auto; }
.fb-list { display: flex; flex-direction: column; }
.fb-item { border-bottom: 1px solid var(--line); }
.fb-item.open { background: var(--surface-2); }
.fb-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; }
.fb-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; border-radius: 6px; }
.fb-toggle:hover { background: rgba(28,27,25,.04); }
.fb-type { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #efede8; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.fb-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.fb-req { font-size: 11px; color: var(--warn); font-weight: 600; }
.fb-pill { font-size: 11px; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 0 7px; white-space: nowrap; }
.fb-map { color: var(--gold-ink); border-color: #e2d6b0; background: var(--gold-soft); }
.fb-tools { display: flex; gap: 2px; flex-shrink: 0; }
.fb-tools .btn { min-width: 28px; }
.fb-del:hover { color: var(--bad); }
.fb-body { padding: 4px 16px 16px 16px; }
.fb-body .field { margin-bottom: 10px; }
.lead-row td { cursor: pointer; }
.lead-row.is-new .cell-main::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-ink); margin-right: 7px; vertical-align: 1px; }
.lead-msg { color: var(--ink-2); max-width: 520px; }
.lead-fields { display: grid; grid-template-columns: 200px 1fr; gap: 0; }
.lead-fields dt, .lead-fields dd { padding: 11px 0; border-bottom: 1px solid var(--line); margin: 0; }
.lead-fields dt { color: var(--muted); font-size: 13px; padding-right: 14px; }
.lead-fields dd { white-space: pre-line; word-break: break-word; }
.lead-fields dd ul { margin: 0; padding-left: 18px; white-space: normal; }
@media (max-width: 1100px) { .builder-split { grid-template-columns: minmax(0, 1fr); } .builder-side { position: static; } .pv-surface { max-height: none; } }
@media (max-width: 860px) { .lead-fields { grid-template-columns: 1fr; } .lead-fields dt { border-bottom: 0; padding-bottom: 0; } }

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1100px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--side); color: #fff; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; padding: 4px; cursor: pointer; }
  .topbar svg { width: 22px; height: 22px; }
  .page { padding: 18px 16px 48px; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .row2, .row3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .filters .input[type="search"] { min-width: 0; width: 100%; }
  .step { grid-template-columns: 32px 1fr; }
  .step > :last-child { grid-column: 1 / -1; }
  .preview-frame { height: 440px; }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 22px; }
  .page-head .actions { width: 100%; }
}

/* v2.1 — pratinjau & template email */
.ep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ep-card { min-width: 0; }
.ep-meta { padding: 12px 20px; border-bottom: 1px solid var(--line, #eceae4); font-size: 13px; display: grid; gap: 4px; }
.ep-meta span { display: inline-block; width: 70px; color: var(--muted, #8c877d); }
.ep-frame { display: block; width: 100%; height: 1150px; border: 0; background: #f3f3f1; border-radius: 0 0 10px 10px; }
.tpl-hero { background: #faf9f6; border: 1px solid var(--line, #eceae4); border-radius: 8px; padding: 12px 14px 4px; margin-bottom: 14px; }
.tag-doc { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12.5px; }
.tag-doc code { white-space: nowrap; }
@media (max-width: 1100px) { .ep-grid { grid-template-columns: minmax(0, 1fr); } }
.ep-grid > .card + .card { margin-top: 0; }
