/* ============================================================
   Dashboard HRD — Nugraha Group
   PRD UI/UX v1.0 — Dark Mode Premium | Glassmorphism
   Design System by PRD_UI_UX_Dashboard_HRD.md
   ============================================================ */

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Backgrounds */
    --bg-primary: #0D0D15;
    --bg-sidebar: #12121E;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-table-row-alt: rgba(255, 255, 255, 0.02);
    --bg-input: rgba(255, 255, 255, 0.06);
    
    /* Borders */
    --border-card: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-input: rgba(255, 255, 255, 0.1);
    
    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.35);
    
    /* Accent Colors */
    --accent-primary: #7C5CFC;
    --accent-primary-hover: #6C4CE0;
    --accent-primary-glow: rgba(124, 92, 252, 0.15);
    --accent-success: #10D4A0;
    --accent-success-bg: rgba(16, 212, 160, 0.12);
    --accent-warning: #FFC947;
    --accent-warning-bg: rgba(255, 201, 71, 0.12);
    --accent-danger: #EF4444;
    --accent-danger-bg: rgba(239, 68, 68, 0.12);
    --accent-info: #05A8F4;
    --accent-info-bg: rgba(5, 168, 244, 0.12);
    --accent-cyan: #00E5FF;
    
    /* Badge Colors */
    --badge-green-bg: rgba(16, 212, 160, 0.15);
    --badge-green-text: #10D4A0;
    --badge-green-border: rgba(16, 212, 160, 0.3);
    --badge-orange-bg: rgba(245, 158, 11, 0.15);
    --badge-orange-text: #F59E0B;
    --badge-orange-border: rgba(245, 158, 11, 0.3);
    --badge-red-bg: rgba(239, 68, 68, 0.15);
    --badge-red-text: #EF4444;
    --badge-red-border: rgba(239, 68, 68, 0.3);
    --badge-purple-bg: rgba(124, 92, 252, 0.15);
    --badge-purple-text: #7C5CFC;
    --badge-purple-border: rgba(124, 92, 252, 0.3);
    
    /* Gradients */
    --gradient-chart: linear-gradient(135deg, #7C5CFC, #00E5FF);
    --gradient-cta: linear-gradient(135deg, #7C5CFC, #A855F7);
    
    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --navbar-height: 64px;
    --content-padding: 24px;
    --card-padding: 20px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* Typography */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

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

a { color: var(--accent-info); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-primary); }

/* ============================================================
   SIDEBAR (260px, fixed)
   ============================================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-card);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: white;
}

.brand-info { display: flex; flex-direction: column; }
.brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.brand-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.sidebar-close { display: none; background: none; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.15s ease;
    margin-bottom: 4px;
    position: relative;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-primary-glow);
    color: var(--accent-primary);
    font-weight: 500;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 8px var(--accent-primary);
}

.nav-icon { 
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-text { flex: 1; font-size: 0.9rem; }

.nav-badge {
    background: var(--accent-danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

/* Sidebar Divider */
.sidebar-divider { 
    height: 1px; 
    background: var(--border-subtle); 
    margin: 8px 16px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 12px;
    margin-top: auto;
    border-top: 1px solid var(--border-card);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
    object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 40px; height: 40px; font-size: 1rem; }

.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border: 2px solid var(--bg-primary); }
.avatar-stack .avatar:first-child { margin-left: 0; }

.user-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.user-name { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
}

