/* DESIGN SYSTEM & VARIABLE DEFINITIONS */
:root {
    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Theme colors: Default Dark */
    --bg-app: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: rgba(30, 41, 59, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.9);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: #3b82f6;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --shadow-premium: 0 4px 20px rgba(0, 0, 0, 0.25);

    /* UI Brand Accent Colors - Muted & Sophisticated */
    --primary: #1e3a8a; /* Deep Corporate Navy Blue */
    --primary-light: #3b82f6; /* Modern Blue */
    --secondary: #475569; /* Warm Slate */
    --success: #059669; /* Muted Emerald */
    --success-light: #10b981;
    --warning: #d97706; /* Muted Gold/Amber */
    --danger: #b91c1c; /* Muted Crimson */
    --danger-light: #ef4444;
    --info: #0891b2; /* Muted Cyan */

    /* Gradients - Corporate Dark Elegance */
    --grad-primary: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%); /* Deep rich Navy to Slate */
    --grad-success: linear-gradient(135deg, #059669 0%, #064e3b 100%);
    --grad-danger: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
    --grad-dark-card: linear-gradient(135deg, rgba(30, 41, 59, 0.75) 0%, rgba(15, 23, 42, 0.75) 100%);

    /* Indentations for Hierarchy Levels */
    --indent-program: 0px;
    --indent-kegiatan: 15px;
    --indent-kro: 30px;
    --indent-ro: 45px;
    --indent-komponen: 60px;
    --indent-subkomponen: 75px;
    --indent-akun: 90px;
    --indent-item: 105px;
    
    /* Transitions */
    --transition-fast: all 0.2s ease;
    --transition-smooth: all 0.3s ease;
}

/* Light Theme Variables */
body.light-theme {
    --bg-app: #f1f5f9; /* Soft light gray-slate background for panel contrast */
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-glass: #e2e8f0;
    --border-glass-focus: #1e3a8a;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --shadow-premium: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --grad-dark-card: #ffffff;
    --grad-primary: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); /* Professional blue gradient */
}

