/**
 * KOPKAR GSS - Stylesheet
 * Premium Dark Slate/Navy Theme, Glassmorphism, Layout Grids, Responsive UI, and Print Media.
 */

/* --- CSS Variables & Design Tokens --- */
:root {
    /* LIGHT MODE */
    --bg-app: #f1f5f9;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-input: #ffffff;
    --bg-modal: #ffffff;
    --bg-modal-header: #f8fafc;
    
    --bg-highlight: #eff6ff;
    --border-highlight: #bfdbfe;
    --text-highlight-title: #2563eb;
    --bg-highlight-badge: #2563eb;
    --text-highlight-badge: #ffffff;
    --bg-success-box: #f0fdf4;
    --border-success-box: #bbf7d0;
    --text-success-box: #16a34a;

    --border-color: #e2e8f0;
    --border-modal: #e2e8f0;
    --border-focus: #2563eb;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-accent: #3b82f6;
    --color-success: #10b981;
    --color-info: #0ea5e9;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-purple: #8b5cf6;

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 15px rgba(37, 99, 235, 0.2);
    
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
    /* DARK MODE - clean solid values, no circular references */
    --bg-app: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #0f172a;
    --bg-modal: #1e293b;
    --bg-modal-header: #0f172a;
    
    --bg-highlight: #172033;
    --border-highlight: rgba(37, 99, 235, 0.25);
    --text-highlight-title: #60a5fa;
    --bg-highlight-badge: #1d4ed8;
    --text-highlight-badge: #bfdbfe;
    --bg-success-box: #0f2a1a;
    --border-success-box: #166534;
    --text-success-box: #4ade80;

    --border-color: #334155;
    --border-modal: #475569;
    --border-focus: #3b82f6;

    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* --- Base Reset & General --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}


code {
    font-family: monospace;
    background: var(--border-color);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--color-accent);
}

/* --- Layout Structure --- */
.app-layout-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar Styling (Matching Modern Glass Theme) --- */
.sidebar {
    width: 310px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 24px rgba(0,0,0,0.35);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    overflow: hidden;
}

/* --- Sidebar Header & Modern Branding --- */
.sidebar-header {
    padding: 22px 18px 20px 18px;
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    flex-shrink: 0;
}

.sidebar-header::after {
    content: '';
    display: none;
}

.sidebar-brand-container {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.sidebar-logo-box {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--border-color), rgba(241, 245, 249, 0.88));
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 0 1px var(--border-color);
    border: 1px solid var(--color-primary);
}

.sidebar-logo-box img {
    width: 100%;
    height: 100%;
    border-radius: 9px;
    object-fit: contain;
}

.sidebar-brand-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.brand-title {
    font-size: 17.5px;
    font-weight: 800;
    letter-spacing: 0.6px;
    color: var(--text-primary);
    text-transform: uppercase;
    margin: 0 0 4px 0;
    line-height: 1.15;
}

.brand-subtitle {
    font-size: 11.5px;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.45;
    margin: 0;
    white-space: pre-line;
    word-break: break-word;
}

/* --- Period Selector (Modern & Interactive) --- */
.sidebar-period-selector {
    padding: 16px 18px 18px 18px;
    background: var(--bg-app);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    flex-shrink: 0;
}

.period-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 800;
    color: var(--color-info);
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-transform: none;
}

.period-live-indicator {
    font-size: 9.5px;
    font-weight: 800;
    color: var(--color-success);
    background: var(--color-success);
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    letter-spacing: 0.5px;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
}

.period-select-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.period-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--color-primary);
    color: var(--text-primary);
    padding: 9px 10px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color-scheme: dark;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25), inset 0 1px 0 var(--border-color);
    text-align: center;
}

.period-select:hover {
    border-color: var(--color-info);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
    transform: translateY(-1px);
}

.period-select:focus {
    border-color: var(--color-info);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    background: var(--bg-input);
}

.period-select option {
    background-color: var(--bg-input);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 8px;
}

/* --- Custom Ultra-Modern Floating Dropdown --- */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-select-trigger:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--color-primary);
    background: var(--bg-input);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.custom-select-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-arrow {
    display: flex;
    align-items: center;
    color: var(--color-info);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    margin-left: 6px;
}

