/* ==========================================================================
   TANGANI — design system (vanilla CSS)
   Tegas: kontras tinggi, tipografi berat, sidebar charcoal, aksen amber.
   ========================================================================== */

:root {
    /* Token visual TANGANI (acuan: app-tangani). Nama variabel tetap, nilai mengikuti tema. */
    --amber: #c2691f;
    --amber-400: #e58a3c;
    --amber-500: #d97a2b;
    --amber-600: #b05e1b;
    --amber-700: #9e5318;
    --amber-50: #fdf2e7;
    --amber-100: #fbe2cb;
    --ink: #1f1d1b;
    --ink-2: #2b2824;
    --ink-3: #3d3934;
    --text: #1f1d1b;
    --muted: #5f5a53;
    --subtle: #9c958c;
    --bg: #f7f4ee;
    --surface: #ffffff;
    --surface-2: #faf7f2;
    --border: #e9e2d6;
    --border-soft: #f1ece4;
    --border-strong: #ddd4c6;
    --inverse-bg: #1f1d1b;
    --inverse-fg: #ffffff;

    --green: #3f7f51;
    --green-50: #eaf4ec;
    --violet: #6d60c2;
    --violet-50: #efedfb;
    --blue: #2f6bd8;
    --blue-50: #e9f0fd;
    --red: #c2493a;
    --red-50: #fdeeeb;
    --yellow: #b7860b;
    --yellow-50: #fff5da;
    --pink: #c84a7d;
    --pink-50: #fcebf2;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 1px 2px rgb(31 29 27 / .04), 0 12px 28px -18px rgb(31 29 27 / .18);
    --shadow: 0 2px 4px rgb(31 29 27 / .05), 0 18px 36px -18px rgb(31 29 27 / .24);
    --shadow-lg: 0 24px 60px -20px rgb(31 29 27 / .35);
    --shadow-amber: 0 10px 24px -10px rgb(194 105 31 / .55);
    --ring: 0 0 0 4px rgb(251 226 203 / .9);
    --glass: rgb(255 255 255 / .82);

    --sidebar-w: 288px;
    --font: "Onest", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Mode gelap: token yang sama diberi nilai gelap yang hangat. */
.dark {
    color-scheme: dark;
    --amber-50: #33220f;
    --amber-100: #452c14;
    --amber-600: #e58a3c;
    --amber-700: #f2a865;
    --ink: #f3eee6;
    --ink-2: #e6e0d6;
    --ink-3: #d3cbbf;
    --text: #f3eee6;
    --muted: #bab2a6;
    --subtle: #877f73;
    --bg: #14120f;
    --surface: #1e1b17;
    --surface-2: #24201b;
    --border: #353029;
    --border-soft: #2a2621;
    --border-strong: #463f36;
    --inverse-bg: #f3eee6;
    --inverse-fg: #1f1d1b;
    --green: #84c897;
    --green-50: #18271c;
    --violet: #b0a6f5;
    --violet-50: #221f37;
    --blue: #8fb4ff;
    --blue-50: #172238;
    --red: #f2907f;
    --red-50: #351b17;
    --yellow: #f0c24f;
    --yellow-50: #2e2510;
    --pink: #f39ac0;
    --pink-50: #34182a;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3), 0 12px 28px -18px rgb(0 0 0 / .6);
    --shadow: 0 2px 4px rgb(0 0 0 / .35), 0 18px 36px -18px rgb(0 0 0 / .7);
    --shadow-lg: 0 24px 60px -20px rgb(0 0 0 / .8);
    --shadow-amber: 0 10px 24px -12px rgb(217 122 43 / .45);
    --ring: 0 0 0 4px rgb(69 44 20 / .9);
    --glass: rgb(30 27 23 / .82);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    /* Cahaya hangat tipis di bagian atas agar latar tidak datar. */
    background-image:
        radial-gradient(60rem 28rem at 85% -10%, rgb(229 138 60 / .10), transparent 70%),
        radial-gradient(48rem 24rem at 10% -12%, rgb(138 127 214 / .08), transparent 70%);
    background-attachment: fixed;
    font-feature-settings: 'ss01', 'cv11';
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
.icon, .channel-icon { flex-shrink: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---------- Layout (acuan: app-tangani) ---------- */
.app { min-height: 100vh; }

/* Sidebar terang dengan efek kaca */
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--sidebar-w);
    display: flex; flex-direction: column;
    background: var(--glass); backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform .25s ease;
}
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 35; background: rgb(0 0 0 / .4);
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
.sidebar-top { display: grid; gap: 12px; padding: 24px 16px 0; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 24px 12px 12px; display: grid; gap: 4px; align-content: start; }
.sidebar-bottom { padding: 12px; }

/* Logo "lima jari" */
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-tile {
    width: 40px; height: 40px; border-radius: 16px; flex-shrink: 0;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--amber-400), #c2691f);
    box-shadow: var(--shadow-amber), inset 0 0 0 1px rgb(158 83 24 / .2);
}
.logo-tile svg { width: 24px; height: 24px; }
.logo-tile.sm { width: 32px; height: 32px; border-radius: 12px; }
.logo-tile.sm svg { width: 20px; height: 20px; }
.logo-text { min-width: 0; line-height: 1.15; }
.logo-text b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.logo-text small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--amber-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.switcher {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    padding: 8px; border-radius: 16px; border: 1px solid transparent; background: none; cursor: pointer; text-align: left;
    transition: background .15s, border-color .15s;
}
.switcher:hover, details[open] > .switcher { background: var(--bg); border-color: var(--border); }
.switcher .icon { color: var(--subtle); }
.tenant-switch {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    padding: 9px 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border);
    font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer;
}
.tenant-switch:hover { color: var(--ink); border-color: var(--border-strong); }
.tenant-switch span { display: flex; align-items: center; gap: 8px; min-width: 0; }

