/* public/assets/css/style.css - Kansan HR Modern SaaS Design System */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #3730a3;
    --sidebar-bg: #090d16;
    --sidebar-surface: #111827;
    --sidebar-border: #1e293b;
    --surface: #ffffff;
    --surface-subtle: #f8fafc;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', 'Outfit', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-primary);
    background-color: #f8fafc;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sidebar Nav Item Styling */
#main-sidebar {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    overscroll-behavior: none !important;
}

#main-sidebar-nav {
    overflow-y: hidden;
    overscroll-behavior: contain;
}

@media (max-height: 560px) {
    #main-sidebar-nav {
        overflow-y: auto;
    }
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #94a3b8;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    margin-bottom: 2px;
}

.sidebar-link:hover {
    color: #f8fafc;
    background-color: rgba(255, 255, 255, 0.06);
    transform: translateX(2px);
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.95), rgba(99, 102, 241, 0.9));
    box-shadow: 0 4px 14px -1px rgba(79, 70, 229, 0.35);
}

.sidebar-link.active .sidebar-icon {
    color: #ffffff !important;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.35rem 0.75rem 0.15rem;
    display: block;
}

/* Modern Card Component */
.modern-card {
    background-color: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1.25rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}
.modern-card:hover {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
}

/* Stat Widget Cards */
.stat-widget {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.07);
}

