/* ================================================================
   SIGMA - App Shell Layout
   File 3 of 5: Sidebar, navbar, main column, content, footer.
   Depends on: sigma-tokens.css, sigma-base.css
   ================================================================ */

/* ----------------------------------------------------------------
   App body
   ---------------------------------------------------------------- */
body.sigma-app {
    margin: 0;
    font-family: var(--font);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100dvh;
}
body.sigma-app a      { text-decoration: none; }
body.sigma-app button { font-family: inherit; }

/* ----------------------------------------------------------------
   App root - flex row: sidebar + main
   ---------------------------------------------------------------- */
.app-root {
    display: flex;
    min-height: 100dvh;
    position: relative;
    z-index: 1;
}

/* ================================================================
   Sidebar - theme-aware
   ================================================================ */
.app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100dvh;
    width: var(--sidebar-w);
    background: var(--surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sticky);
    overflow: hidden;
    transition: width var(--t-spring), transform var(--t-spring);
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.05);
    isolation: isolate;
}

/* ----------------------------------------------------------------
   Sidebar ambient orbs (aurora / bokeh effect)
   ---------------------------------------------------------------- */
.sidebar-forest {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(
        ellipse 120px 100px at 80% 55%,
        rgba(8,110,55,0.16) 0%,
        transparent 70%
    );
}
[data-theme="light"] .sidebar-forest {
    opacity: 0.5;
}
.sidebar-forest::before {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(20,220,110,0.21) 0%,
        rgba(14,175,82,0.13) 28%,
        rgba(8,120,55,0.05) 55%,
        transparent 75%
    );
    top: -140px;
    left: -120px;
    will-change: transform;
    animation: orb-drift-a 26s ease-in-out infinite alternate;
    transform: translate3d(0,0,0);
}
.sidebar-forest::after {
    content: "";
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(8,158,76,0.24) 0%,
        rgba(6,118,58,0.13) 30%,
        rgba(4,80,40,0.05) 56%,
        transparent 76%
    );
    bottom: -70px;
    right: -120px;
    will-change: transform;
    animation: orb-drift-b 34s ease-in-out infinite alternate;
    animation-delay: -16s;
    transform: translate3d(0,0,0);
}

/* ----------------------------------------------------------------
   Sidebar header (brand row)
   ---------------------------------------------------------------- */
.sidebar-header {
    height: var(--navbar-h);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-4);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* ----------------------------------------------------------------
   Sidebar brand (logo + name)
   ---------------------------------------------------------------- */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Brand SIGMA — wordmark lockup (expanded) + Σ mark (collapsed), theme-aware.
   Exactly one <img> visible per (theme × collapse) state. Dark = default :root. */
.sidebar-brand .brand-lockup,
.sidebar-brand .brand-mark { display: none; }
.sidebar-brand .brand-lockup {
    height: 34px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.sidebar-brand .brand-mark {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    object-fit: contain;
    transition: transform var(--t-base, var(--t-fast));
}
/* Expanded: show lockup by theme (prefix .sidebar-brand so specificity beats the hide rule above) */
.sidebar-brand .brand-lockup--dark { display: block; }
[data-theme="light"] .sidebar-brand .brand-lockup--dark  { display: none; }
[data-theme="light"] .sidebar-brand .brand-lockup--light { display: block; }
.sidebar-brand:hover .brand-mark { transform: scale(1.04); }

.sidebar-brand__text {
    min-width: 0;
    overflow: hidden;
    transition: opacity var(--t-slow), max-width var(--t-slow);
    max-width: 10rem;
    line-height: 1;
}
.sidebar-brand__name {
    font-family: var(--font);
    font-weight: 900;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.1;
    white-space: nowrap;
}
.sidebar-brand__version {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-family: var(--font);
    font-weight: 500;
    color: var(--text-muted);
    opacity: 0.85;
    white-space: nowrap;
}
[data-theme="light"] .sidebar-brand__version {
    background: var(--accent-light);
    color: var(--accent);
}

/* ----------------------------------------------------------------
   Sidebar navigation
   ---------------------------------------------------------------- */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: var(--sp-2) var(--sp-2);
    display: flex;
    flex-direction: column;
    gap: 2px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    position: relative;
    z-index: 1;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Section label - elegant with trailing line */
.sidebar-section {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: var(--sp-5) var(--sp-2) var(--sp-1);
    white-space: nowrap;
}
.sidebar-section::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    border-radius: 1px;
}
.sidebar-nav > .sidebar-section:first-child {
    padding-top: var(--sp-2);
}

/* Nav link */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0 var(--sp-2);
    /* height: 2.35rem; */
    min-height: 38px;
    height: 38px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

/* ───────────────────────────────────────────────────────────────────
   Staggered slide-in entrance - semua entry di sidebar-nav
   (direct .sidebar-link, .sidebar-group toggle, section label)
   tampil berurutan dari atas saat halaman load.

   Catatan: target adalah DIRECT children dari .sidebar-nav agar
   stagger sesuai urutan visual (campuran sidebar-link, sidebar-group,
   sidebar-section). Sub-link di dalam group punya animasi sendiri.
   ─────────────────────────────────────────────────────────────────── */