.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--subtle); padding: 0 12px 6px; font-weight: 700; }
.nav-group { padding-top: 20px; display: grid; gap: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    color: var(--muted); font-weight: 600; font-size: 14px;
    transition: background .15s, color .15s;
}
.nav-link .icon { color: var(--subtle); transition: color .15s; }
.nav-link:hover { background: var(--bg); color: var(--ink); }
.nav-link:hover .icon { color: var(--amber-600); }
.nav-link.active { background: linear-gradient(to bottom, var(--amber-500), #c2691f); color: #fff; box-shadow: var(--shadow-amber); }
.nav-link.active .icon { color: #fff; }
.nav-link span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.profile-card {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 12px; border-radius: 16px; cursor: pointer; text-align: left;
    background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--border);
    transition: background .15s, border-color .15s;
}
.profile-card:hover { background: var(--bg); border-color: var(--border-strong); }
.profile-card b { display: block; font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-card small { display: block; font-size: 12px; color: var(--muted); }
.dropdown-menu.up { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; }

/* Kolom konten */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; max-width: 1472px; margin: 0 auto; min-width: 0; padding: 24px 16px 32px; }

/* Header */
.app-header {
    position: sticky; top: 0; z-index: 20;
    background: var(--glass); backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border);
}
.app-header .bar { display: flex; align-items: center; gap: 12px; max-width: 1472px; margin: 0 auto; padding: 10px 16px; }
.app-header .bar.desktop { display: none; }
.app-header .open-nav { border: 0; background: none; padding: 4px; margin-left: -4px; border-radius: 16px; cursor: pointer; text-align: left; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; font-weight: 600; color: var(--muted); }
.crumbs .icon { color: var(--subtle); }
.crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs .mod { color: var(--amber-700); }
.crumbs .cur { color: var(--ink); }
.header-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-shrink: 0; }
.tool-btn {
    position: relative; width: 44px; height: 44px; flex-shrink: 0;
    display: inline-grid; place-items: center; border-radius: 12px; cursor: pointer;
    background: var(--surface); color: var(--ink); border: 1px solid var(--border);
    transition: background .15s, border-color .15s;
}
.tool-btn:hover { background: var(--bg); border-color: var(--border-strong); }
.tool-btn .badge-count {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 99px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
    background: linear-gradient(to bottom, var(--amber-500), #c2691f); box-shadow: 0 0 0 2px var(--surface);
}
.theme-toggle .sun { display: none; color: var(--amber-500); }
.dark .theme-toggle .sun { display: block; }
.dark .theme-toggle .moon { display: none; }
.demo-label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--amber-50); color: var(--amber-700); font-size: 12px; font-weight: 700; border: 1px solid color-mix(in srgb, var(--amber) 25%, transparent); white-space: nowrap; }
.demo-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber-500); }
.account-btn { display: flex; align-items: center; gap: 6px; padding: 2px 8px 2px 2px; border-radius: 99px; border: 1px solid var(--border); background: none; cursor: pointer; }
.account-btn:hover { background: var(--bg); }
.account-btn .icon { color: var(--subtle); }