/* Light Theme Badges Contrast Enhancements - Corporate Tonal Badges */
body.light-theme .badge-level.p { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; border-radius: 6px; }
body.light-theme .badge-level.k { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; border-radius: 6px; }
body.light-theme .badge-level.kro { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 6px; }
body.light-theme .badge-level.ro { background: #fffbeb; color: #b45309; border: 1px solid #fef3c7; border-radius: 6px; }
body.light-theme .badge-level.komp { background: #f8fafc; color: #475569; border: 1px solid #e2e8f0; border-radius: 6px; }
body.light-theme .badge-level.subk { background: #f0fdf4; color: #166534; border: 1px solid #dcfce7; border-radius: 6px; }
body.light-theme .badge-level.ak { background: #faf5ff; color: #6b21a8; border: 1px solid #f3e8ff; border-radius: 6px; }
body.light-theme .badge-level.it { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; border-radius: 6px; }

/* Light Theme Table Row Hierarchy - Matched to PDF backgrounds */
body.light-theme .row-program {
    background: #f8fafc !important;
}
body.light-theme .row-kegiatan {
    background: #f1f5f9 !important; 
    border-bottom: 1px solid #e2e8f0 !important;
}
body.light-theme .row-kro {
    background: #f8fafc !important;
}
body.light-theme .row-ro {
    background: #f1f5f9 !important;
}
body.light-theme .row-ro td strong {
    font-weight: 600 !important;
}
body.light-theme .row-komponen {
    background: #ffffff !important;
}
body.light-theme .row-subkomponen {
    background: #ecfdf5 !important;
}
body.light-theme .row-akun {
    background: #f3e8ff !important;
}
body.light-theme .row-item {
    background: #ffffff !important;
}

/* Light Theme Table Row Text Colors matching Excel & PDF styles */
body.light-theme .row-program td,
body.light-theme .row-program td *,
body.light-theme .row-program td strong {
    color: #0f172a !important;
}
body.light-theme .row-kegiatan td,
body.light-theme .row-kegiatan td *,
body.light-theme .row-kegiatan td strong {
    color: #1e3a8a !important; /* Navy */
}
body.light-theme .row-kro td,
body.light-theme .row-kro td *,
body.light-theme .row-kro td strong {
    color: #b91c1c !important; /* Red */
}
body.light-theme .row-ro td,
body.light-theme .row-ro td *,
body.light-theme .row-ro td strong {
    color: #b45309 !important; /* Amber */
}
body.light-theme .row-komponen td,
body.light-theme .row-komponen td *,
body.light-theme .row-komponen td strong {
    color: #334155 !important;
}
body.light-theme .row-subkomponen td,
body.light-theme .row-subkomponen td *,
body.light-theme .row-subkomponen td strong {
    color: #166534 !important; /* Green */
}
body.light-theme .row-akun td,
body.light-theme .row-akun td *,
body.light-theme .row-akun td strong {
    color: #6b21a8 !important; /* Purple */
}
body.light-theme .row-item td,
body.light-theme .row-item td *,
body.light-theme .row-item td strong {
    color: #0f172a !important;
}

/* Light Theme Form Controls */
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme input[type="password"],
body.light-theme select,
body.light-theme .search-box {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02) !important;
}

body.light-theme input::placeholder,
body.light-theme select::placeholder,
body.light-theme textarea::placeholder {
    color: #94a3b8 !important;
}

body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme .search-box:focus-within {
    background: #ffffff !important;
    border-color: #1e3a8a !important;
    box-shadow: 0 0 0 2px rgba(30, 58, 138, 0.1) !important;
}

/* Light Theme Button UI Enhancements */
body.light-theme .btn-primary {
    background: #1e3a8a !important; /* Solid Navy Button */
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
}
body.light-theme .btn-primary:hover {
    background: #1e40af !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    filter: none !important;
}

body.light-theme .btn-secondary {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}
body.light-theme .btn-secondary:hover {
    background: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .btn-outline {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}
body.light-theme .btn-outline:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

body.light-theme .btn-icon {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}
body.light-theme .btn-icon:hover {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

/* Light Theme Misc Element Polishing */
body.light-theme .rkk-table th {
    background: #f8fafc !important;
    color: #475569 !important;
    border-bottom: 2px solid #cbd5e1 !important;
    font-weight: 700 !important;
    font-size: 0.72rem !important;
}

body.light-theme .rkk-table td {
    border-bottom: 1px solid #f1f5f9 !important;
}

body.light-theme .dropdown-content {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03) !important;
}
body.light-theme .dropdown-content a {
    color: #334155 !important;
}
body.light-theme .dropdown-content a:hover {
    background-color: #f1f5f9 !important;
}

body.light-theme .toast {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

body.light-theme .stat-mini {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-theme .chart-bar-track {
    background: #e2e8f0 !important;
}

body.light-theme .db-status-bar {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-theme .db-status-text {
    color: #334155 !important;
}

body.light-theme .read-only-total {
    background: #f0fdf4 !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

/* Custom global placeholders & option styles */
input::placeholder, select::placeholder, textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

select option {
    background-color: var(--bg-sidebar);
    color: var(--text-primary);
}

/* CORE STYLES & RESET */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: var(--transition-smooth);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* APP CONTAINER LAYOUT */
.app-container {
    display: block;
    min-height: 100vh;
}

/* SIDEBAR STYLES */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 10;
    width: 320px;
    box-sizing: border-box;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-container.sidebar-collapsed .sidebar {
    width: 0;
    padding: 0;
    opacity: 0;
    border-right: none;
    pointer-events: none;
    overflow: hidden;
}

/* ==========================================
   BOTTOM NAVBAR & BOTTOM SHEET (replaces sidebar)
   ========================================== */
.sidebar {
    display: none !important;
}

.mobile-menu-overlay,
.mobile-menu-sheet {
    display: block;
}

.mobile-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    z-index: 9000;
    padding: 0 0.25rem;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mobile-navbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    padding: 0.35rem 0.5rem;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-family: var(--font-body);
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    min-width: 48px;
    -webkit-tap-highlight-color: transparent;
}

.mobile-navbar-item i {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.mobile-navbar-item.active {
    color: var(--primary);
    font-weight: 700;
}

.mobile-navbar-item.active i {
    transform: scale(1.1);
}

.mobile-navbar-item:active {
    background: rgba(var(--primary-rgb, 37, 99, 235), 0.08);
}

/* Bottom Sheet Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Bottom Sheet */
.mobile-menu-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 9600;
    padding: 0.75rem 1.25rem 1.5rem;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
    max-height: 70vh;
    overflow-y: auto;
}

.mobile-menu-sheet.active {
    transform: translateY(0);
}

.mobile-menu-handle {
    width: 36px;
    height: 4px;
    background: var(--text-secondary);
    opacity: 0.3;
    border-radius: 2px;
    margin: 0 auto 1rem;
}

.mobile-menu-user {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem;
    border-radius: 14px;
    background: rgba(var(--primary-rgb, 37, 99, 235), 0.06);
    margin-bottom: 1rem;
}

.mobile-menu-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mobile-menu-user strong {
    display: block;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.mobile-menu-role {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.mobile-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
}

.mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.75rem;
    border: none;
    background: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-body);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    width: 100%;
    text-align: left;
}

.mobile-menu-btn:hover,
.mobile-menu-btn:active {
    background: rgba(var(--primary-rgb, 37, 99, 235), 0.06);
}

.mobile-menu-btn i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    color: var(--text-secondary);
}

.mobile-menu-btn-danger {
    color: var(--danger);
}

.mobile-menu-btn-danger i {
    color: var(--danger);
}

.mobile-menu-copyright {
    text-align: center;
    font-size: 0.7rem;
    color: var(--text-secondary);
    opacity: 0.6;
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-glass);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo h2 span {
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-text-icon {
    font-size: 1.75rem;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* GLASSMORPHISM CARD SYSTEM */
.card-glass {
    background: var(--grad-dark-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
}

.card-glass:hover {
    border-color: rgba(99, 102, 241, 0.2);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-section h3 {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sidebar Navigation Menu */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.sidebar-nav .btn {
    justify-content: flex-start;
    border-radius: 10px;
    text-align: left;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

.sidebar-footer-btn {
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-copyright {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.25rem;
}

/* Sidebar Navigation Active State */
.sidebar-nav .btn.nav-active {
    background: var(--grad-primary) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.3);
}

.sidebar-nav .btn:not(.nav-active) {
    background: transparent !important;
    border: 1px solid var(--border-glass) !important;
}

.sidebar-nav .btn:not(.nav-active):hover {
    background: rgba(255, 255, 255, 0.04) !important;
    border-color: var(--text-secondary) !important;
}

/* Toggle Sidebar Button (for admin workspaces) */
.btn-toggle-sidebar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.1rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.btn-toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

body.light-theme .btn-toggle-sidebar {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #475569;
}

body.light-theme .btn-toggle-sidebar:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Account Filter Bar */
.account-filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0;
}

.account-filter-label {
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 150px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.account-filter-select {
    flex: 1;
    max-width: 400px;
}

/* ROLE SELECTOR BADGES */
.role-selector-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.role-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.role-badge.active-role {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.role-badge.admin-role {
    background: var(--grad-success);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

/* STATISTICAL BOXES */
.stat-box {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.15);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--primary-light);
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.stat-mini {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    padding: 0.75rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mini-value {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mini-value-small {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--info);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mini-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 0.15rem;
}

/* PURE CSS BAR CHARTS */
.chart-container h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chart-bar-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 500;
}

.chart-bar-code {
    color: var(--text-primary);
}

.chart-bar-val {
    color: var(--text-secondary);
}

.chart-bar-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.fill-pegawai { background: var(--info); }
.fill-barang { background: var(--primary); }
.fill-modal { background: var(--secondary); }

.chart-placeholder {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1rem 0;
}

/* DATABASE CONFIG & SYNC PANEL */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lock-icon {
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.db-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    border: 1px solid var(--border-glass);
    margin-bottom: 0.5rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.status-indicator.online {
    background-color: var(--success);
    color: var(--success);
}

.status-indicator.offline {
    background-color: var(--danger);
    color: var(--danger);
}

.status-text {
    font-weight: 600;
}

.admin-locked-message {
    padding: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--text-secondary);
}

.admin-locked-message i {
    color: var(--warning);
}

/* MAIN WORKSPACE LAYOUT */
.main-content {
    padding: 1.5rem;
    padding-bottom: calc(60px + 1.5rem); /* clear bottom navbar */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 100;
}



.document-info {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.editable-title {
    background: transparent;
    border: none;
    border-bottom: 1px dashed transparent;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    width: 100%;
    padding: 0.15rem 0;
    transition: var(--transition-fast);
}

.editable-title:hover, .editable-title:focus {
    border-color: var(--border-glass-focus);
    outline: none;
}

.editable-subtitle {
    background: transparent;
    border: none;
    border-bottom: 1px dashed transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    width: 100%;
    padding: 0.15rem 0;
    transition: var(--transition-fast);
}

.editable-subtitle:hover, .editable-subtitle:focus {
    border-color: var(--border-glass-focus);
    outline: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* FILTERS ROW */
.workspace-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 1rem;
    margin-bottom: 1rem;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-premium);
}

body.light-theme .workspace-filters {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03) !important;
}

.toolbar-state {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .toolbar-state {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
}

/* CLIPBOARD COPY BANNER */
.clipboard-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: rgba(59, 130, 246, 0.08);
    border: 1px dashed var(--primary-light);
    border-radius: 12px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text-primary);
    animation: fadeIn 0.2s ease-out;
}

.clipboard-status-banner strong {
    color: var(--primary-light);
    font-weight: 600;
}

.clipboard-status-banner .badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0 0.85rem;
    flex: 1;
    max-width: 480px;
    transition: var(--transition-fast);
    height: 36px;
    box-sizing: border-box;
}

.search-box:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.search-box input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 0 !important;
    color: var(--text-primary) !important;
    width: 100% !important;
    font-size: 0.9rem !important;
}

body.light-theme .search-box input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #0f172a !important;
}

.search-box i {
    color: var(--text-muted);
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
}

/* FORM ELEMENTS & INPUTS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
    width: 100%;
}

.form-group label,
.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: block;
}

input[type="text"], input[type="number"], input[type="password"] {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    width: 100%;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: rgba(255, 255, 255, 0.03);
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23a1a1aa' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.65rem 2.5rem 0.65rem 0.85rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    width: 100%;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.form-row .form-group {
    flex: 1;
}

.flex-2 { flex: 2 !important; }
.flex-1 { flex: 1 !important; }

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    filter: none !important;
}

.btn-primary {
    background: var(--grad-primary);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.btn-success {
    background: var(--grad-success);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--text-secondary);
}

.btn-icon {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary-light);
    border-color: rgba(99, 102, 241, 0.2);
}

.btn-sm {
    padding: 0 0.85rem;
    font-size: 0.85rem;
    border-radius: 8px;
    height: 36px;
    box-sizing: border-box;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.w-full {
    width: 100%;
}

/* HIERARCHICAL TREE TABLE STYLES */
.workspace-body {
    padding: 0;
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
    max-height: calc(100vh - 220px);
}

.rkk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.rkk-table th {
    background: rgba(15, 23, 42, 0.4);
    padding: 0.85rem 1.1rem;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-glass);
    text-align: left;
}

.rkk-table td {
    padding: 0.65rem 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
    color: var(--text-primary);
}

.rkk-table tbody tr {
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.rkk-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035) !important;
    box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.03);
}

/* Rows styling for each Level */
.row-program {
    background: rgba(99, 102, 241, 0.05);
    font-weight: 700;
}
.row-program td:first-child {
    border-left: 4px solid var(--primary);
}

.row-kegiatan {
    background: rgba(168, 85, 247, 0.03);
    font-weight: 600;
}
.row-kegiatan td,
.row-kegiatan td *,
.row-kegiatan td strong {
    color: #60a5fa !important; /* Blue text on screen */
}
.row-kegiatan td:first-child {
    border-left: 4px solid var(--secondary);
}

.row-kro {
    background: rgba(6, 182, 212, 0.02);
    font-weight: 600;
}
.row-kro td,
.row-kro td *,
.row-kro td strong {
    color: #f87171 !important; /* Red text on screen */
}
.row-kro td:first-child {
    border-left: 4px solid var(--info);
}

.row-ro {
    background: rgba(245, 158, 11, 0.015);
    font-weight: 600;
}
.row-ro td,
.row-ro td *,
.row-ro td strong {
    color: #ffffff !important; /* Bold white on screen */
    font-weight: 700 !important;
}
.row-ro td:first-child {
    border-left: 4px solid var(--warning);
}

.row-komponen {
    background: rgba(255, 255, 255, 0.005);
    font-weight: 600;
}
.row-komponen td,
.row-komponen td *,
.row-komponen td strong {
    color: #ffffff !important; /* Bold white on screen */
    font-weight: 700 !important;
}
.row-komponen td:first-child {
    border-left: 4px solid var(--text-secondary);
}

.row-subkomponen {
    background: rgba(16, 185, 129, 0.02);
    font-weight: 500;
}
.row-subkomponen td:first-child {
    border-left: 4px solid var(--success);
}

.row-akun {
    background: rgba(255, 255, 255, 0.01);
    font-weight: 500;
}
.row-akun td:first-child {
    border-left: 4px solid var(--primary-light);
}

.row-item {
    background: transparent;
}

/* Indentation offsets */
.indent-1 { padding-left: calc(1.1rem + var(--indent-kegiatan)) !important; }
.indent-2 { padding-left: calc(1.1rem + var(--indent-kro)) !important; }
.indent-3 { padding-left: calc(1.1rem + var(--indent-ro)) !important; }
.indent-4 { padding-left: calc(1.1rem + var(--indent-komponen)) !important; }
.indent-5 { padding-left: calc(1.1rem + var(--indent-subkomponen)) !important; }
.indent-6 { padding-left: calc(1.1rem + var(--indent-akun)) !important; }
.indent-7 { padding-left: calc(1.1rem + var(--indent-item)) !important; }

/* Level badges */
.badge-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 0.6rem;
    letter-spacing: 0.03em;
}

.badge-level.p { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.badge-level.k { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-level.kro { background: rgba(6, 182, 212, 0.15); color: #22d3ee; }
.badge-level.ro { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-level.komp { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.badge-level.subk { background: rgba(16, 185, 129, 0.15); color: var(--success-light); }
.badge-level.ak { background: rgba(236, 72, 153, 0.15); color: #f472b6; }
.badge-level.it { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

/* Tree Collapse/Expand toggle */
.tree-toggle {
    margin-right: 0.6rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tree-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: scale(1.15);
}

.tree-toggle.collapsed {
    transform: rotate(-90deg);
}
.tree-toggle.collapsed:hover {
    transform: rotate(-90deg) scale(1.15);
}

/* Alignment utilities */
.text-right { text-align: right !important; }
.text-center { text-align: center !important; }

/* Actions cell buttons */
.row-actions {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
}

.row-btn {
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.row-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.row-btn.add-btn {
    border-color: rgba(16, 185, 129, 0.15);
    background: rgba(16, 185, 129, 0.02);
}
.row-btn.add-btn:hover {
    color: var(--success-light);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.row-btn.edit-btn {
    border-color: rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.02);
}
.row-btn.edit-btn:hover {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.row-btn.del-btn {
    border-color: rgba(239, 68, 68, 0.15);
    background: rgba(239, 68, 68, 0.02);
}
.row-btn.del-btn:hover {
    color: var(--danger-light);
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Empty State */
.empty-state {
    padding: 4rem 2rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-state i {
    font-size: 3rem;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.7;
}

.empty-state p {
    font-size: 1rem;
    max-width: 400px;
    line-height: 1.5;
}

/* MODALS STYLES */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9800;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 90%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.open .modal-content {
    transform: scale(1);
}

.config-modal-content {
    max-width: 680px;
}

#editor-modal .modal-content {
    max-width: 780px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.modal-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header .close-modal-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.modal-header .close-modal-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.25rem 0;
}

.scrollable-modal-body {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-glass);
}

/* Tab controls inside Config Modal */
.tabs-header {
    display: flex;
    border-bottom: 1px solid var(--border-glass);
    margin-bottom: 1.25rem;
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    padding: 0.6rem 1.2rem;
    font-family: var(--font-heading);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary);
}

.tab-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.advanced-section {
    margin-top: 1.5rem;
    border-top: 1px dashed var(--border-glass);
    padding-top: 1.25rem;
}

.advanced-section h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.form-grid-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Password wrapper utility */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 2.5rem;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.toggle-password:hover {
    color: var(--text-primary);
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.db-test-result {
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.db-test-result.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: var(--success-light);
}

.db-test-result.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--danger-light);
}

.read-only-total {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: 0.75rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--success-light);
}

/* DROPDOWN SYSTEM */
.dropdown {
    position: relative;
    display: inline-block;
    z-index: 50;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-glass);
    min-width: 160px;
    box-shadow: var(--shadow-premium);
    z-index: 9999 !important;
    border-radius: 12px;
    overflow: visible;
    margin-top: 0.35rem;
}

/* Pseudo-element bridge to prevent hover loss between button and menu */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -0.5rem;
    left: 0;
    right: 0;
    height: 0.5rem;
    background: transparent;
}

.dropdown-content a {
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.88rem;
    font-weight: 500;
    transition: var(--transition-fast);
}

.dropdown-content a:first-child {
    border-top-left-radius: 11px;
    border-top-right-radius: 11px;
}

.dropdown-content a:last-child {
    border-bottom-left-radius: 11px;
    border-bottom-right-radius: 11px;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dropdown:hover .dropdown-content {
    display: block;
}

.text-green { color: var(--success) !important; }
.text-red { color: var(--danger) !important; }

/* TOAST NOTIFICATION STYLES */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 10000 !important;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-glass);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 0.95rem 1.5rem;
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    color: var(--text-primary);
    transform: translateX(120%);
    animation: toast-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
}

.toast.toast-info {
    border-left: 4px solid var(--info);
}

.toast.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-icon {
    font-size: 1.1rem;
}
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-info .toast-icon { color: var(--info); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-message {
    font-size: 0.88rem;
    font-weight: 500;
}

@keyframes toast-in {
    from {
        transform: translateX(120%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* CUSTOM SCROLLBAR */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* SPIN HOVER ANIMATION */
.fa-spin-hover:hover {
    animation: spin 1s infinite linear;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* MICRO ANIMATION FOR KEYFRAMES */
.anim-bounce {
    animation: modal-bounce 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modal-bounce {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Centered Workspace Header Styling for screen (desktop only) */
@media (min-width: 769px) {
    #rkk-workspace .workspace-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 1.5rem 1.25rem !important;
        gap: 0.75rem !important;
        position: relative !important;
    }

    #rkk-workspace .workspace-header .header-left {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
    }




    #rkk-workspace .workspace-header .document-info {
        align-items: center !important;
        text-align: center !important;
    }

    #rkk-workspace .workspace-header .document-info > div {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
    }

    #rkk-workspace .workspace-header .header-actions {
        justify-content: center !important;
        width: 100% !important;
        margin-top: 0.25rem !important;
    }
}

/* Screen mode styling for Total Pagu metadata display */
.workspace-analytics {
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0.5rem 0.25rem 0.75rem 0.25rem !important;
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.workspace-analytics .pagu-icon-box {
    display: none !important;
}

.workspace-analytics .stat-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.workspace-analytics .stat-label::after {
    content: " :";
    color: var(--text-secondary);
}

.workspace-analytics .stat-value {
    color: var(--primary-light);
    font-weight: 800;
    margin-left: 0.25rem;
}

/* HIDDEN UTILITY */
.hidden {
    display: none !important;
}

/* PRINT MEDIA STYLING (FOR PDF EXPORT) */
/* PRINT MEDIA STYLING (FOR PDF EXPORT) */
@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 10pt;
    }
    
    .sidebar, .workspace-header .header-actions, .workspace-filters, 
    .row-actions, #btn-save-draft, #btn-edit-rkk-meta, #btn-toggle-sidebar,
    .tree-toggle, #expand-all-btn, #collapse-all-btn, .modal, .toast-container {
        display: none !important;
    }

    .app-container {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 0;
        height: auto;
        overflow: visible;
    }

    .card-glass {
        background: none !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
    }

    /* Format Document Title & Subtitle */
    .header-left {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
    }
    
    .document-info {
        width: 100% !important;
        display: block !important;
        text-align: center !important;
        margin: 0 auto !important;
    }

    #doc-title-display {
        font-size: 16pt !important;
        font-weight: bold !important;
        text-align: center !important;
        margin-bottom: 0.25cm !important;
        color: black !important;
        width: 100% !important;
        display: block !important;
    }
    
    #doc-desc-display {
        font-size: 10pt !important;
        text-align: center !important;
        margin-bottom: 0.3cm !important;
        color: #475569 !important;
        width: 100% !important;
        display: block !important;
    }

    /* Format Pagu Stats Box */
    .workspace-analytics {
        background: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 0 0.35rem 0 !important;
        display: block !important;
        box-shadow: none !important;
        max-width: none !important;
        text-align: left !important;
    }
    .workspace-analytics .pagu-icon-box {
        display: none !important;
    }
    .workspace-analytics div > div {
        display: block !important;
    }
    .workspace-analytics .stat-label {
        font-size: 10.5pt !important;
        font-weight: 600 !important;
        color: #334155 !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        display: inline !important;
    }
    .workspace-analytics .stat-label::after {
        content: " : " !important;
    }
    .workspace-analytics .stat-value {
        font-size: 11pt !important;
        font-weight: 700 !important;
        color: #000000 !important;
        display: inline !important;
        margin-left: 2px !important;
        text-shadow: none !important;
    }

    /* Print Table Layout */
    .rkk-table {
        width: 100% !important;
        font-size: 8.5pt !important;
        border-collapse: collapse !important;
        page-break-inside: auto;
    }

    .rkk-table tr {
        page-break-inside: avoid !important;
        page-break-after: auto !important;
    }

    .rkk-table thead {
        display: table-header-group !important;
    }

    .rkk-table th {
        background: #e2e8f0 !important;
        color: #0f172a !important;
        border: 1px solid #94a3b8 !important;
        padding: 6px 8px !important;
        font-weight: bold !important;
        text-align: center !important;
    }

    .rkk-table td {
        border: 1px solid #cbd5e1 !important;
        padding: 5px 8px !important;
    }
    
    .row-program td, .row-program td *, .row-program td strong { color: #0f172a !important; }
    .row-kegiatan td, .row-kegiatan td *, .row-kegiatan td strong { color: #1e3a8a !important; }
    .row-kro td, .row-kro td *, .row-kro td strong { color: #b91c1c !important; }
    .row-ro td, .row-ro td *, .row-ro td strong { color: #b45309 !important; }
    .row-komponen td, .row-komponen td *, .row-komponen td strong { color: #334155 !important; }
    .row-subkomponen td, .row-subkomponen td *, .row-subkomponen td strong { color: #166534 !important; }
    .row-akun td, .row-akun td *, .row-akun td strong { color: #6b21a8 !important; }
    .row-item td, .row-item td *, .row-item td strong { color: #0f172a !important; }

    /* Hide the 7th column (Aksi/Action column) */
    .rkk-table th:nth-child(7),
    .rkk-table td:nth-child(7) {
        display: none !important;
    }

    /* Print color visibility overrides */
    .row-program { background-color: #f8fafc !important; }
    .row-kegiatan { background-color: #f1f5f9 !important; }
    .row-kro { background-color: #f8fafc !important; }
    .row-ro { background-color: #f1f5f9 !important; }
    .row-komponen { background-color: #ffffff !important; }
    .row-subkomponen { background-color: #ecfdf5 !important; }
    .row-akun { background-color: #f3e8ff !important; }

    .badge-level {
        border: 1px solid #64748b !important;
        color: #334155 !important;
        background: #f1f5f9 !important;
        font-size: 7.5pt !important;
        padding: 1px 4px !important;
        border-radius: 4px !important;
    }
}

/* AUTH LANDING SCREEN STYLING */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent 40%),
                var(--bg-app);
    padding: 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition-smooth);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 2.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--grad-dark-card);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    box-shadow: var(--shadow-premium);
}

.auth-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 800;
}

.auth-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-form-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    animation: fade-in 0.25s ease-out;
}

.auth-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-glass);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.auth-footer strong {
    color: var(--primary-light);
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* User profile display in sidebar */
.user-profile-info {
    padding: 0.25rem 0;
}

#current-username-display {
    color: var(--primary-light);
    font-family: var(--font-heading);
}

/* Custom Akun Belanja result list styling */
.akun-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.akun-result-item:last-child {
    border-bottom: none;
}

.akun-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding-left: 1.25rem;
}

.akun-result-item.active-result {
    background: rgba(40, 167, 69, 0.25) !important;
    color: var(--text-primary) !important;
    border-left: 4px solid #28a745 !important;
    padding-left: 1.25rem !important;
}

/* Breadcrumb Navigation Styles */
.breadcrumb-item {
    transition: color 0.2s ease, text-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item:not(.active):hover {
    color: var(--primary) !important;
    text-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.breadcrumb-separator {
    user-select: none;
}

/* Custom Master Reference result list styling */
.master-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.master-result-item:last-child {
    border-bottom: none;
}

.master-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding-left: 1.25rem;
}

.master-result-item.active-result {
    background: rgba(99, 102, 241, 0.25) !important;
    color: var(--text-primary) !important;
    border-left: 4px solid var(--primary-light) !important;
    padding-left: 1.25rem !important;
}

/* HTML2PDF PRINTING STYLES OVERRIDES */
body.html2pdf-printing {
    background: #ffffff !important;
    color: #0f172a !important;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

body.html2pdf-printing #rkk-workspace {
    background: #ffffff !important;
    padding: 24px !important;
    width: 100% !important;
    max-width: 1150px !important;
    box-sizing: border-box !important;
}

/* Hide controls */
body.html2pdf-printing .sidebar,
body.html2pdf-printing .workspace-header .header-actions,
body.html2pdf-printing .workspace-filters,
body.html2pdf-printing #btn-toggle-sidebar,
body.html2pdf-printing #btn-edit-rkk-meta,
body.html2pdf-printing .tree-toggle,
body.html2pdf-printing .row-actions,
body.html2pdf-printing #btn-save-draft,
body.html2pdf-printing #expand-all-btn,
body.html2pdf-printing #collapse-all-btn,
body.html2pdf-printing .modal,
body.html2pdf-printing .toast-container {
    display: none !important;
}

/* Format Document Title & Subtitle */
body.html2pdf-printing .header-left {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
}

body.html2pdf-printing .document-info {
    width: 100% !important;
    display: block !important;
    text-align: center !important;
    margin: 0 auto !important;
}

body.html2pdf-printing #doc-title-display {
    font-size: 18pt !important;
    font-weight: 800 !important;
    text-align: center !important;
    margin-bottom: 0.1cm !important;
    color: #0f172a !important;
    width: 100% !important;
    display: block !important;
    letter-spacing: -0.02em !important;
    text-transform: capitalize !important;
}

body.html2pdf-printing #doc-desc-display {
    font-size: 10.5pt !important;
    text-align: center !important;
    margin-bottom: 0.3cm !important;
    color: #64748b !important;
    width: 100% !important;
    display: block !important;
    font-weight: 500 !important;
}

/* Card glass containers should look clean and border-only */
body.html2pdf-printing .card-glass {
    background: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    color: #0f172a !important;
}

/* Format Pagu Stats Box */
body.html2pdf-printing .workspace-analytics {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 0 0.35rem 0 !important;
    display: block !important;
    box-shadow: none !important;
    max-width: none !important;
    text-align: left !important;
    box-sizing: border-box !important;
}

body.html2pdf-printing .workspace-analytics .pagu-icon-box {
    display: none !important;
}

body.html2pdf-printing .workspace-analytics div > div {
    display: block !important;
}

body.html2pdf-printing .workspace-analytics .stat-label {
    font-size: 10.5pt !important;
    font-weight: 600 !important;
    color: #475569 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    display: inline !important;
}

body.html2pdf-printing .workspace-analytics .stat-label::after {
    content: " : " !important;
}

body.html2pdf-printing .workspace-analytics .stat-value {
    font-size: 11pt !important;
    font-weight: 700 !important;
    color: #000000 !important;
    display: inline !important;
    margin-left: 2px !important;
    text-shadow: none !important;
}

/* Table overrides */
body.html2pdf-printing .rkk-table {
    width: 100% !important;
    font-size: 8.5pt !important;
    border-collapse: collapse !important;
    color: #0f172a !important;
}

body.html2pdf-printing .rkk-table th {
    background: #f1f5f9 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-size: 7.5pt !important;
    text-align: center !important;
}

body.html2pdf-printing .rkk-table td {
    border: 1px solid #e2e8f0 !important;
    padding: 6px 10px !important;
    color: #0f172a !important;
    line-height: 1.4 !important;
}

body.html2pdf-printing .rkk-table td *,
body.html2pdf-printing .rkk-table td strong {
    color: #0f172a !important;
}

/* Hide the 7th column (Aksi/Action column) */
body.html2pdf-printing .rkk-table th:nth-child(7),
body.html2pdf-printing .rkk-table td:nth-child(7) {
    display: none !important;
}

/* Row Background & Text Color Overrides for Print Visibility (Matched to Excel) */
body.html2pdf-printing .row-program { 
    background-color: #f8fafc !important; 
    font-weight: 700 !important; 
}
body.html2pdf-printing .row-program td,
body.html2pdf-printing .row-program td *,
body.html2pdf-printing .row-program td strong {
    color: #0f172a !important;
}

body.html2pdf-printing .row-kegiatan { 
    background-color: #f1f5f9 !important; 
    font-weight: 600 !important; 
}
body.html2pdf-printing .row-kegiatan td,
body.html2pdf-printing .row-kegiatan td *,
body.html2pdf-printing .row-kegiatan td strong {
    color: #1e3a8a !important; /* Navy */
}

body.html2pdf-printing .row-kro { 
    background-color: #f8fafc !important; 
    font-weight: 600 !important; 
}
body.html2pdf-printing .row-kro td,
body.html2pdf-printing .row-kro td *,
body.html2pdf-printing .row-kro td strong {
    color: #b91c1c !important; /* Red */
}

body.html2pdf-printing .row-ro { 
    background-color: #f1f5f9 !important; 
    font-weight: 800 !important; 
}
body.html2pdf-printing .row-ro td,
body.html2pdf-printing .row-ro td *,
body.html2pdf-printing .row-ro td strong {
    color: #b45309 !important; /* Amber */
    font-weight: 800 !important;
}

body.html2pdf-printing .row-komponen { 
    background-color: #ffffff !important; 
    font-weight: 800 !important; 
}
body.html2pdf-printing .row-komponen td,
body.html2pdf-printing .row-komponen td *,
body.html2pdf-printing .row-komponen td strong {
    color: #334155 !important; /* Slate */
    font-weight: 800 !important;
}

body.html2pdf-printing .row-subkomponen { 
    background-color: #ecfdf5 !important; 
    font-weight: 500 !important; 
}
body.html2pdf-printing .row-subkomponen td,
body.html2pdf-printing .row-subkomponen td *,
body.html2pdf-printing .row-subkomponen td strong {
    color: #166534 !important; /* Green */
}

body.html2pdf-printing .row-akun { 
    background-color: #f3e8ff !important; 
    font-weight: 500 !important; 
}
body.html2pdf-printing .row-akun td,
body.html2pdf-printing .row-akun td *,
body.html2pdf-printing .row-akun td strong {
    color: #6b21a8 !important; /* Purple */
}

body.html2pdf-printing .row-item {
    background-color: #ffffff !important;
}
body.html2pdf-printing .row-item td,
body.html2pdf-printing .row-item td *,
body.html2pdf-printing .row-item td strong {
    color: #0f172a !important;
}

body.html2pdf-printing .badge-level {
    border: 1px solid #64748b !important;
    color: #334155 !important;
    background: #f1f5f9 !important;
    font-size: 7.5pt !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
}

/* Portrait Mode Specific PDF Optimizations */
body.html2pdf-printing.print-portrait #rkk-workspace {
    max-width: 790px !important; /* Standard width fitting F4 portrait margins */
    padding: 16px !important;
}

body.html2pdf-printing.print-portrait #doc-title-display {
    font-size: 15pt !important; /* Slightly smaller title for portrait */
}

body.html2pdf-printing.print-portrait #doc-desc-display {
    font-size: 9.5pt !important;
    margin-bottom: 0.5cm !important;
}

body.html2pdf-printing.print-portrait .rkk-table {
    font-size: 7.2pt !important; /* Scale down table font size to prevent wrapping */
    width: 100% !important;
}

body.html2pdf-printing.print-portrait .rkk-table th {
    padding: 6px 8px !important;
    font-size: 6.8pt !important;
    text-align: center !important;
}

body.html2pdf-printing.print-portrait .rkk-table td {
    padding: 4px 6px !important; /* Tighter padding for portrait layout */
}

/* ==========================================
   MOBILE & TABLET RESPONSIVE STYLES (iPhone SE, etc.)
   ========================================== */
@media (max-width: 768px) {

    /* Prevent body scrollbar from causing margin imbalance */
    html, body {
        overflow: hidden !important;
        width: 100% !important;
    }

    /* 2. Hide sidebar completely on mobile — replaced by bottom navbar */
    .sidebar {
        display: none !important;
    }

    /* 3. Show mobile navbar */
    .mobile-navbar {
        display: flex !important;
    }

    .mobile-menu-overlay,
    .mobile-menu-sheet {
        display: block !important;
    }

    /* Main Content — balanced symmetric padding + navbar clearance */
    .main-content {
        padding: 0.5rem !important;
        padding-bottom: calc(60px + 0.5rem) !important;
        height: 100vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* === WORKSPACE HEADER — Mobile layout === */
    .workspace-header {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
        padding: 0.75rem !important;
    }

    .header-left {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .workspace-header .document-info {
        width: 100% !important;
    }

    /* Title + pen icon inline */
    .workspace-header .document-info > div {
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
    }

    .workspace-header h2 {
        font-size: 1.05rem !important;
        line-height: 1.3 !important;
        word-break: break-word !important;
    }

    .workspace-header p,
    .workspace-header .document-info p {
        font-size: 0.78rem !important;
        color: var(--text-secondary) !important;
        margin-top: 0.1rem !important;
    }

    /* === HEADER ACTIONS — Wrap into rows on mobile === */
    .header-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
        width: 100% !important;
    }

    .header-actions .btn {
        flex-shrink: 0 !important;
        font-size: 0.75rem !important;
        padding: 0.35rem 0.55rem !important;
        white-space: nowrap !important;
    }

    /* Dropdown inside header actions */
    .header-actions .dropdown {
        flex-shrink: 0 !important;
    }

    /* === WORKSPACE ANALYTICS — Compact Total Pagu === */
    .workspace-analytics {
        padding: 0.25rem 0 !important;
        font-size: 0.9rem !important;
    }

    .workspace-analytics .stat-label {
        font-size: 0.75rem !important;
    }

    .workspace-analytics .stat-value {
        font-size: 1rem !important;
    }

    /* === WORKSPACE BODY & FILTERS — Compact card spacing === */
    .workspace-body.card-glass,
    .workspace-filters.card-glass {
        padding: 0.6rem !important;
        margin-bottom: 0 !important;
    }

    /* === TABLE — Hide header on mobile, card-style rows === */
    #rkk-table thead {
        display: none !important;
    }

    #rkk-table .empty-state-row td {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
    }

    #rkk-table .empty-state-row td::before {
        display: none !important;
        content: none !important;
    }

    .empty-state {
        text-align: center !important;
        padding: 2rem 1rem !important;
    }

    .empty-state p {
        text-align: center !important;
    }


    /* 4. Filter Controls stacking */
    .workspace-filters {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        padding: 0.75rem !important;
    }

    .search-box {
        max-width: none !important;
        width: 100% !important;
    }

    .filter-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        width: 100% !important;
    }

    .filter-actions .btn {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        justify-content: center !important;
        font-size: 0.82rem !important;
        padding: 0.45rem 0.65rem !important;
    }

    /* 5. Stat Boxes Responsive Grid */
    .user-stats-grid {
        grid-template-columns: 1fr 1fr !important;
    }

    .stat-box {
        padding: 0.75rem !important;
    }

    .stat-value {
        font-size: 1.35rem !important;
    }

    .stat-label {
        font-size: 0.72rem !important;
    }

    /* 6. Account Filter Bar responsive */
    .account-filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }

    .account-filter-label {
        min-width: auto !important;
    }

    .account-filter-select {
        max-width: none !important;
    }

    /* 7. Breadcrumbs overflow */
    #master-breadcrumbs {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
        padding-bottom: 0.25rem !important;
    }

    #master-breadcrumbs::-webkit-scrollbar {
        display: none !important;
    }

    /* 8. Modals scrollability & form grid stacking */
    .modal {
        align-items: flex-start !important;
        overflow-y: auto !important;
        padding: 1rem 0.5rem !important;
    }

    .modal-content {
        margin: auto !important;
        width: 95% !important;
        max-width: none !important;
    }

    .modal-header h2 {
        font-size: 1.05rem !important;
    }

    .form-row:not(#multi-volume-container .form-row) {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }
    
    .form-row:not(#multi-volume-container .form-row) .form-group {
        flex: none !important;
        width: 100% !important;
    }

    .form-grid-columns {
        grid-template-columns: 1fr !important;
    }

    /* 9. Mobile Tables (All dashboards converted to clean list cards) */
    .table-responsive {
        max-height: none !important;
        overflow: visible !important;
    }

    .rkk-table, 
    .rkk-table thead, 
    .rkk-table tbody, 
    .rkk-table th, 
    .rkk-table td, 
    .rkk-table tr { 
        display: block !important; 
    }
    
    .rkk-table thead {
        display: none !important;
    }
    
    .rkk-table tbody tr {
        margin-bottom: 0.75rem !important;
        border: 1px solid var(--border-glass) !important;
        border-radius: 12px !important;
        padding: 0.85rem !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
        position: relative !important;
        background: rgba(255, 255, 255, 0.01) !important;
        overflow: hidden !important;
    }
    
    body.light-theme .rkk-table tbody tr {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    }
    
    .rkk-table td {
        border: none !important;
        padding: 0.4rem 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 0.88rem !important;
        text-align: left !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-bottom: 1px dashed rgba(255, 255, 255, 0.06) !important;
    }
    
    body.light-theme .rkk-table td {
        border-bottom: 1px dashed #f1f5f9 !important;
    }
    
    .rkk-table td:last-child {
        border-bottom: none !important;
        margin-top: 0.4rem !important;
        padding-top: 0.4rem !important;
        justify-content: flex-end !important;
    }

    /* 10. Row Action Buttons - Enlarged touch targets */
    .row-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.95rem !important;
    }

    .row-actions {
        gap: 0.5rem !important;
    }

    /* RKK Tree Table Card Indentation */
    #rkk-table tr[data-level] {
        transition: margin-left 0.2s ease !important;
    }

    #rkk-table tr[data-level="0"] { margin-left: 0 !important; border-left: 5px solid #0f172a !important; }
    #rkk-table tr[data-level="1"] { margin-left: 6px !important; border-left: 5px solid #1e3a8a !important; }
    #rkk-table tr[data-level="2"] { margin-left: 12px !important; border-left: 5px solid #b91c1c !important; }
    #rkk-table tr[data-level="3"] { margin-left: 18px !important; border-left: 5px solid #b45309 !important; }
    #rkk-table tr[data-level="4"] { margin-left: 24px !important; border-left: 5px solid #334155 !important; }
    #rkk-table tr[data-level="5"] { margin-left: 30px !important; border-left: 5px solid #166534 !important; }
    #rkk-table tr[data-level="6"] { margin-left: 36px !important; border-left: 5px solid #6b21a8 !important; }
    #rkk-table tr[data-level="7"] { margin-left: 42px !important; border-left: 5px solid #475569 !important; }

    /* RKK Main Table Column Labels */
    #rkk-table td:nth-child(1)::before { content: "Kode:"; font-weight: 600; color: var(--text-secondary); margin-right: 0.5rem; }
    #rkk-table td:nth-child(2) {
        display: block !important;
        font-weight: 500 !important;
        margin-top: 0.25rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem !important;
    }
    #rkk-table td:nth-child(2)::before { content: "Uraian:"; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 0.25rem; }
    #rkk-table td:nth-child(3)::before { content: "Volume:"; font-weight: 600; color: var(--text-secondary); }
    #rkk-table td:nth-child(4)::before { content: "Satuan:"; font-weight: 600; color: var(--text-secondary); }
    #rkk-table td:nth-child(5)::before { content: "Harga Satuan:"; font-weight: 600; color: var(--text-secondary); }
    #rkk-table td:nth-child(6)::before { content: "Total:"; font-weight: 600; color: var(--text-secondary); }
    #rkk-table td:nth-child(7)::before { content: "Aksi:"; font-weight: 600; color: var(--text-secondary); margin-right: auto; }

    /* Users Table Column Labels */
    #users-table td:nth-child(1)::before { content: "No:"; font-weight: 600; color: var(--text-secondary); }
    #users-table td:nth-child(2)::before { content: "Username:"; font-weight: 600; color: var(--text-secondary); }
    #users-table td:nth-child(3)::before { content: "Role:"; font-weight: 600; color: var(--text-secondary); }
    #users-table td:nth-child(4)::before { content: "Aksi:"; font-weight: 600; color: var(--text-secondary); margin-right: auto; }

    /* Master Data Table Column Labels */
    #master-data-table td:nth-child(1)::before { content: "Kode:"; font-weight: 600; color: var(--text-secondary); }
    #master-data-table td:nth-child(2) { display: block !important; font-weight: 500 !important; }
    #master-data-table td:nth-child(2)::before { content: "Uraian:"; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 0.25rem; }
    #master-data-table td:nth-child(3)::before { content: "Aksi:"; font-weight: 600; color: var(--text-secondary); margin-right: auto; }

    /* Accounts Table Column Labels */
    #accounts-table td:nth-child(1)::before { content: "Kode Akun:"; font-weight: 600; color: var(--text-secondary); }
    #accounts-table td:nth-child(2) { display: block !important; font-weight: 500 !important; }
    #accounts-table td:nth-child(2)::before { content: "Nama Akun:"; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 0.25rem; }
    #accounts-table td:nth-child(3)::before { content: "Jenis:"; font-weight: 600; color: var(--text-secondary); }
    #accounts-table td:nth-child(4)::before { content: "Aksi:"; font-weight: 600; color: var(--text-secondary); margin-right: auto; }

    /* Saved RKK Documents Table Column Labels */
    #saved-rkk-table td:nth-child(1)::before { content: "No:"; font-weight: 600; color: var(--text-secondary); }
    #saved-rkk-table td:nth-child(2) { display: block !important; font-weight: 600 !important; }
    #saved-rkk-table td:nth-child(2)::before { content: "Nama Kertas Kerja:"; font-weight: 600; color: var(--text-secondary); display: block; margin-bottom: 0.25rem; }
    #saved-rkk-table td:nth-child(3)::before { content: "Ubah Terakhir:"; font-weight: 600; color: var(--text-secondary); }
    #saved-rkk-table td:nth-child(4)::before { content: "Aksi:"; font-weight: 600; color: var(--text-secondary); margin-right: auto; }
    
    #rkk-table .tree-toggle {
        margin-right: 0.5rem !important;
        display: inline-block !important;
    }

    /* 11. Toast Notifications Mobile */
    .toast-container {
        top: 1rem !important;
        right: 0.75rem !important;
        left: 0.75rem !important;
    }

    .toast {
        min-width: auto !important;
        width: 100% !important;
        padding: 0.75rem 1rem !important;
        font-size: 0.85rem !important;
    }

    /* 12. Empty state compact on mobile */
    .empty-state {
        padding: 1.5rem 1rem !important;
    }

    .empty-state i {
        font-size: 2.5rem !important;
    }

    .empty-state p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }

    /* 13. Main content gap reduced */
    .main-content {
        gap: 0.75rem !important;
    }
}