/* ============================================================
   TOP NAVBAR (64px, sticky)
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--navbar-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-card);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    z-index: 100;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px;
}

.navbar-brand-mobile {
    display: none;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    padding: 0 14px;
    flex: 1;
    max-width: 450px;
    gap: 8px;
}

.search-box .search-icon { font-size: 0.9rem; color: var(--text-muted); flex-shrink: 0; }

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

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

.navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.navbar-icon-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: all 0.15s;
    position: relative;
    line-height: 1;
}

.navbar-icon-btn:hover { background: var(--bg-card); color: var(--text-primary); }

.notif-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--accent-danger);
    border-radius: 50%;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

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

.navbar-user-info { text-align: right; }
.navbar-user-name { font-size: 0.85rem; font-weight: 600; }
.navbar-user-role { font-size: 0.7rem; color: var(--text-muted); }

.switch-role-btn {
    font-size: 0.7rem;
    color: var(--accent-primary);
    background: none;
    border: 1px solid rgba(124, 92, 252, 0.3);
    border-radius: 4px;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.switch-role-btn:hover { background: var(--accent-primary-glow); }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    padding: var(--content-padding);
}

/* Page Header */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

.page-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: var(--card-padding);
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
    /* v1.22.26c — explicit width for guaranteed alignment with .kpi-grid */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.card-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* --- KPI Cards --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
    /* v1.22.26c — explicit width constraint to prevent auto-shrink */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    /* v1.22.27 — flex column layout works with both wrapper (kas-karyawan) and flat (dashboard) markup */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-height: 110px;
    transition: all 0.2s ease;
}
.kpi-card .kpi-info { flex: 1; min-width: 0; }

.kpi-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.kpi-card.has-accent-left { border-left: 3px solid var(--accent-success); }
.kpi-card.has-accent-right { border-right: 3px solid var(--accent-primary); }

/* ===== Navbar Dropdowns ===== */
.notif-dropdown, .user-dropdown {
    position: absolute; top: 100%; right: 0; z-index: 1000;
    min-width: 260px; background: #1e293b; border: 1px solid #334155;
    border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    margin-top: 8px; overflow: hidden;
}
.notif-dropdown { right: -60px; }
.user-dropdown { right: 0; min-width: 200px; }
.notif-header {
    padding: 12px 16px; font-weight: 700; font-size: 13px;
    color: #f1f5f9; border-bottom: 1px solid #334155;
}
.notif-read {
    opacity: 0.5;
    transition: opacity 0.15s;
}
.notif-read:hover {
    opacity: 0.8;
}