.sidebar-nav > .sidebar-link,
.sidebar-nav > .sidebar-group,
.sidebar-nav > .sidebar-section {
    animation: sidebar-item-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.sidebar-nav > *:nth-child(1)  { animation-delay:  40ms; }
.sidebar-nav > *:nth-child(2)  { animation-delay:  70ms; }
.sidebar-nav > *:nth-child(3)  { animation-delay: 100ms; }
.sidebar-nav > *:nth-child(4)  { animation-delay: 130ms; }
.sidebar-nav > *:nth-child(5)  { animation-delay: 160ms; }
.sidebar-nav > *:nth-child(6)  { animation-delay: 190ms; }
.sidebar-nav > *:nth-child(7)  { animation-delay: 220ms; }
.sidebar-nav > *:nth-child(8)  { animation-delay: 250ms; }
.sidebar-nav > *:nth-child(9)  { animation-delay: 280ms; }
.sidebar-nav > *:nth-child(10) { animation-delay: 310ms; }
.sidebar-nav > *:nth-child(11) { animation-delay: 340ms; }
.sidebar-nav > *:nth-child(12) { animation-delay: 370ms; }
.sidebar-nav > *:nth-child(n+13) { animation-delay: 400ms; }

/* Sub-link slide-in saat group dibuka - pakai transition (bukan animation)
   agar re-trigger setiap kali .is-open di-toggle. Stagger per item.

   NOTE specificity: .sidebar-sublink dan .sidebar-link punya rule transition
   sendiri (background, color). Selector di bawah pakai class + child
   combinator + class agar specificity (0,2,1) > .sidebar-sublink (0,1,0)
   sehingga transition opacity/transform tidak ke-override. */
.sidebar-group__sub-inner > .sidebar-sublink,
.sidebar-group__sub-inner > .sidebar-link {
    opacity: 0;
    transform: translateY(-6px);
    transition:
        opacity    0.28s ease,
        transform  0.32s cubic-bezier(0.16, 1, 0.3, 1),
        background var(--t-fast),
        color      var(--t-fast);
}
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-sublink,
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-link {
    opacity: 1;
    transform: translateY(0);
}
/* Stagger delay hanya saat group dibuka. Saat collapse, semua keluar
   bersamaan supaya cepat tertutup. Selector spesifik agar nth-child
   bekerja di kedua tipe item (.sidebar-sublink & .sidebar-link). */
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-sublink:nth-child(1),
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-link:nth-child(1)    { transition-delay:  60ms; }
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-sublink:nth-child(2),
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-link:nth-child(2)    { transition-delay:  95ms; }
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-sublink:nth-child(3),
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-link:nth-child(3)    { transition-delay: 130ms; }
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-sublink:nth-child(4),
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-link:nth-child(4)    { transition-delay: 165ms; }
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-sublink:nth-child(5),
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-link:nth-child(5)    { transition-delay: 200ms; }
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-sublink:nth-child(6),
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-link:nth-child(6)    { transition-delay: 235ms; }
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-sublink:nth-child(n+7),
.sidebar-group.is-open > .sidebar-group__sub .sidebar-group__sub-inner > .sidebar-link:nth-child(n+7)  { transition-delay: 270ms; }

@media (prefers-reduced-motion: reduce) {
    .sidebar-nav > .sidebar-link,
    .sidebar-nav > .sidebar-group,
    .sidebar-nav > .sidebar-section { animation: none; }
    .sidebar-group__sub-inner > .sidebar-sublink,
    .sidebar-group__sub-inner > .sidebar-link {
        opacity: 1;
        transform: none;
        transition: background var(--t-fast), color var(--t-fast);
    }
}

/* Icon box - container with changeable background */
.sidebar-link__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid var(--border);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    color: var(--text-faint);
}
.sidebar-link__icon svg { width: 14px; height: 14px; }

.sidebar-link__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover state */
.sidebar-link:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text);
}
.sidebar-link:hover .sidebar-link__icon {
    background: var(--accent-light);
    border-color: var(--border);
    color: var(--accent);
}
[data-theme="dark"] .sidebar-link:hover {
    background: rgba(255,255,255,0.055);
}

/* Active state - premium gradient pill + left glow bar */
.sidebar-link.is-active {
    background: linear-gradient(
        90deg,
        var(--accent-light) 0%,
        transparent 100%
    );
    color: var(--accent);
    font-weight: 600;
}
/* Active icon box - solid with glow */
.sidebar-link.is-active .sidebar-link__icon {
    background: var(--accent-light);
    border-color: rgba(34,217,124,0.20);
    color: var(--accent);
    box-shadow: 0 0 10px var(--accent-ring);
}
[data-theme="light"] .sidebar-link.is-active .sidebar-link__icon {
    box-shadow: 0 0 8px var(--accent-ring);
}

/* ----------------------------------------------------------------
   Sidebar user profile card (bottom) - mini profile card
   ---------------------------------------------------------------- */
.sidebar-user {
    margin: var(--sp-2);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
/* Menang atas .dropdown{display:inline-block} tanpa bergantung urutan load */
.sidebar-user.dropdown {
    display: block;
}
/* Kartu = pemicu dropdown (seluruh kartu bisa diklik, keyboard-accessible) */
.sidebar-user__trigger {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    padding: var(--sp-3);
    border-radius: var(--radius-md);
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
    color: inherit;
    font-family: var(--font);
    transition: background var(--t-fast), border-color var(--t-fast);
}
.sidebar-user__trigger:hover {
    background: var(--surface-raised);
    border-color: var(--border-strong);
}

/* Avatar styling */
.sidebar-user__avatar {
    font-weight: 700 !important;
    font-size: 0.76rem !important;
    flex-shrink: 0;
}
/* Glow for sidebar avatar */
.app-sidebar .avatar--user {
    background: linear-gradient(135deg, var(--accent) 0%, #0a9e50 100%) !important;
    color: var(--on-accent) !important;
    box-shadow: 0 0 10px var(--accent-ring);
}

.sidebar-user__info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    transition: opacity var(--t-slow), max-width var(--t-slow);
}
.sidebar-user__name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.sidebar-user__role {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    line-height: 1.4;
    margin-top: 1px;
}
/* Chevron icon */
.sidebar-user__cog {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-xs, 4px);
    color: var(--text-faint);
    cursor: pointer;
    transition: color var(--t-fast), background var(--t-fast);
    flex-shrink: 0;
    padding: 0;
}
.sidebar-user__trigger:hover .sidebar-user__cog { color: var(--text-muted); }
.sidebar-user__cog svg { width: 0.8rem; height: 0.8rem; }