@media (max-width: 480px) {
    /* Auth screen improvements */
    .auth-card {
        padding: 1.5rem !important;
        max-width: 92vw !important;
    }
    
    .auth-header h2 {
        font-size: 1.5rem !important;
    }

    .tabs-header {
        gap: 0 !important;
    }

    .tab-btn {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.8rem !important;
    }

    /* Even smaller stat grids */
    .user-stats-grid {
        grid-template-columns: 1fr !important;
    }

    .filter-actions .btn {
        font-size: 0.75rem !important;
        padding: 0.4rem 0.5rem !important;
    }

    .filter-actions .btn i + span,
    .filter-actions .btn:not(:first-child) span {
        display: none;
    }
}

/* CUSTOM CONFIRMATION DIALOG STYLING (PREMIUM AESTHETICS) */
.confirm-card {
    max-width: 400px !important;
    padding: 2.25rem !important;
    border-radius: 24px !important;
    box-shadow: var(--shadow-premium), 0 20px 40px rgba(0, 0, 0, 0.35) !important;
    text-align: center;
    border: 1px solid var(--border-glass) !important;
    background: var(--bg-card) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

/* Light theme card override to keep high contrast */
body.light-theme .confirm-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
}

.confirm-icon-wrapper {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem auto;
    border: 1px solid rgba(217, 119, 6, 0.2);
    box-shadow: 0 8px 16px rgba(217, 119, 6, 0.15);
    animation: pulse-warning 2s infinite;
}