.notif-mark-all {
    background: transparent;
    border: 1px solid var(--border, #334155);
    color: #94a3b8;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}
.notif-mark-all:hover {
    background: var(--accent, #6C5CE7);
    border-color: var(--accent, #6C5CE7);
    color: #fff;
}

.notif-item, .dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px; font-size: 13px; color: #e2e8f0;
    text-decoration: none; transition: background 0.15s;
}
.notif-item:hover, .dropdown-item:hover { background: #0f172a; }
.notif-icon { font-size: 16px; }
.notif-text { flex: 1; }
.notif-empty, .notif-loading {
    padding: 20px; text-align: center; font-size: 13px; color: #64748b;
}
.dropdown-divider { height: 1px; background: #334155; margin: 4px 0; }

/* ===== Mobile Touch Optimization ===== */
@media (max-width: 768px) {
    .btn, .btn-sm, .btn-xs { min-height: 44px; min-width: 44px; padding: 12px 16px; font-size: 14px; }
    .btn-xs { padding: 10px 14px; }
    .nav-item { min-height: 48px; padding: 12px 16px; }
    input, select, textarea, .form-control { font-size: 16px !important; } /* Prevent iOS zoom */
}

/* ===== Splash Screen ===== */
.splash-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #0D0D15; z-index: 99999;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    animation: splashFade 0.3s ease 1.5s forwards;
}
@keyframes splashFade {
    to { opacity: 0; pointer-events: none; }
}
.splash-logo {
    width: 80px; height: 80px; background: #7C5CFC; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 16px;
    box-shadow: 0 20px 60px rgba(124,92,252,0.3);
    animation: splashPulse 1s ease infinite;
}
@keyframes splashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.splash-title { font-size: 20px; font-weight: 700; color: #f1f5f9; }
.splash-sub { font-size: 13px; color: #64748b; margin-top: 4px; }
.splash-loader { margin-top: 30px; width: 48px; height: 48px; border: 3px solid #334155; border-top-color: #7C5CFC; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.kpi-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    /* v1.22.27 — leave room for top-right icon */
    padding-right: 44px;
    margin-bottom: 2px;
    margin-bottom: 8px;
}

.kpi-icon {
    /* v1.22.27 — absolute top-right, smaller box, emoji-friendly font-size */
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
    pointer-events: none;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    margin-bottom: 4px;
    /* v1.22.27 — prevent value text from wrapping to 2nd line on long currency strings */
    overflow-wrap: anywhere;
    word-break: break-word;
    max-width: 100%;
}

.kpi-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.kpi-trend {
    font-size: 0.75rem;
    font-weight: 500;
}

.kpi-trend.up { color: var(--accent-success); }
.kpi-trend.down { color: var(--accent-danger); }

.kpi-badge {
    position: absolute;
    top: 16px;
    right: 44px;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: var(--badge-green-bg);
    color: var(--badge-green-text);
    font-weight: 500;
}

/* --- Stats Grid (3 columns) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-wrapper.success { background: var(--badge-green-bg); color: var(--accent-success); }
.stat-icon-wrapper.warning { background: var(--badge-orange-bg); color: var(--accent-warning); }
.stat-icon-wrapper.danger { background: var(--badge-red-bg); color: var(--accent-danger); }
.stat-icon-wrapper.info { background: var(--badge-purple-bg); color: var(--accent-primary); }

.stat-content { min-width: 0; }
.stat-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 2px; }
.stat-value { font-size: 1.3rem; font-weight: 700; }
.stat-sub { font-size: 0.75rem; color: var(--text-secondary); margin-top: 2px; }

/* --- Tables --- */
.table-container {
    overflow-x: auto;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
}

.table-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-card);
}

.table-title-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-title-area h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.table-title-area .live-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.85rem;
}

tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
tbody tr:last-child td { border-bottom: none; }

.td-employee {
    display: flex;
    align-items: center;
    gap: 10px;
}

.td-employee-info { display: flex; flex-direction: column; }
.td-employee-name { font-weight: 500; color: var(--text-primary); }
.td-employee-dept { font-size: 0.75rem; color: var(--text-secondary); }

.td-money { text-align: right; font-variant-numeric: tabular-nums; }
.td-money.income { color: var(--accent-success); }
.td-money.deduction { color: var(--accent-danger); }
.td-money.total { color: var(--text-primary); font-weight: 700; }
.td-money.muted { color: var(--text-muted); }

/* Table Footer / Pagination */
.table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-top: 1px solid var(--border-card);
    font-size: 0.8rem;
}

.table-footer .info { color: var(--text-muted); }

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination button {
    background: none;
    border: 1px solid var(--border-card);
    border-radius: 6px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}

.pagination button:hover { background: var(--bg-card); color: var(--text-primary); }
.pagination button.active { background: var(--accent-primary); border-color: var(--accent-primary); color: white; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.form-control,
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.form-control:focus,
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

.form-input.error {
    border-color: var(--accent-danger);
    box-shadow: 0 0 0 3px var(--accent-danger-bg);
}

.form-error { font-size: 0.75rem; color: var(--accent-danger); margin-top: 4px; }

.form-textarea { min-height: 100px; resize: vertical; }

/* --- Form Controls --- */
.form-control,
.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' opacity='0.6' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Textarea: no dropdown arrow */
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.85rem;
    transition: all 0.2s;
    resize: vertical;
    min-height: 60px;
}
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-glow);
}

/* Date & Time inputs: no dropdown arrow (bawaan browser) */
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
    background-image: none;
    padding-right: 14px;
    cursor: text;
}