/* ----------------------------------------------------------------
   Nav item: link keluar-app ke portal publik (buka tab baru).
   Item nav terakhir, diberi jarak ekstra sebagai penanda "keluar app".
   Warna eksplisit --text-muted supaya konsisten di light & dark.
   ---------------------------------------------------------------- */
.sidebar-link--external {
    margin-top: var(--sp-2);
    color: var(--text-muted);
}
/* Panah "keluar app" di ujung kanan label */
.sidebar-link__ext {
    flex-shrink: 0;
    font-size: 0.9rem;
    color: var(--text-faint);
    transition: color var(--t-fast);
}
.sidebar-link--external:hover .sidebar-link__ext {
    color: var(--accent);
}
/* Collapsed: sembunyikan panah (ikon-only) */
.app-sidebar.is-collapsed .sidebar-link__ext {
    display: none;
}

/* ----------------------------------------------------------------
   Sidebar tooltip (JS-generated for collapsed mode)
   ---------------------------------------------------------------- */
.sidebar-tooltip {
    position: fixed;
    background: var(--surface-raised);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 0.3rem 0.72rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.30);
    border: 1px solid var(--border-strong);
    animation: tooltip-pop 0.12s ease both;
}

/* ----------------------------------------------------------------
   Collapsed sidebar state
   ---------------------------------------------------------------- */
.app-sidebar.is-collapsed {
    width: var(--sidebar-w-collapsed);
}
/* Hide text labels */
.app-sidebar.is-collapsed .sidebar-section,
.app-sidebar.is-collapsed .sidebar-link__label {
    display: none;
}
/* Center brand logo */
.app-sidebar.is-collapsed .sidebar-brand {
    gap: 0;
    padding: 0;
    justify-content: center;
}
/* Collapsed: hide wordmark lockup, show square Σ mark (by theme) */
.app-sidebar.is-collapsed .brand-lockup { display: none; }
.app-sidebar.is-collapsed .brand-mark--dark { display: block; }
[data-theme="light"] .app-sidebar.is-collapsed .brand-mark--dark  { display: none; }
[data-theme="light"] .app-sidebar.is-collapsed .brand-mark--light { display: block; }
.app-sidebar.is-collapsed .brand-mark { width: 2rem; height: 2rem; }
/* Nav padding tighter */
.app-sidebar.is-collapsed .sidebar-nav {
    padding-left: var(--sp-1);
    padding-right: var(--sp-1);
}
/* Links: center icons */
.app-sidebar.is-collapsed .sidebar-link {
    justify-content: center;
    gap: 0;
    padding: var(--sp-2) 0;
    height: auto;
}
.app-sidebar.is-collapsed .sidebar-link:hover {
    background: transparent;
}
.app-sidebar.is-collapsed .sidebar-link__icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
}
.app-sidebar.is-collapsed .sidebar-link__icon svg {
    width: 1.1rem;
    height: 1.1rem;
}
/* Active: icon pill highlight only - no left bar in collapsed mode */
.app-sidebar.is-collapsed .sidebar-link.is-active {
    background-image: none;
    background-color: transparent;
}
.app-sidebar.is-collapsed .sidebar-link.is-active::before {
    display: none;
}

/* ----------------------------------------------------------------
   Sidebar group (collapsible accordion)
   ---------------------------------------------------------------- */
.sidebar-group {
    position: relative;
    z-index: 1;
}

/* Toggle button - inherits sidebar-link visual style */
.sidebar-group__toggle {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    width: 100%;
    padding: 0 var(--sp-2);
    height: 38px;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    font-family: var(--font);
    transition: background var(--t-fast), color var(--t-fast);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}
[data-theme="dark"] .sidebar-group__toggle:hover,
.sidebar-group__toggle:hover {
    background: rgba(255,255,255,0.055);
    color: var(--text);
}
[data-theme="light"] .sidebar-group__toggle:hover {
    background: rgba(0,0,0,0.05);
    color: var(--text);
}
.sidebar-group__toggle:hover .sidebar-link__icon {
    background: var(--accent-light);
    border-color: var(--border);
    color: var(--accent);
}

/* When group has an active child */
.sidebar-group.has-active > .sidebar-group__toggle {
    color: var(--text);
    background: linear-gradient(90deg, var(--accent-light) 0%, transparent 100%);
}
.sidebar-group.has-active > .sidebar-group__toggle .sidebar-link__icon {
    background: var(--accent-light);
    border-color: rgba(34,217,124,0.20);
    color: var(--accent);
    box-shadow: 0 0 10px var(--accent-ring);
}
[data-theme="light"] .sidebar-group.has-active > .sidebar-group__toggle .sidebar-link__icon {
    box-shadow: 0 0 8px var(--accent-ring);
}

/* Chevron arrow */
.sidebar-group__chevron {
    margin-left: auto;
    flex-shrink: 0;
    color: var(--text-faint);
    transition: transform var(--t-fast), color var(--t-fast);
}
.sidebar-group__chevron svg { width: 0.75rem; height: 0.75rem; }
.sidebar-group.is-open > .sidebar-group__toggle .sidebar-group__chevron {
    transform: rotate(90deg);
    color: var(--text-muted);
}

/* Sub-menu - CSS grid accordion (no JS height calc needed) */
.sidebar-group__sub {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--t-spring);
    position: relative;
}
.sidebar-group.is-open > .sidebar-group__sub {
    grid-template-rows: 1fr;
}
.sidebar-group__sub-inner {
    overflow: hidden;
    padding-left: var(--sp-3);
    padding-top: 2px;
    padding-bottom: 4px;
    position: relative;
}

/* Vertical guide line - aligns with icon center */
.sidebar-group__sub-inner::before {
    content: '';
    position: absolute;
    left: calc(var(--sp-3) + 9px);
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: var(--border);
    border-radius: 1px;
}