.custom-select-wrapper.open .custom-select-arrow {
    transform: rotate(180deg);
    color: var(--color-info);
}

.custom-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-input);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-info);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 9999;
    overflow-y: auto;
    max-height: 230px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.custom-select-wrapper.open .custom-select-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Custom Scrollbar for Dropdown Menu */
.custom-select-menu::-webkit-scrollbar {
    width: 5px;
}
.custom-select-menu::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 4px;
}
.custom-select-menu::-webkit-scrollbar-thumb {
    background: var(--color-info);
    border-radius: 4px;
}
.custom-select-menu::-webkit-scrollbar-thumb:hover {
    background: var(--color-info);
}

.custom-select-option {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.custom-select-option:last-child {
    margin-bottom: 0;
}

.custom-select-option:hover {
    background: var(--color-primary);
    color: #ffffff;
    padding-left: 14px;
}

.custom-select-option.selected {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 800;
    border-left: 3px solid var(--color-info);
    padding-left: 12px;
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) transparent;
    cursor: default;
    user-select: none;
}

.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--color-primary), rgba(99,102,241,0.25));
    border-radius: 6px;
    transition: background 0.2s;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--color-primary), rgba(99,102,241,0.5));
}

.table-responsive,
.card-table-container {
    width: 100%;
    overflow-x: visible;
}

/* ── Custom Scrollbar Konsisten (Seragam dengan Sidebar) ── */
#inst-detail-body,
.custom-scroll,
.modal-content,
.table-responsive,
div[style*="overflow-y:auto"],
div[style*="overflow-y: auto"] {
    scrollbar-width: thin !important;
    scrollbar-color: var(--color-primary) transparent !important;
}

#inst-detail-body::-webkit-scrollbar,
.custom-scroll::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
div[style*="overflow-y:auto"]::-webkit-scrollbar,
div[style*="overflow-y: auto"]::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
#inst-detail-body::-webkit-scrollbar-track,
.custom-scroll::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
div[style*="overflow-y:auto"]::-webkit-scrollbar-track,
div[style*="overflow-y: auto"]::-webkit-scrollbar-track {
    background: transparent;
}
#inst-detail-body::-webkit-scrollbar-thumb,
.custom-scroll::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
div[style*="overflow-y:auto"]::-webkit-scrollbar-thumb,
div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--color-primary), rgba(99,102,241,0.25));
    border-radius: 6px;
    transition: background 0.2s;
}
#inst-detail-body::-webkit-scrollbar-thumb:hover,
.custom-scroll::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
div[style*="overflow-y:auto"]::-webkit-scrollbar-thumb:hover,
div[style*="overflow-y: auto"]::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--color-primary), rgba(99,102,241,0.5));
}

/* ── Nav Section Label ── */
.nav-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.6px;
    text-transform: none;
    padding: 18px 14px 8px 14px;
    margin-top: 6px;
}

.nav-section-label::after {
    content: '';
    display: block;
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color), transparent);
    margin-left: 8px;
}

.nav-section-icon {
    font-size: 12px;
    opacity: 0.8;
}

/* Keep backward-compat for old nav-section-title */
.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.6px;
    padding: 18px 14px 8px 14px;
    text-transform: none;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    gap: 2px;
    border: 1px solid transparent;
}

.menu-item:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: translateX(3px);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.menu-item.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary));
    color: var(--color-info);
    font-weight: 700;
    border: 1px solid var(--color-primary);
    box-shadow: none;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18%;
    height: 64%;
    width: 3.5px;
    background: linear-gradient(to bottom, var(--color-primary), var(--color-info));
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.menu-icon {
    margin-right: 10px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-badge {
    font-size: 9px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    margin-left: auto;
    flex-shrink: 0;
    text-transform: uppercase;
}

.badge-info {
    background: rgba(14,165,233,0.12);
    color: var(--color-info);
    border: 1px solid rgba(14,165,233,0.2);
}

.menu-disabled {
    filter: grayscale(1);
    cursor: not-allowed;
}

.sidebar-bottom-recap-container {
    padding: 10px 12px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card-hover);
}

.btn-recap-highlight {
    background: linear-gradient(135deg, var(--color-primary), rgba(79,70,229,0.85)) !important;
    color: #fff !important;
    text-align: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    border-radius: 10px !important;
}