.quick-search { position: relative; width: 100%; max-width: 384px; margin-left: auto; }
.quick-search > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; }
.quick-search input {
    width: 100%; height: 40px; padding: 0 44px 0 40px; border-radius: 12px; font-size: 14px; font-weight: 500;
    border: 1px solid var(--border); background: color-mix(in srgb, var(--bg) 70%, transparent); outline: none;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.quick-search input:focus { border-color: var(--amber-500); background: var(--surface); box-shadow: var(--ring); }
.quick-search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 1px 6px; border-radius: 6px; font: 700 11px var(--font); color: var(--subtle); background: var(--surface); border: 1px solid var(--border); pointer-events: none; }
.quick-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); display: grid; }
.quick-results a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; color: var(--ink); }
.quick-results a small { font-size: 12px; color: var(--subtle); font-weight: 600; }
.quick-results a.active { background: var(--amber-50); color: var(--amber-700); }
.quick-results .none { padding: 10px 12px; color: var(--muted); font-size: 13px; }

.notif-item { display: block; padding: 8px 10px; border-radius: 8px; }
.notif-item:hover { background: var(--bg); }
.notif-item p { font-size: 14px; color: var(--ink); font-weight: 600; }
.notif-item p.read { color: var(--muted); font-weight: 500; }
.notif-item small { font-size: 12px; color: var(--subtle); }