/* Sub-link items */
.sidebar-sublink {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0.2rem var(--sp-2) 0.2rem calc(var(--sp-3) + 14px);
    font-size: 0.775rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast), color var(--t-fast);
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    min-width: 0;
}
.sidebar-sublink > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.sidebar-sublink:hover {
    color: var(--text);
}
[data-theme="light"] .sidebar-sublink:hover {
}
.sidebar-sublink.is-active {
    color: var(--accent);
    font-weight: 600;
}

/* Dot indicator */
.sidebar-sublink__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--border-strong);
    flex-shrink: 0;
    transition: background var(--t-fast), box-shadow var(--t-fast);
}
.sidebar-sublink.is-active .sidebar-sublink__dot {
    background: var(--accent);
    box-shadow: 0 0 5px var(--accent-ring);
}

/* ── Collapsed sidebar: groups show only icon, no sub-menu ── */
.app-sidebar.is-collapsed .sidebar-group__sub { display: none; }
.app-sidebar.is-collapsed .sidebar-group__chevron { display: none; }
.app-sidebar.is-collapsed .sidebar-group__toggle {
    justify-content: center;
    gap: 0;
    padding: var(--sp-2) 0;
    height: auto;
}
.app-sidebar.is-collapsed .sidebar-group__toggle .sidebar-link__label { display: none; }
.app-sidebar.is-collapsed .sidebar-group__toggle .sidebar-link__icon {
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-md);
}
.app-sidebar.is-collapsed .sidebar-group.has-active > .sidebar-group__toggle .sidebar-link__icon {
    background: var(--accent-light);
    color: var(--accent);
}

.app-sidebar.is-collapsed .sidebar-link.is-active .sidebar-link__icon,
.app-sidebar.is-collapsed .sidebar-link:hover .sidebar-link__icon {
    background: var(--accent-light);
    color: var(--accent);
}
/* User card: center avatar only */
.app-sidebar.is-collapsed .sidebar-user {
    justify-content: center;
    gap: 0;
    padding: var(--sp-2);
    margin: var(--sp-2) var(--sp-1);
}
.app-sidebar.is-collapsed .sidebar-user__info,
.app-sidebar.is-collapsed .sidebar-user__cog {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
    width: 0;
}

/* ----------------------------------------------------------------
   Mobile: sidebar off-screen until opened
   ---------------------------------------------------------------- */
@media (max-width: 1023px) {
    .app-sidebar {
        transform: translateX(-100%);
        z-index: calc(var(--z-modal) - 1);
        width: var(--sidebar-w) !important;
    }
    .app-sidebar[data-open] {
        transform: translateX(0);
    }
}

/* ----------------------------------------------------------------
   Mobile overlay
   ---------------------------------------------------------------- */
.app-sidebar__overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: calc(var(--z-modal) - 2);
    animation: s-fade-in 0.2s ease both;
    cursor: pointer;
}
.app-sidebar__overlay[hidden] { display: none; }

/* ================================================================
   Main column (right of sidebar)
   ================================================================ */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100dvh;
}
@media (min-width: 1024px) {
    .app-main {
        margin-left: var(--sidebar-w);
        transition: margin-left var(--t-spring);
    }
    body.sidebar-collapsed .app-main {
        margin-left: var(--sidebar-w-collapsed);
    }
}

/* ================================================================
   Top Navbar
   ================================================================ */
.app-navbar {
    height: var(--navbar-h);
    background: var(--navbar-bg);
    border-bottom: 1px solid var(--navbar-border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    align-items: center;
    padding: 0 var(--sp-6);
    gap: var(--sp-2);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    flex-shrink: 0;
}
/* Accent glow line at bottom of navbar */
.app-navbar::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--accent-ring) 50%,
        transparent 100%
    );
}
@media (max-width: 640px) {
    .app-navbar { padding: 0 var(--sp-2); }
}

/* ── Desktop sidebar collapse toggle ── */
.navbar-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.2rem;
    border: none;
    background: var(--accent-light);
    font-size: 1.2rem;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    transition: background var(--t-fast), color var(--t-fast);
    flex-shrink: 0;
}
.navbar-sidebar-toggle:hover {
    background: var(--accent-light);
    color: var(--accent);
}
.navbar-sidebar-toggle svg { width: 1.15rem; height: 1.15rem; }
/* Toggle icon swap */
.navbar-sidebar-toggle .icon-expand { display: none; }
body.sidebar-collapsed .navbar-sidebar-toggle .icon-collapse { display: none; }
body.sidebar-collapsed .navbar-sidebar-toggle .icon-expand  {
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (min-width: 1024px) {
    .navbar-sidebar-toggle { display: flex; }
}

/* ── Mobile hamburger ── */
.app-navbar__menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    transition: background var(--t-fast), color var(--t-fast);
    flex-shrink: 0;
}
.app-navbar__menu-btn:hover { background: var(--accent-light); color: var(--accent); }
.app-navbar__menu-btn svg { width: 1.25rem; height: 1.25rem; }
@media (max-width: 1023px) { .app-navbar__menu-btn { display: flex; } }

/* ── Navbar context (page title + breadcrumb) ── */
.app-navbar__context {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    line-height: 1.3;
}
.app-navbar__page-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Navbar inline breadcrumb ── */
.navbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--sp-1);
    margin: 0;
    padding: 0;
    list-style: none;
}
.navbar-breadcrumb__item {
    font-size: 0.7rem;
    color: var(--text-faint);
    text-decoration: none;
    white-space: nowrap;
    transition: color var(--t-fast);
}
.navbar-breadcrumb__item[href]:hover { color: var(--accent); }
.navbar-breadcrumb__item--current {
    color: var(--text-muted);
    font-weight: 500;
}
.navbar-breadcrumb__sep {
    font-size: 1.1rem;
    color: var(--text-faint);
    opacity: 0.35;
    line-height: 0;
    user-select: none;
    flex-shrink: 0;
}

