/* Centang Hijau — palet dari logo: biru #0061b2, hijau #0ed451, merah #ff3131 */
:root {
  --bg: #f4f7fc; --surface: #fff; --surface-2: #f3f6fb; --surface-3: #eaf0f8; --border: #e3e9f2; --border-strong: #d3dce9;
  --text: #0f1f36; --muted: #66758c; --faint: #9aa7ba;
  --primary: #0061b2; --primary-600: #004f91; --primary-50: #ebf3fc; --primary-100: #d3e5f7;
  --green: #0ed451; --green-600: #0aa63f; --green-50: #e6fbee; --red: #ff3131;
  --danger: #dc2626; --warn-50: #fff6e8;
  --grad: linear-gradient(125deg, #002f63 0%, #0061b2 48%, #0a90d2 78%, #10c85a 125%);
  --grad-soft: linear-gradient(135deg, #ebf3fc 0%, #e8fbef 100%);
  --side: #0a1a33; --side-2: #10264a; --side-text: rgba(229,238,252,.72); --side-line: rgba(255,255,255,.07);
  --bubble-out: linear-gradient(135deg, #0061b2, #0a7fd0); --bubble-out-text: #fff; --bubble-in: #fff; --bubble-bot: #eef3fa; --bubble-bot-text: #0f1f36;
  --radius: 16px; --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(16,36,72,.04), 0 4px 14px rgba(16,36,72,.05);
  --shadow-md: 0 2px 4px rgba(16,36,72,.05), 0 10px 26px rgba(16,36,72,.08);
  --shadow-lg: 0 18px 50px rgba(10,26,51,.18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070e1b; --surface: #0e182a; --surface-2: #131f35; --surface-3: #182740; --border: #1e2c45; --border-strong: #2a3b59;
    --text: #e8eef8; --muted: #93a3bb; --faint: #64748b;
    --primary: #3d97ec; --primary-600: #2b84da; --primary-50: #11284a; --primary-100: #1a3762;
    --green-50: #0d2a1b; --warn-50: #2e2210;
    --side: #050b16; --side-2: #0c1830;
    --bubble-out: linear-gradient(135deg, #0b5fae, #1477c6); --bubble-in: #131f35; --bubble-bot: #182740; --bubble-bot-text: #e8eef8;
    --grad-soft: linear-gradient(135deg, #10233f 0%, #0d2a1b 100%);
    --shadow: 0 1px 2px rgba(0,0,0,.35); --shadow-md: 0 6px 20px rgba(0,0,0,.35); --shadow-lg: 0 18px 50px rgba(0,0,0,.55);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
::selection { background: var(--primary-100); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---------- shell: sidebar navy ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--side-2) 0%, var(--side) 60%); color: var(--side-text); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sidebar::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; left: -120px; bottom: -110px; background: radial-gradient(circle, rgba(14,212,81,.16), transparent 70%); pointer-events: none; }
.brand { padding: 20px 16px 10px; }
.brand-full { display: block; background: #fff; border-radius: 14px; padding: 8px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.brand-full img { display: block; width: 100%; height: auto; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: rgba(229,238,252,.4); padding: 16px 22px 6px; }
.nav { list-style: none; margin: 0; padding: 2px 12px; flex: 1; overflow: auto; position: relative; z-index: 1; }
.nav li { margin: 2px 0; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: var(--side-text); text-decoration: none; font-weight: 500; transition: background .15s, color .15s; }
.nav a svg { opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: linear-gradient(90deg, rgba(61,151,236,.28), rgba(61,151,236,.08)); color: #fff; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(120,180,255,.14); }
.nav a.active svg { opacity: 1; color: #7cc0ff; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--green); box-shadow: 0 0 12px rgba(14,212,81,.6); }
.nav .sep { height: 1px; background: var(--side-line); margin: 10px 8px; }
.nav svg, .icon { width: 18px; height: 18px; flex: none; }
.side-foot { margin: 12px; padding: 10px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--side-line); display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.side-foot .me { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, #0a90d2, #0ed451); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; text-decoration: none; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }
.side-foot .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: #fff; }
.side-foot small { display: block; color: var(--side-text); font-weight: 500; text-transform: capitalize; font-size: 12px; }
.side-foot .btn.ghost { color: var(--side-text); }
.side-foot .btn.ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
main { overflow: auto; min-width: 0; }

/* ---------- common ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; background: linear-gradient(135deg, #0061b2, #0a7fd0); color: #fff;
  padding: 9px 17px; border-radius: 11px; cursor: pointer; font-weight: 700; white-space: nowrap; text-decoration: none; transition: filter .15s, box-shadow .15s, transform .05s;
  box-shadow: 0 1px 2px rgba(0,60,120,.2), inset 0 1px 0 rgba(255,255,255,.15); }
.btn:hover { filter: brightness(1.06); box-shadow: 0 6px 16px rgba(0,97,178,.28); }
.btn:active { transform: translateY(1px); }
.btn.outline { background: var(--surface); color: var(--primary); border-color: var(--border-strong); box-shadow: none; }
.btn.outline:hover { background: var(--primary-50); border-color: var(--primary-100); filter: none; }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); filter: none; box-shadow: none; }
.btn.green { background: linear-gradient(135deg, #0aa63f, #0ec653); }
.btn.green:hover { box-shadow: 0 6px 16px rgba(10,166,63,.28); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { box-shadow: 0 6px 16px rgba(220,38,38,.25); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }
.icon-btn { width: 36px; height: 36px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: .15s; flex: none; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary-100); background: var(--primary-50); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 15px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.input, select.input, textarea.input { width: 100%; border: 1px solid var(--border-strong); background-color: var(--surface); border-radius: 11px; padding: 10px 13px; transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--faint); }
.input:hover { border-color: #b9c6d8; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2366758c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 32px; }
.input.sm, select.input.sm { padding: 6px 30px 6px 11px; font-size: 13px; border-radius: 9px; width: auto; }
textarea.input { resize: vertical; min-height: 90px; }
.hint { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.page { padding: 30px 32px; max-width: 1400px; }
.page h1 { font-size: 24px; margin: 0 0 4px; font-weight: 800; letter-spacing: -.02em; }
.page .sub { color: var(--muted); margin: 0 0 22px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--surface-3); color: var(--muted); text-transform: capitalize; }
.badge.ok, .badge.accepted, .badge.resolved, .badge.read, .badge.delivered, .badge.connected, .badge.success, .badge.done { background: #dcfce7; color: #15803d; }
.badge.warn, .badge.published, .badge.answered, .badge.sent, .badge.running, .badge.scheduled, .badge.pending, .badge.sandbox { background: #fef3c7; color: #92400e; }
.badge.bad, .badge.rejected, .badge.failed, .badge.error, .badge.cancelled { background: #fee2e2; color: #b91c1c; }
.badge.open, .badge.queue, .badge.draft { background: #e0efff; color: #00498a; }
@media (prefers-color-scheme: dark) {
  .badge.ok, .badge.accepted, .badge.resolved, .badge.read, .badge.delivered, .badge.connected, .badge.success, .badge.done { background: rgba(14,212,81,.14); color: #5ee38f; }
  .badge.warn, .badge.published, .badge.answered, .badge.sent, .badge.running, .badge.scheduled, .badge.pending, .badge.sandbox { background: rgba(245,158,11,.15); color: #fbbf5a; }
  .badge.bad, .badge.rejected, .badge.failed, .badge.error, .badge.cancelled { background: rgba(239,68,68,.15); color: #fca5a5; }
  .badge.open, .badge.queue, .badge.draft { background: rgba(61,151,236,.16); color: #8cc4ff; }
  .input:hover { border-color: #3a4d6e; }
}
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.switch input { display: none; }
.switch .track { width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; transition: .18s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--green-600); }
.switch input:checked + .track::after { left: 18px; }
.switch input:checked ~ span:last-child { color: var(--text); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 34px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 220px at 85% -10%, rgba(255,255,255,.18), transparent 70%), radial-gradient(400px 200px at 10% 120%, rgba(14,212,81,.25), transparent 70%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 40%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 40%, #000); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 0; opacity: .88; max-width: 560px; }
.hero .kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); padding: 4px 11px; border-radius: 99px; margin-bottom: 12px; backdrop-filter: blur(6px); }
.hero .kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(14,212,81,.3); }
.hero .art { width: 104px; height: 104px; flex: none; filter: drop-shadow(0 12px 24px rgba(0,0,0,.3)); animation: float 6s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px) rotate(-3deg); } }
.hero .tabs { margin-top: 18px; display: flex; gap: 8px; }
.hero .tabs a { color: #fff; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); padding: 7px 14px; border-radius: 11px; text-decoration: none; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.hero .tabs a.active { background: #fff; border-color: #fff; color: var(--primary-600); }

/* ---------- stats ---------- */
.summary { display: grid; grid-template-columns: 200px repeat(4, 1fr); gap: 16px; align-items: stretch; margin-bottom: 22px; }
.summary.three { grid-template-columns: 200px repeat(3, 1fr); }
.summary h2 { font-size: 20px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.summary .date { color: var(--muted); }
.summary > div:first-child { align-self: center; }
.stat { position: relative; overflow: hidden; min-height: 112px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 2px; transition: transform .15s, box-shadow .15s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; background: var(--primary-50); color: var(--primary); }
.stat .ic.g { background: var(--green-50); color: var(--green-600); }
.stat .ic.o { background: #fff1e0; color: #c26a00; }
.stat .ic.r { background: #ffe8e8; color: #d92020; }
.stat .num { font-size: 28px; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; }
.stat .lbl { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat a { position: absolute; top: 16px; right: 16px; font-size: 12px; font-weight: 700; text-decoration: none; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); }
.stat a:hover { background: var(--primary-50); }
@media (prefers-color-scheme: dark) {
  .stat .ic.o { background: rgba(255,153,0,.14); color: #ffb347; }
  .stat .ic.r { background: rgba(255,49,49,.14); color: #ff7a7a; }
  .stat .ic.g { color: var(--green); }
}
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 30px; }
.qa { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: .15s; }
.qa:hover { border-color: var(--primary-100); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.qa-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--grad); color: #fff; flex: none; box-shadow: 0 6px 14px rgba(0,97,178,.25); }
.qa b { display: block; font-size: 14px; }
.qa small { display: block; color: var(--muted); font-size: 12px; }
.section-title { font-size: 18px; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.section-sub { color: var(--muted); margin: 2px 0 14px; }

/* chart */
.chart { width: 100%; height: 300px; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: var(--border); stroke-dasharray: 3 5; }
.legend { display: flex; gap: 18px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 700; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---------- split layout ---------- */
.split { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }
.panel { background: var(--surface); border-right: 1px solid var(--border); padding: 24px 20px; }
.panel h2 { font-size: 20px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.01em; }
.panel h2 svg { color: #fff; background: var(--grad); padding: 7px; width: 32px; height: 32px; border-radius: 10px; }
.panel h3 { font-size: 11px; margin: 24px 0 8px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.panel h3 a { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--primary); }
.panel p { color: var(--muted); margin: 0 0 8px; font-size: 13px; }
.panel .opt { display: flex; flex-direction: column; gap: 10px; }
.content { padding: 24px 30px; min-width: 0; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.search { position: relative; }
.search input { padding-left: 38px; width: 270px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.count { color: var(--muted); font-size: 13px; font-weight: 700; }

/* ---------- table ---------- */
.table-wrap { overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th { text-align: left; font-weight: 800; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); position: sticky; top: 0; }
table.t td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tbody tr { transition: background .1s; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tr:last-child td { border-bottom: 0; }
table.t .clip { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 36px; text-align: center; color: var(--muted); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state svg { width: 52px; height: 52px; padding: 13px; border-radius: 16px; background: var(--grad-soft); color: var(--primary); margin-bottom: 10px; }
.empty-state b { color: var(--text); font-size: 15px; }
.empty-state span { font-size: 13px; max-width: 240px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 0; color: var(--muted); font-size: 13px; }

/* ---------- drawer & modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(6,16,34,.5); backdrop-filter: blur(4px); z-index: 50; display: flex; justify-content: flex-end; animation: fade .15s ease; }
.overlay.center { justify-content: center; align-items: center; }
.drawer { width: min(480px, 100%); background: var(--surface); height: 100%; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .2s ease; }
.modal { width: min(580px, calc(100% - 32px)); max-height: calc(100% - 48px); background: var(--surface); border-radius: 20px; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease; border: 1px solid var(--border); }
.dhead { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.dbody { padding: 22px; overflow: auto; flex: 1; }
.dfoot { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 20px 20px; }
.drawer .dfoot { border-radius: 0; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 99; background: #0f1f36; color: #fff; padding: 13px 18px 13px 16px; border-radius: 14px; box-shadow: var(--shadow-lg); max-width: 420px; border-left: 4px solid var(--green); font-weight: 600; animation: pop .18s ease; }
.toast.err { border-left-color: var(--red); }
@keyframes fade { from { opacity: 0 } }
@keyframes slide { from { transform: translateX(30px); opacity: 0 } }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0 } }

/* ---------- chat ---------- */
.chat { display: grid; grid-template-columns: 360px 1fr; height: 100vh; }
.clist { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.clist .top { padding: 18px 16px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.clist-title { display: flex; align-items: center; justify-content: space-between; }
.clist-title h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.clist .top .search input { width: 100%; background-color: var(--surface-2); border-color: transparent; }
.clist .top .search input:focus { background-color: var(--surface); border-color: var(--primary); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg a { text-align: center; padding: 7px 6px; border-radius: 9px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; text-decoration: none; transition: .15s; white-space: nowrap; }
.seg a:hover { color: var(--text); }
.seg a.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(16,36,72,.12); }
@media (prefers-color-scheme: dark) { .seg a.active { background: var(--primary-100); color: #fff; } }
.filters { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.citems { overflow: auto; flex: 1; padding: 6px; }
.citem { position: relative; display: flex; gap: 12px; padding: 11px 12px; border-radius: 13px; cursor: pointer; transition: background .12s; margin-bottom: 2px; }
.citem:hover { background: var(--surface-2); }
.citem.active { background: var(--primary-50); box-shadow: inset 0 0 0 1px var(--primary-100); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; color: #13233a; position: relative; }
.avatar .ch { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--surface); }
.citem .mid { flex: 1; min-width: 0; }
.citem .name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem .prev { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.citem .right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.citem .right .badge { font-size: 10.5px !important; padding: 2px 8px; }
.unread { background: var(--green-600); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 800; padding: 1px 7px; min-width: 20px; text-align: center; box-shadow: 0 2px 6px rgba(10,166,63,.35); }
.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.thead { background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
.thead .name { font-weight: 800; font-size: 15px; }
.thead small { color: var(--muted); display: block; }
.thead select.input { width: auto; padding-top: 7px; padding-bottom: 7px; font-size: 13px; }
.msgs { flex: 1; overflow: auto; padding: 22px 32px; display: flex; flex-direction: column; gap: 8px;
  background-color: var(--bg); background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 24px 24px; }
.daysep { align-self: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface); padding: 4px 14px; border-radius: 99px; margin: 10px 0; box-shadow: var(--shadow); border: 1px solid var(--border); }
.bubble { max-width: min(560px, 75%); padding: 10px 14px 6px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow); line-height: 1.5; }
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 6px; border: 1px solid var(--border); }
.bubble.out { align-self: flex-end; background: var(--bubble-out); color: var(--bubble-out-text); border-bottom-right-radius: 6px; box-shadow: 0 4px 14px rgba(0,97,178,.2); }
.bubble.bot { background: var(--bubble-bot); color: var(--bubble-bot-text); border: 1px solid var(--border); box-shadow: var(--shadow); }
.bubble .meta { font-size: 10.5px; opacity: .7; text-align: right; margin-top: 3px; display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.bubble .who { font-size: 11px; font-weight: 800; opacity: .85; margin-bottom: 2px; letter-spacing: .01em; }
.bubble.bot .who { color: var(--green-600); opacity: 1; }
.bubble img { max-width: 260px; border-radius: 10px; display: block; margin-bottom: 4px; }
.bubble .err { color: #ffd2d2; font-size: 11px; }
.bubble.bot .err { color: var(--danger); }
.banner { align-self: center; max-width: 560px; background: var(--warn-50); color: #9a5b00; text-align: center; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; margin-top: 8px; border: 1px solid #ffdca8; }
@media (prefers-color-scheme: dark) { .banner { color: #fbbf5a; border-color: rgba(245,158,11,.3); } }
.composer { margin: 0 16px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 8px; display: flex; gap: 6px; align-items: flex-end; box-shadow: var(--shadow-md); }
.composer textarea, .composer input.input { flex: 1; min-height: 40px; max-height: 160px; resize: none; border: 0; box-shadow: none !important; background: transparent; padding: 9px 8px; }
.composer .btn:not(.ghost) { border-radius: 12px; padding: 10px 14px; }
.nochat { display: grid; place-items: center; color: var(--muted); height: 100%; text-align: center; padding: 24px;
  background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 24px 24px; }
.nochat-badge { width: 120px; height: 120px; margin: 0 auto 14px; border-radius: 32px; background: var(--surface); box-shadow: var(--shadow-md); display: grid; place-items: center; border: 1px solid var(--border); }
.nochat-badge img { width: 76px; animation: float 6s ease-in-out infinite; }
.nochat h3 { margin: 4px 0; color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.nochat p { margin: 0 0 16px; }
.nochat-tips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.nochat-tips span { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 99px; background: var(--surface); border: 1px solid var(--border); }

/* ---------- broadcast wizard ---------- */
.stepper { display: flex; justify-content: space-between; margin: 0 40px 30px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; flex: 1; position: relative; }
.step .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); font-size: 12px; font-weight: 800; z-index: 1; border: 2px solid var(--surface); }
.step.active, .step.done { color: var(--primary); }
.step.active .dot { background: var(--grad); color: #fff; box-shadow: 0 0 0 5px var(--primary-50); }
.step.done .dot { background: var(--green-600); color: #fff; }
.step:not(:last-child)::after { content: ""; position: absolute; top: 15px; left: 50%; width: 100%; height: 2px; background: var(--border); }
.wapreview { background: #e9e2d8; border-radius: 14px; padding: 18px; min-height: 160px; }
.wapreview .bubble { background: #fff; color: #111; max-width: 100%; border: 0; }
.wapreview .footer { color: #667; font-size: 12px; margin-top: 4px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.login-brand { position: relative; overflow: hidden; background: var(--grad); color: #fff; padding: 52px 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand::before { content: ""; position: absolute; inset: 0; background: radial-gradient(700px 400px at 100% 0%, rgba(255,255,255,.16), transparent 60%), radial-gradient(500px 300px at 0% 100%, rgba(14,212,81,.28), transparent 60%); }
.login-brand::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px); background-size: 20px 20px; mask-image: linear-gradient(180deg, transparent, #000 70%); -webkit-mask-image: linear-gradient(180deg, transparent, #000 70%); }
.login-brand > * { position: relative; z-index: 1; }
.login-brand .logo-card { background: #fff; border-radius: 18px; padding: 14px 18px; width: min(360px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.22); }
.login-brand .logo-card img { width: 100%; display: block; }
.login-brand h2 { font-size: 34px; line-height: 1.15; margin: 34px 0 12px; font-weight: 800; letter-spacing: -.03em; max-width: 480px; }
.login-brand p { opacity: .88; max-width: 460px; margin: 0; font-size: 15px; }
.login-brand ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 11px; }
.login-brand li { display: flex; gap: 10px; align-items: center; font-weight: 600; }
.login-brand li span { width: 24px; height: 24px; border-radius: 50%; background: rgba(14,212,81,.35); border: 1px solid rgba(255,255,255,.35); display: grid; place-items: center; flex: none; }
.preview { margin-top: 32px; width: min(400px, 100%); background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.22); border-radius: 20px; padding: 14px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 20px 50px rgba(0,20,50,.25); display: flex; flex-direction: column; gap: 8px; }
.pv-head { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid rgba(255,255,255,.15); }
.pv-head b { display: block; font-size: 14px; }
.pv-head small { display: block; font-size: 11.5px; opacity: .75; }
.pv-av { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--primary-600); display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.pv-b { max-width: 82%; padding: 8px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; }
.pv-b.in { background: rgba(255,255,255,.92); color: #0f1f36; align-self: flex-start; border-bottom-left-radius: 4px; }
.pv-b.out { background: #0ed451; color: #04230f; align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 500; }
.pv-b i { display: block; text-align: right; font-style: normal; font-size: 10.5px; opacity: .65; margin-top: 2px; }
.login-brand .foot { font-size: 12px; opacity: .7; margin-top: 28px; }
.login-form { display: grid; place-items: center; padding: 32px 24px; background: var(--surface); }
.login-form form { width: min(380px, 100%); }
.login-form h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.login-form .input { padding: 12px 14px; }
.login-form .mobile-logo { display: none; width: 220px; margin-bottom: 24px; }

.kv { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--muted); }
code.copy { background: var(--surface-2); padding: 9px 11px; border-radius: 10px; display: block; word-break: break-all; font-size: 12px; border: 1px solid var(--border); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; color: #fff; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-head b { font-size: 15px; display: flex; align-items: center; gap: 8px; }

@media (max-width: 1180px) {
  .quick { grid-template-columns: repeat(2, 1fr); }
  .summary { grid-template-columns: repeat(4, 1fr); }
  .summary.three { grid-template-columns: repeat(3, 1fr); }
  .summary > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: .22s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex !important; }
  main { padding-top: 56px; }
  .split, .chat { grid-template-columns: 1fr; }
  .panel { border-right: 0; border-bottom: 1px solid var(--border); }
  .summary, .summary.three, .grid2 { grid-template-columns: 1fr 1fr; }
  .chat { height: auto; min-height: calc(100vh - 56px); }
  .chat .clist { max-height: 55vh; }
  .page, .content { padding: 18px 16px; }
  .hero { padding: 24px 18px; }
  .hero h1 { font-size: 23px; }
  .hero .art { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-form .mobile-logo { display: block; }
  .msgs { padding: 16px; }
  .thread:has(.nochat) { display: none; }
  .chat .clist { max-height: none; }
}
@media (max-width: 520px) { .quick { grid-template-columns: 1fr; } }
.menu-btn { display: none; position: fixed; top: 10px; left: 10px; z-index: 30; background: var(--surface); }