/* Light theme warning icon background contrast */
body.light-theme .confirm-icon-wrapper {
    background: #fffbeb;
    border-color: #fde68a;
    color: #d97706;
}

@keyframes pulse-warning {
    0% {
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(217, 119, 6, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
    }
}

.confirm-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-heading);
}

.confirm-message {
    margin: 0 0 2rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 0.85rem;
    justify-content: center;
    width: 100%;
}

.confirm-actions .btn {
    flex: 1;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
}

.btn-danger {
    background: var(--grad-danger);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
    border: none !important;
}

.btn-danger:hover {
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
    filter: brightness(1.15);
}

body.light-theme .btn-secondary {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

body.light-theme .btn-secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Copy & Paste Button Styling */
.row-btn.copy-btn {
    border-color: rgba(59, 130, 246, 0.15);
    background: rgba(59, 130, 246, 0.02);
}

.row-btn.copy-btn:hover {
    color: var(--primary-light);
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.3);
}

.row-btn.paste-btn {
    border-color: rgba(16, 185, 129, 0.15);
    background: rgba(16, 185, 129, 0.02);
}

.row-btn.paste-btn:hover {
    color: var(--success-light);
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

/* FLOATING AI BUTTON */
.floating-ai-btn {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 9500;
    background: var(--grad-primary);
    color: #ffffff !important;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-ai-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.floating-ai-btn i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .floating-ai-btn {
        bottom: 80px;
        right: 16px;
        padding: 0.75rem;
    }
    .floating-ai-btn span {
        display: none;
    }
}