/* ── Mobile brand (logo mark only, no text, shown <1024px) ── */
.app-navbar__brand-mobile {
    display: none;
    align-items: center;
    gap: var(--sp-3);
    text-decoration: none;
    flex: 1;
    min-width: 0;
}
.app-navbar__brand-mobile__logo {
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    object-fit: contain;
}
/* Theme swap: dark = default, light = [data-theme="light"] */
.app-navbar__brand-mobile .nav-mark--light { display: none; }
.app-navbar__brand-mobile .nav-mark--dark  { display: block; }
[data-theme="light"] .app-navbar__brand-mobile .nav-mark--light { display: block; }
[data-theme="light"] .app-navbar__brand-mobile .nav-mark--dark  { display: none; }
@media (max-width: 1023px) {
    .app-navbar__brand-mobile { display: flex; }
    .app-navbar__context      { display: none; }
}

/* ── Navbar search bar ── */
.navbar-search {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-input, 10px);
    padding: 0 var(--sp-3);
    height: 2.25rem;
    cursor: text;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    flex-shrink: 0;
}
.navbar-search:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
.navbar-search__icon {
    width: 0.85rem;
    height: 0.85rem;
    color: var(--text-faint);
    flex-shrink: 0;
}
.navbar-search__input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.82rem;
    color: var(--text);
    font-family: var(--font);
    width: 13rem;
    padding: 0;
    min-width: 0;
    transition: width var(--t-spring);
}
.navbar-search:focus-within .navbar-search__input {
    width: 16rem;
}
.navbar-search__input::placeholder { color: var(--text-faint); }
.navbar-search__kbd {
    font-size: 0.66rem;
    color: var(--text-faint);
    background: var(--border-subtle);
    border-radius: 4px;
    padding: 0.1rem 0.32rem;
    flex-shrink: 0;
    pointer-events: none;
    line-height: 1.6;
    transition: opacity var(--t-fast);
}
.navbar-search:focus-within .navbar-search__kbd {
    opacity: 0;
}
@media (max-width: 1023px) { .navbar-search { display: none; } }

/* ── Navbar right actions container ── */
.app-navbar__actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-shrink: 0;
    margin-left: auto;
}

/* ── Icon buttons (notifications, etc.) ── */
.navbar-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.2rem;
    border: none;
    background: var(--accent-light);
    color: var(--text-muted);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    transition: background var(--t-fast), color var(--t-fast);
    text-decoration: none;
}
.navbar-icon-btn:hover {
    background: var(--accent-light);
    color: var(--accent);
}
.navbar-icon-btn svg { width: 1.15rem; height: 1.15rem; }
.navbar-icon-btn__badge {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    min-width: 0.9rem;
    height: 0.9rem;
    padding: 0 0.16rem;
    background: var(--danger-text);
    color: #fff;
    font-size: 0.55rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── User menu button ── */
.navbar-user-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 0.3rem var(--sp-2) 0.3rem 0.3rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--t-fast);
    text-align: left;
    font-family: var(--font);
    color: var(--text);
    text-decoration: none;
}
.navbar-user-btn:hover { background: var(--accent-light); }
.navbar-user-btn--compact {
    padding: 2px;
    border-radius: var(--radius-full);
    gap: 0;
    transition: box-shadow var(--t-fast);
    background: transparent;
    box-shadow: 0 0 0 2px var(--accent);
}
.navbar-user-btn--compact:hover {
    background: transparent;
    box-shadow: 0 0 5px 2px var(--accent);
}
.navbar-user-btn__name {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    white-space: nowrap;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-user-btn__role {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.2;
    white-space: nowrap;
}
@media (max-width: 767px) {
    .navbar-user-btn__info { display: none; }
}

/* ================================================================
   Command Palette
   ================================================================ */
.navbar-cmd-btn {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    height: 2.25rem;
    padding: 0 var(--sp-3);
    background: var(--surface-sunken);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-input, 10px);
    color: var(--text-faint);
    font-family: var(--font);
    font-size: 0.82rem;
    cursor: pointer;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), color var(--t-fast), background var(--t-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    white-space: nowrap;
    flex-shrink: 0;
}
.navbar-cmd-btn:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
    color: var(--text-muted);
    background: var(--surface-sunken);
}
.navbar-cmd-btn__icon { width: 0.85rem; font-size: 1rem; flex-shrink: 0; }
.navbar-cmd-btn__label { flex: 1; text-align: left; min-width: 10rem; }
.navbar-cmd-btn__kbd {
    font-size: 0.65rem;
    color: var(--text-faint);
    background: var(--border-subtle);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    flex-shrink: 0;
    pointer-events: none;
    line-height: 1.6;
}
@media (max-width: 1023px) { .navbar-cmd-btn { display: none; } }

/* Command palette overlay */
.cmd-palette {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) + 10);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
}
.cmd-palette[hidden] { display: none; }

.cmd-palette__backdrop {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: cmd-backdrop-in 0.15s ease both;
}
@keyframes cmd-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cmd-palette__panel {
    position: relative;
    width: min(640px, calc(100vw - 2rem));
    /* Token modal — putih di light, gelap di dark (theme-aware) */
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    overflow: hidden;
    animation: cmd-panel-in 0.18s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cmd-panel-in {
    from { opacity: 0; transform: translateY(-12px) scale(0.97); }
    to   { opacity: 1; transform: none; }
}

.cmd-palette__search-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border);
}
.cmd-palette__search-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: var(--accent);
    flex-shrink: 0;
}
.cmd-palette__input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    font-family: var(--font);
    color: var(--text);
    min-width: 0;
}
.cmd-palette__input::placeholder { color: var(--text-faint); }
.cmd-palette__esc-kbd {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    background: var(--border-subtle);
    border-radius: 4px;
    color: var(--text-faint);
    flex-shrink: 0;
    line-height: 1.6;
    pointer-events: none;
}