/* Footer */
.footer-wrap { width: 100%; max-width: 1472px; margin: 0 auto; padding: 0 16px 96px; }
.app-footer { border-top: 1px solid var(--border); padding: 20px 0 8px; }
.app-footer .top { display: flex; flex-direction: column; gap: 16px; font-size: 14px; }
.app-footer .brand b { display: block; font-weight: 700; color: var(--ink); }
.app-footer .brand small { display: block; font-size: 12px; color: var(--muted); }
.app-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; color: var(--muted); }
.app-footer nav a:hover { color: var(--amber-700); }
.app-footer .bottom { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; font-size: 12px; color: var(--subtle); }
@media (min-width: 640px) {
    .app-footer .top, .app-footer .bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* Menu bawah ponsel */
.mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--glass); backdrop-filter: blur(24px);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav .inner { max-width: 512px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 6px 8px; }
.mobile-nav a, .mobile-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border-radius: 16px;
    font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--muted); background: none; border: 0; cursor: pointer; min-width: 0;
}
.mobile-nav .pillicon { display: inline-grid; place-items: center; width: 48px; height: 32px; border-radius: 99px; transition: background .15s; }
.mobile-nav a:hover .pillicon, .mobile-nav button:hover .pillicon { background: var(--bg); }
.mobile-nav .label { width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-nav .active { color: var(--amber-700); }
.mobile-nav .active .pillicon { background: linear-gradient(to bottom, var(--amber-500), #c2691f); color: #fff; box-shadow: var(--shadow-amber); }

@media (min-width: 640px) {
    .main { padding: 24px 24px 32px; }
    .app-header .bar, .footer-wrap { padding-left: 24px; padding-right: 24px; }
}
@media (min-width: 1100px) {
    .sidebar { transform: none; }
    .sidebar-backdrop, .mobile-nav, .app-header .bar.mobile { display: none; }
    .app-header .bar.desktop { display: flex; height: 64px; gap: 24px; padding: 0 40px; }
    .shell { padding-left: var(--sidebar-w); }
    .main { padding: 28px 40px 32px; }
    .footer-wrap { padding: 0 40px 24px; }
}

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(22px, 2.3vw, 30px); font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.page-head .sub { margin-top: 4px; color: var(--muted); font-size: 14px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.page-meta { width: 100%; text-align: right; font-size: 12px; color: var(--subtle); margin-top: -12px; }
@media (max-width: 640px) {
    .page-actions { width: 100%; }
    .page-actions > * { flex: 1 1 auto; }
    .page-meta { text-align: left; margin-top: -6px; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 16px; border-radius: 10px;
    border: 1px solid transparent; background: none;
    font-weight: 700; font-size: 14px; white-space: nowrap; cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, transform .05s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn-primary { background: linear-gradient(to bottom, var(--amber-500), #c2691f); color: #fff; box-shadow: var(--shadow-amber); }
.btn-primary:hover { background: linear-gradient(to bottom, #c2691f, #a9561a); }
.btn-dark { background: var(--inverse-bg); color: var(--inverse-fg); }
.btn-dark:hover { opacity: .9; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-outline-amber { background: var(--surface); border-color: var(--amber); color: var(--amber-600); }
.btn-outline-amber:hover { background: var(--amber-50); }
.btn-outline-violet { background: var(--surface); border-color: var(--violet); color: var(--violet); }
.btn-outline-violet:hover { background: var(--violet-50); }
.btn-soft { background: var(--amber-50); color: var(--amber-700); }
.btn-soft:hover { background: var(--amber-100); }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { min-height: 0; width: 34px; height: 34px; padding: 0; border-radius: 8px; }
.link { color: var(--amber-600); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { color: var(--amber-700); text-decoration: underline; text-underline-offset: 3px; }
.link-muted { color: var(--muted); font-weight: 600; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    padding: 20px; min-width: 0;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.card-head .grow { flex: 1; min-width: 0; }
.card-title { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card-head .end { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.card-foot { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-head { padding: 20px 20px 0; }
.card-dark { background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--inverse-bg); }
.card-dark .card-title { color: var(--inverse-fg); }
.card-dark .card-sub { color: #b9b0a3; }
@media (min-width: 768px) { .card { padding: 22px 24px; } .card-flush { padding: 0; } .card-flush .card-head { padding: 22px 24px 0; } }

.tile {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center;
    background: var(--amber-50); color: var(--amber);
}
.tile-sm { width: 32px; height: 32px; border-radius: 9px; }
.tile-lg { width: 48px; height: 48px; border-radius: 14px; }
.tone-amber { background: var(--amber-50); color: var(--amber); }
.tone-green { background: var(--green-50); color: var(--green); }
.tone-violet { background: var(--violet-50); color: var(--violet); }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-red { background: var(--red-50); color: var(--red); }
.tone-yellow { background: var(--yellow-50); color: var(--yellow); }
.tone-pink { background: var(--pink-50); color: var(--pink); }
.tone-neutral { background: var(--border-soft); color: var(--muted); }
.tone-dark { background: var(--inverse-bg); color: var(--inverse-fg); }

/* ---------- Grid ---------- */
.stack { display: grid; gap: 16px; align-content: start; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-stats { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.grid-main, .grid-main-wide, .grid-2, .grid-3, .grid-studio { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid-tight { gap: 12px; }
.section-gap { margin-bottom: 16px; }
@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
    .grid-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid-stats.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
    .grid-main-wide { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) {
    .grid-studio { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, .95fr); }
}
@media (max-width: 340px) {
    .grid-stats { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Stats ---------- */
.stat { display: flex; gap: 14px; align-items: flex-start; position: relative; overflow: hidden; }
.stat .body { min-width: 0; flex: 1; }
.stat .label { font-weight: 700; color: var(--ink-3); font-size: 14px; }
.stat .value { font-size: clamp(22px, 2.1vw, 30px); font-weight: 800; letter-spacing: -.035em; color: var(--ink); line-height: 1.1; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .value small { font-size: .62em; color: var(--muted); font-weight: 700; letter-spacing: -.02em; }
.stat .hint { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.stat .progress { margin-top: 12px; }
.hint-good { color: var(--green) !important; }
.hint-warn { color: var(--amber-600) !important; }
.hint-bad { color: var(--red) !important; }
@media (max-width: 640px) {
    .stat { flex-direction: column; gap: 10px; }
    .stat .tile { width: 34px; height: 34px; border-radius: 10px; }
}

/* ---------- Progress ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--amber); transition: width .6s ease; }
.progress.violet > span { background: var(--violet); }
.progress.green > span { background: var(--green); }
.progress.blue > span { background: var(--blue); }
.progress-lg { height: 12px; }

/* ---------- Pills / chips ---------- */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 99px;
    font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.4;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-lg { padding: 7px 14px; font-size: 13px; }
.xp { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--yellow-50); color: #8a5d00; font-weight: 800; font-size: 13px; }
.xp .icon { color: #e3a008; fill: #f5b82e; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px;
    border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer;
}
.chip input { display: none; }
.chip:has(input:checked) { border-color: var(--amber); background: var(--amber-50); color: var(--amber-700); }
.kbd { font-family: ui-monospace, Menlo, monospace; font-size: 12px; padding: 2px 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }

/* ---------- Avatars ---------- */
.avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: inline-grid; place-items: center;
    font-weight: 800; font-size: 13px;
    border: 2px solid var(--surface);
}
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-lg { width: 44px; height: 44px; font-size: 17px; }
.avatar-xl { width: 52px; height: 52px; font-size: 20px; }
.av-0 { background: var(--pink-50); color: var(--pink); }
.av-1 { background: var(--blue-50); color: var(--blue); }
.av-2 { background: var(--green-50); color: var(--green); }
.av-3 { background: var(--violet-50); color: var(--violet); }
.av-4 { background: var(--yellow-50); color: var(--yellow); }
.av-5 { background: var(--amber-50); color: var(--amber); }
.avatar-stack { display: flex; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.who { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-3); min-width: 0; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 16px; font-weight: 700; color: var(--muted); white-space: nowrap;
    border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--amber-600); border-bottom-color: var(--amber); }
.tab-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.tab-card {
    display: flex; align-items: center; gap: 10px; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    font-weight: 700; color: var(--ink-3);
}
.tab-card:hover { border-color: var(--border-strong); }
.tab-card.active { border-color: var(--amber); background: var(--amber-50); color: var(--amber-700); box-shadow: inset 0 -3px 0 var(--amber); }
@media (min-width: 768px) { .tab-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .tab-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.segmented a, .segmented button { padding: 7px 16px; border-radius: 9px; font-weight: 700; color: var(--muted); border: 0; background: none; cursor: pointer; }
.segmented .active { background: linear-gradient(to bottom, var(--amber-500), #c2691f); color: #fff; box-shadow: var(--shadow-amber); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; text-transform: none; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--amber-50) 40%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-plain { border: 0; border-radius: 0; }
.table-plain .table th { background: none; padding-left: 0; }
.table-plain .table td { padding-left: 0; }
.t-strong { font-weight: 700; color: var(--ink); }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex-shrink: 0; display: grid; place-items: center; font-weight: 800; }

/* ---------- Forms ---------- */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.help { font-size: 12px; color: var(--muted); }
.error-text { font-size: 12px; color: var(--red); font-weight: 600; }
.input, .select, .textarea {
    width: 100%; min-height: 44px; padding: 10px 14px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    font-size: 14px; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b6358' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--amber); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-2); }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input, .input-icon .select { padding-left: 40px; }
.field-row { display: grid; gap: 6px; }
@media (min-width: 640px) {
    .field-row { grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 12px; }
    .field-row.top { align-items: start; }
    .field-row.top > .label { padding-top: 12px; }
}
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-2 { grid-column: span 2; } }
.counter { font-size: 12px; color: var(--subtle); text-align: right; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

.switch { position: relative; display: inline-flex; width: 48px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong); cursor: pointer; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + span { background: var(--amber); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { box-shadow: var(--ring); }

.color-swatch { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--border); box-shadow: inset 0 0 0 3px rgba(255,255,255,.6); }
input[type="color"].color-input { width: 52px; height: 52px; padding: 0; border: 1px solid var(--border); border-radius: 50%; cursor: pointer; background: none; }
input[type="color"].color-input::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"].color-input::-webkit-color-swatch { border: 0; border-radius: 50%; }

/* ---------- Alerts / notes ---------- */
.note { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-3); font-size: 13px; font-weight: 600; }
.note .icon { color: var(--amber); }
.note-violet { background: var(--violet-50); border-color: color-mix(in srgb, var(--violet) 30%, transparent); color: var(--violet); }
.note-violet .icon { color: var(--violet); }
.note-amber { background: var(--amber-50); border-color: var(--amber-100); color: var(--amber-700); }
.flash-stack { position: fixed; z-index: 80; right: 16px; bottom: 16px; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.flash {
    display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius);
    background: var(--inverse-bg); color: var(--inverse-fg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px;
    animation: flash-in .25s ease;
}
.flash .icon { color: #7ddba8; margin-top: 1px; }
.flash.error .icon { color: #ff9b9b; }
.flash button { margin-left: auto; background: none; border: 0; color: #b9b0a3; cursor: pointer; padding: 0; }
@keyframes flash-in { from { transform: translateY(10px); opacity: 0; } }

/* ---------- Lists ---------- */
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--muted); font-size: 12px; }
.row-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 16px; }
.time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-3); width: 46px; flex-shrink: 0; }
.bullet { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--amber); }
.bullet.green { background: var(--green); } .bullet.violet { background: var(--violet); } .bullet.blue { background: var(--blue); } .bullet.neutral { background: var(--subtle); }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty .tile { margin: 0 auto 10px; }
.empty b { display: block; color: var(--ink); margin-bottom: 4px; }

/* KPI table bars */
.kpi-table td .progress { min-width: 120px; }
.pct { font-weight: 800; color: var(--amber-600); font-variant-numeric: tabular-nums; }
.pct.violet { color: var(--violet); } .pct.green { color: var(--green); }

/* ---------- Journey ---------- */
.journey { display: grid; gap: 0; }
.journey-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.journey-step:last-child { padding-bottom: 0; }
.journey-step::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.journey-step:last-child::before { display: none; }
.journey-step.done::before { background: var(--green); }
.journey-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; background: var(--border-soft); color: var(--muted); position: relative; z-index: 1; }
.journey-step.done .journey-dot { background: var(--green); color: #fff; }
.journey-step.current .journey-dot { background: var(--amber); color: #fff; box-shadow: 0 0 0 5px var(--amber-50); }
.journey-step b { display: block; font-size: 14px; color: var(--ink); }
.journey-step.current b { color: var(--amber-600); }
.journey-step small { color: var(--muted); font-size: 12px; }
.journey-compact .journey-step { padding-bottom: 8px; }
.journey-compact .journey-step::before { display: none; }
.journey-compact .journey-step > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; align-items: baseline; }

/* ---------- Calendar ---------- */
.cal-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.cal-toolbar .range { display: inline-flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 42px; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; font-weight: 700; }
.cal-toolbar .filters { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.cal-toolbar .filters .select { min-height: 42px; width: auto; min-width: 130px; }
.cal-shell { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1280px) { .cal-shell { grid-template-columns: minmax(0, 1fr) 340px; } }
.cal-week { overflow-x: auto; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(7, minmax(118px, 1fr)); min-width: 900px; }
.cal-grid .day-head { padding: 12px 6px; text-align: center; font-weight: 700; color: var(--ink-3); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); font-size: 13px; }
.cal-grid .day-head small { display: block; color: var(--muted); font-weight: 600; }
.cal-grid .day-head.today { color: var(--amber-600); background: var(--amber-50); }
.cal-grid .day-head.today small { color: var(--amber-600); }
.cal-hours { display: grid; }
.cal-hour { height: 64px; font-size: 11px; color: var(--subtle); text-align: right; padding: 0 8px; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px); background-size: 100% 64px; }
.cal-col.today { background-color: color-mix(in srgb, var(--amber-50) 45%, transparent); }
.cal-event {
    position: absolute; left: 5px; right: 5px; z-index: 1;
    padding: 8px 9px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
    box-shadow: var(--shadow-sm); font-size: 12px; overflow: hidden; display: grid; gap: 3px; align-content: start;
    transition: box-shadow .15s, transform .15s;
}
.cal-event:hover { box-shadow: var(--shadow); transform: translateY(-1px); z-index: 2; }
.cal-event.selected { border: 2px solid var(--amber); box-shadow: 0 0 0 4px var(--amber-50); z-index: 3; }
.cal-event b { font-size: 12.5px; color: var(--ink); line-height: 1.25; }
.cal-event .meta { color: var(--muted); font-size: 11px; }
.cal-event .foot { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.cal-event.s-review { background: color-mix(in srgb, var(--violet-50) 70%, var(--surface)); border-color: color-mix(in srgb, var(--violet) 25%, var(--border)); }
.cal-event.s-draft { background: color-mix(in srgb, var(--amber-50) 70%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 25%, var(--border)); }
.cal-event.s-published { background: color-mix(in srgb, var(--green-50) 70%, var(--surface)); border-color: color-mix(in srgb, var(--green) 25%, var(--border)); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px 28px; padding: 14px 18px; }
.cal-legend div { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; color: var(--muted); }
.cal-legend b { display: block; color: var(--ink-3); font-size: 13px; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--border); border-left: 1px solid var(--border); }
.cal-month .dh { padding: 8px; font-size: 12px; font-weight: 700; color: var(--muted); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cal-month .cell { min-height: 112px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: grid; gap: 4px; align-content: start; }
.cal-month .cell.out { background: var(--surface-2); color: var(--subtle); }
.cal-month .cell.today .n { background: var(--amber); color: #fff; }
.cal-month .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.cal-month .ev { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 6px; border-radius: 6px; background: var(--surface-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.cal-month .ev:hover { background: var(--amber-50); }
@media (max-width: 700px) { .cal-month .cell { min-height: 72px; } .cal-month .ev span { display: none; } }

/* Preview slides */
.slides { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
.slide {
    scroll-snap-align: start; flex: 0 0 auto; width: 132px; aspect-ratio: 4/5; border-radius: 12px; padding: 12px;
    background: linear-gradient(160deg, #fdebd6, #f7d3ad); color: var(--amber-700);
    display: flex; flex-direction: column; justify-content: space-between; font-weight: 800; font-size: 12px; line-height: 1.25;
}
.slide.first { width: 150px; background: linear-gradient(160deg, #fff4e6, #f3c895); color: var(--amber-700); font-size: 17px; }
.slide .num { width: 22px; height: 22px; border-radius: 50%; background: var(--amber); color: #fff; display: grid; place-items: center; font-size: 11px; }
.slide small { font-size: 9px; letter-spacing: .08em; color: var(--ink); }

.draft-hero {
    position: relative; border-radius: var(--radius); overflow: hidden; min-height: 300px; padding: 22px;
    background: radial-gradient(120% 100% at 100% 100%, #f3c48f 0%, #fbe7d2 45%, #fff8ef 100%);
    display: flex; flex-direction: column; justify-content: space-between;
}
.draft-hero .count { position: absolute; top: 14px; right: 14px; background: rgba(23,20,15,.75); color: #fff; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.draft-hero h3 { font-size: clamp(26px, 3.2vw, 38px); font-weight: 800; letter-spacing: -.035em; color: var(--ink); max-width: 13ch; line-height: 1.05; }
.draft-hero h3 em { font-style: normal; color: var(--amber); }
.draft-hero p { font-size: 17px; font-weight: 600; margin-top: 12px; max-width: 22ch; color: var(--ink-2); }
.draft-hero .bar { width: 44px; height: 4px; border-radius: 99px; background: var(--amber); margin-top: 18px; }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.thumbs button {
    aspect-ratio: 1; border-radius: 10px; border: 2px solid transparent; background: #fbefe2; padding: 6px; text-align: left;
    font-size: 9.5px; font-weight: 700; color: var(--ink-3); cursor: pointer; overflow: hidden; position: relative; line-height: 1.2;
}
.thumbs button.active { border-color: var(--amber); }
.thumbs button i { position: absolute; left: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-3); color: #fff; font-style: normal; display: grid; place-items: center; font-size: 10px; }
.thumbs button.active i { background: var(--amber); }

.check-list { display: grid; gap: 16px; }
.check-item { display: flex; gap: 12px; }
.check-item .tile { width: 30px; height: 30px; border-radius: 50%; }
.check-item b { display: block; color: var(--ink); }
.check-item small { color: var(--muted); font-size: 13px; }
.check-item.warn b { color: var(--amber-600); }

/* Integrations */
.integration-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .integration-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.integration { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; align-content: space-between; background: var(--surface); }
.integration .top { display: flex; gap: 14px; align-items: flex-start; }
.integration h4 { font-size: 17px; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.integration .bottom { display: flex; gap: 12px; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* Badges */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.badge-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 10px; text-align: center; display: grid; gap: 4px; justify-items: center; }
.badge-card .hex { width: 48px; height: 52px; display: grid; place-items: center; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); margin-bottom: 4px; }
.badge-card b { font-size: 13px; color: var(--ink); }
.badge-card small { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.badge-card.locked { opacity: .5; filter: grayscale(1); }

.contrib { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .contrib { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.contrib > div { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; }
.contrib b { font-weight: 700; }
.contrib .big { font-size: 24px; font-weight: 800; grid-column: 2; line-height: 1; }
.contrib small { grid-column: 2; color: var(--muted); font-size: 12px; }

/* ---------- Modal (dialog) ---------- */
dialog.modal {
    width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0;
    border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); color: var(--text);
}
dialog.modal.wide { width: min(860px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(23, 20, 15, .5); backdrop-filter: blur(2px); }
dialog.modal[open] { animation: modal-in .2s ease; }
@keyframes modal-in { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { font-size: 18px; font-weight: 800; }
.modal-head .btn-icon { margin-left: auto; }
.modal-body { padding: 20px 22px; display: grid; gap: 14px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--surface-2); position: sticky; bottom: 0; }

/* Dropdown (details) */
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 200px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
    display: grid;
}
.dropdown-menu.left { right: auto; left: 0; }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: none; text-align: left; font-weight: 600; cursor: pointer; font-size: 13.5px; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); }
.dropdown-menu .active { color: var(--amber-600); background: var(--amber-50); }
.dropdown-menu .danger { color: var(--red); }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.sidebar .dropdown-menu { left: 0; right: 0; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--muted); }
.pagination .pages { display: flex; gap: 4px; }
.pagination a, .pagination span.cur { min-width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-weight: 700; padding: 0 10px; }
.pagination span.cur { background: linear-gradient(to bottom, var(--amber-500), #c2691f); color: #fff; border-color: transparent; box-shadow: var(--shadow-amber); }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 960px) { .auth { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.auth-hero { display: none; background: #1f1d1b; color: #fff; padding: 48px; position: relative; overflow: hidden; }
@media (min-width: 960px) { .auth-hero { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -160px; bottom: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(194,105,31,.55), transparent 65%); }
.auth-hero h2 { font-size: 48px; font-weight: 800; letter-spacing: -.04em; max-width: 12ch; line-height: 1.02; position: relative; z-index: 1; }
.auth-hero h2 em { font-style: normal; color: #f0a35e; }
.auth-hero p { color: #c9c0b4; font-size: 16px; max-width: 42ch; margin-top: 16px; position: relative; z-index: 1; }
.auth-main { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.auth-card-wide { width: min(600px, 100%); }
.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.plan-option { position: relative; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.plan-option:hover { border-color: var(--border-strong); }
.plan-option input { position: absolute; opacity: 0; }
.plan-option:has(input:checked) { border-color: var(--amber); background: var(--amber-50); box-shadow: inset 0 -3px 0 var(--amber); }
.plan-option:has(input:focus-visible) { box-shadow: var(--ring); }
.plan-option:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.module-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.module-checks .plan-option { grid-auto-flow: column; align-items: center; gap: 8px; padding: 9px 12px; font-weight: 700; }
@media (max-width: 520px) { .plan-grid { grid-template-columns: minmax(0, 1fr); } }
.demo-accounts { margin-top: 22px; border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 14px; font-size: 13px; }
.demo-accounts button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.demo-accounts button:hover { background: var(--surface); }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.subtle { color: var(--subtle); }
.strong { font-weight: 800; color: var(--ink); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flex { display: flex; align-items: center; gap: 10px; min-width: 0; }
.flex-col { display: flex; flex-direction: column; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.gap-sm { gap: 6px; }
.gap-lg { gap: 16px; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 18px; } .mt-4 { margin-top: 24px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 18px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.big-number { font-size: clamp(32px, 4vw, 44px); font-weight: 800; letter-spacing: -.04em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.big-number small { font-size: .55em; color: var(--ink-3); }
.green { color: var(--green); } .violet { color: var(--violet); } .amber { color: var(--amber-600); } .red { color: var(--red); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 640px) { .hide-sm { display: none !important; } }
@media (min-width: 641px) { .show-sm { display: none !important; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Penyesuaian responsif ---------- */
.note .xp { flex-shrink: 0; }
@media (max-width: 640px) {
    .row .title { white-space: normal; }
    .kpi-table td .progress { min-width: 56px; }
    .table th, .table td { padding: 11px 10px; }
    .card-head .end { margin-left: 0; }
    .card-head { flex-wrap: wrap; }
    .card-head .grow { flex-basis: calc(100% - 60px); }
}

@media (max-width: 1099px) { .flash-stack { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.dropdown-menu a[aria-disabled="true"] { cursor: default; }
.dropdown-menu a[aria-disabled="true"]:hover { background: none; }
.amber { color: var(--amber-700); }
.crumbs { flex: 0 1 auto; }
.crumbs .mod, .crumbs .cur, .crumbs .icon { flex-shrink: 0; }
.app-header .quick-search { flex: 1 1 240px; }
.mobile-nav .inner { gap: 2px; padding: 6px 4px; }
.mobile-nav a, .mobile-nav button { padding: 6px 2px; }
.page-head { margin-bottom: 18px; align-items: center; }
.page-actions .btn { min-height: 42px; }
.page-actions .select { min-height: 42px; }
.app-footer .copyright { font-size: 12px; color: var(--subtle); }
.stat .value { overflow-wrap: anywhere; }

/* Tombol titik tiga di samping nama perusahaan: buka/tutup sidebar */
.crumb-toggle {
    display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 6px; flex-shrink: 0;
    border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.crumb-toggle:hover { background: var(--amber-50); color: var(--amber-700); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.crumb-toggle .icon { color: inherit; }
@media (min-width: 1100px) {
    .sidebar-anim .sidebar, .sidebar-anim .shell { transition: transform .25s ease, padding-left .25s ease; }
    .sidebar-collapsed .sidebar { transform: translateX(-100%); }
    .sidebar-collapsed .shell { padding-left: 0; }
    .sidebar-collapsed .crumb-toggle { background: var(--amber-50); color: var(--amber-700); }
}
/* Sidebar ditutup: halaman memakai lebar penuh kiri-kanan. */
@media (min-width: 1100px) {
    .sidebar-collapsed .main,
    .sidebar-collapsed .app-header .bar,
    .sidebar-collapsed .footer-wrap { max-width: none; }
}
/* Footer ringkas: satu baris */
.app-footer { padding: 12px 0 4px; }
.app-footer .top { gap: 6px; font-size: 13px; }
.app-footer .brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.app-footer .brand b { display: inline; font-size: 13px; }
.app-footer .brand small { display: inline; font-size: 12px; }
.logo-tile.xs { width: 22px; height: 22px; border-radius: 7px; box-shadow: none; }
.logo-tile.xs svg { width: 15px; height: 15px; }
@media (min-width: 1100px) { .footer-wrap { padding-bottom: 12px; } }
