:root {
  --brand: #2563eb;
  --brand-600: #1d4ed8;
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e3e9f3;
  --bg: #f5f8fe;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --card: #ffffff;
  --danger: #dc2626;
  --amber: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .05);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); font-size: .88em; }
code { background: #f1f5f9; padding: .1em .4em; border-radius: 5px; }
pre {
  background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; line-height: 1.5; margin: 0 0 1em;
}
pre code { background: none; padding: 0; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt { margin-top: 16px; } .mb { margin-bottom: 16px; }

/* ---------- Tombol & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  background: var(--brand); color: #fff; text-decoration: none !important;
  transition: background .15s, box-shadow .15s;
}
.btn:hover { background: var(--brand-600); }
.btn:focus-visible { outline: 3px solid var(--brand-100); outline-offset: 1px; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #f8fafc; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-ghost { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn-danger-ghost:hover { background: #fef2f2; }
.btn-sm { padding: 6px 11px; font-size: .84rem; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--ink-2); }
.field { margin-bottom: 14px; }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font: inherit; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; }
.check input { margin-top: 4px; accent-color: var(--brand); }
.row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- Komponen ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > .card { margin-bottom: 0; }

.stat { padding: 18px 20px; }
.stat .label { color: var(--muted); font-size: .84rem; font-weight: 600; }
.stat .value { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px;
  font-size: .76rem; font-weight: 700; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-violet { background: #ede9fe; color: #6d28d9; }
.badge-gray { background: #f1f5f9; color: #475569; }

.alert { padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; border: 1px solid; font-size: .92rem; }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.alert-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.alert-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

.copy { display: flex; gap: 8px; }
.copy input { font-family: var(--mono); font-size: .88rem; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 9px 14px; border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--brand-600); border-color: var(--brand); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filters > * { width: auto; min-width: 140px; flex: 1 1 140px; }
.filters .btn { flex: 0 0 auto; min-width: 0; }

/* ---------- Layout aplikasi ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: #0b1220; color: #cbd5e1; padding: 20px 14px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.08rem; padding: 4px 8px 20px; text-decoration: none !important; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, #10b981, #047857);
  display: grid; place-items: center; color: #fff; flex: 0 0 auto;
}
.logo small { display: block; font-weight: 500; font-size: .72rem; color: #64748b; letter-spacing: .02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #cbd5e1;
  font-weight: 600; font-size: .92rem; text-decoration: none; background: none; border: 0; font-family: inherit; cursor: pointer; width: 100%; text-align: left;
}
.nav a:hover, .nav button:hover { background: #111a2e; color: #fff; }
.nav a.active { background: #10b98120; color: #6ee7b7; }
.nav svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #475569; padding: 16px 12px 6px; font-weight: 700; }
.sidebar-foot { margin-top: auto; border-top: 1px solid #1e293b; padding-top: 14px; }
.me { padding: 6px 12px 10px; font-size: .84rem; }
.me strong { color: #fff; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me span { color: #64748b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.main { padding: 28px 32px 48px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.topbar { display: none; }

/* ---------- Device ---------- */
.device-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.device-card { display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, transform .15s; }
.device-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.device-card .phone { font-family: var(--mono); color: var(--ink-2); font-size: .9rem; }
.meter { height: 6px; background: #f1f5f9; border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

.connect-box { text-align: center; padding: 10px 0; }
.qr-frame { width: 280px; max-width: 100%; aspect-ratio: 1; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 14px; display: grid; place-items: center; background: #fff; padding: 8px; }
.qr-frame img { width: 100%; height: 100%; image-rendering: pixelated; }
.pair-code { font-family: var(--mono); font-size: 2rem; font-weight: 800; letter-spacing: .12em; background: var(--brand-50); color: var(--brand-600); padding: 16px 20px; border-radius: 12px; display: inline-block; margin-bottom: 14px; }
.steps { text-align: left; max-width: 420px; margin: 0 auto; padding-left: 20px; color: var(--ink-2); font-size: .9rem; }
.steps li { margin-bottom: 4px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--brand-100); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.connected-big { display: flex; align-items: center; gap: 14px; text-align: left; }
.connected-big .dot { width: 48px; height: 48px; border-radius: 50%; background: #dcfce7; color: #15803d; display: grid; place-items: center; flex: 0 0 auto; }

.danger-zone { border-color: #fecaca; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: radial-gradient(circle at 20% 10%, #10b98155, transparent 50%), linear-gradient(160deg, #052e22, #0b1220 70%);
  color: #d1fae5; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h2 { color: #fff; font-size: 1.9rem; max-width: 420px; }
.auth-side ul { list-style: none; padding: 0; margin: 24px 0 0; }
.auth-side li { padding-left: 28px; position: relative; margin-bottom: 12px; color: #a7f3d0; }
.auth-side li::before { content: '✓'; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #10b98133; color: #6ee7b7; display: grid; place-items: center; font-size: .75rem; font-weight: 800; }
.auth-main { display: grid; place-items: center; padding: 40px 20px; background: #fff; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 1.5rem; }
.auth-box .logo { color: var(--ink); padding: 0 0 26px; }

/* ---------- Landing ---------- */
.site-nav { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.site-nav .container { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 12px; }
.site-nav .logo { color: var(--ink); padding: 0; }
.site-nav .links { display: flex; gap: 22px; align-items: center; }
.site-nav .links a:not(.btn) { color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.hero { padding: 80px 0 64px; background: radial-gradient(ellipse at 70% 0%, #d1fae5, transparent 55%), #fff; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); padding: 5px 12px; border-radius: 99px; font-weight: 700; font-size: .8rem; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -.03em; line-height: 1.1; }
.hero h1 em { font-style: normal; color: var(--brand); }
.hero p.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 540px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero-code { box-shadow: 0 24px 60px rgba(4, 120, 87, .18); border-radius: 14px; overflow: hidden; }
.hero-code .bar { background: #1e293b; padding: 10px 14px; display: flex; gap: 6px; }
.hero-code .bar i { width: 10px; height: 10px; border-radius: 50%; background: #475569; display: block; }
.hero-code pre { border-radius: 0; margin: 0; font-size: .82rem; padding: 18px; }
.tok-k { color: #f472b6; } .tok-s { color: #86efac; } .tok-c { color: #64748b; }
.section { padding: 72px 0; }
.section-alt { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: 1.9rem; letter-spacing: -.02em; }
.section-head p { color: var(--muted); }
.feature { padding: 22px; }
.feature .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin-bottom: 14px; }
.feature .ic svg { width: 22px; height: 22px; }
.feature p { color: var(--muted); margin: 0; font-size: .93rem; }
.step-n { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 12px; }
.cta-band { background: linear-gradient(135deg, #047857, #065f46); color: #ecfdf5; border-radius: 18px; padding: 44px; text-align: center; }
.cta-band h2 { color: #fff; font-size: 1.8rem; }
.cta-band .btn { background: #fff; color: var(--brand-600); }
.footer { padding: 28px 0; color: var(--muted); font-size: .88rem; }
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.6em; }
.prose li { margin-bottom: .4em; }

/* ---------- Pindah mode & banner ---------- */
.nav a.mode-switch { border: 1px dashed #334155; margin-bottom: 10px; color: #e2e8f0; }
.nav a.mode-switch:hover { border-color: #64748b; }
.nav-soon { display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: #475569; font-weight: 600; font-size: .92rem; cursor: default; }
.nav-soon svg { width: 18px; height: 18px; }
.impersonate-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fef3c7; border: 1px solid #fcd34d; color: #78350f; padding: 10px 14px; border-radius: 10px; margin-bottom: 18px; font-size: .92rem;
}
.impersonate-bar span { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.impersonate-bar .btn { background: #b45309; }
.impersonate-bar .btn:hover { background: #92400e; }
.announce { display: flex; gap: 10px; align-items: flex-start; }
.announce svg { flex: 0 0 auto; margin-top: 3px; }

/* ---------- Area admin (tema ungu agar beda jelas dengan dashboard pengguna) ---------- */
.admin-area { --brand: #7c3aed; --brand-600: #6d28d9; --brand-50: #f5f3ff; --brand-100: #ede9fe; }
.admin-area .sidebar, .admin-area .topbar { background: #160f2e; }
.admin-area .nav a:hover, .admin-area .nav button:hover { background: #22184a; }
.admin-area .nav a.active { background: #8b5cf626; color: #c4b5fd; }
.admin-area .logo-mark { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.admin-area .sidebar-foot { border-color: #2a1f52; }
.admin-area .nav a.mode-switch { border-color: #3b2d6b; }

/* ---------- Grafik ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .bar-sent { fill: var(--brand); }
.chart .bar-failed { fill: #f87171; }
.chart .grid-line { stroke: #eef2f7; }
.chart text { fill: var(--muted); font-size: 10px; font-family: inherit; }
.chart .bar:hover { opacity: .8; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Detail ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 600; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.rate-bad { color: var(--danger); font-weight: 700; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.switch-row:last-child { border-bottom: 0; }
.switch-row p { margin: 2px 0 0; font-size: .84rem; color: var(--muted); }
.switch-row label { margin: 0; }
.toggle { position: relative; width: 44px; height: 24px; flex: 0 0 auto; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 99px; transition: background .15s; cursor: pointer; }
.toggle span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.toggle input:checked + span { background: var(--brand); }
.toggle input:checked + span::after { transform: translateX(20px); }
.toggle input:focus-visible + span { outline: 3px solid var(--brand-100); }

/* ---------- Paket & harga ---------- */
.plans { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; margin: 0; }
.plan h3 { font-size: 1.15rem; margin-bottom: 2px; }
.plan-desc { min-height: 2.6em; }
.plan-hl { border: 2px solid var(--brand); box-shadow: 0 12px 32px rgba(5, 150, 105, .14); }
.plan-tag { position: absolute; top: -12px; left: 20px; background: var(--brand); color: #fff; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.plan-price { margin: 6px 0 4px; }
.plan-price strong { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
.plan-price span { color: var(--muted); margin-left: 4px; }
.plan-features { list-style: none; padding: 0; margin: 14px 0 18px; font-size: .9rem; flex: 1; }
.plan-features li { padding: 5px 0 5px 24px; position: relative; }
.plan-features li::before { content: '✓'; position: absolute; left: 0; color: var(--brand); font-weight: 800; }
.plan-features li.no { color: #94a3b8; text-decoration: line-through; }
.plan-features li.no::before { content: '–'; color: #cbd5e1; }
.period-toggle { display: inline-flex; background: #eef2f6; border-radius: 99px; padding: 4px; margin-top: 8px; }
.period-toggle button { border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; padding: 7px 16px; border-radius: 99px; cursor: pointer; color: var(--ink-2); }
.period-toggle button.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.1); color: var(--ink); }
.period-toggle .save { font-size: .72rem; color: var(--brand-600); font-weight: 700; margin-left: 4px; }
.usage { margin: 6px 0 2px; }
.usage .meter { height: 8px; }
.meter > span.warn { background: #f59e0b; }
.meter > span.full { background: var(--danger); }
.invoice { max-width: 640px; }
.side-plan { display: flex; flex-direction: column; gap: 3px; margin: 18px 4px 0; padding: 12px; border-radius: 10px; background: #111a2e; color: #cbd5e1; font-size: .86rem; text-decoration: none !important; }
.side-plan strong { color: #fff; }
.side-plan .meter { background: #1e293b; margin-top: 4px; }
.side-plan:hover { background: #16213a; }
.invoice .total { font-size: 1.5rem; font-weight: 800; }

@media print {
  .sidebar, .topbar, .no-print, .impersonate-bar, .announce { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; }
}

/* ---------- Dashboard pengguna ---------- */
.plan-strip { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; padding: 14px 20px; }
.plan-strip > div { display: flex; flex-direction: column; gap: 1px; }
.plan-strip .ps-quota { flex: 1; min-width: 220px; }
.ps-label, .eyebrow-sm { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); }
.eyebrow-sm { color: var(--brand-600); display: block; margin-bottom: 2px; }
.eyebrow-sm.light { color: #6ee7b7; }
.dash-top { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); margin-bottom: 20px; }
.att-list { display: flex; flex-direction: column; gap: 8px; }
.att { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; background: #f8fafc; color: inherit; text-decoration: none !important; border: 1px solid transparent; }
.att:hover { border-color: var(--line); background: #fff; }
.att-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--brand); }
.att-warn .att-dot { background: #f59e0b; }
.att-danger .att-dot { background: var(--danger); }
.att-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.att-body span { font-size: .84rem; color: var(--muted); }
.att-cta { font-size: .84rem; font-weight: 700; color: var(--brand-600); white-space: nowrap; }
.today-card { background: linear-gradient(150deg, #052e22, #0b1220 75%); color: #d1fae5; border: 0; }
.today-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 10px 0 14px; }
.today-grid b { display: block; font-size: 2rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.today-grid span { display: block; font-weight: 700; font-size: .88rem; }
.today-grid small { color: #6ee7b7aa; font-size: .76rem; }
.today-foot { border-top: 1px solid #ffffff1f; padding-top: 10px; font-size: .86rem; color: #a7f3d0; }
.today-foot a { color: #fff; font-weight: 700; }
.steps-list { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; }
.step.done { background: #f0fdf4; border-color: #bbf7d0; }
.step-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #f1f5f9; color: var(--ink-2); flex: 0 0 auto; }
.step.done .step-num { background: var(--brand); color: #fff; }
.step-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.step-body span { font-size: .85rem; color: var(--muted); }
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: .9rem; }
.feed-item:last-child { border-bottom: 0; }
.feed-item a { color: var(--ink); }
.feed-ic { width: 22px; text-align: center; flex: 0 0 auto; }

/* ---------- Halaman alat ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: .82rem; font-weight: 600; color: var(--ink-2); cursor: pointer; text-decoration: none !important; }
.chip.active, .chip:has(input:checked) { background: var(--brand-50); border-color: var(--brand); color: var(--brand-600); }
.chip input { display: none; }
.chip small { color: var(--muted); font-weight: 500; }
.tag { display: inline-block; background: #f1f5f9; color: var(--ink-2); font-size: .74rem; padding: 1px 7px; border-radius: 5px; margin: 1px 2px 1px 0; }
.help-box { background: #f8fafc; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; font-size: .85rem; color: var(--ink-2); }
.help-box code { background: #fff; }
.preview-bubble { background: #d9fdd3; border-radius: 10px; padding: 9px 11px; font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(0,0,0,.08); min-height: 40px; }
.preview-wrap { background: #efeae2; border-radius: 12px; padding: 14px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.seg label { margin: 0; }
.result-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.result-cols textarea { min-height: 160px; font-family: var(--mono); font-size: .84rem; }
.progress-big { height: 12px; background: #f1f5f9; border-radius: 99px; overflow: hidden; display: flex; }
.progress-big span { height: 100%; }
.pb-sent { background: var(--brand); }
.pb-failed { background: #f87171; }
.pb-cancel { background: #cbd5e1; }

.insight { background: var(--brand-50); border-color: var(--brand-100); }
.insight ul { padding-left: 20px; }
.insight li { margin-bottom: 4px; }

/* ---------- Sidebar bergrup ---------- */
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.nav-scroll::-webkit-scrollbar { width: 4px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }
.nav-soon em { margin-left: auto; font-style: normal; font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; background: #1e293b; color: #94a3b8; padding: 1px 6px; border-radius: 99px; }
.nav-group summary { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 9px; color: #cbd5e1; font-weight: 600; font-size: .92rem; cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: ''; margin-left: auto; width: 7px; height: 7px; border-right: 2px solid #64748b; border-bottom: 2px solid #64748b; transform: rotate(-45deg); transition: transform .15s; }
.nav-group[open] summary::after { transform: rotate(45deg); }
.nav-group summary:hover { background: #111a2e; color: #fff; }
.nav-group summary svg { width: 18px; height: 18px; flex: 0 0 auto; }
.nav .nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 21px; padding-left: 12px; border-left: 1px solid #1e293b; }
.nav .nav-sub a { padding: 7px 10px; font-size: .87rem; font-weight: 500; color: #94a3b8; }
.nav .nav-sub a.active { color: #6ee7b7; background: #10b98114; }
.side-plan-cta { color: #6ee7b7; font-weight: 700; font-size: .8rem; margin-top: 4px; }
.me-row { display: flex; align-items: center; gap: 6px; }
.me-row .me { flex: 1; min-width: 0; padding-right: 0; }
.me-logout { width: auto !important; padding: 8px !important; border: 1px solid #1e293b !important; }
.sidebar { overflow: hidden; }

/* ---------- Inbox ---------- */
.nav-count { margin-left: auto; background: #10b981; color: #052e22; font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.nav-count[hidden] { display: none; }
.main-inbox { padding: 0; display: flex; flex-direction: column; height: 100vh; }
.main-inbox > .alert, .main-inbox > .impersonate-bar { margin: 12px 16px 0; }
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px 1fr; border-top: 1px solid transparent; }
.ib-list { display: flex; flex-direction: column; min-height: 0; background: #fff; border-right: 1px solid var(--line); }
.ib-list-head { padding: 18px 16px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.ib-list-head h1 { font-size: 1.3rem; margin: 0; }
.ib-list-head select { padding: 7px 10px; font-size: .88rem; }
.ib-search { position: relative; }
.ib-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.ib-search input { padding: 8px 12px 8px 34px; background: #f1f5f9; border-color: transparent; font-size: .9rem; }
.ib-filter { display: flex; gap: 6px; }
.ib-filter button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 12px; font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.ib-filter button.active { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-600); }
.ib-items { flex: 1; overflow-y: auto; }
.ib-item { display: flex; gap: 12px; width: 100%; padding: 11px 16px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; border-bottom: 1px solid #f1f5f9; color: inherit; }
.ib-item:hover { background: #f8fafc; }
.ib-item.active { background: var(--brand-50); }
.ib-avatar { width: 44px; height: 44px; border-radius: 50%; color: #fff; font-weight: 700; font-size: .95rem; display: grid; place-items: center; flex: 0 0 auto; }
.ib-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ib-item-top, .ib-item-bottom { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.ib-item-top strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-item-top time { font-size: .74rem; color: var(--muted); flex: 0 0 auto; }
.ib-item.unread .ib-item-top time { color: var(--brand-600); font-weight: 700; }
.ib-item.unread .ib-item-top strong { font-weight: 800; }
.ib-prev { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-badge { background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; min-width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; padding: 0 6px; flex: 0 0 auto; }
.ib-item-device { font-size: .72rem; color: #94a3b8; }
.ib-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: .9rem; }

.ib-chat { min-height: 0; display: flex; flex-direction: column; background: #efeae2; position: relative; }
.ib-placeholder { margin: auto; text-align: center; max-width: 360px; padding: 20px; }
.ib-ph-icon { width: 76px; height: 76px; border-radius: 50%; background: #fff; display: grid; place-items: center; margin: 0 auto 14px; color: var(--brand); }
.ib-thread { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ib-thread[hidden] { display: none; }
.ib-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.ib-head .ib-avatar { width: 40px; height: 40px; }
.ib-head-info { display: flex; flex-direction: column; min-width: 0; }
.ib-head-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-back { display: none; border: 0; background: none; padding: 4px; cursor: pointer; color: var(--ink); }
.ib-warn { background: #fffbeb; color: #92400e; padding: 8px 16px; font-size: .86rem; border-bottom: 1px solid #fde68a; }
.ib-messages { flex: 1; overflow-y: auto; padding: 14px 6% 18px; display: flex; flex-direction: column; gap: 3px; }
.ib-day { text-align: center; margin: 12px 0 8px; }
.ib-day span { background: #fff; color: var(--muted); font-size: .76rem; font-weight: 600; padding: 4px 12px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.ib-older { text-align: center; margin-bottom: 8px; }
.ib-older button { border: 0; background: #fff; border-radius: 99px; padding: 5px 14px; font: inherit; font-size: .82rem; cursor: pointer; }
.ib-msg { display: flex; }
.ib-msg.out { justify-content: flex-end; }
.ib-bubble { max-width: min(75%, 560px); background: #fff; border-radius: 10px; padding: 6px 9px 4px; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: .93rem; line-height: 1.45; overflow-wrap: anywhere; }
.ib-msg.out .ib-bubble { background: #d9fdd3; }
.ib-sender { font-size: .78rem; font-weight: 700; color: var(--brand-600); margin-bottom: 1px; }
.ib-text a { color: #027eb5; }
.ib-text code { background: rgba(0,0,0,.06); }
.ib-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: .7rem; color: #667781; margin-top: 2px; white-space: nowrap; }
.ib-src { background: rgba(0,0,0,.06); border-radius: 4px; padding: 0 5px; }
.ib-tick { font-size: .78rem; letter-spacing: -3px; padding-right: 3px; color: #667781; }
.ib-tick.read { color: #53bdeb; }
.ib-tick.fail { color: #fff; background: var(--danger); border-radius: 50%; width: 14px; height: 14px; display: inline-grid; place-items: center; letter-spacing: 0; padding: 0; font-weight: 800; font-size: .66rem; }
.ib-tick.sm { font-size: .72rem; }
.ib-err { font-size: .78rem; color: var(--danger); margin-top: 2px; }
.ib-img { display: block; margin: 0 -5px 4px; }
.ib-img img { display: block; max-width: 100%; max-height: 320px; border-radius: 7px; }
.ib-video { max-width: 100%; max-height: 320px; border-radius: 7px; margin-bottom: 4px; }
.ib-bubble audio { max-width: 260px; height: 40px; }
.ib-doc { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.05); border-radius: 7px; padding: 9px 10px; margin-bottom: 4px; color: inherit; font-size: .88rem; }
.ib-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-media-missing { font-size: .85rem; color: var(--muted); font-style: italic; margin-bottom: 2px; }
.ib-composer { background: #f0f2f5; padding: 10px 14px; border-top: 1px solid var(--line); }
.ib-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.ib-compose-row textarea { min-height: 42px; max-height: 160px; resize: none; border-radius: 10px; padding: 10px 12px; line-height: 1.4; }
.ib-attach { margin: 0; padding: 10px 6px; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.ib-attach:hover { color: var(--ink); }
.ib-send { width: 44px; height: 42px; padding: 0; border-radius: 50%; flex: 0 0 auto; }
.ib-file { display: flex; justify-content: space-between; align-items: center; background: #fff; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: .86rem; }
.ib-file[hidden] { display: none; }
.ib-file button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.ib-readonly { background: #fef3c7; color: #78350f; text-align: center; padding: 12px; font-size: .88rem; }

@media (max-width: 900px) {
  .main-inbox { height: calc(100vh - 58px); }
  .inbox { grid-template-columns: 1fr; }
  .ib-chat { display: none; }
  .inbox.show-thread .ib-list { display: none; }
  .inbox.show-thread .ib-chat { display: flex; }
  .ib-back { display: block; }
  .ib-messages { padding: 12px 10px; }
  .ib-bubble { max-width: 86%; }
}

/* ---------- Responsif ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 30; }
  .topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #0b1220; position: sticky; top: 0; z-index: 20; }
  .topbar .logo { padding: 0; font-size: 1rem; }
  .topbar button { background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
  .main { padding: 20px 16px 40px; }
  .grid-2, .grid-3, .dash-top, .two-col, .result-cols { grid-template-columns: 1fr; }
  .today-grid b { font-size: 1.6rem; }
  .hero .container { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .site-nav .links a.hide-sm { display: none; }
}
@media (max-width: 560px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .row, .row-3 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .stat .value { font-size: 1.4rem; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 52px 0; }
  .cta-band { padding: 30px 20px; }
  .pair-code { font-size: 1.5rem; }
}

/* =====================================================================
   TEMA BIRU TERANG — menimpa warna gelap/hijau versi sebelumnya
   ===================================================================== */
button, input, select, textarea, .btn, svg text, .chart text { font-family: var(--font); }

/* sidebar & topbar terang */
.sidebar { background: #fff; color: var(--ink-2); border-right: 1px solid var(--line); }
.logo { color: var(--ink); }
.logo small { color: var(--muted); }
.logo-mark { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.nav a, .nav button, .nav-group summary { color: var(--ink-2); }
.nav a:hover, .nav button:hover, .nav-group summary:hover { background: #f1f5fd; color: var(--ink); }
.nav a.active { background: var(--brand-50); color: var(--brand-600); box-shadow: inset 3px 0 0 var(--brand); }
.nav-label { color: #94a3b8; }
.nav-soon { color: #a3adbd; }
.nav-soon em { background: #eef2f8; color: #8794a8; }
.nav-group summary::after { border-color: #94a3b8; }
.nav .nav-sub { border-left-color: var(--line); }
.nav .nav-sub a { color: var(--muted); }
.nav .nav-sub a:hover { color: var(--ink); }
.nav .nav-sub a.active { color: var(--brand-600); background: var(--brand-50); box-shadow: none; font-weight: 600; }
.nav-scroll::-webkit-scrollbar-thumb { background: #dbe3ef; }
.nav-count { background: var(--danger); color: #fff; }
.sidebar-foot { border-top-color: var(--line); }
.me strong { color: var(--ink); }
.me span { color: var(--muted); }
.me-logout { border-color: var(--line) !important; }
.nav a.mode-switch { border: 1px dashed #c7d4ea; color: var(--brand-600); }
.nav a.mode-switch:hover { border-color: var(--brand); }
.side-plan { background: var(--brand-50); color: var(--ink-2); border: 1px solid var(--brand-100); }
.side-plan strong { color: var(--ink); }
.side-plan:hover { background: #e4eefe; }
.side-plan .meter { background: #fff; }
.side-plan-cta { color: var(--brand-600); }
@media (max-width: 900px) {
  .topbar { background: #fff; border-bottom: 1px solid var(--line); }
  .topbar button { color: var(--ink); }
  body.nav-open::after { background: rgba(15, 23, 42, .3); }
}

/* area admin: tetap terang, aksen indigo agar beda dari dashboard pengguna */
.admin-area { --brand: #4f46e5; --brand-600: #4338ca; --brand-50: #eef2ff; --brand-100: #e0e7ff; }
.admin-area .sidebar, .admin-area .topbar { background: #fff; }
.admin-area .nav a:hover, .admin-area .nav button:hover { background: #f3f4fe; }
.admin-area .nav a.active { background: var(--brand-50); color: var(--brand-600); }
.admin-area .logo-mark { background: linear-gradient(135deg, #6366f1, #4338ca); }
.admin-area .sidebar-foot { border-color: var(--line); }
.admin-area .nav a.mode-switch { border-color: #c7cbf3; }

/* kartu "Hari ini" terang */
.today-card { background: linear-gradient(150deg, #eff6ff, #dbeafe); color: var(--ink-2); border: 1px solid var(--brand-100); }
.today-grid b { color: var(--brand-600); }
.today-grid small { color: var(--muted); }
.today-foot { border-top-color: #c7dafc; color: var(--ink-2); }
.today-foot a { color: var(--brand-600); }
.eyebrow-sm.light { color: var(--brand-600); }

/* auth, landing */
.auth-side { background: radial-gradient(circle at 15% 10%, #bfdbfe, transparent 55%), linear-gradient(160deg, #eff6ff, #dbeafe); color: var(--ink-2); }
.auth-side h2 { color: var(--ink); }
.auth-side .logo { color: var(--ink); }
.auth-side li { color: var(--ink-2); }
.auth-side li::before { background: var(--brand); color: #fff; }
.auth-side small { color: var(--muted) !important; }
.hero { background: radial-gradient(ellipse at 70% 0%, #dbeafe, transparent 55%), #fff; }
.hero-code { box-shadow: 0 24px 60px rgba(37, 99, 235, .18); }
.cta-band { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #eff6ff; }
.plan-hl { box-shadow: 0 12px 32px rgba(37, 99, 235, .15); }
.btn:focus-visible { outline-color: var(--brand-100); }

/* inbox: nuansa biru */
.ib-chat { background: #eef3fb; }
.ib-msg.out .ib-bubble { background: #dcebff; }
.preview-wrap { background: #eef3fb; }
.preview-bubble { background: #dcebff; }
.ib-tick.read { color: #2563eb; }

/* ---------- Inbox v2: filter, panel konteks, SLA ---------- */
.inbox.ctx-open { grid-template-columns: 340px minmax(0, 1fr) 320px; }
.ib-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ib-title-row select { width: auto; max-width: 160px; }
.ib-filter { flex-wrap: wrap; }
.ib-filter button span:not(:empty) { background: #e8eefa; border-radius: 99px; padding: 0 6px; margin-left: 2px; font-size: .74rem; }
.ib-filter button.active span:not(:empty) { background: #fff; }
.ib-item-meta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 2px; }
.ib-item-meta:empty { display: none; }
.ib-lbl { font-size: .68rem; background: #eef2f8; color: var(--ink-2); padding: 0 6px; border-radius: 4px; }
.ib-lbl.warn { background: #fef3c7; color: #92400e; }
.ib-need { font-size: .68rem; color: var(--brand-600); font-weight: 700; }
.ib-sla { font-size: .68rem; background: #fee2e2; color: #b91c1c; font-weight: 800; padding: 0 6px; border-radius: 4px; }
.ib-item.late { box-shadow: inset 3px 0 0 var(--danger); }
.ib-agent { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-100); color: var(--brand-600); font-size: .62rem; font-weight: 800; display: grid; place-items: center; }
.ib-star-sm { color: #f59e0b; margin-right: 4px; }
.ib-head-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ib-icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; cursor: pointer; display: grid; place-items: center; font-size: 1.05rem; color: var(--ink-2); }
.ib-icon-btn:hover { background: #f5f8fe; }
.ib-icon-btn.on { color: #f59e0b; border-color: #fde68a; background: #fffbeb; }
.ib-tpl { background: #fff; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; max-height: 220px; overflow-y: auto; box-shadow: var(--shadow); }
.ib-tpl button { display: flex; flex-direction: column; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f1f5f9; background: none; padding: 8px 12px; cursor: pointer; font: inherit; }
.ib-tpl button:hover { background: var(--brand-50); }
.ib-tpl button span { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-ctx { background: #fff; border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.ib-ctx[hidden] { display: none; }
.ib-ctx-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ib-ctx-body { flex: 1; overflow-y: auto; padding: 14px; }
.ctx-card { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.ctx-id { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ctx-name { border: 1px solid transparent; padding: 4px 6px; margin-left: -6px; font-weight: 700; font-size: 1rem; }
.ctx-name:hover:not(:disabled) { border-color: var(--line); }
.ctx-sec { border-top: 1px solid #f1f5f9; padding: 12px 0; }
.ctx-sec label { margin: 8px 0 4px; font-size: .78rem; }
.ctx-sec select, .ctx-sec input, .ctx-sec textarea { padding: 7px 10px; font-size: .88rem; }
.ctx-sec textarea { min-height: 70px; }
.ctx-label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.ctx-action { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 9px 11px; margin-top: 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: .86rem; cursor: pointer; text-decoration: none !important; text-align: left; }
.ctx-action:hover { border-color: var(--brand); background: var(--brand-50); }
.ctx-note { font-size: .82rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 1100px) {
  .inbox.ctx-open { grid-template-columns: 300px minmax(0, 1fr); }
  .ib-ctx { position: fixed; right: 0; top: 0; bottom: 0; width: min(340px, 92vw); z-index: 45; box-shadow: -10px 0 30px rgba(15, 23, 42, .12); }
}
@media (max-width: 900px) {
  .inbox.ctx-open { grid-template-columns: 1fr; }
}

.agent-of { padding: 10px 12px; margin-top: 10px; background: var(--brand-50); border-radius: 9px; }
.ib-head-actions .btn { white-space: nowrap; }

/* ---------- Bilah atas (tema, notifikasi, bantuan, akun) ---------- */
.appbar {
  position: sticky; top: 0; z-index: 25; display: flex; align-items: center; gap: 10px;
  height: 60px; margin: -28px -32px 24px; padding: 0 32px;
  background: rgba(245, 248, 254, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.main-inbox > .appbar { margin: 0; padding: 0 16px; }
.appbar .appbar-menu, .appbar-brand { display: none; }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.appbar-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; min-width: 38px; padding: 0 9px; border-radius: 10px; border: 1px solid transparent;
  background: none; color: var(--ink-2); cursor: pointer; font: inherit; font-weight: 600; font-size: .88rem; text-decoration: none !important;
}
.appbar-btn:hover, .appbar-btn.active, .appbar-btn[aria-expanded="true"] { background: var(--card); border-color: var(--line); color: var(--ink); }
.appbar-btn:focus-visible, .appbar-user:focus-visible { outline: 3px solid var(--brand-100); outline-offset: 1px; }
.appbar-dot {
  position: absolute; top: 2px; right: 1px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg);
}
.appbar-dot[hidden] { display: none; }
.ic-dark, .ic-light { display: inline-flex; }
.ic-light { display: none; }
[data-theme="dark"] .ic-light { display: inline-flex; }
[data-theme="dark"] .ic-dark { display: none; }
.appbar-user {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card); border-radius: 99px;
  padding: 3px 12px 3px 3px; cursor: pointer; font: inherit; font-weight: 600; font-size: .88rem; color: var(--ink); margin-left: 4px;
}
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: .76rem; font-weight: 800; flex: 0 0 auto; }
.appbar-user-name { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appbar-pop { position: relative; }
.pop-panel {
  position: absolute; right: 0; top: calc(100% + 8px); width: 340px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(15, 23, 42, .14); z-index: 50; overflow: hidden;
}
.pop-panel[hidden] { display: none; }
.user-panel { width: 250px; }
.pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pop-head .small { overflow: hidden; text-overflow: ellipsis; }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none;
  font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none !important;
}
.pop-item:hover { background: var(--brand-50); }
.pop-danger { color: var(--danger); }
.user-panel form { margin: 0; border-top: 1px solid var(--line); }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: .87rem; text-decoration: none !important; }
.notif-item:last-child { border-bottom: 0; }
a.notif-item:hover { background: var(--brand-50); }
.notif-item.unread { background: var(--brand-50); }
.notif-item.unread .notif-body > span { font-weight: 700; }
.notif-ic { flex: 0 0 auto; width: 20px; text-align: center; }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-body small { color: var(--muted); font-size: .76rem; }
.pop-empty { padding: 24px 18px; text-align: center; color: var(--muted); font-size: .86rem; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }

/* ---------- Pusat Bantuan ---------- */
.help-hero { background: linear-gradient(135deg, var(--brand-50), var(--card)); border-color: var(--brand-100); padding: 28px; }
.help-hero h1 { font-size: 1.5rem; }
.help-search { position: relative; max-width: 560px; margin-top: 14px; }
.help-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.help-search input { padding: 12px 14px 12px 42px; font-size: 1rem; border-radius: 12px; }
.help-card { display: flex; flex-direction: column; gap: 4px; color: var(--ink); text-decoration: none !important; transition: border-color .15s, transform .15s; }
.help-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.help-ic { width: 42px; height: 42px; border-radius: 11px; background: var(--brand-50); color: var(--brand-600); display: grid; place-items: center; margin-bottom: 8px; }
.faq-cat-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 18px 0 8px; }
.faq-cat:first-child .faq-cat-title { margin-top: 4px; }
.faq-card { padding: 4px 18px; margin-bottom: 0; }
.faq-item { border-bottom: 1px solid #f1f5f9; }
.faq-item:last-child { border-bottom: 0; }
.faq-item summary { cursor: pointer; padding: 13px 24px 13px 0; font-weight: 600; list-style: none; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; position: absolute; right: 2px; top: 10px; font-size: 1.2rem; color: var(--muted); font-weight: 500; }
.faq-item[open] summary::after { content: '–'; }
.faq-item p { margin: 0 0 14px; color: var(--ink-2); font-size: .92rem; }
.help-steps { margin: 0; padding-left: 20px; }
.help-steps li { margin-bottom: 12px; }
.help-steps li span { display: block; font-size: .87rem; color: var(--muted); }

@media (max-width: 900px) {
  .appbar { margin: -20px -16px 18px; padding: 0 10px; gap: 4px; }
  .main-inbox > .appbar { margin: 0; padding: 0 10px; }
  .main-inbox { height: 100vh; height: 100dvh; }
  .appbar .appbar-menu { display: inline-flex; }
  .appbar-brand { display: block; min-width: 0; }
  .appbar-brand .logo { padding: 0; font-size: .98rem; gap: 8px; }
  .appbar-brand .logo small { display: none; }
  .appbar-brand .logo-mark { width: 30px; height: 30px; }
  .appbar-help span, .appbar-user-name { display: none; }
  .appbar-user { padding: 3px; }
  .pop-panel { position: fixed; left: 10px; right: 10px; top: 64px; width: auto; }
}
@media (max-width: 380px) {
  .appbar-brand .logo > span:last-child { display: none; }
}

/* =====================================================================
   MODE GELAP (hanya area dashboard; dipilih lewat tombol bulan/matahari)
   ===================================================================== */
[data-theme="dark"] { color-scheme: dark; background: #0b1120; }
[data-theme="dark"] .app-body {
  --brand: #3b82f6; --brand-600: #60a5fa; --brand-50: #13213d; --brand-100: #1e3a6b;
  --ink: #e5e9f0; --ink-2: #c3cad6; --muted: #8b96a8; --line: #253047;
  --bg: #0b1120; --card: #121a2b; --soft: #1a2336; --danger: #f87171; --amber: #fbbf24;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
[data-theme="dark"] .app-body.admin-area { --brand: #6366f1; --brand-600: #a5b4fc; --brand-50: #1b1d45; --brand-100: #2b2f6b; }
[data-theme="dark"] .app-body code { background: var(--soft); }
[data-theme="dark"] .app-body pre { background: #070b14; }
[data-theme="dark"] .app-body input[type=text], [data-theme="dark"] .app-body input[type=email], [data-theme="dark"] .app-body input[type=password],
[data-theme="dark"] .app-body input[type=url], [data-theme="dark"] .app-body input[type=number], [data-theme="dark"] .app-body input[type=tel],
[data-theme="dark"] .app-body input[type=search], [data-theme="dark"] .app-body input[type=time], [data-theme="dark"] .app-body input[type=date],
[data-theme="dark"] .app-body input[type=datetime-local], [data-theme="dark"] .app-body select, [data-theme="dark"] .app-body textarea { background: #0e1626; color: var(--ink); }
[data-theme="dark"] .app-body .btn-ghost, [data-theme="dark"] .app-body .btn-danger-ghost, [data-theme="dark"] .app-body .chip,
[data-theme="dark"] .app-body .ib-filter button, [data-theme="dark"] .app-body .ib-icon-btn, [data-theme="dark"] .app-body .ctx-action,
[data-theme="dark"] .app-body .ib-older button { background: var(--card); color: var(--ink); }
[data-theme="dark"] .app-body .btn-danger-ghost { color: var(--danger); border-color: #5b2330; }
[data-theme="dark"] .app-body .btn-ghost:hover, [data-theme="dark"] .app-body .ib-icon-btn:hover { background: var(--soft); }
[data-theme="dark"] .app-body .btn-danger-ghost:hover { background: #2a1519; }
[data-theme="dark"] .app-body .chip.active, [data-theme="dark"] .app-body .chip:has(input:checked),
[data-theme="dark"] .app-body .ib-filter button.active { background: var(--brand-50); color: var(--brand-600); }

[data-theme="dark"] .app-body .badge-green { background: #12351f; color: #86efac; }
[data-theme="dark"] .app-body .badge-amber { background: #3a2a0b; color: #fcd34d; }
[data-theme="dark"] .app-body .badge-red { background: #3b1519; color: #fca5a5; }
[data-theme="dark"] .app-body .badge-blue { background: #142a52; color: #93c5fd; }
[data-theme="dark"] .app-body .badge-violet { background: #2a1f4d; color: #c4b5fd; }
[data-theme="dark"] .app-body .badge-gray { background: #1e2738; color: #c3cad6; }
[data-theme="dark"] .app-body .alert-success { background: #0f2a1a; border-color: #1d4d2f; color: #86efac; }
[data-theme="dark"] .app-body .alert-error { background: #2a1215; border-color: #5b2330; color: #fca5a5; }
[data-theme="dark"] .app-body .alert-info { background: #11203d; border-color: #1e3a6b; color: #93c5fd; }
[data-theme="dark"] .app-body .alert-warn { background: #2a210b; border-color: #5a4510; color: #fcd34d; }

[data-theme="dark"] .app-body td, [data-theme="dark"] .app-body .switch-row, [data-theme="dark"] .app-body .feed-item,
[data-theme="dark"] .app-body .ib-item, [data-theme="dark"] .app-body .ib-tpl button, [data-theme="dark"] .app-body .ctx-sec,
[data-theme="dark"] .app-body .faq-item { border-color: var(--line); }
[data-theme="dark"] .app-body .sidebar, [data-theme="dark"] .app-body .ib-list, [data-theme="dark"] .app-body .ib-head,
[data-theme="dark"] .app-body .ib-ctx, [data-theme="dark"] .app-body .ib-tpl { background: var(--card); }
[data-theme="dark"] .app-body .nav a:hover, [data-theme="dark"] .app-body .nav button:hover, [data-theme="dark"] .app-body .nav-group summary:hover { background: var(--soft); color: var(--ink); }
[data-theme="dark"] .app-body .nav-label { color: #64748b; }
[data-theme="dark"] .app-body .nav a.mode-switch { border-color: #2c3a57; }
[data-theme="dark"] .app-body .nav-scroll::-webkit-scrollbar-thumb { background: #2c3a57; }
[data-theme="dark"] .app-body .side-plan:hover { background: #172a4d; }
[data-theme="dark"] .app-body .side-plan .meter { background: #0e1626; }
[data-theme="dark"] .app-body .meter, [data-theme="dark"] .app-body .progress-big, [data-theme="dark"] .app-body .period-toggle,
[data-theme="dark"] .app-body .step-num, [data-theme="dark"] .app-body .tag, [data-theme="dark"] .app-body .ib-lbl,
[data-theme="dark"] .app-body .ib-search input { background: var(--soft); }
[data-theme="dark"] .app-body .period-toggle button.active { background: var(--card); }
[data-theme="dark"] .app-body .toggle span { background: #334155; }
[data-theme="dark"] .app-body .att { background: #0e1626; }
[data-theme="dark"] .app-body .att:hover { background: var(--soft); }
[data-theme="dark"] .app-body .today-card { background: linear-gradient(150deg, #13213d, #172c55); border-color: #1e3a6b; }
[data-theme="dark"] .app-body .today-foot { border-top-color: #2a4677; }
[data-theme="dark"] .app-body .step.done { background: #0f2a1a; border-color: #1d4d2f; }
[data-theme="dark"] .app-body .help-box { background: #0e1626; }
[data-theme="dark"] .app-body .help-box code { background: var(--card); }
[data-theme="dark"] .app-body .plan-features li.no { color: #64748b; }
[data-theme="dark"] .app-body .danger-zone { border-color: #5b2330; }
[data-theme="dark"] .app-body .chart .grid-line { stroke: var(--line); }
[data-theme="dark"] .app-body .impersonate-bar { background: #2a210b; border-color: #5a4510; color: #fcd34d; }

[data-theme="dark"] .app-body .preview-wrap, [data-theme="dark"] .app-body .ib-chat, [data-theme="dark"] .app-body .col { background: #0d1424; }
[data-theme="dark"] .app-body .preview-bubble, [data-theme="dark"] .app-body .ib-msg.out .ib-bubble { background: #173a6b; color: var(--ink); }
[data-theme="dark"] .app-body .ib-bubble, [data-theme="dark"] .app-body .ib-day span, [data-theme="dark"] .app-body .ib-ph-icon,
[data-theme="dark"] .app-body .ib-file { background: var(--card); color: var(--ink); }
[data-theme="dark"] .app-body .ib-item:hover { background: var(--soft); }
[data-theme="dark"] .app-body .ib-item.active { background: var(--brand-50); }
[data-theme="dark"] .app-body .ib-composer { background: #0e1626; }
[data-theme="dark"] .app-body .ib-meta, [data-theme="dark"] .app-body .ib-tick { color: #8b96a8; }
[data-theme="dark"] .app-body .ib-tick.read { color: #60a5fa; }
[data-theme="dark"] .app-body .ib-text a { color: #60a5fa; }
[data-theme="dark"] .app-body .ib-text code, [data-theme="dark"] .app-body .ib-src, [data-theme="dark"] .app-body .ib-doc { background: rgba(255, 255, 255, .08); }
[data-theme="dark"] .app-body .ib-warn, [data-theme="dark"] .app-body .ib-readonly { background: #2a210b; color: #fcd34d; border-color: #5a4510; }
[data-theme="dark"] .app-body .ib-filter button span:not(:empty) { background: var(--soft); }
[data-theme="dark"] .app-body .ib-filter button.active span:not(:empty) { background: var(--card); }
[data-theme="dark"] .app-body .ib-icon-btn.on { background: #2a210b; border-color: #5a4510; }
[data-theme="dark"] .app-body .ib-sla { background: #3b1519; color: #fca5a5; }
[data-theme="dark"] .app-body .ib-lbl.warn { background: #3a2a0b; color: #fcd34d; }

[data-theme="dark"] .app-body .appbar { background: rgba(11, 17, 32, .86); }
[data-theme="dark"] .app-body .pop-panel { box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
[data-theme="dark"] .app-body .help-hero { background: linear-gradient(135deg, #13213d, var(--card)); }

/* ---------- Pilih grup WA (Kirim Satuan) ---------- */
.group-picker { border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; padding: 8px; background: var(--card); }
.group-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.group-item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--ink); }
.group-item:hover { background: var(--brand-50); }
.group-item.picked { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }