/* ==========================================================================
   INTINYA DASHBOARD SHELL & DESIGN SYSTEM
   Visual Direction: Dark Sidebar (#151313) + Off-White Canvas (#F7F7F5)
   Typography: Kodchasan for brand wordmarks; Plus Jakarta Sans for all UI text
   ========================================================================== */

@import "doodles.css";

:root {
    /* Reference Core Palette */
    --c-dark: #151313;
    --c-coral: #FF5734;
    --c-purple: #BE94F5;
    --c-yellow: #F59E0B;
    --c-blue: #A3DCF5;
    --c-mint: #98E2C6;
    --c-canvas: #F7F7F5;
    --c-card: #FFFFFF;
    
    /* Layout Surfaces */
    --sidebar-bg: #151313;
    --sidebar-text: #E4E4E7;
    --sidebar-muted: #71717A;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-active-bg: #F59E0B;
    --sidebar-active-text: #151313;
    
    --canvas-bg: #F7F7F5;
    --card-bg: #FFFFFF;
    --card-border: rgba(21, 19, 19, 0.08);
    --card-shadow: 0 4px 20px -2px rgba(21, 19, 19, 0.04);
    --card-shadow-hover: 0 14px 30px -4px rgba(21, 19, 19, 0.09);
    
    /* Typography & Hierarchy */
    --text-primary: #151313;
    --text-secondary: #52525B;
    --text-muted: #71717A;
    --text-inverse: #FFFFFF;
    
    --font-brand: 'Kodchasan', 'Plus Jakarta Sans', sans-serif;
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Metrics & Radii */
    --sidebar-w: 268px;
    --topbar-h: 74px;
    --radius-pill: 9999px;
    --radius-card: 22px;
    --radius-card-sm: 14px;
    --radius-btn: 14px;
    --view-max-w: 1440px;
    --view-padding-x: clamp(1rem, 2.5vw, 2.25rem);
    
    /* Action & Status */
    --btn-primary-bg: #F59E0B;
    --btn-primary-text: #151313;
    --btn-primary-hover: #D97706;
    --primary: #F59E0B;
    --primary-hover: #D97706;
    --success: #10B981;
    --danger: #EF4444;

    /* Legacy Variable Aliases for 100% Component Compatibility */
    --bg-card: var(--card-bg);
    --bg-card-solid: var(--card-bg);
    --bg-body: var(--canvas-bg);
    --text-main: var(--text-primary);
    --border-card: var(--card-border);
    --shadow-card: var(--card-shadow);
    --btn-text: #151313;
    --badge-bg: rgba(252, 204, 66, 0.18);
}

/* THEME: GELAP (DARK MODE) */
[data-theme="dark"] {
    --c-canvas: #0D0F12;
    --canvas-bg: #0D0F12;
    --card-bg: #161A22;
    --card-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    --text-primary: #F4F4F5;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;
    --sidebar-bg: #0A0C0E;
    --sidebar-border: rgba(255, 255, 255, 0.06);
}

/* THEME: UNIVERSITAS INDONESIA (JAKUN UI) */
[data-theme="ui"] {
    --c-canvas: #FFFBEB;
    --canvas-bg: #FFFBEB;
    --card-bg: #FFFFFF;
    --card-border: rgba(234, 179, 8, 0.25);
    --card-shadow: 0 4px 20px rgba(202, 138, 4, 0.08);
    --text-primary: #1C1917;
    --text-secondary: #57534E;
    --text-muted: #854D0E;
    --sidebar-active-bg: #EAB308;
    --sidebar-active-text: #1C1917;
    --sidebar-bg: #18181B;
    --sidebar-border: rgba(234, 179, 8, 0.2);
}

/* THEME: INSTITUT TEKNOLOGI BANDUNG (JAMAL ITB) */
[data-theme="itb"] {
    --c-canvas: #EDF5FD;
    --canvas-bg: #EDF5FD;
    --card-bg: #FFFFFF;
    --card-border: rgba(2, 132, 199, 0.15);
    --sidebar-active-bg: #0284C7;
    --sidebar-active-text: #FFFFFF;
    --sidebar-bg: #0C1E34;
}

/* THEME: UNIVERSITAS GADJAH MADA (ALMET UGM) */
[data-theme="ugm"] {
    --c-canvas: #F5EFEB;
    --canvas-bg: #F5EFEB;
    --card-bg: #FFFFFF;
    --card-border: rgba(180, 83, 9, 0.16);
    --sidebar-active-bg: #B45309;
    --sidebar-active-text: #FFFFFF;
    --sidebar-bg: #1A1412;
}

/* ==========================================================================
   GLOBAL RESET & BASE APPSHELL LAYOUT
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-primary);
    background-color: var(--canvas-bg);
    overflow-x: hidden;
    line-height: 1.5;
}

/* Smooth Canvas Wrapper */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background: var(--canvas-bg);
    transition: background 0.25s ease;
}

#shellSidebarMount,
#shellTopbarMount {
    display: contents;
}

/* ==========================================================================
   LEFT SIDEBAR (DESKTOP)
   ========================================================================== */

.app-sidebar {
    width: var(--sidebar-w);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    border-right: 1px solid var(--sidebar-border);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease;
    user-select: none;
    overflow: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

/* Brand Header in Sidebar */
.sidebar-header {
    min-height: var(--topbar-h);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #FFFFFF;
}

.sidebar-logo-icon {
    display: none !important;
    width: 38px;
    height: 38px;
    background: var(--c-yellow);
    color: #151313;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-brand);
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(252, 204, 66, 0.25);
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-family: var(--font-brand, "Plus Jakarta Sans", sans-serif);
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    font-family: var(--font-brand);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #FFFFFF;
}

.sidebar-badge {
    font-size: 0.65rem;
    font-weight: 800;
    background: rgba(255, 87, 52, 0.2);
    color: var(--c-coral);
    border: 1px solid rgba(255, 87, 52, 0.3);
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#navAuthSlot[hidden] { display: none !important; }

/* Sidebar Navigation Sections */
.sidebar-nav-group {
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 7px;
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-anchor: none;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.18) transparent;
}

.sidebar-nav-group::-webkit-scrollbar { width: 6px; }
.sidebar-nav-group::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
}

.sidebar-nav-group > * { flex-shrink: 0; }

.sidebar-section-title {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sidebar-muted);
    padding: 0.5rem 0.85rem 0.35rem;
}

.sidebar-section-title:not(:first-child) {
    margin-top: 0.75rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.72rem 0.85rem;
    border-radius: 12px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-nav-label,
.sidebar-nav-item > span:not(.sidebar-nav-icon):not(.sidebar-nav-badge) {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #FFFFFF;
}

.sidebar-nav-parent.current-branch {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-nav-child {
    margin-left: 16px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 0 10px 10px 0;
    font-size: .82rem;
}

.sidebar-disclosure {
    margin-top: 0.55rem;
}

.sidebar-disclosure-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-inline: 6px;
    padding: 0.72rem 0.85rem;
    border-radius: 12px;
    color: var(--sidebar-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.sidebar-disclosure-title::-webkit-details-marker { display: none; }

.sidebar-disclosure-title::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.sidebar-disclosure[open] .sidebar-disclosure-title::after {
    transform: rotate(225deg);
}

.sidebar-disclosure-title:hover,
.sidebar-disclosure-title:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.sidebar-disclosure-content {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding-top: 6px;
}

.sidebar-nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(252, 204, 66, 0.25);
}

.sidebar-nav-item.active svg {
    color: var(--sidebar-active-text);
    stroke: var(--sidebar-active-text);
}

.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-nav-badge {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    line-height: 1.25;
}

.sidebar-nav-item.active .sidebar-nav-badge {
    background: rgba(21, 19, 19, 0.15);
    color: var(--sidebar-active-text);
}

/* Sidebar Footer Profile Quick Card */
.sidebar-footer {
    padding: 0.75rem 1.125rem;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-user-brief {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #FFFFFF;
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    transition: background 0.18s ease;
}

.sidebar-user-brief:hover,
.sidebar-user-brief:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--c-yellow);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-streak {
    font-size: 0.74rem;
    color: var(--c-yellow, #F59E0B);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
}

.sidebar-user-streak svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: #F59E0B;
    fill: currentColor;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.45));
}

/* ==========================================================================
   MAIN CONTENT CANVAS & TOP BAR
   ========================================================================== */

.app-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Sidebar Collapsed State (Antigravity & ChatGPT Style) */
.app-shell.sidebar-collapsed .app-sidebar {
    transform: translateX(-100%);
}

.app-shell.sidebar-collapsed .app-main {
    margin-left: 0 !important;
}

/* Universal Sidebar Toggle Buttons (Antigravity / ChatGPT Panel Left) */
.sidebar-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 11px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.18s ease;
    flex-shrink: 0;
    padding: 0;
}

.sidebar-toggle-btn svg { display: block; }

.sidebar-toggle-btn:hover {
    background: rgba(128, 128, 128, 0.12);
    border-color: rgba(128, 128, 128, 0.2);
    color: var(--text-primary);
}

.sidebar-header-toggle {
    width: 32px;
    height: 32px;
    color: var(--sidebar-text);
}

.sidebar-header-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.topbar-sidebar-toggle {
    display: inline-flex;
}

/* Desktop: Hide duplicate topbar toggle when sidebar is open */
@media (min-width: 769px) {
    .app-shell:not(.sidebar-collapsed) .topbar-sidebar-toggle {
        display: none !important;
    }
    .app-shell.sidebar-collapsed .topbar-sidebar-toggle {
        display: inline-flex !important;
    }
    .app-shell.sidebar-collapsed .app-topbar-inner {
        padding-left: 1.25rem;
    }
}

/* Top Bar Styling matching Reference */
.app-topbar {
    height: var(--topbar-h);
    padding: 0;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(247, 247, 245, 0.88);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--card-border);
    width: 100%;
}

.app-topbar-inner {
    width: 100%;
    max-width: var(--view-max-w, 1440px);
    margin: 0 auto;
    padding: 0 var(--view-padding-x, clamp(1rem, 2.5vw, 2.25rem));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.topbar-leading { display: flex; align-items: center; gap: 12px; }

[data-theme="dark"] .app-topbar {
    background: rgba(13, 15, 18, 0.88);
}

[data-theme="ui"] .app-topbar {
    background: rgba(255, 251, 235, 0.92);
    border-bottom-color: rgba(234, 179, 8, 0.22);
}

[data-theme="itb"] .app-topbar {
    background: rgba(237, 245, 253, 0.92);
    border-bottom-color: rgba(2, 132, 199, 0.18);
}

[data-theme="ugm"] .app-topbar {
    background: rgba(245, 239, 235, 0.92);
    border-bottom-color: rgba(180, 83, 9, 0.18);
}

/* Greeting Block */
.topbar-greeting {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.topbar-greeting strong {
    color: var(--text-primary);
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.05rem;
}

/* Sleek Pill Global Search Trigger (Reference Match) */
.topbar-search-wrap {
    flex: 1;
    max-width: 480px;
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: var(--radius-pill);
    padding: 0 10px 0 14px;
    height: 44px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.topbar-search-wrap:hover {
    border-color: rgba(245, 158, 11, 0.6);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
}

.topbar-search-icon {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    margin-right: 10px;
    flex-shrink: 0;
}

.topbar-search-input {
    flex: 1;
    width: auto;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0;
    font-size: 0.88rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    cursor: pointer;
    box-shadow: none;
}

.topbar-search-input:focus {
    box-shadow: none;
    border: none;
}

.topbar-search-btn {
    position: absolute;
    right: 5px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-coral);
    color: #FFFFFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.topbar-search-btn:hover {
    background: var(--btn-primary-hover);
    transform: scale(1.05);
}

/* Right Actions (Countdown, Notif, Theme, User) */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Countdown Pill */
.countdown-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.countdown-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
    animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

/* Circular Action Button (Theme, Notif) */
.topbar-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    position: relative;
}

.topbar-btn:hover {
    background: rgba(21, 19, 19, 0.05);
    border-color: var(--text-primary);
    transform: translateY(-1px);
}

.topbar-badge-dot {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-coral);
    border: 2px solid var(--card-bg);
}

/* User Account Badge Button */
.topbar-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    padding: 4px 14px 4px 4px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-user-badge:hover {
    border-color: var(--text-primary);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.topbar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--c-yellow);
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.topbar-user-name {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.topbar-user-handle {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Mobile Toggle Hamburger */
.mobile-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 6px;
    align-items: center;
    justify-content: center;
}

/* Mobile Search Icon Trigger */
.mobile-search-btn {
    display: none;
}

.search-shortcut-hint {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(128, 128, 128, 0.08);
    padding: 3px 8px;
    border-radius: 6px;
    pointer-events: none;
    border: 1px solid rgba(128, 128, 128, 0.18);
    flex-shrink: 0;
}

.search-shortcut-hint kbd {
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 800;
}

.search-result-item.is-focused,
.search-quick-card.is-focused {
    background: rgba(245, 158, 11, 0.15) !important;
    outline: 2px solid rgba(245, 158, 11, 0.6) !important;
}

/* ==========================================================================
   VIEW CONTAINER & MAIN CANVAS INNER
   ========================================================================== */

.app-view-container {
    padding: 2rem var(--view-padding-x, clamp(1rem, 2.5vw, 2.25rem));
    flex: 1;
    max-width: var(--view-max-w, 1440px);
    width: 100%;
    margin: 0 auto;
}

/* Sidebar Drawer Backdrop for Mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

@media (max-width: 768px) {
    .sidebar-backdrop {
        display: block;
    }
    .app-sidebar.open ~ .sidebar-backdrop,
    .app-shell.mobile-sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Bottom Nav for Mobile / Handphone */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #151313;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    justify-content: space-around;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mobile-bottom-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #A1A1AA;
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 700;
    transition: all 0.18s ease;
    min-width: 44px;
    min-height: 44px; /* Touch target >= 44px */
}

.mobile-bottom-item.active {
    color: var(--c-yellow);
    transform: translateY(-2px);
}

.mobile-bottom-item svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   THEME-AWARE VECTOR SILHOUETTE STYLING
   ========================================================================== */
.intinya-silhouette, .intinya-silhouette {
    width: 100%;
    height: 100%;
    color: var(--text-primary);
    transition: color 0.2s ease, transform 0.2s ease;
}

.silhouette-box {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(21, 19, 19, 0.05);
    color: var(--text-primary);
}

[data-theme="dark"] .silhouette-box {
    background: rgba(255, 255, 255, 0.06);
}

[data-theme="ui"] .silhouette-box {
    background: rgba(255, 215, 0, 0.12);
    color: #FFD700;
}

[data-theme="itb"] .silhouette-box {
    background: rgba(2, 132, 199, 0.12);
    color: #0284C7;
}

[data-theme="ugm"] .silhouette-box {
    background: rgba(180, 83, 9, 0.12);
    color: #B45309;
}

/* ==========================================================================
   GLOBAL SPOTLIGHT SEARCH MODAL (Desktop & Mobile Optimized)
   ========================================================================== */
.search-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 10vh 1rem 2rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.search-modal-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-modal-container {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 24px;
    width: 100%;
    max-width: 620px;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.search-modal-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--card-border);
    gap: 12px;
}

.search-modal-icon {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.search-modal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1.05rem;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text-primary);
}

.search-modal-close {
    background: rgba(128, 128, 128, 0.12);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}

.search-modal-close:hover {
    background: rgba(128, 128, 128, 0.25);
}

.search-modal-results {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.search-section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.search-quick-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.search-quick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(128, 128, 128, 0.05);
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.search-quick-card:hover {
    background: rgba(252, 204, 66, 0.15);
    border-color: var(--c-yellow);
    transform: translateY(-1px);
}

.search-quick-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    flex-shrink: 0;
}

.search-quick-title {
    font-size: 0.85rem;
    font-weight: 750;
    line-height: 1.2;
}

.search-quick-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.search-subtest-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: background 0.15s ease;
}

.search-result-item:hover {
    background: rgba(128, 128, 128, 0.08);
}

.search-result-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.search-subtest-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    background: #151313;
    color: #FFFFFF;
    flex-shrink: 0;
}

.search-subtest-badge.badge-topic {
    background: rgba(252, 204, 66, 0.25);
    color: #92400E;
}

[data-theme="dark"] .search-subtest-badge.badge-topic {
    color: #FCCC42;
}

.search-result-title {
    font-size: 0.9rem;
    font-weight: 750;
}

.search-result-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.search-result-arrow {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.1rem;
}

.search-empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}

.search-modal-footer {
    padding: 0.75rem 1.25rem;
    background: rgba(128, 128, 128, 0.04);
    border-top: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.search-modal-footer kbd {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.7rem;
}

/* ==========================================================================
   GLOBAL TOAST ALERT
   ========================================================================== */
.intinya-toast, .intinya-toast {
    position: fixed;
    bottom: 84px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #151313;
    color: #FFFFFF;
    padding: 10px 22px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.intinya-toast, .intinya-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Handphone & Tablet Ergonomics)
   ========================================================================== */

@media (max-width: 1024px) {
    :root {
        --sidebar-w: 250px;
    }
    .app-topbar-inner {
        padding: 0 1.25rem;
    }
    .app-view-container {
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0,0,0,0.5);
    }
    .app-main {
        margin-left: 0;
        padding-bottom: 74px; /* Space for bottom nav */
    }
    .mobile-sidebar-toggle {
        display: flex;
    }
    .topbar-search-wrap {
        display: none; /* Accessible via mobile search icon */
    }
    .mobile-search-btn {
        display: flex;
    }
    .countdown-pill {
        display: none; /* Preserved in status strip & modal */
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .topbar-user-name,
    .topbar-user-handle {
        display: none;
    }
    .topbar-user-badge {
        padding: 4px;
    }
    .search-modal-backdrop {
        padding: 0;
        align-items: flex-end;
    }
    .search-modal-container {
        max-height: 90vh;
        border-radius: 24px 24px 0 0;
        border-bottom: none;
    }
    .search-quick-grid {
        grid-template-columns: 1fr;
    }
    .search-result-sub {
        max-width: 220px;
    }
}

@media (max-width: 480px) {
    .app-topbar {
        height: 62px;
    }
    .app-topbar-inner {
        padding: 0 0.85rem;
    }
    .topbar-actions {
        gap: 6px;
    }
    .topbar-btn {
        width: 38px;
        height: 38px;
    }
    .app-view-container {
        padding: 1rem 0.85rem;
    }
    .intinya-toast, .intinya-toast {
        bottom: 80px;
        font-size: 0.78rem;
        padding: 8px 18px;
        max-width: 90%;
        white-space: normal;
        text-align: center;
    }
}

/* ==========================================================================
   SUBTEST & CATEGORY FILTER PILLS (UNIVERSAL APPSHELL)
   Used in cbt.html, dashboard.html, error-log.html
   ========================================================================== */
.cat-pill {
    background: var(--card-bg, #FFFFFF);
    border: 1.5px solid var(--card-border, rgba(0, 0, 0, 0.08));
    color: var(--text-primary, #18181B);
    padding: 7px 18px;
    border-radius: var(--radius-pill, 999px);
    font-size: 0.85rem;
    font-weight: 750;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cat-pill:hover {
    border-color: var(--brand-primary, #F59E0B);
    transform: translateY(-1px);
}

.cat-pill.active {
    background: var(--c-dark, #18181B);
    color: #FFFFFF;
    border-color: var(--c-dark, #18181B);
    box-shadow: 0 4px 14px rgba(24, 24, 27, 0.2);
}

[data-theme="dark"] .cat-pill.active {
    background: var(--c-yellow, #FBBF24);
    color: #0F172A;
    border-color: var(--c-yellow, #FBBF24);
    box-shadow: 0 4px 16px rgba(251, 191, 36, 0.25);
}

[data-theme="ui"] .cat-pill.active {
    background: #EAB308;
    color: #1C1917;
    border-color: #EAB308;
    box-shadow: 0 4px 16px rgba(234, 179, 8, 0.3);
}

[data-theme="itb"] .cat-pill.active {
    background: #0284C7;
    color: #FFFFFF;
    border-color: #0284C7;
    box-shadow: 0 4px 16px rgba(2, 132, 199, 0.25);
}

[data-theme="ugm"] .cat-pill.active {
    background: #B45309;
    color: #FFFFFF;
    border-color: #B45309;
    box-shadow: 0 4px 16px rgba(180, 83, 9, 0.25);
}
/* Daily streak and actionable notification cards. */
body[data-streak-tier="orange"], [data-streak-tier="orange"] { --streak-color: #d97706; --streak-soft: #fff0d5; }
body[data-streak-tier="purple"], [data-streak-tier="purple"] { --streak-color: #9650dc; --streak-soft: #eee0ff; }
body[data-streak-tier="blue"], [data-streak-tier="blue"] { --streak-color: #2587e6; --streak-soft: #deefff; }
body[data-streak-tier="inactive"] { --streak-color: var(--text-muted); --streak-soft: var(--surface-muted); }
body[data-streak-tier] :is(.intinya-flame-icon, .bubble-flame, .sidebar-user-streak, .sidebar-user-streak svg, .topbar-user-handle) { color: var(--streak-color) !important; }
body[data-streak-tier] .bubble-flame { background: var(--streak-soft); }
.streak-milestone { position: fixed; inset: 0; z-index: 100010; display: grid; place-items: center; padding: 20px; background: #17151b30; pointer-events: auto; }
.streak-milestone-card { position: relative; width: min(290px, 100%); padding: 30px 24px 24px; border: 1px solid var(--card-border); border-radius: 24px; background: var(--card-bg, #fff); color: var(--text-primary); text-align: center; box-shadow: 0 12px 45px #0002; animation: streak-card-in .25s ease-out both; }
.streak-milestone-flame { display: grid; place-items: center; color: var(--streak-color); height: 100px; }
.streak-milestone-flame svg { width: 76px; height: 76px; transform-origin: 50% 85%; animation: streak-ignite 1.1s ease-out both; filter: drop-shadow(0 5px 12px var(--streak-soft)); }
.streak-milestone-card strong { display: block; font: 700 23px/1.4 var(--font-display); }
.streak-milestone-card p { margin: 7px 0 0; font-size: 13px; color: var(--text-secondary); }
.streak-milestone-card button { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; font: 20px/1 sans-serif; background: transparent; color: var(--text-secondary); cursor: pointer; }
@keyframes streak-card-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes streak-ignite { 0% { opacity: 0; transform: scale(.3); } 40% { opacity: 1; transform: scale(1.12) rotate(-4deg); } 65% { transform: scale(.95) rotate(3deg); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .streak-milestone-card, .streak-milestone-flame svg { animation: none; } }
body[data-streak-active="false"] .bubble-flame,
body[data-streak-active="false"] .sidebar-user-streak,
body[data-streak-active="false"] .sidebar-user-streak svg,
body[data-streak-active="false"] .topbar-user-handle { color: var(--text-muted) !important; }
body[data-streak-active="false"] .bubble-flame { background: var(--surface-muted, #e9ebee); }
body[data-streak-active="true"] .bubble-flame,
body[data-streak-active="true"] .sidebar-user-streak,
body[data-streak-active="true"] .sidebar-user-streak svg,
body[data-streak-active="true"] .topbar-user-handle { color: var(--warning, #d97706) !important; }
.notification-panel { position: fixed; z-index: 10010; width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 120px); overflow-y: auto; border: 1px solid var(--card-border); border-radius: 18px; background: var(--card-bg); color: var(--text-primary); box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.notification-panel[hidden] { display: none; }
.notification-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--card-border); }
.notification-panel-header h2 { font: 700 1rem/1.4 var(--font-display); margin: 0 0 3px; }
.notification-panel-header p, .notification-item p { color: var(--text-secondary); font-size: .78rem; line-height: 1.6; margin: 0; }
.notification-panel-header button { display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--card-border); background: var(--surface-muted, var(--card-bg)); color: var(--text-primary); width: 36px; height: 36px; border-radius: 10px; line-height: 1; cursor: pointer; flex: 0 0 36px; }
.notification-panel-header button svg { display: block; flex: 0 0 auto; }
.notification-list { padding: 10px; display: grid; gap: 8px; }
.notification-item { padding: 14px; border: 1px solid var(--card-border); border-radius: 12px; background: var(--surface-muted, var(--canvas-bg)); }
.notification-item h3 { font: 700 .84rem/1.5 var(--font-body); margin: 0 0 6px; overflow-wrap: anywhere; }
.notification-item a { display: inline-flex; gap: 8px; align-items: center; min-height: 40px; margin-top: 6px; color: var(--primary-text, var(--text-primary)); font-size: .78rem; font-weight: 700; text-decoration: none; }
@media (max-width: 768px) {
    html[data-shell-view] .notification-panel { max-height: calc(100dvh - 190px - env(safe-area-inset-bottom, 0px)); }
}