/* Input teks & number: jangan kena panah dropdown */
.form-control[type="text"],
.form-control[type="number"],
.form-control:not(select) {
    background-image: none !important;
    padding-right: 14px;
    cursor: text;
}

/* Dark theme untuk dropdown option */
select.form-control option,
select.form-select option,
.form-control option,
.form-select option {
    background: #1e293b;
    color: #e2e8f0;
    padding: 8px 12px;
}

/* Filter/dropdown khusus yang pake <select> langsung (bukan form-control) */
select:not(.form-control):not(.form-select) option {
    background: #1e293b;
    color: #e2e8f0;
}

@media (max-width: 768px) {
    select.form-control option,
    select.form-select option {
        font-size: 16px; /* Prevent iOS zoom */
    }
}

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

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.2;
}

.btn-primary {
    background: var(--gradient-cta);
    color: white;
}

.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 20px rgba(124, 92, 252, 0.3); }

.btn-success { background: var(--accent-success); color: #000; }
.btn-success:hover { filter: brightness(1.1); }

.btn-danger { background: var(--accent-danger); color: white; }
.btn-danger:hover { filter: brightness(1.1); }

.btn-warning { background: var(--accent-warning); color: #000; }
.btn-warning:hover { filter: brightness(1.1); }

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

.btn-outline:hover { border-color: var(--accent-primary); color: var(--accent-primary); background: var(--accent-primary-glow); }

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-secondary);
}

.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 0.9rem; }

/* --- Badges --- */
.badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.badge-success { background: var(--badge-green-bg); color: var(--badge-green-text); border-color: var(--badge-green-border); }
.badge-warning { background: var(--badge-orange-bg); color: var(--badge-orange-text); border-color: var(--badge-orange-border); }
.badge-danger { background: var(--badge-red-bg); color: var(--badge-red-text); border-color: var(--badge-red-border); }
.badge-info { background: var(--accent-info-bg); color: var(--accent-info); border-color: rgba(5, 168, 244, 0.3); }
.badge-purple { background: var(--badge-purple-bg); color: var(--badge-purple-text); border-color: var(--badge-purple-border); }
.badge-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-secondary); border-color: transparent; }

/* --- Alerts --- */
.alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.85rem;
    animation: slideIn 0.3s ease-out;
}

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

.alert-success { background: var(--badge-green-bg); border: 1px solid var(--badge-green-border); color: var(--badge-green-text); }
.alert-danger { background: var(--badge-red-bg); border: 1px solid var(--badge-red-border); color: var(--badge-red-text); }
.alert-warning { background: var(--badge-orange-bg); border: 1px solid var(--badge-orange-border); color: var(--badge-orange-text); }
.alert-info { background: var(--accent-info-bg); border: 1px solid rgba(5, 168, 244, 0.3); color: var(--accent-info); }

.alert-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.6;
    flex-shrink: 0;
}

/* --- Modal --- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease-out;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-header h2 { font-size: 1.1rem; }

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

/* --- Progress Bar --- */
.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease-out;
}

.progress-fill.success { background: var(--accent-success); }
.progress-fill.warning { background: var(--accent-warning); }
.progress-fill.danger { background: var(--accent-danger); }
.progress-fill.primary { background: var(--accent-primary); }

/* --- Action Buttons (card-style) --- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.action-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.action-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.action-card-info { display: flex; flex-direction: column; }
.action-card-title { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); margin-bottom: 2px; }
.action-card-desc { font-size: 0.75rem; color: var(--text-secondary); }

/* --- Dropdown / Pill Select --- */
.pill-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-input);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s;
}

.pill-select:hover { background: var(--bg-card); color: var(--text-primary); }

/* --- Policy Alert --- */
.policy-alert {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid var(--accent-danger);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 16px;
}

.policy-alert-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-danger);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.policy-alert-body {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.policy-alert-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.policy-alert-link {
    display: block;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: underline;
}

/* --- Split Layout (chart + action panel) --- */
.split-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.85rem; color: var(--text-muted); }