.btn-recap-highlight:hover {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary)) !important;
    box-shadow: var(--shadow-md);
    transform: none !important;
}

/* ── Sidebar Bottom: User Profile + Logout ── */
.sidebar-user-profile {
    padding: 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: transparent;
    flex-shrink: 0;
}

.sidebar-user-info-row {
    display: flex;
    align-items: center;
    padding: 14px 16px 10px 16px;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), rgba(99,102,241,0.3));
    border: 1px solid rgba(99,102,241,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info {
    flex-grow: 1;
    overflow: hidden;
}

.user-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 20px);
    margin: 0 10px 10px 10px;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    letter-spacing: 0.3px;
    text-transform: none;
}

.btn-logout:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.08);
    border-color: transparent;
}

/* Duplicate sidebar styles consolidated above */

/* Duplicate period selector styles consolidated above */

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

/* ── Nav Section Label (Categorized) ── */
.nav-section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.6px;
    text-transform: none;
    padding: 18px 14px 8px 14px;
    margin-top: 6px;
    position: relative;
}

.nav-section-label::after {
    content: '';
    display: block;
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-color), transparent);
    margin-left: 8px;
}

.nav-section-icon {
    font-size: 12px;
    opacity: 0.8;
}

/* Keep backward-compat for old nav-section-title */
.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.6px;
    padding: 18px 14px 8px 14px;
    text-transform: none;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 4px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    user-select: none;
    gap: 2px;
    border: 1px solid transparent;
}

.menu-item:hover {
    background: var(--border-color);
    color: var(--text-primary);
    transform: translateX(3px);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.menu-item.active {
    background: var(--color-primary);
    color: #ffffff;
    font-weight: 700;
    border: 1px solid var(--color-primary);
    box-shadow: none;
}

.menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 18%;
    height: 64%;
    width: 3.5px;
    background: linear-gradient(to bottom, var(--color-primary), var(--color-info));
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.menu-icon {
    margin-right: 10px;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    flex-shrink: 0;
}

.menu-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.menu-badge {
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    letter-spacing: 0.3px;
    margin-left: auto;
    flex-shrink: 0;
    text-transform: uppercase;
}

.badge-info {
    background-color: rgba(14, 165, 233, 0.15);
    color: var(--color-info);
}

.menu-disabled {
    filter: grayscale(1);
    cursor: not-allowed;
}

.sidebar-bottom-recap-container {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card-hover);
}

.btn-recap-highlight {
    background-color: var(--color-primary) !important;
    color: #fff !important;
    text-align: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.btn-recap-highlight:hover {
    background-color: var(--color-primary-hover) !important;
    box-shadow: var(--shadow-sm);
}


.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), rgba(139, 92, 246, 0.3));
    border: 1px solid rgba(139, 92, 246, 0.45);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-right: 12px;
}

.user-info {
    flex-grow: 1;
    overflow: hidden;
}

.user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* --- Main Layout --- */
.main-content {
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 40px;
    background-color: var(--bg-app);
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) transparent;
}

.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-track {
    background: transparent;
}

.main-content::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--color-primary), rgba(99,102,241,0.25));
    border-radius: 6px;
    transition: background 0.2s;
}

.main-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--color-primary), rgba(99,102,241,0.5));
}

.main-content.full-width {
    width: 100%;
}

