/* ==========================================================================
   Marki Robot CMS — mengikuti design system Sassly (auth.sassly.ai / onix.sassly.ai):
   Inter, primer #233D4D, aksen #FE7F2D, permukaan putih dengan ring 1px, radius minimal.
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter-latin.woff2") format("woff2");
    font-weight: 100 900; font-style: normal; font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+2215, U+2713, U+2715, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter-latin-ext.woff2") format("woff2");
    font-weight: 100 900; font-style: normal; font-display: swap;
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: "JetBrains Mono";
    src: url("/assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
    font-weight: 400 800; font-style: normal; font-display: swap;
}

:root {
    --primary: #233D4D; --primary-2: #2F5064; --primary-3: #1A2F3B;
    --orange: #FE7F2D; --yellow: #FCCA46; --sage: #A1C181; --teal: #619B8A; --red: #C2463C;

    --page: #F6F7F9; --surface: #FFFFFF; --surface-sub: #FAFBFC; --surface-alt: #F1F3F5;
    --line: #E2E5E9; --line-soft: #ECEEF1; --line-strong: #D1D6DC;
    --ink: #1B2329; --ink-2: #4B5660; --ink-3: #66717A; --ink-4: #A0A9B0;

    --st-hot: #A8392F;  --st-hot-bg: #FCEEEC;  --st-hot-ln: #F3D6D2;
    --st-warm: #7F5700; --st-warm-bg: #FFF7DE; --st-warm-ln: #F5E2A4;
    --st-cool: #3B6A2B; --st-cool-bg: #F0F6EA; --st-cool-ln: #D8E7C8;
    --st-info: #2B6455; --st-info-bg: #EAF4F1; --st-info-ln: #CDE2DB;
    --st-accent: #A3480F; --st-accent-bg: #FFF1E7; --st-accent-ln: #FAD7BF;
    --st-cold: #5A656E; --st-cold-bg: #F2F3F1; --st-cold-ln: #E1E3DF;

    --grad-primary: linear-gradient(180deg, #2F5064 0%, #233D4D 100%);
    --grad-accent: linear-gradient(180deg, #FF9150 0%, #FE7F2D 100%);
    --grad-dark: linear-gradient(180deg, #2B4657 0%, #172A35 100%);

    --ring: 0 0 0 1px rgba(16, 24, 40, .08);
    --sh-1: var(--ring), 0 1px 2px rgba(16, 24, 40, .04);
    --sh-2: var(--ring), 0 1px 3px rgba(16, 24, 40, .05);
    --sh-3: var(--ring), 0 4px 8px -2px rgba(16, 24, 40, .08), 0 14px 28px -8px rgba(16, 24, 40, .16);
    --sh-primary: 0 1px 2px rgba(23, 42, 53, .30), 0 3px 8px -2px rgba(23, 42, 53, .26);
    --sh-accent: 0 1px 2px rgba(163, 72, 15, .28), 0 3px 8px -2px rgba(254, 127, 45, .32);
    --focus-ring: 0 0 0 3px rgba(35, 61, 77, .16);

    --r-xs: 2px; --r-sm: 4px; --r: 6px; --r-lg: 8px; --r-xl: 10px; --r-chip: 4px; --r-pill: 99px;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    --fs-xs: 10.5px; --fs-sm: 11.5px; --fs-md: 12.5px; --fs-base: 13.5px; --fs-lg: 18px; --fs-metric: 26px;

    --sidebar-w: 216px; --topbar-h: 50px; --control-h: 30px; --control-h-sm: 26px; --nav-h: 28px;
    --nav-hover-bg: #F1F3F5; --nav-active-bg: #E7EDF1;

    --ease: cubic-bezier(.2, .7, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1);
    --dur-fast: .14s; --dur: .22s; --dur-slow: .42s;
}

/* --- Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; background: var(--page); color: var(--ink);
    font-family: var(--font-sans); font-size: var(--fs-base); line-height: 1.5;
    font-feature-settings: "cv11" 1, "ss03" 1; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; border-spacing: 0; }
code, kbd, pre, .mono { font-family: var(--font-mono); font-size: .92em; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
@keyframes rise-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* --- Buttons --------------------------------------------------------------- */
.btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
    height: var(--control-h); padding: 0 12px; border: 0; border-radius: var(--r);
    background: var(--surface); box-shadow: var(--sh-1); color: var(--ink-2);
    font-size: var(--fs-md); font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none;
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
    transition: box-shadow var(--dur-fast) var(--ease), color var(--dur-fast), background-color var(--dur-fast), transform .1s var(--ease);
}
.btn:hover { box-shadow: var(--sh-2); color: var(--ink); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(.5px) scale(.985); }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; }
.btn .icon { width: 14px; height: 14px; margin-left: -1px; }
.btn-primary { background: var(--grad-primary); color: #FFF; box-shadow: var(--sh-primary); }
.btn-primary:hover:not(:disabled) { color: #FFF; box-shadow: var(--sh-primary), 0 0 0 3px rgba(35, 61, 77, .14); }
.btn-accent { background: var(--grad-accent); color: #2A1406; box-shadow: var(--sh-accent); font-weight: 600; }
.btn-accent:hover:not(:disabled) { color: #2A1406; box-shadow: var(--sh-accent), 0 0 0 3px rgba(254, 127, 45, .2); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover:not(:disabled) { background: rgba(27, 35, 41, .05); box-shadow: none; }
.btn-danger { color: var(--st-hot); }
.btn-danger:hover:not(:disabled) { color: var(--st-hot); background: var(--st-hot-bg); box-shadow: 0 0 0 1px var(--st-hot-ln); }
.btn-sm { height: var(--control-h-sm); padding: 0 9px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-lg { height: 40px; padding: 0 18px; font-size: var(--fs-base); border-radius: var(--r-xl); }
.btn-block { width: 100%; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-sm.btn-icon { width: var(--control-h-sm); }

/* --- Forms ------------------------------------------------------------------ */
.field { display: grid; gap: 5px; min-width: 0; }
.field > span:not(.field-hint):not(.field-error), .field-label { font-size: var(--fs-md); font-weight: 500; color: var(--ink); }
.field-hint { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.45; }
.field-error { font-size: var(--fs-sm); color: var(--st-hot); }
.input, .select, .textarea {
    width: 100%; min-height: var(--control-h); padding: 5px 10px; border: 0; border-radius: var(--r);
    background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); font-size: var(--fs-base); line-height: 1.35;
    transition: box-shadow var(--dur-fast) var(--ease);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; padding-top: 7px; padding-bottom: 7px; }
.select {
    appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
.input:hover, .select:hover, .textarea:hover { box-shadow: 0 0 0 1px rgba(27, 35, 41, .15), 0 1px 1.5px rgba(27, 35, 41, .05); }
.input:focus, .select:focus, .textarea:focus { outline: none; box-shadow: 0 0 0 1px rgba(35, 61, 77, .55), var(--focus-ring); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input-sm, .select-sm { min-height: var(--control-h-sm); padding-top: 3px; padding-bottom: 3px; font-size: var(--fs-md); border-radius: var(--r-sm); }
.select-sm { width: auto; }
.is-invalid { box-shadow: 0 0 0 1px var(--st-hot-ln), 0 0 0 3px rgba(194, 70, 60, .08) !important; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-base); line-height: 1.4; cursor: pointer; }
.check input { width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--primary); flex: none; cursor: pointer; }
.form-grid { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.form-actions .muted { margin-right: auto; font-size: var(--fs-sm); }
.input-prefix { position: relative; }
.input-prefix > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: var(--fs-md); pointer-events: none; }
.input-prefix > .input { padding-left: 32px; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; width: 30px; height: 18px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-strong); transition: background-color var(--dur-fast); }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #FFF; box-shadow: 0 1px 2px rgba(16, 24, 40, .25); transition: transform var(--dur) var(--ease); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(12px); }
.switch input:focus-visible + span { box-shadow: var(--focus-ring); }

/* --- Cards / panels ------------------------------------------------------------ */
.panel, .card { position: relative; min-width: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-2); }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-height: 44px; padding: 11px 15px 8px; }
.panel-head h2 { margin-right: auto; font-size: var(--fs-base); font-weight: 500; letter-spacing: -.15px; }
.panel-head .muted { font-size: var(--fs-sm); }
.panel-head.has-line { border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; }
.panel-head-actions { display: flex; align-items: center; gap: 6px; }
.panel-body { padding: 4px 15px 15px; }
.panel-body.is-padded { padding-top: 14px; }
.panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 15px; border-top: 1px solid var(--line-soft); border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--surface-sub); }
.panel-foot .muted { margin-right: auto; font-size: var(--fs-sm); }
.panel-note { padding: 0 15px 13px; font-size: var(--fs-sm); color: var(--ink-3); }