/* Modern Attendance Status Pills (Screen View) */
.att-pill {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.att-pill:hover {
    transform: scale(1.18);
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.pill-p {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.pill-a {
    background-color: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}
.pill-hd {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.pill-pl {
    background-color: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.pill-ul {
    background-color: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}
.pill-empty {
    color: #cbd5e1;
    font-size: 0.8rem;
    border: 1px dashed transparent;
}
.pill-empty:hover {
    border-color: #94a3b8;
    color: #64748b;
    background-color: #f8fafc;
}
.pill-future {
    color: #cbd5e1;
    font-size: 0.8rem;
    cursor: not-allowed !important;
    user-select: none;
    opacity: 0.45;
}
.pill-future:hover {
    transform: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

/* Full Cell Color Roster Attendance Styles */
.roster-cell {
    padding: 0 !important;
    height: 32px !important;
    width: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    text-align: center !important;
    vertical-align: middle !important;
    font-size: 0.75rem !important;
    font-weight: 900 !important;
    line-height: 32px !important;
    user-select: none;
    transition: all 0.15s ease;
}

.roster-table tbody tr td.roster-cell-p,
.roster-table tbody tr:hover td.roster-cell-p {
    background-color: #059669 !important; /* Rich Solid Emerald Green */
    color: #ffffff !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25) !important;
}
.roster-table tbody tr td.roster-cell-a,
.roster-table tbody tr:hover td.roster-cell-a {
    /* Color-blind safe: High-contrast diagonal hazard stripes (Visible in grayscale & all vision types) */
    background: repeating-linear-gradient(135deg, #e11d48, #e11d48 3.5px, #881337 3.5px, #881337 7px) !important;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9) !important;
    box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5) !important;
    font-weight: 900 !important;
}
.roster-table tbody tr td.roster-cell-hd,
.roster-table tbody tr:hover td.roster-cell-hd {
    background-color: #f59e0b !important; /* Vibrant Amber */
    color: #0f172a !important; /* Dark text for crystal clear contrast */
    font-weight: 900 !important;
}
.roster-table tbody tr td.roster-cell-pl,
.roster-table tbody tr:hover td.roster-cell-pl {
    background-color: #0284c7 !important; /* Sky Blue */
    color: #ffffff !important;
}
.roster-table tbody tr td.roster-cell-ul,
.roster-table tbody tr:hover td.roster-cell-ul {
    background-color: #7c3aed !important; /* Royal Purple */
    color: #ffffff !important;
}
.roster-table tbody tr td.roster-cell-empty {
    background-color: #ffffff;
    color: #cbd5e1;
}
.roster-table tbody tr:hover td.roster-cell-empty {
    background-color: #f1f5f9;
    color: #64748b;
    font-weight: 900;
}
.roster-table tbody tr td.roster-cell-future,
.roster-table tbody tr:hover td.roster-cell-future {
    background-color: #f8fafc !important;
    color: #cbd5e1 !important;
    cursor: not-allowed !important;
}

.roster-table tbody tr td.roster-cell:hover:not(.roster-cell-future) {
    filter: brightness(0.88);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7) !important;
}

/* Status Radio Selection inside Modal */
.status-radio-card {
    border: 1.5px solid #e2e8f0;
    background-color: #ffffff;
    transition: all 0.15s ease;
}
.status-radio-card:has(input:checked) {
    border-color: #4f46e5;
    background-color: #eef2ff;
    box-shadow: 0 0 0 1px #4f46e5;
}
.status-radio-card input:checked + span {
    transform: scale(1.08);
}

/* Toast Notifications */
.toast {
    padding: 0.875rem 1.25rem;
    border-radius: 1rem;
    font-size: 0.825rem;
    font-weight: 700;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
}
.toast-success {
    background-color: #064e3b;
    color: #ecfdf5;
    border: 1px solid #059669;
}
.toast-error {
    background-color: #881337;
    color: #fff1f2;
    border: 1px solid #e11d48;
}

@keyframes toastSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* Roster Table Scroll Container with Freeze Panes (Interactive Web View) */
.roster-scroll-container {
    max-height: 74vh;
    overflow-x: auto;
    overflow-y: auto;
    position: relative;
    border: 1px solid #cbd5e1;
    border-radius: 0.875rem;
    background: #ffffff;
}

.roster-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-variant-numeric: tabular-nums;
}

.roster-table thead tr th {
    position: sticky;
    top: 0;
    z-index: 30;
    background-color: #0f172a;
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 0.25rem;
    border-bottom: 2px solid #334155;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.roster-table th.col-sr,
.roster-table td.col-sr {
    position: sticky;
    left: 0;
    z-index: 20;
    width: 42px;
    min-width: 42px;
    max-width: 42px;
    text-align: center;
}

.roster-table th.col-name,
.roster-table td.col-name {
    position: sticky;
    left: 42px;
    z-index: 20;
    min-width: 145px;
    max-width: 175px;
}

.roster-table th.col-desig,
.roster-table td.col-desig {
    position: sticky;
    left: 187px;
    z-index: 20;
    min-width: 80px;
    border-right: 2px solid #cbd5e1 !important;
    box-shadow: 4px 0 8px -2px rgba(0, 0, 0, 0.08);
}

.roster-table thead th.col-sr,
.roster-table thead th.col-name,
.roster-table thead th.col-desig {
    z-index: 45 !important;
    background-color: #0f172a !important;
    color: #ffffff !important;
}

.roster-table tbody tr.row-even td.col-sr,
.roster-table tbody tr.row-even td.col-name,
.roster-table tbody tr.row-even td.col-desig {
    background-color: #ffffff !important;
}

.roster-table tbody tr.row-odd td.col-sr,
.roster-table tbody tr.row-odd td.col-name,
.roster-table tbody tr.row-odd td.col-desig {
    background-color: #f8fafc !important;
}

/* High-Contrast Hover Styles for Roster Rows */
.roster-table tbody tr:hover td:not(.roster-cell) {
    background-color: #f1f5f9;
}

/* Sticky Columns on Hover - Crisp, legible dark text */
.roster-table tbody tr:hover td.col-sr,
.roster-table tbody tr:hover td.col-name,
.roster-table tbody tr:hover td.col-desig {
    background-color: #e2e8f0 !important;
}

.roster-table tbody tr:hover td.col-sr {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.roster-table tbody tr:hover td.col-name span {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.roster-table tbody tr:hover td.col-desig span {
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Advance Column on Hover */
.roster-table tbody tr:hover td.col-advance {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    font-weight: 900 !important;
}

/* Summary Columns on Hover - High-contrast text */
.roster-table tbody tr:hover td.col-pl {
    background-color: #f0f9ff !important;
    color: #0369a1 !important;
    font-weight: 900 !important;
}

.roster-table tbody tr:hover td.col-ul {
    background-color: #faf5ff !important;
    color: #6d28d9 !important;
    font-weight: 900 !important;
}

.roster-table tbody tr:hover td.col-tp {
    background-color: #ecfdf5 !important;
    color: #047857 !important;
    font-weight: 900 !important;
}

.roster-table tbody tr:hover td.col-ta {
    background-color: #fff1f2 !important;
    color: #be123c !important;
    font-weight: 900 !important;
}

/* Staff Directory Cards & Fixed Avatar System */
.staff-card {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    overflow: hidden !important;
    transition: all 0.2s ease !important;
}

.staff-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.staff-avatar-box {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    aspect-ratio: 1 / 1 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #0f172a;
    border: 1.5px solid #e0e7ff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.staff-avatar-box img {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
}

/* ------------------------------------------------------------- */
/* EXACT PRINT STYLES FOR IMAGE 1 (ROSTER) AND IMAGE 2 (SALARY) */
/* ------------------------------------------------------------- */
@media print {
    .no-print, header, nav, aside, #toast-container, button, form, input, select, .sidebar-link, #sidebar-drawer {
        display: none !important;
    }

    body {
        background-color: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 8pt !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    main {
        padding: 0 !important;
        min-height: auto !important;
        width: 100% !important;
        margin: 0 !important;
    }

    @page {
        size: A4 landscape;
        margin: 3mm 4mm !important;
    }

    .roster-scroll-container, .sheet-card {
        max-height: none !important;
        overflow: visible !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .roster-table, .report-table {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 7.5pt !important;
    }

    .roster-table th, .roster-table td,
    .report-table th, .report-table td {
        position: static !important;
        box-shadow: none !important;
        border: 1px solid #64748b !important;
        padding: 2px 3px !important;
    }

    .roster-table th {
        background-color: #0f172a !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .report-table th {
        background-color: #0f3460 !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .banner-header {
        background-color: #1e293b !important;
        color: #ffffff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Print color fills */
    .cell-p, .pill-p {
        background-color: #d1fae5 !important;
        color: #065f46 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .cell-a, .pill-a {
        background-color: #fee2e2 !important;
        color: #991b1b !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .cell-hd, .pill-hd {
        background-color: #fef3c7 !important;
        color: #92400e !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .cell-pl, .pill-pl {
        background-color: #e0f2fe !important;
        color: #075985 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    .cell-ul, .pill-ul {
        background-color: #f3e8ff !important;
        color: #6b21a8 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