.cmd-palette__body {
    max-height: 400px;
    overflow-y: auto;
    padding: var(--sp-2);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.cmd-palette__body::-webkit-scrollbar { width: 3px; }
.cmd-palette__body::-webkit-scrollbar-thumb { background: var(--border); border-radius: var(--radius-full); }
.cmd-palette__body::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.cmd-group__label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--text-faint);
    padding: var(--sp-3) var(--sp-3) var(--sp-1);
}
.cmd-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0.55rem var(--sp-3);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--t-fast), color var(--t-fast);
    outline: none;
}
.cmd-item:hover,
.cmd-item.is-focused {
    background: var(--accent-light);
    color: var(--accent);
}
.cmd-item.is-focused .cmd-item__icon { color: var(--accent); }
.cmd-item__icon {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-sunken);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.cmd-item:hover .cmd-item__icon,
.cmd-item.is-focused .cmd-item__icon {
    background: var(--accent-light);
    border-color: transparent;
    color: var(--accent);
}
.cmd-item__icon svg { width: 0.9rem; height: 0.9rem; }
.cmd-item__icon i { font-size: 1rem; line-height: 1; }
.cmd-item__label { flex: 1; min-width: 0; }
/* Baris hasil data 2-baris: label + sublabel */
.cmd-item__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow: hidden;
}
.cmd-item__text .cmd-item__label {
    flex: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmd-item__sub {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cmd-item:hover .cmd-item__sub,
.cmd-item.is-focused .cmd-item__sub { color: var(--accent); opacity: 0.85; }
/* Loading state saat menunggu hasil data server */
.cmd-loading {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-4);
    font-size: 0.8rem;
    color: var(--text-faint);
}
.cmd-spinner {
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: cmd-spin 0.6s linear infinite;
    flex-shrink: 0;
}
@keyframes cmd-spin { to { transform: rotate(360deg); } }
.cmd-item__hint {
    font-size: 0.72rem;
    color: var(--text-faint);
    background: var(--border-subtle);
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    line-height: 1.6;
    flex-shrink: 0;
}
.cmd-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--sp-10) var(--sp-4);
    gap: var(--sp-2);
    color: var(--text-faint);
    font-size: 0.875rem;
}
.cmd-empty svg { width: 2rem; height: 2rem; opacity: 0.4; }

.cmd-palette__footer {
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    padding: var(--sp-2) var(--sp-5);
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    color: var(--text-faint);
}
.cmd-palette__footer kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    background: var(--border-subtle);
    border-radius: 3px;
    font-size: 0.65rem;
    margin-right: 0.25rem;
    color: var(--text-muted);
}

/* ── Avatar gradient (user avatar) ── */
.avatar--user {
    background: linear-gradient(135deg, #0d9488 0%, #059669 45%, #16a34a 100%) !important;
    color: rgba(255,255,255,0.95) !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.20);
    box-shadow: 0 2px 8px rgba(13,148,136,0.30);
}
.app-sidebar .avatar--user {
    background: linear-gradient(135deg, #22d97c, #0a9e50) !important;
    color: #031209 !important;
    box-shadow: 0 2px 10px rgba(34,217,124,0.35),
                0 0 0 1px rgba(255,255,255,0.08);
}

/* ================================================================
   Main content area
   ================================================================ */
.app-content {
    flex: 1;
    padding: var(--sp-6) var(--sp-8);
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
}
@media (min-width: 1024px)  { .app-content { padding: var(--sp-6) var(--sp-6); } }
@media (min-width: 1280px)  { .app-content { padding: var(--sp-6) var(--sp-10); max-width: 1170px; } }
@media (max-width: 767px)   { .app-content { padding: var(--sp-4); } }

/* ── Compact controls inside app-content (vs. auth pages) ── */
.toolbar .field__input,
.toolbar select.field__input {
    height: 2.2rem;
    font-size: 0.82rem;
    padding: 0 0.7rem;
    border-radius: var(--radius-md);
}
.toolbar select.field__input { padding-right: 2rem; }
.toolbar .field__input--textarea { height: auto; min-height: 6rem; }
.toolbar .toolbar .btn--sm {
    height: 2.1rem;
    font-size: 0.82rem;
    padding: 0 0.8rem;
    border-radius: var(--radius-md);
}
/* Full-size inputs on form pages */
.toolbar .form-page .field__input,
.toolbar .form-page select.field__input {
    height: 2.5rem;
    font-size: var(--text-base);
    padding: 0 0.8rem;
}
textarea.field__input,
.toolbar .form-page .field__input--textarea {
    padding: 0.8rem !important;
    min-height: 7rem;
}
.toolbar .form-page .btn { height: 2.5rem; font-size: var(--text-base); }

/* Flash messages stack */
.app-flash-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    margin-bottom: var(--sp-4);
}

/* Subnav bar (breadcrumb under navbar, desktop only) */
.app-subnav {
    flex-shrink: 0;
    padding: var(--sp-2) var(--sp-8);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    min-height: 0;
}
.app-subnav:empty { display: none; }
@media (max-width: 1023px) { .app-subnav { display: none; } }

/* ================================================================
   Footer
   ================================================================ */
.app-footer {
    padding: var(--sp-2) var(--sp-6);
    border-top: 1px solid var(--border);
    background: var(--surface-sunken);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-2);
    font-size: var(--text-sm);
    color: var(--text-faint);
    flex-shrink: 0;
}
/* Mobile: footer teks di-center (bukan space-between kiri-kanan) */
@media (max-width: 560px) {
    .app-footer { justify-content: center; text-align: center; }
}

/* ================================================================
   Auth page layout (split-screen)
   ================================================================ */