.content-container {
    max-width: 1536px;
    margin: 0 auto;
    width: 100%;
    flex: 1 0 auto;
    animation: fadeIn var(--transition-normal);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Typography Helpers --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-primary { color: var(--color-accent); }
.text-secondary { color: var(--text-secondary); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-10 { margin-top: 10px; }
.mt-15 { margin-top: 15px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mr-10 { margin-right: 10px; }
.w-100 { width: 100%; }

/* --- Buttons (Premium Glassmorphic Theme) --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-sans);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
    text-transform: capitalize;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary) 100%);
    color: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-primary) 100%);
    box-shadow: var(--shadow-md);
    
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
    
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success) 100%);
    color: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--color-success) 0%, var(--color-success) 100%);
    box-shadow: var(--shadow-md);
    
}

.btn-danger {
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger) 100%);
    color: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--color-danger) 0%, var(--color-danger) 100%);
    box-shadow: var(--shadow-md);
    
}

.btn-warning {
    background: linear-gradient(135deg, var(--color-warning) 0%, var(--color-warning) 100%);
    color: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, var(--color-warning) 100%);
    box-shadow: var(--shadow-md);
    
}

.btn-info {
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-info) 100%);
    color: #fff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.btn-info:hover {
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-info) 100%);
    box-shadow: var(--shadow-md);
    
}

.btn-sm {
    padding: 7px 14px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
    border-radius: 14px;
}

.btn-icon {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-size: 15px;
    padding: 7px 10px;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* --- Cards & Dashboard --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transition: background-color var(--transition-normal);
}

.card:hover {
    background-color: var(--bg-card-hover);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
}

.card-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Grid Layouts */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.col-span-2 { grid-column: span 2; }

/* Stat Cards & Grids */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    width: 100%;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-card.primary {
    border-left: 4px solid var(--color-primary);
}

.stat-card .icon {
    font-size: 24px;
    margin-bottom: 12px;
}

.stat-card .title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 22px;
    font-weight: 800;
    margin-top: 6px;
}

/* --- Modern Stat Card (Consistent with Recap design) --- */
.modern-stat-card {
    background: var(--bg-input); /* Match the rgba(15,23,42,.6) in dark mode */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.modern-stat-card:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--text-muted);
}

.modern-stat-card .title {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.modern-stat-card .value {
    font-size: 1.3rem; /* Same as the screenshot */
    font-weight: 900;
    line-height: 1.2;
}

.modern-stat-card .subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Tint modifiers for modern stat cards */
.modern-stat-card.tint-danger {
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.15);
}
.modern-stat-card.tint-success {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.15);
}
.modern-stat-card.tint-info {
    background: rgba(14, 165, 233, 0.05);
    border-color: rgba(14, 165, 233, 0.15);
}
.modern-stat-card.tint-purple {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.15);
}
.modern-stat-card.tint-warning {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.15);
}

.mini-stat-card {
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
}

.mini-stat-card.primary {
    border-left: 3px solid var(--color-primary);
    background: var(--color-primary);
}