/* --- Tables ----------------------------------------------------------------- */
.table-wrap { position: relative; overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-2); }
.table { width: 100%; font-size: var(--fs-md); }
.table th, .table td { padding: 9px 12px; text-align: left; vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 15px; }
.table th:last-child, .table td:last-child { padding-right: 15px; }
.table thead th { position: sticky; top: 0; z-index: 1; padding-top: 10px; padding-bottom: 8px; background: var(--surface-sub); font-size: var(--fs-sm); font-weight: 500; color: var(--ink-3); white-space: nowrap; box-shadow: inset 0 -1px 0 var(--line-soft); }
.table tbody td { border-top: 1px solid var(--line-soft); }
.table tbody tr:first-child td { border-top: 0; }
.table tbody tr:hover { background: rgba(27, 35, 41, .022); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table tr.is-off td { color: var(--ink-3); }
.table tr.is-new { animation: row-flash 1.6s var(--ease); }
@keyframes row-flash { from { background: rgba(254, 127, 45, .14); } }
.panel > .table-wrap { box-shadow: none; background: transparent; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.panel > .table-wrap .table thead th { background: transparent; }
.cell-title { font-weight: 500; color: var(--ink); }
.cell-sub { font-size: var(--fs-sm); color: var(--ink-3); }

/* --- Badges ---------------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 8px; border-radius: var(--r-chip); font-size: var(--fs-sm); font-weight: 500; line-height: 1.35; white-space: nowrap; background: var(--st-cold-bg); color: var(--st-cold); box-shadow: inset 0 0 0 1px var(--st-cold-ln); }
.badge .icon { width: 11px; height: 11px; stroke-width: 2; }
.badge.tone-success { background: var(--st-cool-bg); color: var(--st-cool); box-shadow: inset 0 0 0 1px var(--st-cool-ln); }
.badge.tone-warning { background: var(--st-warm-bg); color: var(--st-warm); box-shadow: inset 0 0 0 1px var(--st-warm-ln); }
.badge.tone-danger { background: var(--st-hot-bg); color: var(--st-hot); box-shadow: inset 0 0 0 1px var(--st-hot-ln); }
.badge.tone-info { background: var(--st-info-bg); color: var(--st-info); box-shadow: inset 0 0 0 1px var(--st-info-ln); }
.badge.tone-accent { background: var(--st-accent-bg); color: var(--st-accent); box-shadow: inset 0 0 0 1px var(--st-accent-ln); }
.badge-outline { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex: none; }
.dot.is-on { background: #4E9A3A; box-shadow: 0 0 0 3px rgba(78, 154, 58, .15); }
.dot.is-live { background: var(--orange); animation: pulse-dot 1.4s infinite; }

/* --- Notices / flash -------------------------------------------------------------- */
.notice { position: relative; display: flex; gap: 9px; align-items: flex-start; padding: 10px 13px 10px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); font-size: var(--fs-md); }
.notice::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.notice .icon { margin-top: 1px; color: var(--st-info); }
.notice.is-success::before { background: var(--sage); } .notice.is-success .icon { color: var(--st-cool); }
.notice.is-error::before { background: var(--red); } .notice.is-error .icon { color: var(--st-hot); }
.notice.is-warning::before { background: var(--yellow); } .notice.is-warning .icon { color: var(--st-warm); }
.notice strong { font-weight: 600; }

/* --- App shell ---------------------------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; z-index: 40; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-top { display: flex; align-items: center; gap: 6px; padding: 10px 8px 6px; }
.brand-block { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 6px; border-radius: var(--r); color: var(--ink); text-decoration: none; }
.brand-block:hover { background: var(--nav-hover-bg); text-decoration: none; }
.brand-block-icon { flex: none; width: 30px; height: 30px; border-radius: var(--r); box-shadow: var(--sh-1); }
.brand-block-text { display: grid; min-width: 0; line-height: 1.25; }
.brand-block-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; letter-spacing: -.2px; }
.brand-block-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); color: var(--ink-3); }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; padding: 0 8px 10px; }
.nav-group { padding: 12px 8px 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.nav-link { position: relative; display: flex; align-items: center; gap: 8px; height: var(--nav-h); padding: 0 8px; border-radius: var(--r); color: var(--ink-2); font-size: 13px; text-decoration: none; transition: background-color var(--dur-fast), color var(--dur-fast); }
.nav-link:hover { background: var(--nav-hover-bg); color: var(--ink); text-decoration: none; }
.nav-link .icon { width: 15px; height: 15px; opacity: .7; }
.nav-link.is-active { background: var(--nav-active-bg); color: var(--primary); font-weight: 600; }
.nav-link.is-active::before { content: ""; position: absolute; left: -8px; top: 5px; bottom: 5px; width: 3px; border-radius: 0 3px 3px 0; background: var(--orange); }
.nav-link.is-active .icon { opacity: 1; }
.nav-count { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--orange); color: #FFF; font-size: 10.5px; font-weight: 600; line-height: 18px; text-align: center; }
.sidebar-foot { padding: 10px; border-top: 1px solid var(--line-soft); }
.sidebar-scrim { display: none; }
.relay-chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-lg); background: var(--surface-sub); box-shadow: var(--ring); font-size: var(--fs-sm); color: var(--ink-2); }
.relay-chip strong { font-weight: 600; color: var(--ink); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 18px 0 22px; background: rgba(255, 255, 255, .88); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px); }
.menu-toggle { display: none; margin-left: -8px; }
.topbar-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: var(--fs-md); color: var(--ink-3); }
.topbar-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--ink); }
.topbar-title .icon { width: 12px; height: 12px; color: var(--ink-4); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.user-pill { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 4px 0 4px; border-radius: var(--r); }
.user-pill-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-alt); box-shadow: var(--ring); font-size: 10.5px; font-weight: 600; color: var(--ink-2); overflow: hidden; }
.user-pill-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-pill-name { font-size: var(--fs-md); font-weight: 500; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 17px 22px 32px; }
.content > * { min-width: 0; animation: rise-in var(--dur-slow) var(--ease-out) both; }
.content > :nth-child(2) { animation-delay: 30ms; } .content > :nth-child(3) { animation-delay: 60ms; } .content > :nth-child(n+4) { animation-delay: 90ms; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; }
.page-head h1 { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.4px; }
.page-head .muted { font-size: var(--fs-md); }
.page-actions { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.page-back { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin-bottom: -4px; font-size: var(--fs-sm); color: var(--ink-3); }
.page-back .icon { width: 13px; height: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.stack { display: grid; gap: 12px; align-content: start; }
.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--r); background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--line-soft); }
.segmented a { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-sm); font-size: var(--fs-md); color: var(--ink-2); text-decoration: none; }
.segmented a.is-active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--sh-1); }
.empty { display: grid; place-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--ink-3); font-size: var(--fs-md); }
.empty .icon { width: 22px; height: 22px; color: var(--ink-4); }
.empty strong { color: var(--ink); font-weight: 500; font-size: var(--fs-base); }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 7px 12px; font-size: var(--fs-md); }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.code-box { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r); background: #172A35; color: #E6EDF1; font-family: var(--font-mono); font-size: 12px; overflow-x: auto; }
.code-box code { flex: 1; white-space: nowrap; }
.code-box .btn { background: rgba(255, 255, 255, .1); color: #E6EDF1; box-shadow: none; }

/* --- Metrics ---------------------------------------------------------------------- */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-2); overflow: hidden; }
.metric { display: grid; gap: 2px; padding: 13px 16px 14px; border-left: 1px solid var(--line-soft); }
.metric:first-child { border-left: 0; }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); color: var(--ink-3); }
.metric-label .tile { display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-sm); background: var(--surface-alt); box-shadow: var(--ring); }
.metric-label .tile .icon { width: 13px; height: 13px; color: var(--ink-2); }
.metric-label .tile.is-accent { background: var(--st-accent-bg); } .metric-label .tile.is-accent .icon { color: var(--st-accent); }
.metric-label .tile.is-info { background: var(--st-info-bg); } .metric-label .tile.is-info .icon { color: var(--st-info); }
.metric-label .tile.is-warn { background: var(--st-warm-bg); } .metric-label .tile.is-warn .icon { color: var(--st-warm); }
.metric-value { margin-top: 6px; font-size: var(--fs-metric); font-weight: 600; letter-spacing: -.6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-sub { font-size: var(--fs-sm); color: var(--ink-3); }

/* Bars (7-day chart) */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 8px 4px 0; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-fill { width: 100%; max-width: 34px; min-height: 2px; border-radius: 3px 3px 0 0; background: var(--primary); }
.bar.is-today .bar-fill { background: var(--orange); }
.bar-label { font-size: var(--fs-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bar-value { font-size: var(--fs-xs); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank { display: grid; gap: 8px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; font-size: var(--fs-md); }
.rank-track { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--surface-alt); overflow: hidden; }
.rank-track span { display: block; height: 100%; border-radius: 3px; background: var(--teal); }

/* --- Kitchen board ------------------------------------------------------------------ */
.board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; align-items: start; }
.board-col { display: grid; gap: 8px; align-content: start; min-height: 120px; padding: 8px; border-radius: var(--r-xl); background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--line-soft); }
.board-col-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; font-size: var(--fs-md); font-weight: 600; }
.board-col-head .badge { margin-left: auto; }
.ticket { display: grid; gap: 8px; padding: 11px 12px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-2); }
.ticket.is-new { animation: row-flash 2s var(--ease); }
.ticket-head { display: flex; align-items: baseline; gap: 8px; }
.ticket-no { font-size: 20px; font-weight: 700; letter-spacing: -.5px; color: var(--primary); font-variant-numeric: tabular-nums; }
.ticket-table { font-size: var(--fs-md); font-weight: 500; }
.ticket-time { margin-left: auto; font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ticket-items { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-md); }
.ticket-items li { display: flex; gap: 6px; }
.ticket-items b { min-width: 22px; font-weight: 600; color: var(--primary); }
.ticket-items em { display: block; font-style: normal; font-size: var(--fs-sm); color: var(--st-accent); }
.ticket-foot { display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--line); }
.ticket-foot .total { margin-right: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- Menu list ---------------------------------------------------------------------- */
.cat-list { display: grid; gap: 1px; padding: 6px; }
.cat-link { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 9px; border-radius: var(--r); color: var(--ink-2); font-size: 13px; text-decoration: none; }
.cat-link:hover { background: var(--nav-hover-bg); text-decoration: none; color: var(--ink); }
.cat-link.is-active { background: var(--nav-active-bg); color: var(--primary); font-weight: 600; }
.cat-link .count { margin-left: auto; font-size: var(--fs-sm); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.spicy { color: var(--red); font-size: var(--fs-sm); letter-spacing: -1px; }
.star { color: var(--orange); }

/* --- Mic level meter (voice tolerance) ------------------------------------------------- */
.meter-row { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r-lg); background: var(--surface-sub); box-shadow: var(--ring); }
.meter-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: var(--fs-md); }
.meter { position: relative; height: 12px; border-radius: 6px; background: var(--surface-alt); box-shadow: inset 0 0 0 1px var(--line-soft); overflow: visible; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: linear-gradient(90deg, var(--teal), var(--orange)); transition: width .25s var(--ease); }
.meter-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; border-radius: 1px; transition: left .25s var(--ease); }
.meter-mark.is-floor { background: var(--ink-4); }
.meter-mark.is-peak { background: var(--st-accent); }
.meter-mark.is-thr { top: -6px; bottom: -6px; width: 3px; background: var(--primary); box-shadow: 0 0 0 2px #FFF; }

/* --- Transcript ---------------------------------------------------------------------- */
.chat { display: grid; gap: 10px; padding: 14px 15px 16px; }
.msg { display: grid; gap: 3px; max-width: 78%; }
.msg-bubble { padding: 8px 11px; border-radius: 12px; font-size: var(--fs-base); line-height: 1.45; }
.msg-meta { font-size: var(--fs-xs); color: var(--ink-3); }
.msg.is-user { justify-self: end; text-align: right; }
.msg.is-user .msg-bubble { background: var(--primary); color: #FFF; border-bottom-right-radius: 4px; }
.msg.is-assistant .msg-bubble { background: var(--surface-alt); color: var(--ink); border-bottom-left-radius: 4px; box-shadow: inset 0 0 0 1px var(--line-soft); }
.msg.is-tool { justify-self: center; max-width: 92%; }
.msg.is-tool .msg-bubble { padding: 5px 10px; border-radius: var(--r); background: var(--st-accent-bg); color: var(--st-accent); box-shadow: inset 0 0 0 1px var(--st-accent-ln); font-family: var(--font-mono); font-size: 11.5px; }

/* --- Auth & public pages -------------------------------------------------------------- */
.auth-body { display: grid; place-items: center; min-height: 100vh; padding: 24px 16px; background: var(--page); }
.auth-card { width: min(420px, 100%); padding: 30px 28px; border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--sh-3); display: grid; gap: 18px; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand img { width: 36px; height: 36px; border-radius: var(--r-lg); }
.auth-brand strong { display: block; font-size: 15px; letter-spacing: -.2px; }
.auth-brand span { font-size: var(--fs-sm); color: var(--ink-3); }
.auth-card h1 { font-size: 20px; font-weight: 600; letter-spacing: -.5px; }
.auth-card p { color: var(--ink-2); font-size: var(--fs-base); }
.auth-foot { font-size: var(--fs-sm); color: var(--ink-3); text-align: center; }
.sassly-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 42px; border-radius: var(--r-xl); background: var(--grad-primary); color: #FFF; font-weight: 600; box-shadow: var(--sh-primary); text-decoration: none; }
.sassly-btn:hover { text-decoration: none; box-shadow: var(--sh-primary), 0 0 0 3px rgba(35, 61, 77, .14); }
.sassly-btn img { width: 20px; height: 20px; border-radius: 5px; background: #FFF; }

.site-body { background: var(--page); }
.site-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 max(16px, calc((100vw - 1080px) / 2)); background: rgba(255, 255, 255, .9); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.site-nav .brand-block { padding-left: 0; }
.site-nav-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-main { max-width: 1080px; margin: 0 auto; padding: 28px 16px 64px; display: grid; gap: 22px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 18px 0 8px; }
.hero h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.12; letter-spacing: -1.2px; font-weight: 700; }
.hero h1 span { color: var(--orange); }
.hero p { margin-top: 12px; color: var(--ink-2); font-size: 15px; max-width: 520px; }
.hero-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.hero-robot { aspect-ratio: 1; width: min(360px, 100%); justify-self: center; border-radius: 28px; background: var(--grad-dark); box-shadow: var(--sh-3); display: grid; place-items: center; overflow: hidden; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.menu-card { display: grid; gap: 4px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.menu-card-top { display: flex; gap: 8px; align-items: baseline; }
.menu-card-top strong { font-weight: 600; }
.menu-card-top .price { margin-left: auto; }
.menu-card p { font-size: var(--fs-md); color: var(--ink-3); }
.menu-card.is-off { opacity: .55; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; letter-spacing: -.2px; }

/* Docs */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.docs-toc { position: sticky; top: 72px; display: grid; gap: 1px; font-size: 13px; }
.docs-toc a { padding: 4px 8px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; }
.docs-toc a:hover { background: var(--nav-hover-bg); color: var(--ink); }
.docs-toc .nav-group { padding-left: 8px; }
.doc-section { display: grid; gap: 10px; padding-bottom: 8px; scroll-margin-top: 72px; }
.doc-section h2 { font-size: 17px; letter-spacing: -.3px; }
.doc-section h3 { font-size: 14px; margin-top: 6px; }
.doc-section p, .doc-section li { color: var(--ink-2); }
.doc-section ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; }
.endpoint { display: grid; gap: 10px; padding: 14px 15px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-2); }
.endpoint-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.method { display: inline-block; min-width: 54px; padding: 2px 7px; border-radius: var(--r-chip); font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-align: center; color: #FFF; background: var(--teal); }
.method.post { background: var(--orange); } .method.ws { background: var(--primary); } .method.patch { background: #8A6D1C; }
.endpoint-path { font-family: var(--font-mono); font-size: 13px; font-weight: 500; }
.endpoint-auth { margin-left: auto; }
pre.code { margin: 0; padding: 12px 14px; border-radius: var(--r-lg); background: #172A35; color: #E6EDF1; font-size: 12px; line-height: 1.55; overflow-x: auto; }
pre.code .c { color: #8FA4B2; }
.params { width: 100%; font-size: var(--fs-md); }
.params th, .params td { padding: 6px 8px; text-align: left; vertical-align: top; border-top: 1px solid var(--line-soft); }
.params th { color: var(--ink-3); font-weight: 500; font-size: var(--fs-sm); border-top: 0; }
.params td:first-child { font-family: var(--font-mono); font-size: 12px; white-space: nowrap; }

/* Pay page */
.pay-body { min-height: 100vh; display: grid; place-items: start center; padding: 28px 16px; background: var(--page); }
.pay-card { width: min(440px, 100%); display: grid; gap: 16px; padding: 24px 22px; border-radius: 14px; background: var(--surface); box-shadow: var(--sh-3); }
.pay-amount { font-size: 34px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.pay-lines { display: grid; gap: 6px; padding: 12px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); font-size: var(--fs-md); }
.pay-lines div { display: flex; gap: 8px; } .pay-lines span:last-child { margin-left: auto; font-variant-numeric: tabular-nums; }
.pay-status { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: var(--r-lg); background: var(--st-cool-bg); color: var(--st-cool); box-shadow: inset 0 0 0 1px var(--st-cool-ln); font-weight: 600; }
.pay-status.is-pending { background: var(--st-warm-bg); color: var(--st-warm); box-shadow: inset 0 0 0 1px var(--st-warm-ln); }
.pay-status.is-off { background: var(--st-hot-bg); color: var(--st-hot); box-shadow: inset 0 0 0 1px var(--st-hot-ln); }
.check-anim { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--st-cool-bg); color: var(--st-cool); box-shadow: inset 0 0 0 1px var(--st-cool-ln); }
.check-anim .icon { width: 30px; height: 30px; stroke-width: 2.5; }

/* --- Simulator ------------------------------------------------------------------------ */
.sim { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 14px; align-items: start; }
.sim-screen { position: relative; aspect-ratio: 1; width: 100%; border-radius: 28px; padding: 14px; background: #0C1116; box-shadow: var(--sh-3), inset 0 0 0 2px #1F2A33; }
.sim-screen canvas { width: 100%; height: 100%; border-radius: 16px; display: block; cursor: pointer; }
.sim-log { max-height: 460px; overflow-y: auto; }

/* --- Responsive ------------------------------------------------------------------------- */
@media (max-width: 1180px) {
    .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric:nth-child(3) { border-left: 0; }
    .metric:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
    .grid-main { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
    .app { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); height: auto; transform: translateX(-102%); visibility: hidden; transition: transform var(--dur) var(--ease-out), visibility 0s linear var(--dur); box-shadow: var(--sh-3); }
    .app.sidebar-open .sidebar { transform: none; visibility: visible; transition: transform var(--dur) var(--ease-out), visibility 0s; }
    .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(23, 42, 53, .32); opacity: 0; visibility: hidden; transition: opacity var(--dur), visibility 0s linear var(--dur); }
    .app.sidebar-open .sidebar-scrim { opacity: 1; visibility: visible; transition: opacity var(--dur), visibility 0s; }
    .nav-link { height: 38px; padding: 0 10px; font-size: 14px; }
    .menu-toggle { display: inline-grid; }
    .topbar { padding: 0 12px; }
    .user-pill-name { display: none; }
    .content { padding: 14px 14px 28px; }
    .grid-2, .grid-3, .sim, .hero, .docs { grid-template-columns: minmax(0, 1fr); }
    .docs-toc { position: static; }
    .table .col-opt { display: none; }
}
@media (max-width: 640px) {
    .input, .select, .textarea { font-size: 16px; }
    .board, .metrics { grid-template-columns: minmax(0, 1fr); }
    .metric { border-left: 0; border-top: 1px solid var(--line-soft); }
    .metric:first-child { border-top: 0; }
    .page-actions { margin-left: 0; }
    .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .kv dd { margin-bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