/* --- Loading Skeleton --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.08) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* --- Spinner --- */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-card);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --- Page Load Animation --- */
.page-content {
    animation: pageFadeIn 0.3s ease-out;
}

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

/* ============================================================
   AUTH PAGE
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-primary);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}

.auth-card .brand {
    justify-content: center;
    margin-bottom: 32px;
}

.auth-card h1 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 4px;
}

.auth-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 0.85rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .split-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay.show { display: block; }
    
    .navbar { left: 0; }
    .hamburger { display: block; }
    .navbar-brand-mobile { display: block; }
    .search-box { display: none; }
    .navbar-user-info { display: none; }
    
    .main-content { margin-left: 0; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .content-padding { padding: 16px; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .action-grid { grid-template-columns: 1fr; }
}


/* ===== Missing CSS classes (audit fix 23 Jun 2026) ===== */

/* Text utilities (high usage) */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--accent-danger); }
.text-success { color: var(--accent-success); }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-primary { color: var(--accent-primary); }
.text-on-surface-variant { color: var(--text-secondary); }
.text-h3 { font-size: 1.5rem; font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Layout utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-align-center { display: flex; align-items: center; }
.items-center { align-items: center; }
.ml-auto { margin-left: auto; }

/* Spacing */
.py-lg { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-xl { padding-top: 2rem; padding-bottom: 2rem; }
.mb-lg { margin-bottom: 1.5rem; }
.p-lg { padding: 1.5rem; }
.gap-xs { gap: 0.25rem; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-gutter { gap: 16px; }

/* Container/grid */
.row { display: flex; flex-wrap: wrap; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }

/* Forms */
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--text-secondary); }
.form { display: flex; flex-direction: column; gap: 0.5rem; }
.form-actions { display: flex; gap: 0.5rem; }
.inline-form { display: inline-flex; }

/* Table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border-card); }
.table th { font-weight: 600; color: var(--text-secondary); }
.table-striped tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }
.table-sm th, .table-sm td { padding: 4px 8px; font-size: 0.85rem; }

/* Card */
.card-body { padding: 16px; }

/* Modal — CRITICAL FIX for BPJS, absensi, etc */
.modal-inner {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.2s ease-out;
    color: var(--text-primary);
}

/* Pill (status badge) */
.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.pill-warning { background: rgba(245, 158, 11, 0.15); color: var(--accent-warning); }
.pill-success { background: rgba(16, 212, 160, 0.15); color: var(--accent-success); }
.pill-danger { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.pill-info { background: rgba(124, 92, 252, 0.15); color: var(--accent-primary); }

/* Badge outline */
.badge-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-card);
}

/* Notification */
.notif-empty { text-align: center; padding: 32px; color: var(--text-muted); }
.notif-item { padding: 12px; border-bottom: 1px solid var(--border-card); cursor: pointer; }
.notif-item:hover { background: var(--bg-card-hover); }

