/* zaiBase — palet: Black #0F0F0F · Gray Dark #2A2A2A · Gray #6B6B6B · Gray Light #D6D6D6 · White Milk #F8F8F6 */
:root {
  --black: #0F0F0F;
  --gray-dark: #2A2A2A;
  --gray: #6B6B6B;
  --gray-light: #D6D6D6;
  --milk: #F8F8F6;
  --white: #FFFFFF;
  --line: #E4E4E0;
  --ok: #2F9E5B;
  --bad: #C94A4A;
  --r: 12px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: #E9E9E6;
  color: var(--black);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.app { max-width: 640px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--milk); position: relative; box-shadow: 0 0 40px #0000001a; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--black); color: var(--white); height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px; }
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; flex: 1; }
.topbar .brand svg { width: 22px; height: 22px; }
.iconbtn { background: none; border: 0; color: inherit; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; position: relative; }
.iconbtn:active { background: #ffffff22; }
.badge { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9px; background: var(--white); color: var(--black); font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gray-light); color: var(--black); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.page { padding: 18px 16px 96px; }
.page h1 { margin: 0; font-size: 22px; line-height: 1.2; }
.page .sub { color: var(--gray); font-size: 12.5px; margin: 2px 0 16px; }
.titlerow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.titlerow h1 { font-size: 20px; }
.titlerow .sub { margin: 0; }
.backbtn { background: none; border: 0; padding: 0; color: var(--black); display: grid; place-items: center; }
.backbtn svg { width: 26px; height: 26px; }

.bottomnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(100%, 640px); background: var(--white); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); z-index: 20; padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottomnav a { display: grid; justify-items: center; gap: 2px; padding: 9px 0 8px; font-size: 11px; color: var(--gray); text-decoration: none; }
.bottomnav a.on { color: var(--black); font-weight: 700; }
.bottomnav a.on svg { stroke-width: 2.4; }