.mini-stat-card .title {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.mini-stat-card .value {
    font-size: 16px;
    font-weight: 800;
    margin-top: 4px;
}

/* --- Data Tables & Card Containers (Modern Glassmorphic Theme) --- */
.card-table-container {
    overflow-x: auto;
    padding: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.scrollable-table {
    max-height: 440px;
    overflow-y: auto;
}

.data-table,
.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.data-table th,
.table th {
    background: var(--bg-card);
    padding: 14px 18px;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    border-right: none;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.8px;
}

.data-table th:last-child,
.table th:last-child {
    border-right: none;
}

.data-table td,
.table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
    border-right: none;
    vertical-align: middle;
    color: var(--text-secondary);
}

.data-table td:last-child,
.table td:last-child {
    border-right: none;
}

.data-table tbody tr,
.table tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.data-table tbody tr:hover,
.table tbody tr:hover {
    background: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.table-actions {
    display: flex;
    gap: 8px;
}

.actions-header {
    width: 100px;
}

.table-summary-row {
    background: var(--bg-card-hover);
}

.table-summary-row td {
    border-top: 2px solid var(--border-color);
    font-size: 14px;
}

/* Specific Highlight Column for Totals */
.highlight-column-header {
    background: rgba(239, 68, 68, 0.08) !important;
    color: var(--color-danger) !important;
}

.highlight-column-val {
    background: rgba(239, 68, 68, 0.05) !important;
    color: var(--color-danger) !important;
    font-weight: 800 !important;
}

.empty-state {
    padding: 40px !important;
    color: var(--text-muted);
    font-style: italic;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.badge-success { background-color: rgba(16, 185, 129, 0.15); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-danger { background-color: rgba(239, 68, 68, 0.15); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-warning { background-color: rgba(245, 158, 11, 0.15); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-info { background-color: rgba(14, 165, 233, 0.15); color: var(--color-info); border: 1px solid rgba(14, 165, 233, 0.3); }
.badge-primary { background-color: rgba(37, 99, 235, 0.15); color: var(--color-primary); border: 1px solid rgba(37, 99, 235, 0.3); }
.badge-purple { background-color: rgba(139, 92, 246, 0.15); color: var(--color-purple); border: 1px solid rgba(139, 92, 246, 0.3); }
.badge-secondary { background-color: var(--border-color); color: var(--text-secondary); }

/* --- Forms & Search Filtering --- */
.card-table-filter {
    padding: 16px 20px;
    margin-bottom: 16px;
}

.search-bar-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2px 16px;
    width: 100%;
}

.search-icon {
    font-size: 16px;
    color: var(--text-muted);
    margin-right: 12px;
}

.search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 10px 0;
    width: 100%;
    font-family: var(--font-sans);
    font-size: 14px;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-control {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-fast);
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-calc-preview {
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.form-calc-preview strong {
    font-size: 16px;
    color: var(--color-success);
    display: block;
    margin-top: 2px;
}

/* --- Modals (Premium Glassmorphic Theme) --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    padding: 16px;
    box-sizing: border-box;
}

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

.modal-content {
    background: var(--bg-modal) !important;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-modal) !important;
    border-radius: 16px !important;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3) !important;
    overflow: hidden !important;
    transform: translateY(-15px) scale(0.99);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

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

.modal-large {
    max-width: 860px;
}

.modal-header {
    padding: 16px 22px !important;
    border-bottom: 1px solid var(--border-color) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-modal-header) !important;
    flex-shrink: 0;
}

.modal-content > form,
.modal-content .modal-form,
.modal-content .modal-body,
.modal-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex: 1 1 auto;
    min-height: 0;
    padding: 18px 22px !important;
    box-sizing: border-box;
}

.modal-body > *,
#doc-preview-body > *,
#analis-modal-body > *,
#investor-modal-body > *,
#loan-checklist-modal-body > *,
#investor-mgmt-body > * {
    flex-shrink: 0 !important;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
    margin: 0;
}

.close-modal {
    font-size: 24px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.close-modal:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.12);
}

.modal-form, .modal-body {
    padding: 26px !important;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

/* Employee details page styles inside modal */
.emp-profile-header {
    display: flex;
    align-items: center;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-md);
}

.emp-avatar {
    font-size: 32px;
    margin-right: 16px;
}

.emp-meta-info h4 {
    font-size: 16px;
    font-weight: 700;
}

.emp-meta-info p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.emp-period-badge {
    margin-left: auto;
    text-align: right;
}

.emp-period-badge .small-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
}

.emp-period-badge .period-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-accent);
}

/* --- Tab Systems --- */
.tab-container {
    display: flex;
    flex-direction: column;
}

.tab-headers {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.tab-header {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    padding: 12px 24px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all var(--transition-fast);
}

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

.tab-header.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn var(--transition-normal);
}

/* --- Fallback Chart (Pure CSS/HTML) --- */
.fallback-chart {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.fallback-chart-row {
    display: flex;
    align-items: center;
}

/* --- Login UI (Sapphire Glassmorphism Theme) --- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.login-card {
    background: var(--bg-input);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
}

.login-portal-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    gap: 48px;
}

.login-brand-open {
    flex: 1.2;
    padding: 20px 10px;
}

.login-box-container {
    flex: 1;
    max-width: 450px;
    width: 100%;
    background: var(--bg-input);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.login-box-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-info), var(--color-primary), var(--color-purple));
}
/* --- MOBILE SIDEBAR & HAMBURGER --- */
.mobile-menu-btn {
    position: absolute;
    top: 16px;
    left: 20px;
    z-index: 500;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: none; /* Shown via JS / Media Query */
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    padding: 0;
}
.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(2px);
    z-index: 490;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* --- SETTINGS RESPONSIVE GRIDS --- */
.settings-grid-1-15 { display: grid; grid-template-columns: 1fr 1.5fr; }
.settings-grid-1-12 { display: grid; grid-template-columns: 1fr 1.2fr; }
.settings-grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; }

@media (max-width: 860px) {
    .settings-grid-1-15, .settings-grid-1-12, .settings-grid-1-1 { grid-template-columns: 1fr !important; }

    .login-portal-grid {
        flex-direction: column;
        gap: 32px;
        max-width: 500px;
    }
    .login-brand-open {
        text-align: center;
        padding: 10px 0;
    }
    .login-brand-open .feature-list {
        text-align: left;
    }
    .login-box-container {
        padding: 32px 26px;
    }
    
    /* Mobile Sidebar overrides */
    .sidebar {
        position: fixed;
        left: -320px;
        top: 0;
        bottom: 0;
        width: 300px;
        z-index: 510;
        transition: left 0.3s ease;
        box-shadow: none;
    }
    .sidebar.active {
        left: 0;
        box-shadow: 4px 0 24px rgba(0,0,0,0.35);
    }
    .main-content {
        padding: 80px 16px 24px 16px; /* give space for hamburger button */
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.login-logo p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.login-input {
    padding: 14px 16px;
    font-size: 14.5px;
    border-radius: 12px;
    background: var(--bg-modal) !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    transition: all 0.2s;
}

.login-input:focus {
    border-color: var(--color-info) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15) !important;
}

.password-toggle-icon {
    position: absolute;
    right: 16px;
    bottom: 12px;
    cursor: pointer;
    font-size: 16px;
    user-select: none;
    transition: transform 0.15s;
}

.password-toggle-icon:hover {
    transform: scale(1.15);
}

.login-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 15.5px;
    margin-top: 22px;
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-primary) 100%) !important;
    box-shadow: var(--shadow-md);
    border-radius: 14px;
    font-weight: 800;
}