/* AI DRAWER STYLING */
.ai-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-glass);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    z-index: 9600;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-drawer.open {
    right: 0 !important;
}

@media (max-width: 768px) {
    .ai-drawer {
        width: 100% !important;
        right: -100% !important;
    }
    .ai-drawer.open {
        right: 0 !important;
    }
}

.ai-drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-drawer-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-drawer-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
}

.close-drawer-btn:hover {
    color: var(--text-primary);
}

.ai-drawer-body {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-message {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    max-width: 85%;
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
}

.ai-message.system {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.15);
    align-self: center;
    text-align: center;
    max-width: 100%;
}

.ai-message.user {
    background: var(--primary);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

.ai-message.assistant {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

body.light-theme .ai-message.assistant {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.ai-suggested-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px dashed var(--border-glass);
}

.prompt-chip {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.prompt-chip:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border-color: var(--primary-light);
}

body.light-theme .prompt-chip {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
}

body.light-theme .prompt-chip:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--primary);
    border-color: var(--primary);
}

.ai-drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
}

body.light-theme .ai-drawer-footer {
    background: #f8fafc;
    border-top-color: #e2e8f0;
}

.ai-drawer-footer input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
    outline: none;
}

body.light-theme .ai-drawer-footer input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

.ai-drawer-footer input:focus {
    border-color: var(--primary-light);
}