/* ---------- Komponen ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card + .card, .card + .sec, .sec + .card { margin-top: 12px; }
.sec { margin-top: 18px; }
.sec h2 { font-size: 15px; margin: 0 0 10px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sec-head h2 { margin: 0; }
.muted { color: var(--gray); }
.small { font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--black); color: var(--white); border: 1px solid var(--black); border-radius: 8px; padding: 11px 16px; font-weight: 600; font-size: 14px; text-decoration: none; }
.btn:active { background: var(--gray-dark); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--white); color: var(--black); border-color: var(--gray-light); }
.btn.ghost:active { background: var(--milk); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: wait; }
.btn + .btn { margin-top: 8px; }
.btnrow { display: flex; gap: 8px; } .btnrow .btn { flex: 1; margin: 0; }

.field { margin: 0 0 12px; }
.field label, .lbl { display: block; font-size: 12.5px; color: var(--gray-dark); margin: 0 0 5px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; background: var(--white); border: 1px solid var(--gray-light); border-radius: 8px; padding: 10px 12px; font-size: 14px; outline: none; }
.input:focus { border-color: var(--black); box-shadow: 0 0 0 3px #0f0f0f14; }
textarea.input { resize: vertical; min-height: 84px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inputicon { position: relative; }
.inputicon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray); width: 18px; height: 18px; }
.inputicon .input { padding-left: 38px; }
.inputicon .tog { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--gray); width: 34px; height: 34px; display: grid; place-items: center; }

.seg { display: flex; background: #ECECE8; border-radius: 8px; padding: 3px; gap: 3px; margin-bottom: 14px; }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; border: 0; background: none; border-radius: 6px; padding: 8px 6px; font-size: 13px; color: var(--gray-dark); font-weight: 500; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--black); color: var(--white); font-weight: 600; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.stat .k { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--gray); }
.stat .k svg { width: 15px; height: 15px; color: var(--black); }
.stat .v { font-size: 26px; font-weight: 700; margin: 4px 0 2px; letter-spacing: -.5px; }
.stat .d { font-size: 11px; color: var(--gray); }

.list { display: grid; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
.li .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--gray-light); display: grid; place-items: center; color: var(--gray-dark); flex: none; }
.li .dot svg { width: 14px; height: 14px; }
.li .t { flex: 1; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .w { font-size: 11.5px; color: var(--gray); flex: none; }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick a { display: grid; justify-items: center; gap: 5px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 4px; font-size: 11px; color: var(--black); text-decoration: none; text-align: center; }

.chip { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #E6E6E2; color: var(--gray-dark); }
.chip.ok { background: #DFF1E6; color: #1E6B3D; }
.chip.off { background: #F3DCDC; color: #8E3030; }
.pill { display: inline-block; background: var(--black); color: var(--white); border-radius: 999px; padding: 1px 10px; font-size: 11px; font-weight: 600; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; color: var(--gray); font-weight: 600; padding: 6px 6px; border-bottom: 1px solid var(--gray-light); white-space: nowrap; }
.tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tblwrap { overflow-x: auto; }

pre.code { margin: 0; background: var(--black); color: #E8E8E4; border-radius: 10px; padding: 12px 14px; font-size: 12px; line-height: 1.6; overflow-x: auto; white-space: pre; }
pre.code .c { color: #8a8a86; } pre.code .k { color: #fff; font-weight: 700; }
.codebox { position: relative; }
.codebox .copy { position: absolute; top: 8px; right: 8px; background: #ffffff1c; border: 0; color: #fff; border-radius: 6px; padding: 4px 8px; font-size: 11px; display: flex; gap: 4px; align-items: center; }
.codebox .copy svg { width: 13px; height: 13px; }
.cmd { background: var(--black); color: #E8E8E4; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.7; }
.cmd .m { display: inline-block; width: 44px; color: #9a9a96; }

.editor { display: flex; background: var(--black); border-radius: 10px; overflow: hidden; }
.editor .gut { margin: 0; padding: 12px 8px 12px 10px; color: #6f6f6b; text-align: right; font-size: 12px; line-height: 1.6; user-select: none; background: #171717; overflow: hidden; }
.editor textarea { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #E8E8E4; padding: 12px; font-size: 12px; line-height: 1.6; height: 280px; resize: vertical; white-space: pre; overflow: auto; }

.empty { text-align: center; color: var(--gray); padding: 22px 0; font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--gray); }
.on-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 6px; }
.off-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); margin-right: 6px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 13px; }
.checks li { display: flex; gap: 8px; align-items: center; }
.checks svg { width: 15px; height: 15px; }

.console { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; }
.console .ln { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.console .ln i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.console .ln.bad i { background: var(--bad); }
.console .ln span.p { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console .ln b { font-weight: 600; }
pre.resp { margin: 8px 0 0; background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 11.5px; max-height: 220px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

.mailframe { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.mailframe .dots { display: flex; gap: 5px; margin-bottom: 10px; } .mailframe .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-light); }
.mailhead { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.mailhead .avatar { background: var(--gray-light); }
.mailhead .n { font-weight: 700; font-size: 13px; } .mailhead .e { font-size: 11.5px; color: var(--gray); } .mailhead .w { margin-left: auto; font-size: 11px; color: var(--gray); }
.mailview { background: #F2F2EF; border-radius: 10px; padding: 8px; display: flex; justify-content: center; }
.mailview iframe { border: 0; background: #fff; border-radius: 8px; width: 100%; height: 440px; }
.mailview.mobile iframe { width: 340px; max-width: 100%; }

/* toggle / checkbox / radio */
.switch { position: relative; width: 44px; height: 24px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--gray-light); border-radius: 12px; transition: .15s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--black); } .switch input:checked + span::after { transform: translateX(20px); }
.alert { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--gray-light); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; background: var(--white); }
.alert + .alert { margin-top: 8px; } .alert svg { margin-top: 1px; width: 17px; height: 17px; }
.alert.bad { border-color: #E3B8B8; background: #FBF1F1; } .alert.ok { border-color: #BFE0CB; background: #F0F8F3; } .alert.warn { border-color: #E6D3A6; background: #FBF6E8; }

/* notifikasi */
.notif { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.notif:last-child { border-bottom: 0; }
.notif .dot { width: 24px; height: 24px; border-radius: 50%; background: var(--black); color: #fff; display: grid; place-items: center; flex: none; }
.notif .dot svg { width: 13px; height: 13px; stroke-width: 2.6; }
.notif.read .dot { background: var(--gray-light); color: var(--gray-dark); }
.notif b { display: block; font-size: 13.5px; } .notif p { margin: 0; font-size: 12px; color: var(--gray); } .notif time { font-size: 11px; color: var(--gray); }

/* modal, toast, menu */
.modal-bg { position: fixed; inset: 0; background: #0000008c; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal { background: var(--white); border-radius: 14px; padding: 18px; width: min(100%, 400px); }
.modal h3 { margin: 0 0 10px; font-size: 17px; } .modal p { margin: 0 0 12px; font-size: 13px; color: var(--gray-dark); }
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--black); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 80; max-width: 88%; text-align: center; box-shadow: 0 6px 20px #0000003a; }
.menu { position: absolute; z-index: 30; background: var(--white); border: 1px solid var(--gray-light); border-radius: 10px; box-shadow: 0 8px 24px #00000026; padding: 4px; min-width: 150px; }
.menu button { display: flex; width: 100%; gap: 8px; align-items: center; background: none; border: 0; padding: 9px 10px; border-radius: 7px; font-size: 13px; text-align: left; }
.menu button:active { background: var(--milk); }

/* ---------- Sidebar / drawer ---------- */
.main { min-width: 0; min-height: 100vh; min-height: 100dvh; position: relative; }
.side { position: fixed; top: 0; bottom: 0; left: 0; width: min(82%, 300px); background: var(--black); color: var(--white); z-index: 41; padding: 16px 12px; display: flex; flex-direction: column; transform: translateX(-104%); transition: transform .22s ease; overflow-y: auto; }
.side.open { transform: none; }
.drawer-bg { position: fixed; inset: 0; background: #0000008c; z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer-bg.open { opacity: 1; pointer-events: auto; }
.side .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; padding: 4px 10px 6px; }
.side .brand svg { width: 28px; height: 28px; }
.side .tagline { color: #8d8d89; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 0 12px 14px; }
.side nav { display: grid; gap: 2px; margin-top: 8px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cfcfcb; text-decoration: none; font-size: 14.5px; }
.side nav a:hover { background: #1b1b1b; color: #fff; }
.side nav a.on { background: var(--gray-dark); color: var(--white); font-weight: 600; }
.sidefoot { margin-top: auto; border-top: 1px solid var(--gray-dark); padding-top: 12px; display: grid; gap: 4px; }
.sidefoot .me { display: flex; gap: 10px; align-items: center; padding: 6px 8px; color: #fff; text-decoration: none; min-width: 0; border-radius: 10px; }
.sidefoot .me:hover { background: #1b1b1b; }
.sidefoot .who { min-width: 0; display: grid; line-height: 1.25; }
.sidefoot .who b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidefoot .who small { color: #9a9a96; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidefoot .item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #cfcfcb; background: none; border: 0; font-size: 14px; text-align: left; width: 100%; }
.sidefoot .item:hover { background: #1b1b1b; color: #fff; }
.deskbar { display: none; }
.app.noside .topbar { display: flex; }

/* ---------- Komponen tambahan ---------- */
.iconbtn.dark { color: var(--black); }
.iconbtn.dark:active, .iconbtn.dark:hover { background: #0000000d; }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.danger:active { background: #a83a3a; }
.btn.sm.danger { padding: 7px 12px; }
.btn.ghost.sm svg, .btn.sm svg { width: 15px; height: 15px; }
.btn:focus-visible, .iconbtn:focus-visible, .seg button:focus-visible, .sel-btn:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }
.pill.warn { background: #8a6a1a; }
.chip.warn { background: #F6EBC9; color: #7a5a10; }
.split { display: grid; gap: 14px; align-items: start; }
.split > * { margin-top: 0 !important; }
.desk-only { display: none; }
.mob-only { display: block; }
.stack > * + * { margin-top: 12px; }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 16px; font-size: 13px; border-bottom: 1px solid var(--line); background: #ECEFF4; color: #25324a; }
.banner svg { width: 17px; height: 17px; margin-top: 1px; }
.banner.success { background: #E7F4EC; color: #1E5B37; }
.banner.warning { background: #FBF3DC; color: #6d4f0c; }
.banner.bad { background: #FBE9E9; color: #8E3030; }
.banner b { font-weight: 600; }

input[type=checkbox].cb, input[type=radio].cb { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0; flex: none; border: 1.5px solid #9a9a96; background-color: var(--white); border-radius: 5px; display: inline-block; cursor: pointer; transition: background-color .12s, border-color .12s, box-shadow .12s; vertical-align: middle; }
input[type=checkbox].cb:checked { background-color: var(--black); border-color: var(--black); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7'/%3E%3C/svg%3E"); background-size: 13px; background-position: center; background-repeat: no-repeat; }
input[type=radio].cb { border-radius: 50%; }
input[type=radio].cb:checked { background-color: var(--black); border-color: var(--black); box-shadow: inset 0 0 0 3.5px var(--white); }
input.cb:focus-visible, .switch input:focus-visible + span { outline: 2px solid var(--black); outline-offset: 2px; }
.cbl { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin: 0; font-size: 13.5px; color: var(--black); }

.sel { position: relative; flex: 1 1 0; min-width: 0; width: 100%; }
.sel.auto { flex: none; width: auto; display: inline-block; }
.sel-native { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sel-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer; width: 100%; min-height: 41px; }
.sel-btn .sel-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn .sel-val.ph { color: var(--gray); }
.sel-btn svg { width: 16px; height: 16px; color: var(--gray); transition: transform .15s; }
.sel-btn[aria-expanded=true] { border-color: var(--black); box-shadow: 0 0 0 3px #0f0f0f14; }
.sel-btn[aria-expanded=true] svg { transform: rotate(180deg); }
.sel-menu { position: fixed; z-index: 90; background: var(--white); border: 1px solid var(--gray-light); border-radius: 12px; box-shadow: 0 14px 40px #00000030; padding: 5px; overflow-y: auto; outline: 0; animation: pop .12s ease; }
.sel-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--black); }
.sel-opt.act { background: #F0F0EC; }
.sel-opt.on { font-weight: 600; }
.sel-opt svg { width: 16px; height: 16px; flex: none; }
.sel-opt.dis { opacity: .4; cursor: not-allowed; }
.sel-bg { position: fixed; inset: 0; background: #0000008c; z-index: 89; }
.sel-menu.sheet { left: 0; right: 0; bottom: 0; top: auto; border-radius: 18px 18px 0 0; border: 0; max-height: 70vh; padding: 8px 10px calc(14px + env(safe-area-inset-bottom, 0px)); animation: slideup .2s ease; }
.sel-menu.sheet .sel-opt { padding: 13px 10px; font-size: 15px; }
.sel-title { font-weight: 700; font-size: 15px; padding: 8px 6px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes slideup { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }

.toast { display: flex; align-items: center; gap: 9px; }
.toast svg { width: 17px; height: 17px; flex: none; }
.toast.ok svg { color: #7fd6a3; } .toast.bad svg { color: #f09a9a; } .toast.warn svg { color: #f0cf7a; } .toast.info svg { color: #a9c4f0; }
.modal .btnrow { margin-top: 14px; }
.modal-bg { animation: fade .12s ease; } .modal { animation: pop .16s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.chart { width: 100%; height: auto; display: block; }
.chart .cg { stroke: var(--line); stroke-width: 1; }
.chart .ct { fill: var(--gray); font-size: 11px; font-family: inherit; }
.chart .cl { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .cl.c0 { stroke: var(--black); } .chart .cl.c1 { stroke: #9c9c98; stroke-dasharray: 5 4; }
.chart .ca { fill: #0f0f0f12; }
.chart .cd { fill: var(--white); stroke-width: 2; } .chart .cd.c0 { stroke: var(--black); } .chart .cd.c1 { stroke: #9c9c98; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--gray); margin-top: 8px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; background: var(--black); }
.legend i.l1 { background: #9c9c98; }

.docs-wrap { display: grid; gap: 14px; }
.tbl tbody tr:hover td { background: #FAFAF8; }
.rowbtns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.field .hint { margin: 5px 0 0; font-size: 12px; color: var(--gray); }
.sw-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sw-row:last-child { border-bottom: 0; }
.sw-row b { display: block; font-size: 14px; } .sw-row p { margin: 2px 0 0; font-size: 12px; color: var(--gray); }
.notif .dot.info { background: var(--black); } .notif .dot.success { background: var(--ok); } .notif .dot.warning { background: #B58A1E; }
.notif.read .dot { background: var(--gray-light); }
.tag-b { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 1px 7px; border-radius: 999px; background: var(--black); color: #fff; margin-left: 6px; vertical-align: middle; }

* { scrollbar-width: thin; scrollbar-color: #c4c4c0 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: #c4c4c0; border-radius: 8px; } ::-webkit-scrollbar-track { background: transparent; }

/* ---------- Login ---------- */
.login { background: radial-gradient(120% 90% at 50% 0%, #1b1b1b 0%, var(--black) 60%); color: var(--white); min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login .brandpanel { display: none; }
.login .formpanel { display: contents; }
.login .inner { width: 100%; max-width: 420px; margin: 0; padding: 30px 24px 26px; position: relative; z-index: 2; background: #151515eb; border: 1px solid #2c2c2c; border-radius: 22px; box-shadow: 0 30px 80px #000000b3, 0 2px 0 #ffffff0d inset; text-align: center; }
.login .logo { display: flex; flex-direction: column; align-items: center; gap: 10px; justify-content: center; margin-bottom: 26px; text-align: center; }
.login .logo svg { width: 56px; height: 56px; }
.login .logo b { font-size: 30px; letter-spacing: -.5px; display: block; line-height: 1; }
.login .logo small { color: #a8a8a4; font-size: 11.5px; display: block; margin-top: 4px; }
.login h1 { font-size: 22px; margin: 0 0 6px; text-align: center; }
.login .lead { color: #bdbdb9; font-size: 13px; margin: 0 0 20px; text-align: center; }
.login form { text-align: left; }
.login .input { background: var(--milk); border-color: var(--milk); color: var(--black); }
.login .inputicon { margin-bottom: 12px; }
.login .opts { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin: 4px 0 16px; }
.login .opts label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.login .opts a { color: #fff; text-decoration: none; }
.login .cb:checked { background-color: #3a3a3a; border-color: #bdbdb9; }
.login .cb { border-color: #8d8d89; }
.login .btn { background: var(--gray-dark); border-color: #5a5a5a; padding: 13px; }
.login .btn:active, .login .btn:hover { background: #3a3a3a; }
.login .err { background: #3a1f1f; border: 1px solid #7a3a3a; color: #ffd0d0; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; margin-bottom: 12px; text-align: left; }
.login .foot { text-align: center; color: #bdbdb9; font-size: 12.5px; margin-top: 18px; }
.login .foot.sub2 { margin-top: 8px; }
.login .foot a { color: #fff; }
.login .wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 190px; z-index: 1; opacity: .9; pointer-events: none; }
.app:has(> .login) { max-width: none; box-shadow: none; background: var(--black); }
@media (max-height: 640px) { .login { place-items: start center; } }

/* ---------- Tablet ---------- */
@media (min-width: 641px) and (max-width: 1023px) {
  .app { max-width: 720px; }
  .bottomnav { width: min(100%, 720px); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .split.two-t { grid-template-columns: 1fr 1fr; }
}

/* ---------- Desktop / DeX ---------- */
@media (min-width: 1024px) {
  body { background: var(--milk); }
  .app.shell { max-width: none; margin: 0; box-shadow: none; background: var(--milk); display: grid; grid-template-columns: 256px minmax(0, 1fr); }
  .app.shell.noside { display: block; max-width: 1100px; margin: 0 auto; box-shadow: 0 0 60px #00000014; }
  .side { position: sticky; top: 0; height: 100vh; height: 100dvh; width: auto; transform: none; z-index: 5; padding: 22px 14px 14px; transition: none; }
  .drawer-bg { display: none; }
  .app.shell:not(.noside) .topbar { display: none; }
  .app.noside .topbar { height: 60px; padding: 0 28px; }
  .bottomnav { display: none; }
  .deskbar { display: flex; align-items: center; gap: 14px; position: absolute; top: 26px; right: 40px; z-index: 6; }
  .page { padding: 32px 40px 56px; max-width: 1280px; }
  .page h1 { font-size: 26px; }
  .page .sub { font-size: 13.5px; margin-bottom: 22px; }
  .titlerow h1 { font-size: 26px; }
  .backbtn { display: none; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .stat { padding: 18px; } .stat .v { font-size: 30px; }
  .card { padding: 20px; }
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
  .split.l3 { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .split.r3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .desk-only { display: block; }
  .mob-only { display: none; }
  .quick { grid-template-columns: repeat(4, 1fr); max-width: 760px; }
  .docs-wrap { grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
  .docs-wrap .seg { flex-direction: column; background: none; padding: 0; gap: 2px; position: sticky; top: 24px; margin: 0; }
  .docs-wrap .seg button { justify-content: flex-start; padding: 10px 14px; border-radius: 8px; font-size: 14px; }
  .docs-wrap .seg button:not(.on):hover { background: #ECECE8; }
  .mailview iframe { height: 520px; }
  .toast { left: auto; right: 28px; bottom: 28px; transform: none; max-width: 380px; text-align: left; }
  .modal { padding: 22px; }
  .editor textarea { height: 360px; }

  .login { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); padding: 0; background: var(--white); color: var(--black); place-items: stretch; }
  .login .brandpanel { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 64px 72px; color: var(--white); position: relative; overflow: hidden; background: radial-gradient(circle at 88% 92%, #1b1b1b 0 32%, transparent 32.4%), radial-gradient(circle at 6% 100%, #171717 0 26%, transparent 26.4%), var(--black); }
  .login .brandpanel svg { width: 52px; height: 52px; margin-bottom: 18px; }
  .login .brandpanel h2 { margin: 0; font-size: 38px; letter-spacing: -.8px; line-height: 1.1; }
  .login .brandpanel .tg { color: #a8a8a4; font-size: 15px; letter-spacing: .02em; }
  .login .brandpanel p { color: #d4d4d0; font-size: 15px; line-height: 1.6; max-width: 360px; margin: 18px 0 0; }
  .login .brandpanel .host { margin-top: auto; color: #6f6f6b; font-size: 12.5px; position: absolute; left: 72px; bottom: 36px; }
  .login .formpanel { display: grid; place-items: center; padding: 40px; background: var(--white); position: relative; }
  .login .inner { background: transparent; border: 0; box-shadow: none; max-width: 380px; padding: 0; text-align: left; }
  .login .logo { display: none; }
  .login h1 { text-align: left; font-size: 26px; }
  .login .lead { text-align: left; color: var(--gray); }
  .login .input { background: var(--white); border-color: var(--gray-light); }
  .login .input:focus { border-color: var(--black); }
  .login .opts a { color: var(--black); font-weight: 600; }
  .login .cb { border-color: #9a9a96; }
  .login .cb:checked { background-color: var(--black); border-color: var(--black); }
  .login .btn { background: var(--black); border-color: var(--black); }
  .login .btn:hover { background: var(--gray-dark); }
  .login .err { background: #FBF1F1; border-color: #E3B8B8; color: #8E3030; }
  .login .foot { color: var(--gray); text-align: center; }
  .login .foot a { color: var(--black); font-weight: 600; }
  .login .wave { display: none; }
  .app:has(> .login) { background: var(--white); }
}
@media (min-width: 1440px) { .page { padding: 36px 56px 64px; } .deskbar { right: 56px; } }
.btn.ghost.danger-t { color: var(--bad); }
a.small { color: var(--black); font-weight: 600; text-decoration: none; } a.small:hover { text-decoration: underline; }

.hint { margin: 5px 0 0; font-size: 12px; color: var(--gray); }

.app { overflow-x: clip; }
.page, .page > *, .docs-wrap > *, .split > *, .stack > *, .stats > *, .two > *, .card, .sec { min-width: 0; }
.docs-wrap { grid-template-columns: minmax(0, 1fr); }
.seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; }
.codebox { max-width: 100%; }
pre.code { max-width: 100%; }
.tbl td, .tbl th { word-break: normal; }
.tbl code { word-break: normal; }
.tbl td:first-child code { white-space: nowrap; }
.card .row { min-width: 0; }
.stat .v { overflow-wrap: anywhere; }
.titlerow > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .tbl { font-size: 11.5px; }
  .tbl td, .tbl th { padding: 8px 5px; }
  .page { padding-left: 14px; padding-right: 14px; }
  .docs-wrap .seg button { flex: 1 0 auto; }
  .row[style*="flex-wrap"] > select.input, .card .row > select.input { flex: 1 1 100%; width: 100% !important; }
}
@media (min-width: 1024px) {
  .docs-wrap { grid-template-columns: 210px minmax(0, 1fr); }
}
