:root {
    --primary-blue: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: #e0f2fe;
    --sidebar-width: 260px;
    --bg-canvas: #f8fafc;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-canvas);
    color: #334155;
    overflow-x: hidden;
}

/* Blur & Lock content when not logged in */
body.not-logged-in #sidebar,
body.not-logged-in #main-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    transition: all 0.3s ease;
    z-index: 1040;
    display: flex;
    flex-direction: column;
}

#sidebar .brand-header {
    padding: 1.25rem 1rem;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#sidebar .nav-link {
    color: #94a3b8;
    padding: 0.85rem 1.25rem;
    font-weight: 500;
    border-left: 4px solid transparent;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

#sidebar .nav-link:hover, #sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.05);
    border-left-color: var(--primary-blue);
}

#sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

/* Main Content Layout */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
    padding-bottom: 60px;
}

.top-navbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1.5rem;
}

/* KPI Cards */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Badge Custom */
.badge-shift {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.shift-1 { background-color: #dbeafe; color: #1e40af; }
.shift-2 { background-color: #e0e7ff; color: #3730a3; }
.shift-3 { background-color: #f3e8ff; color: #6b21a8; }
.shift-HC { background-color: #dcfce7; color: #166534; }
.shift-CG { background-color: #fef9c3; color: #854d0e; }
.shift-NC { background-color: #fee2e2; color: #991b1b; }
.shift-P { background-color: #ffedd5; color: #9a3412; }
.shift-BU { background-color: #f1f5f9; color: #475569; }

/* Responsive Mobile Shift Matrix Modal */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar.active {
        margin-left: 0;
    }
    #main-content {
        margin-left: 0;
    }
    .shift-grid-mobile {
        display: block;
    }
    .shift-grid-desktop {
        display: none;
    }
}

@media (min-width: 992px) {
    .shift-grid-mobile {
        display: none;
    }
    .shift-grid-desktop {
        display: block;
    }
}

/* Print Styling - Exact BM-689 Format */
@media print {
    .no-print, #sidebar, .top-navbar, .btn, .nav-tabs, .modal-header, .modal-footer {
        display: none !important;
    }
    #main-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
    }
    .printable-area {
        display: block !important;
        width: 100%;
    }
    .table-print {
        width: 100% !important;
        border-collapse: collapse !important;
    }
    .table-print th, .table-print td {
        border: 1px solid #000 !important;
        padding: 4px 6px !important;
        text-align: center;
    }
    @page {
        size: A4 landscape;
        margin: 10mm;
    }
}