body.sigma-auth {
    margin: 0;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.sigma-auth a      { color: inherit; }
body.sigma-auth button { font-family: inherit; }

.auth {
    display: flex;
    min-height: 100dvh;
}

/* Auth brand panel (left) */
.auth__brand {
    position: relative;
    flex: 0 0 46%;
    max-width: 640px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    color: #fff;
    background:
        radial-gradient(circle at 22% 18%, rgba(120,232,172,0.20), transparent 55%),
        linear-gradient(158deg, #07331d 0%, #0b5230 54%, #0e6d3e 100%);
}
.auth__brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right,  rgba(255,255,255,0.045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 42px 42px;
    -webkit-mask-image: radial-gradient(circle at 35% 35%, #000 30%, transparent 78%);
    mask-image: radial-gradient(circle at 35% 35%, #000 30%, transparent 78%);
    pointer-events: none;
}
.auth__brand-leaf {
    position: absolute;
    right: -70px;
    bottom: -80px;
    width: 380px;
    height: 380px;
    color: rgba(255,255,255,0.045);
    pointer-events: none;
}
.auth__brand-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: clamp(2.75rem, 4vw, 4.25rem);
}
.auth__brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth__brand-lockup-img {
    height: 44px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.auth__brand-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.7rem;
    height: 2.7rem;
    /* SIGMA mark carries its own rounded chip — strip wrapper bg/frame */
    background: transparent;
}
.auth__brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.auth__brand-name { display: flex; flex-direction: column; }
.auth__brand-wordmark { font-size: 1.18rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.auth__brand-tagline  { font-size: 0.72rem; color: rgba(255,255,255,0.6); margin-top: 1px; }
.auth__brand-body {
    position: relative;
    margin-top: auto;
    padding-top: 3rem;
    animation: auth-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
.auth__brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.8rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255,255,255,0.88);
}
.auth__brand-eyebrow-mark { display: inline-flex; align-items: center; }
.auth__brand-eyebrow-mark img { width: 0.9rem; height: 0.9rem; object-fit: contain; }
.auth__brand-headline {
    margin: 1.3rem 0 0;
    font-size: clamp(1.85rem, 2.5vw, 2.55rem);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -0.025em;
    color: var(--surface-sunken);
}
.auth__brand-headline em     { font-style: normal; color: #7fe3ab; }
.auth__brand-headline strong { color: #7fe3ab; font-weight: inherit; }
.auth__brand-desc {
    margin: 1.05rem 0 0;
    max-width: 30rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: rgba(255,255,255,0.72);
}
.auth__brand-points {
    margin: 1.9rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.auth__brand-points li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.82);
}
.auth__brand-check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.16);
}
.auth__brand-check svg { width: 0.78rem; height: 0.78rem; color: #7fe3ab; }

/* Auth form panel (right) */
.auth__main {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface-sunken);
}
.auth__theme-toggle {
    position: absolute;
    top: 1.35rem;
    right: 1.35rem;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.auth__theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.auth__theme-toggle svg   { width: 1.2rem; height: 1.2rem; }
.auth__scroll {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1.5rem;
}
.auth__form-wrap {
    width: 100%;
    max-width: 450px;
    animation: auth-rise 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.auth__mobilebrand {
    display: none;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 2rem;
}
/* Mobile brand = SIGMA lockup on the theme-aware form bg (dark = default) */
.auth__mobilebrand-lockup { height: 34px; width: auto; max-width: 100%; object-fit: contain; }
.auth__mobilebrand .am-lock--light { display: none; }
.auth__mobilebrand .am-lock--dark  { display: block; }
[data-theme="light"] .auth__mobilebrand .am-lock--light { display: block; }
[data-theme="light"] .auth__mobilebrand .am-lock--dark  { display: none; }
.auth__mobilebrand .auth__brand-wordmark { color: var(--text); font-size: 1.05rem; }
.auth__mobilebrand .auth__brand-tagline  { color: var(--text-muted); }

.auth-head { margin-bottom: 1.9rem; }
.auth-head h1, .auth-head__title {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.022em;
    color: var(--text);
}
.auth-head p, .auth-head__sub {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-head a, .auth-head__sub a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-head a:hover, .auth-head__sub a:hover { text-decoration: underline; }
.auth-foot {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.auth-foot a { color: var(--accent); font-weight: 600; text-decoration: none; }
.auth-foot a:hover { text-decoration: underline; }

/* Callout info di halaman auth (mis. arahan reset password akun instansi) */
.auth-note {
    display: flex;
    gap: 0.65rem;
    margin: 0 0 1.4rem;
    padding: 0.8rem 0.9rem;
    background: var(--accent-light);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.auth-note__icon {
    flex: none;
    margin-top: 0.1rem;
    font-size: 1.05rem;
    color: var(--accent);
}
.auth-note__body {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted);
}
.auth-note__body strong { color: var(--text); font-weight: 600; }
.auth-note--center { margin: 1.2rem 0; text-align: left; }
/* Brand lockup jadi target klik ke beranda publik (mouse-only; jalur aksesibel = .auth__home) */
.auth__brand-lockup-link,
.auth__mobilebrand-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity var(--t-fast);
}
.auth__brand-lockup-link:hover,
.auth__mobilebrand-link:hover { opacity: 0.82; }

/* Link balik ke beranda publik di footer kartu form */
.auth__home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--t-fast);
}
.auth__home:hover { color: var(--accent); }
.auth__home:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}
.auth__home .ti { font-size: 1rem; }

.auth__legal {
    margin-top: 2.25rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-faint);
}
/* Rapatkan legal saat link beranda hadir di atasnya */
.auth__home + .auth__legal { margin-top: 1.25rem; }

@media (max-width: 880px) {
    .auth__brand      { display: none; }
    .auth__mobilebrand { display: flex; }
    .auth__scroll     { padding: 2.5rem 1.25rem; }
}

/* Fix: inline-flex overrides UA [hidden] */
.btn[hidden] { display: none; }

/* ================================================================
   Focus layout - chrome ringkas untuk onboarding mitra
   (base.html cabang onboarding_focus; tanpa sidebar/navbar)
   ================================================================ */
body.sigma-focus { background: var(--surface-sunken, #f3f4f6); min-height: 100dvh; display: flex; flex-direction: column; }
.focus-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3); height: 3.75rem; padding: 0 var(--sp-5);
    background: var(--navbar-bg); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 40;
}
.focus-bar__brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.focus-bar__brand img { width: 1.75rem; height: 1.75rem; }
.focus-bar__brand-name { font-family: var(--font-d); font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; }
.focus-bar__brand-tag {
    font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent);
    padding: .12rem .45rem; border-radius: 999px; margin-left: .15rem;
}
.focus-bar__actions { display: flex; align-items: center; gap: var(--sp-2); }
/* Kontainer konten fokus - lebar maksimum konsisten untuk SEMUA halaman onboarding */
.focus-main { width: 100%; max-width: 920px; margin: 0 auto; padding: var(--sp-6, 1.75rem) var(--sp-4); }
@media (max-width: 480px) { .focus-bar__brand-tag { display: none; } .focus-bar { padding: 0 var(--sp-3); } }