.ai-drawer-footer button {
    border-radius: 10px;
    width: 42px;
    height: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.light-theme .ai-drawer {
    background: #ffffff;
    border-left-color: #cbd5e1;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
}

/* WORKSPACE TOOLBAR STYLING */

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toolbar-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

body.light-theme .toolbar-label {
    color: #64748b;
}

.badge-item-name {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: middle;
}

body.light-theme .badge-item-name {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar-separator {
    color: var(--border-glass);
    margin: 0 0.25rem;
}

body.light-theme .toolbar-separator {
    color: #cbd5e1;
}

/* CUSTOM SELECTION COLUMN */
.select-col {
    width: 45px;
    text-align: center;
    vertical-align: middle !important;
}

/* Radio button customized wrapper */
.custom-radio {
    display: inline-block;
    position: relative;
    cursor: pointer;
    font-size: 0;
    user-select: none;
    height: 18px;
    width: 18px;
    vertical-align: middle;
}

.custom-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.radio-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1.5px solid var(--text-muted);
    border-radius: 50%;
    transition: all 0.2s ease;
}

body.light-theme .radio-checkmark {
    background-color: #ffffff;
    border-color: #94a3b8;
}

/* On mouse-over */
.custom-radio:hover input ~ .radio-checkmark {
    border-color: var(--primary-light);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

/* When checked */
.custom-radio input:checked ~ .radio-checkmark {
    background-color: var(--primary-light);
    border-color: var(--primary-light);
}

.radio-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.custom-radio input:checked ~ .radio-checkmark:after {
    display: block;
}

.custom-radio .radio-checkmark:after {
    top: 5px;
    left: 5px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

/* Row selection highlight */
.rkk-table tr.row-selected {
    background: rgba(59, 130, 246, 0.12) !important;
    box-shadow: inset 3px 0 0 var(--primary-light) !important;
}

body.light-theme .rkk-table tr.row-selected {
    background: rgba(59, 130, 246, 0.06) !important;
    box-shadow: inset 3px 0 0 #2563eb !important;
}

/* Danger outline button for delete tool */
.btn-danger-text {
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--danger-light);
}
.btn-danger-text:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-light);
    color: #ffffff;
}
body.light-theme .btn-danger-text {
    border-color: #fca5a5;
    color: #dc2626;
}
body.light-theme .btn-danger-text:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

/* HIDE SELECTION COLUMN ON PRINT */
@media print {
    .select-col, th:last-child, td:last-child {
        display: none !important;
    }
}
body.html2pdf-printing .select-col,
body.html2pdf-printing th:last-child,
body.html2pdf-printing td:last-child {
    display: none !important;
}