/* Auth-specific */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.flash-error { background: rgba(239, 68, 68, 0.15); color: var(--accent-danger); }
.flash-success { background: rgba(16, 212, 160, 0.15); color: var(--accent-success); }
.logo { font-size: 2rem; font-weight: 800; color: var(--accent-primary); margin-bottom: 16px; }
.login-link { color: var(--accent-primary); text-decoration: none; }
.register-wrap { max-width: 480px; margin: 60px auto; padding: 32px; }
.tracking-box { border: 1px solid var(--border-card); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.progress-step { display: flex; align-items: center; gap: 8px; padding: 12px; }
.step-icon { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.step-done { background: var(--accent-success); color: #000; }
.step-current { background: var(--accent-primary); color: #fff; }
.step-pending { background: var(--bg-card); color: var(--text-muted); }

/* Kas karyawan specific */
.kpi-info { padding: 12px; background: var(--bg-card); border-radius: 8px; }
.avatar-xs { width: 32px; height: 32px; border-radius: 50%; }

/* Payroll / lembur */
.lembur-table { width: 100%; margin-top: 8px; font-size: 13px; }
.lembur-table th, .lembur-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-card); }
.modal-lembur { /* alias of .modal-overlay */ }
.modal-lembur-content { background: var(--bg-card); padding: 24px; border-radius: 12px; }
.modal-lembur-close { background: none; border: none; font-size: 20px; cursor: pointer; }
.lembur-section { margin: 12px 0; padding: 12px; background: rgba(0,0,0,0.2); border-radius: 8px; }
.lembur-total { font-weight: 700; font-size: 1.1rem; color: var(--accent-success); }

/* Toast */
.toast { position: fixed; bottom: 20px; right: 20px; padding: 12px 20px; background: var(--bg-card); border-radius: 8px; z-index: 99999; }

/* Approval */
.approval-item { padding: 12px; border: 1px solid var(--border-card); border-radius: 8px; margin-bottom: 8px; }

/* Settings */
.short-day-field { max-width: 80px; }

/* Laporan (header) */
.header { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }


/* Grid responsive (REGRESSION FIX from v3 audit) — was missing */
.grid-responsive {
    display: grid;
    gap: 16px;
}
@media (max-width: 1024px) {
    .grid-responsive {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 768px) {
    .grid-responsive {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Mobile responsive - Extra small screens (< 360px) & Landscape ===== */

@media (max-width: 360px) {
    .kpi-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
    .stats-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
    .navbar { padding: 0 8px !important; height: 52px !important; }
    .navbar-brand-mobile { font-size: 0.9rem !important; }
    .navbar-user-name { display: none !important; }
    .content-padding { padding: 8px !important; }
    .card { padding: 12px !important; }
    .page-header h1 { font-size: 1.15rem !important; }
    .page-header p { font-size: 0.78rem !important; margin: 4px 0 0 0 !important; }
    .page-header { flex-direction: column !important; align-items: flex-start !important; gap: 8px !important; }
    .table th, .table td { padding: 4px 6px !important; font-size: 12px !important; }
    .table th { font-size: 11px !important; }
    .btn { padding: 8px 12px !important; font-size: 13px !important; }
    .btn-xs { padding: 6px 10px !important; font-size: 12px !important; }
    .modal-inner { padding: 16px !important; max-width: 95% !important; }
    .modal-overlay { padding: 8px !important; }
    .kpi-card { padding: 12px !important; }
    .kpi-value { font-size: 1.4rem !important; }
    .kpi-label { font-size: 0.7rem !important; }
    .form-control { font-size: 14px !important; padding: 6px 10px !important; }
    .badge { font-size: 0.7rem !important; padding: 2px 6px !important; }
    h2, .card-header h2 { font-size: 1rem !important; }
    h3 { font-size: 0.95rem !important; }
    .gap-sm { gap: 0.4rem !important; }
    .gap-xs { gap: 0.2rem !important; }
    .ml-auto { margin-left: 0.5rem !important; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .kpi-grid { grid-template-columns: repeat(4, 1fr) !important; }
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .navbar { height: 48px !important; }
    .content-padding { padding: 12px !important; }
    .card { padding: 12px !important; }
    .modal-inner { max-height: 85vh !important; }
    .page-header { margin-bottom: 12px !important; }
    .page-header h1 { font-size: 1.2rem !important; }
    .splash-screen .splash-loader { margin-top: 16px !important; width: 32px !important; height: 32px !important; }
}

@media print {
    .sidebar, .navbar, .hamburger, .splash-screen, .modal-overlay, .btn, .pagination { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .card { break-inside: avoid; box-shadow: none !important; border: 1px solid #ccc !important; }
    .table-responsive { overflow: visible !important; }
    body { background: white !important; color: black !important; }
    a { color: black !important; text-decoration: underline !important; }
}

/* ============================================================
 * v1.22.23 — Phase 1: Full Responsive Layout Fix
 * - Q2: 6-tier breakpoints (360/480/768/1024/1920/>1921)
 * - Q3: Hybrid horizontal scroll policy (body hidden, table-responsive allowed)
 * - Q5: Table cell word-wrap for inline widths
 * - Q6: Sidebar overlay mode on tablet (1024px)
 * ============================================================ */

/* Q3: App shell never horizontal scroll */
body { overflow-x: hidden; }

/* Q5: Table cells wrap text instead of overflow */
.table th, .table td {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Q6: Sidebar overlay mode on tablet (1024px) */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 1100;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
    .sidebar-close {
        display: block;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .hamburger {
        display: inline-flex !important;
    }
}

/* Q6: Show hamburger button on tablet+ (hidden on desktop) */
@media (min-width: 1025px) {
    .hamburger {
        display: none !important;
    }
}

/* Q3: Per-table horizontal scroll (data tables) */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* Q4: Universal max-width fallback (per-file overrides) */
.modal-inner,
.card,
.form-card {
    max-width: min(95vw, var(--max-content-width, 1200px));
}

/* Q1: Sidebar nav improvement on tablet */
@media (max-width: 1024px) and (min-width: 769px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Ultra-wide monitor (> 1920px) - constrain content */
@media (min-width: 1921px) {
    .main-content {
        max-width: 1800px;
        margin-left: var(--sidebar-width);
        margin-right: auto;
    }
}

/* ============================================================
 * v1.22.25 — Phase 3: Universal responsive patterns
 * - Inline grid 1fr 1fr → 1fr on mobile
 * - Modal-inner max-width fallback for 360px foldables
 * ============================================================ */

/* Phase 3: Inline grid auto-stack on mobile */
@media (max-width: 768px) {
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
}

/* Phase 3: Modal-inner max-width fallback for 360px foldables */
@media (max-width: 360px) {
    .modal-inner {
        max-width: 100% !important;
        margin: 0 8px;
    }
}



/* v1.22.26 — Chart canvas fixes (full width, fixed height, no aspect ratio constraint) */
.card-body canvas,
#growthChart,
.chart-canvas {
    width: 100% !important;
    max-width: 100%;
    height: 280px !important;
    display: block;
}

/* v1.22.27 — Removed kpi-value padding-right; using overflow-wrap instead (icon stays absolute) */

/* v1.22.26c — Layout alignment + spacing fixes */

/* Force all top-level sections to align at same width */
.page-content > .kpi-grid,
.page-content > .card,
.page-content > div > .card,
.page-content > div > .kpi-grid {
    width: 100%;
    max-width: 100%;
}

/* Section spacing: ensure consistent gap between major cards */
.page-content > .card + .card,
.page-content > .card + div,
.page-content > div + .card {
    margin-top: 24px;
}

/* Override mb-lg to be more visible for chart card */
.card.mb-lg {
    margin-bottom: 24px !important;
    margin-top: 32px !important;
}

/* Chart empty state fallback when canvas has no data */
.chart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 32px;
    color: var(--text-secondary);
    text-align: center;
}
.chart-empty-state .icon {
    font-size: 3rem;
    opacity: 0.4;
    margin-bottom: 12px;
}
.chart-empty-state p {
    font-size: 0.9rem;
    margin: 0;
}


/* v1.22.27 — Dashboard KPI Card layout fixes */

/* Ensure 4 cards fit nicely at common viewports */
.kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Smaller card padding on narrow viewports */
@media (max-width: 1280px) {
    .kpi-card {
        padding: 16px 18px;
        min-height: 100px;
    }
    .kpi-value {
        font-size: 1.75rem;
    }
    .kpi-icon {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        font-size: 1.2rem;
    }
    .kpi-label {
        padding-right: 38px;
    }
}