/* Footer onboarding (focus layout) */
.focus-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: auto; }
.focus-footer__inner {
    width: 100%; max-width: 920px; margin: 0 auto; padding: var(--sp-4);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: var(--sp-2) var(--sp-5); font-size: var(--text-xs); color: var(--text-faint);
}
.focus-footer__right { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-4); }
.focus-footer__links { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); }
.focus-footer__links a { color: var(--text-muted); text-decoration: none; }
.focus-footer__links a:hover { color: var(--accent); text-decoration: underline; }
.focus-footer__ver { font-family: var(--font-mono); color: var(--text-faint); }
@media (max-width: 560px) { .focus-footer__inner { justify-content: flex-start; } }

/* ─────────────────────────────────────────────────────────────────────────
   Onboarding / Tracking shell  (dipakai dashboard_terbatas.html + hub_tracking.html)
   Hero + progress ring + stepper + 2-kolom layout + sidebar info cards.
   ───────────────────────────────────────────────────────────────────────── */

/* Hero */
.onb-hero {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface));
    border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
    border-radius: var(--radius-lg, 16px);
    padding: var(--sp-6, 1.75rem);
    margin-bottom: var(--sp-5);
    display: flex; gap: var(--sp-5); align-items: center; flex-wrap: wrap;
}
.onb-hero__text { flex: 1; min-width: 16rem; }
.onb-hero__eyebrow {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--accent); margin-bottom: .5rem;
}
.onb-hero__title { font-family: var(--font-d); font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 700; line-height: 1.2; margin: 0 0 .5rem; }
.onb-hero__sub { color: var(--text-muted); font-size: var(--text-base); line-height: 1.55; margin: 0 0 1rem; }
.onb-hero__cta { display: inline-flex; align-items: center; gap: .5rem; }

/* Progress ring / status emblem */
.onb-ring { --p: 0; position: relative; width: 116px; height: 116px; flex-shrink: 0; }
.onb-ring svg { transform: rotate(-90deg); }
.onb-ring__track { stroke: color-mix(in srgb, var(--accent) 18%, transparent); }
.onb-ring__fill {
    stroke: var(--accent); stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: calc(326.7 * (1 - var(--p) / 100));
    transition: stroke-dashoffset .9s ease;
}
.onb-ring__label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.onb-ring__pct { font-family: var(--font-mono); font-size: 1.55rem; font-weight: 700; line-height: 1; color: var(--text); }
.onb-ring__cap { font-size: .62rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); margin-top: .2rem; }

/* Stepper */
.onb-steps { list-style: none; margin: 0; padding: 0; position: relative; }
.onb-step { display: flex; gap: var(--sp-4); padding: var(--sp-4) 0; position: relative; }
.onb-step:not(:last-child)::before {
    content: ""; position: absolute; left: 1.1rem; top: 3.1rem; bottom: -1.1rem; width: 2px;
    background: var(--border);
}
.onb-step.is-done:not(:last-child)::before { background: var(--success-text, #16a34a); }
.onb-step__icon {
    width: 2.25rem; height: 2.25rem; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface); border: 2px solid var(--border); color: var(--text-faint);
    font-size: 1.05rem; z-index: 1;
}
.onb-step.is-done .onb-step__icon { background: var(--success-text, #16a34a); border-color: var(--success-text, #16a34a); color: #fff; }
.onb-step.is-current .onb-step__icon { background: var(--accent); border-color: var(--accent); color: var(--on-accent, #fff); box-shadow: 0 0 0 4px var(--accent-ring, color-mix(in srgb, var(--accent) 20%, transparent)); }
.onb-step__body { flex: 1; padding-top: .1rem; }
.onb-step__head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.onb-step__title { font-weight: 600; font-size: var(--text-base); color: var(--text); }
.onb-step.is-todo .onb-step__title { color: var(--text-muted); }
.onb-step__desc { color: var(--text-muted); font-size: var(--text-sm); margin: .15rem 0 0; line-height: 1.5; }
.onb-step__action { margin-top: .6rem; }
.onb-step__badge { font-size: .68rem; font-weight: 700; }

/* Layout 2 kolom: konten utama + sidebar info */
.onb-layout { display: grid; grid-template-columns: 1fr 264px; gap: var(--sp-5); align-items: start; }
@media (max-width: 760px) { .onb-layout { grid-template-columns: 1fr; } }

.onb-side { display: grid; gap: var(--sp-3); position: sticky; top: var(--sp-5); }
@media (max-width: 760px) { .onb-side { position: static; } }
.onb-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--sp-4); background: var(--surface); }
.onb-card--accent { border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.onb-card__head { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: var(--text-sm); color: var(--text); margin-bottom: .5rem; }
.onb-card__head i { color: var(--accent); font-size: 1.15rem; }
.onb-card__text { margin: 0; font-size: var(--text-sm); color: var(--text-muted); line-height: 1.55; }
.onb-card__list { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.onb-card__list li { font-size: var(--text-sm); color: var(--text-muted); line-height: 1.45; }
.onb-card__btn { width: 100%; justify-content: center; margin-top: .2rem; }
.onb-card__link { display: inline-flex; align-items: center; gap: .4rem; margin-top: .6rem; font-size: var(--text-sm); font-weight: 600; color: var(--accent); text-decoration: none; }
.onb-card__link:hover { text-decoration: underline; }