.login-btn:hover {
    background: linear-gradient(135deg, var(--color-info) 0%, var(--color-primary) 100%) !important;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.login-help {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 12.5px;
}

.login-accounts-list {
    margin-top: 8px;
    list-style: none;
    color: var(--text-secondary);
}

.login-accounts-list li {
    margin-bottom: 4px;
}

/* --- Print Media Formatting --- */
@media print {
    body {
        background-color: #fff !important;
        color: #000 !important;
        font-size: 12px !important;
    }

    .sidebar, 
    .btn, 
    .btn-icon, 
    .close-modal,
    .page-header .header-actions,
    .modal-actions-bar,
    .shortcut-buttons,
    .sidebar-user-profile,
    .search-bar-container,
    .table-actions {
        display: none !important;
    }

    .main-content {
        padding: 0 !important;
        height: auto !important;
        overflow: visible !important;
        background: none !important;
    }

    .content-container {
        max-width: 100% !important;
        margin: 0 !important;
        transform: none !important;
        animation: none !important;
    }

    /* Print tables clearly */
    .card, 
    .card-table-container,
    .emp-profile-header,
    .mini-stat-card {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 0 20px 0 !important;
    }

    .data-table,
    .table {
        border-collapse: collapse !important;
        width: 100% !important;
    }

    .data-table th,
    .table th {
        background: var(--text-primary) !important;
        color: #000 !important;
        border: 1px solid var(--text-secondary) !important;
        padding: 8px !important;
        font-size: 10px !important;
    }

    .data-table td,
    .table td {
        border: 1px solid var(--text-secondary) !important;
        padding: 8px !important;
        color: #000 !important;
    }

    .highlight-column-header,
    .highlight-column-val {
        background: var(--text-primary) !important;
        color: #000 !important;
        font-weight: 700 !important;
    }

    .table-summary-row {
        background: var(--text-primary) !important;
    }

    .table-summary-row td {
        border-top: 2px solid #000 !important;
        color: #000 !important;
        font-weight: 700 !important;
    }

    /* Hide background colors in badges */
    .badge {
        background: none !important;
        border: 1px solid var(--text-secondary) !important;
        color: #000 !important;
        padding: 2px 6px !important;
    }

    /* Modals display for printing */
    .modal {
        position: static !important;
        background: none !important;
        backdrop-filter: none !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .modal-content {
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        max-width: 100% !important;
        transform: none !important;
    }
}

/* Dashboard KPI Cards Grid */
.kpi-stats-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, 1fr); /* Mobile/Tablet: 2 columns */
}

@media (max-width: 600px) {
    .kpi-stats-grid {
        grid-template-columns: 1fr; /* Small mobile: 1 column */
    }
}

@media (min-width: 1024px) {
    .kpi-stats-grid {
        grid-template-columns: repeat(5, 1fr); /* PC: exactly 5 columns */
    }
}


/* ============================================================
   THEME TOGGLE BUTTON (Top Right, Modern Style)
   ============================================================ */

.btn-theme-toggle-sidebar {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-theme-toggle-sidebar:hover {
    background: var(--bg-card-hover);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.theme-toggle-btn {
    display: none !important;
}






































/* ── Tema 3: Modern Dark (Violet) ── */



































/* ── Tema 4: Forest Calm (Emerald Dark) ── */





































/* ── Tema 5: Amber Pro (Professional Orange) ── */














































@media (max-width: 860px) {
    .mobile-menu-btn.show-mobile-menu { display: flex; }
}
/* -- Ultra-Modern Toast Notifications -- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}
.toast {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    padding: 12px 16px;
    border-radius: 14px;
    box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.14), 0 4px 8px -2px rgba(15, 23, 42, 0.04), 0 0 0 1px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 290px;
    max-width: 440px;
    transform: translateY(-16px) scale(0.96);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    border-left: 4px solid #3b82f6;
}
[data-theme="dark"] .toast,
.dark .toast {
    background: rgba(30, 41, 59, 0.95);
    color: #f8fafc;
    box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.toast.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.toast-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.toast-content {
    flex-grow: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.45;
    color: inherit;
}
.toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}
.toast-close:hover {
    color: #334155;
    background: rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .toast-close:hover {
    color: #f1f5f9;
    background: rgba(255, 255, 255, 0.12);
}
.toast.success { border-left-color: #10b981; }
.toast.error { border-left-color: #ef4444; }
.toast.warning { border-left-color: #f59e0b; }
.toast.info { border-left-color: #3b82f6; }
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}
.confirm-modal {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}


/* --- UI Transitions --- */
body, .sidebar, .card, .modal-content, .btn, input, select, .table-container th, .table-container td {
    transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease, box-shadow 0.4s ease !important;
}
#content-container {
    transition: opacity 0.3s ease !important;
}

/* --- Pinjaman Tabs Component --- */
.pinjaman-module-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px 0 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}
.pinjaman-module-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: #0d9488;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 12px;
    border-bottom: 2px solid #0d9488;
}
.pinjaman-tabs {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.pinjaman-tabs::-webkit-scrollbar {
    display: none;
}
.pinjaman-tab {
    background: transparent;
    border: none;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pinjaman-tab:hover {
    color: #0d9488;
}
.pinjaman-tab.active {
    background: rgba(13, 148, 136, 0.15);
    color: #0d9488;
    border-bottom-color: #0d9488;
}

/* --- Pinjaman Form Baru --- */
.pinjaman-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 16px;
}
@media (max-width: 900px) {
    .pinjaman-layout {
        grid-template-columns: 1fr;
    }
}

.pinjaman-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.pinjaman-form-header {
    font-size: 14px;
    font-weight: 800;
    color: #0d9488;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #0d9488;
    padding-bottom: 8px;
}

.pinjaman-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.pinjaman-input-group label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.pinjaman-input-group input,
.pinjaman-input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.pinjaman-input-group input:focus,
.pinjaman-input-group select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.pinjaman-input-group input[readonly] {
    background: var(--bg-body);
    color: var(--text-muted);
}

.ceklis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}

.ceklis-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.alur-panel {
    background: var(--bg-body);
    border: 1px dashed var(--border-color);
    border-radius: 12px;
    padding: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.alur-panel-title {
    text-align: center;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.alur-panel ol {
    padding-left: 20px;
    margin: 0;
}

.alur-panel li {
    margin-bottom: 10px;
}

/* Autocomplete Dropdown Theme Adaptive */
.autocomplete-dropdown,
#nik-custom-dropdown,
#cr-nik-custom-dropdown,
#ln-nik-custom-dropdown,
#pic-custom-dropdown {
    background: var(--bg-card) !important;
    border: 1.5px solid var(--border-focus) !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.05) !important;
    overflow-y: auto !important;
}

[data-theme="dark"] #nik-custom-dropdown,
[data-theme="dark"] #cr-nik-custom-dropdown,
[data-theme="dark"] #ln-nik-custom-dropdown,
[data-theme="dark"] #pic-custom-dropdown {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6) !important;
}

.nik-dropdown-item,
.pic-dropdown-item {
    background: var(--bg-card);
    transition: background 0.15s ease;
}

.nik-dropdown-item:hover,
.pic-dropdown-item:hover {
    background: var(--bg-card-hover) !important;
}

