/* --- MODERN PROFESSIONAL SaaS THEME --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Sophisticated Color Palette */
    --brand: #f97316;
    --brand-dark: #ea580c;
    --brand-light: #ffedd5;
    --brand-glow: rgba(249, 115, 22, 0.15);
    
    --bg-main: #f8fafc;
    --bg-sidebar: #0f172a;
    --bg-card: #ffffff;
    
    --text-heading: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --text-on-dark: #94a3b8;
    
    --success: #10b981;
    --danger: #ef4444;
    --border: rgba(226, 232, 240, 0.8);
    
    /* Layout Constants */
    --sidebar-width: 285px;
    --top-bar-height: 56px;
    --bottom-nav-height: 64px;
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -1px rgba(0,0,0,0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05);
}

/* --- BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    line-height: 1.5;
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* --- PREMIUM AUTH SCREEN --- */
.auth-wrapper {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
    background: #0f172a;
    /* Animated gradient background */
    background: radial-gradient(circle at top left, rgba(249, 116, 22, 0.339), transparent),
                radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.89), #020617);
}

.auth-card {
    background: rgba(255, 255, 255, 0.98);
    padding: 3.5rem 3rem;
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInSlide 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.auth-brand {
    margin-bottom: 2.5rem;
}

.auth-logo {
    height: 64px; /* Adjust based on your logo shape */
    width: auto;
    margin-bottom: 1.25rem;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.auth-brand h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.auth-brand p {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

/* Input Styling */
.input-group {
    text-align: left;
    margin-bottom: 1.8rem;
}

.input-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #475569;
    margin-bottom: 0.8rem; /* Increased gap between label text and the input box */
    padding-left: 4px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    transition: all 0.3s ease;
    height: 48px;
}

.input-wrapper:focus-within {
    border-color: var(--brand);
    background: white;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
    transform: translateY(-1px);
}

.input-wrapper i {
    padding: 0 16px;
    color: #94a3b8;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.input-wrapper:focus-within i {
    color: var(--brand);
}

.input-wrapper input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    background: transparent;
    color: #1e293b;
    min-width: 0;
}

.toggle-password {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    flex-shrink: 0;
}

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

/* Button Styling */
.btn-login {
    width: 100%;
    height: 52px;
    background: #0f172a; /* Dark professional primary */
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.btn-login:hover {
    background: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.3);
}

.btn-login:active {
    transform: translateY(0);
}

.login-error {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top));
    right: max(1rem, env(safe-area-inset-right));
    left: max(1rem, env(safe-area-inset-left));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    align-items: flex-end;
}

@media (min-width: 480px) {
    .toast-container {
        left: auto;
        max-width: 360px;
    }
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-body);
    animation: toastIn 0.3s ease;
    max-width: 100%;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid #f59e0b; }
.toast.info { border-left: 4px solid var(--brand); }

.toast i { margin-top: 2px; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: #f59e0b; }
.toast.info i { color: var(--brand); }

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

/* --- CONFIRM MODAL --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    padding: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}

.modal-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.modal-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.modal-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: pre-line;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.btn-modal {
    flex: 1;
    min-height: 44px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-modal-primary {
    background: var(--text-heading);
    color: white;
}

.btn-modal-primary:hover {
    background: var(--brand);
}

.btn-modal-secondary {
    background: #f1f5f9;
    color: var(--text-body);
    border: 1px solid var(--border);
}

.btn-modal-secondary:hover {
    background: #e2e8f0;
}

/* --- MOBILE CHECK-IN FAB --- */
.mobile-checkin-fab {
    display: none;
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 1rem + env(safe-area-inset-bottom, 0px));
    right: max(1rem, env(safe-area-inset-right));
    z-index: 75;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: white;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.45);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    touch-action: manipulation;
}

.mobile-checkin-fab i {
    font-size: 1rem;
}

.mobile-checkin-fab:active {
    transform: scale(0.96);
}

.auth-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f1f5f9;
}

.auth-footer p {
    font-size: 0.7rem;
    color: #94a3b8;
    letter-spacing: 0.3px;
}

/* --- FIXED SIDEBAR LOGIC --- */
.app-shell {
    display: flex;
    height: 100vh; /* Lock height to viewport height */
    height: 100dvh;
    overflow: hidden; /* Prevent the outer container from scrolling */
    width: 100%;
    position: relative;
}


.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: white;
    padding: 1.5rem;
    padding-top: max(1.5rem, env(safe-area-inset-top));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.05);
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.25rem 0.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.sidebar-header span {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: -0.3px;
    flex: 1;
    min-width: 0;
}

.sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.5rem;
    padding: 0 0.5rem;
}

.logo-box-sm {
    width: 32px;
    height: 32px;    
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: 0 4px 10px rgba(249, 116, 22, 0.277);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    min-height: 44px;
    color: var(--text-on-dark);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 4px;
}

.nav-item i { font-size: 1rem; width: 22px; text-align: center; }

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

.nav-item.active {
    background: linear-gradient(to right, var(--brand), var(--brand-dark));
    color: white;
    box-shadow: 0 4px 12px rgb(249, 116, 22);
}

.nav-group {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-on-dark);
    padding: 0.75rem 0.75rem 0.5rem;
}

.hidden { 
    display: none !important; 
}

/* --- MAIN CONTENT LAYOUT --- */
.main-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem 2rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Max-width container for content readability on large screens */
.view {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Top Bar Refinement */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    
    top: 0;
    z-index: 50;
    background: var(--bg-main);
    padding-top: max(0.25rem, env(safe-area-inset-top));
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text-heading);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.menu-toggle:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.breadcrumb {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.clock {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.3px;
}

.date-badge {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
}

/* Welcome Banner */
.welcome-banner {
    margin-bottom: 0.25rem;
}

.welcome-banner h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.welcome-banner p {
    font-size: 0.85rem;
    color: var(--text-muted);
}


/* Leave Button Styling */
.btn-leave {
    padding: 10px 20px;
    background: white;
    color: var(--text-body);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-leave:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-leave.leave-active {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
    cursor: default;
}

/* Leave Status Pill */
.score-pill.leave {
    background: #e0f2fe; /* Light Blue */
    color: #0369a1;      /* Dark Blue */
    border: 1px solid #bae6fd;
}

/* Adjust Action Group for mobile — see tablet/mobile breakpoints below */



/* Leave Button Styling */
.btn-leave {
    padding: 10px 20px;
    background: white;
    color: var(--text-body);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-leave:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-leave:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Specific Pill Color for Leave */
.score-pill.leave {
    background: #e0f2fe; /* Light Blue */
    color: #0369a1;      /* Dark Blue */
    border: 1px solid #bae6fd;
}

/* Ensure the login brand is styled correctly */
.auth-logo {
    max-height: 80px;
    width: auto;
    margin-bottom: 20px;
}

/* Fix grid for leaves */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}


/* --- FEATURED CHECK-IN CARD --- */
.checkin-container {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: nowrap;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.checkin-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--brand);
}

.checkin-container.verified {
    background: linear-gradient(to right, #f0fdf4, #ffffff);
    border-color: var(--success);
}

.checkin-container.verified::before { background: var(--success); }

.checkin-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 220px;
}

.icon-box {
    width: 44px;
    height: 44px;
    background: var(--brand-light);
    color: var(--brand);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.checkin-details h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.2rem;
    white-space: nowrap;
}

.checkin-details p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-checkin {
    padding: 10px 24px;
    background: var(--text-heading);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-checkin:hover {
    background: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(249, 115, 22, 0.4);
}

.btn-checkin.completed {
    background: var(--success);
    cursor: default;
    transform: none;
}

/* --- STATISTICS CARDS --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: white;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--brand-glow);
}

.stat-card .label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    display: block;
}

.stat-card h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -1px;
    word-break: break-word;
}

.stat-success h2 { color: var(--success); }
.stat-info h2 { color: #0369a1; }
.stat-danger h2 { color: var(--danger); }

/* --- DATA TABLES --- */
.table-container {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.table-container-spaced {
    margin-top: 1.25rem;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.table-scroll::after {
    content: '';
    position: sticky;
    right: 0;
    top: 0;
    float: right;
    width: 24px;
    height: 100%;
    margin-left: -24px;
    background: linear-gradient(to left, rgba(255,255,255,0.95), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.table-scroll.can-scroll::after {
    opacity: 1;
}

.table-scroll table {
    min-width: 480px;
}

.table-scroll-hint {
    display: none;
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.table-scroll-hint i {
    margin-right: 4px;
    color: var(--brand);
}

.table-header {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-heading);
}

.btn-export {
    padding: 8px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
}

.btn-export:hover {
    background: var(--brand-light);
    border-color: var(--brand);
}

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

th {
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: left;
}

td {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-body);
}

tr:hover td { background: #fafbfc; }
tr:last-child td { border-bottom: none; }

/* Status Score Pills */
.score-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
}

.score-pill.high { background: #ecfdf5; color: #065f46; }
.score-pill.low { background: #fff1f2; color: #9f1239; }







/* Attendance Dots */
.dot-bar { display: flex; gap: 4px; align-items: center; }
.dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: #e2e8f0;
}
.dot.active { 
    background: var(--success); 
}

/* User Cell */
.user-cell strong {
    font-weight: 700;
    color: var(--text-heading);
}

.user-cell small {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Filter Group */
.filter-group {
    display: flex;
    gap: 0.5rem;
}

.filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.8rem;
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: white;
    cursor: pointer;
}

/* View Header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
    margin-top: 2rem;
}

.view-header h1 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.5px;
}

/* --- SIDEBAR PROFILE --- */
.sidebar-profile {
    margin-top: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--brand), #de7709);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.profile-info {
    flex: 1;
    min-width: 0;
}

.profile-info h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-info p {
    font-size: 0.65rem;
    color: var(--text-on-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: none;
    border: none;
    color: #475569;
    cursor: pointer;
    font-size: 1rem;
    transition: 0.2s;
    padding: 6px;
    border-radius: 6px;
}

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


/* --- MULTI-DAY LEAVE UI ENHANCEMENTS --- */

/* Container for the whole action area */
.action-group {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
}

/* Grouping the date pickers and the leave button */
.leave-form-group {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
    padding-right: 16px;
    border-right: 1px solid var(--border);
}

/* Compact leave fields — keeps one row like desktop reference */
.leave-form-group .date-input-field {
    flex: 0 0 auto;
}

.leave-form-group .date-input-field input[type="date"],
.leave-form-group .date-input-field .form-select {
    width: 160px;
    max-width: 160px;
    min-width: 0;
    padding: 8px 12px;
    font-size: 14px;
}

.leave-form-group .date-input-field:has(#leave-reason) .form-select {
    width: 150px;
    max-width: 150px;
}

/* Individual date input styling */
.date-input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.date-input-field label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.date-input-field input[type="date"] {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    color: var(--text-heading);
    background: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
    min-height: 44px;
}

/* Shared form controls */
.form-select,
.form-input {
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 16px;
    background: #f8fafc;
    color: var(--text-heading);
    min-height: 44px;
    width: 100%;
}

.form-select:focus,
.form-input:focus {
    border-color: var(--brand);
    background: white;
    box-shadow: 0 0 0 3px var(--brand-glow);
    outline: none;
}

.form-input-grow {
    flex: 1;
    min-width: 0;
}

.holiday-form-card {
    margin-bottom: 1.5rem;
}

.holiday-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    align-items: stretch;
}

.holiday-form-row .btn-checkin {
    white-space: nowrap;
}

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

/* Mobile bottom navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    background: white;
    border-top: 1px solid var(--border);
    padding: 6px 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    justify-content: space-around;
    align-items: stretch;
    gap: 4px;
}

.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    min-height: 52px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    max-width: 80px;
}

.mobile-nav-item i {
    font-size: 1.15rem;
}

.mobile-nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.mobile-nav-item.active {
    color: var(--brand);
    background: var(--brand-light);
}

.mobile-nav-item:active {
    transform: scale(0.96);
}

/* Card-style tables on small screens */
@media (max-width: 640px) {
    .table-scroll-hint {
        display: block;
    }

    .responsive-table {
        min-width: 0 !important;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table tbody tr {
        display: block;
        padding: 0.85rem 1rem;
        border-bottom: 1px solid var(--border);
    }

    .responsive-table tbody tr:last-child {
        border-bottom: none;
    }

    .responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 1rem;
        padding: 0.35rem 0;
        border-bottom: none;
        text-align: right;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
        text-align: left;
        flex-shrink: 0;
    }

    .responsive-table td:first-child {
        padding-top: 0;
    }

    .responsive-table td:last-child {
        padding-bottom: 0;
    }

    .responsive-table .table-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .responsive-table .table-actions::before {
        display: none;
    }

    .responsive-table tr.empty-row td {
        display: block;
        text-align: center;
        padding: 2rem 1rem;
        color: var(--text-muted);
    }

    .responsive-table tr.empty-row td::before {
        display: none;
    }

    .table-scroll:has(.responsive-table) {
        overflow-x: visible;
    }

    .table-scroll:has(.responsive-table)::after {
        display: none;
    }

    .table-scroll:has(.responsive-table) .table-scroll-hint {
        display: none;
    }

    .table-scroll:has(.responsive-table) table {
        min-width: 0;
    }
}

.date-input-field input[type="date"]:focus {
    border-color: var(--brand);
    background: white;
    box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Vertical alignment for the check-in button */
.checkin-action {
    display: flex;
    align-items: flex-end;
    flex-shrink: 0;
    align-self: end;
}

.checkin-action .btn-checkin {
    min-width: 140px;
    white-space: nowrap;
}

.leave-form-group .btn-leave {
    flex-shrink: 0;
    align-self: flex-end;
    white-space: nowrap;
    padding: 10px 16px;
}

/* Slightly tighter on medium-width screens (sidebar open) */
@media (max-width: 1280px) {
    .checkin-details {
        max-width: 180px;
    }

    .checkin-details p {
        font-size: 0.7rem;
        line-height: 1.35;
    }

    .leave-form-group {
        gap: 8px;
    }

    .leave-form-group .date-input-field input[type="date"],
    .leave-form-group .date-input-field .form-select {
        width: 148px;
        max-width: 148px;
        font-size: 13px;
    }

    .leave-form-group .date-input-field:has(#leave-reason) .form-select {
        width: 140px;
        max-width: 140px;
    }
}

/* Extra compact when sidebar reduces content width */
@media (max-width: 960px) {
    .checkin-details {
        max-width: 150px;
        gap: 0.75rem;
    }

    .checkin-details p {
        display: none;
    }

    .checkin-details h3 {
        font-size: 0.9rem;
    }

    .icon-box {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .leave-form-group .date-input-field input[type="date"],
    .leave-form-group .date-input-field .form-select {
        width: 140px;
        max-width: 140px;
        font-size: 13px;
        padding: 8px 10px;
    }

    .leave-form-group .date-input-field:has(#leave-reason) .form-select {
        width: 132px;
        max-width: 132px;
    }

    .checkin-action .btn-checkin {
        min-width: 120px;
        padding: 10px 16px;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .checkin-container {
        flex-direction: column;
        align-items: stretch;
    }

    .action-group {
        flex-direction: column;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .leave-form-group {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 16px;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .leave-form-group .date-input-field input[type="date"],
    .leave-form-group .date-input-field .form-select,
    .leave-form-group .date-input-field:has(#leave-reason) .form-select {
        width: 100%;
        max-width: none;
        font-size: 16px;
    }

    .btn-checkin, .btn-leave {
        width: 100%;
        justify-content: center;
    }
}

/* Status Colors */
.score-pill.pending { background: #fef3c7; color: #92400e; }
.score-pill.approved { background: #ecfdf5; color: #065f46; }
.score-pill.rejected { background: #fee2e2; color: #991b1b; }

/* Adjusting button display in tables */
.btn-export {
    margin-right: 5px;
}




/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-main); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Touch-friendly interactive elements */
button,
.nav-item,
.btn-export,
.logout-btn {
    touch-action: manipulation;
}

.btn-login,
.btn-checkin,
.btn-leave,
.btn-export,
.logout-btn {
    min-height: 44px;
}

/* Keyboard focus visibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* --- TABLET & MOBILE RESPONSIVE --- */
@media (max-width: 1024px) {
    .main-content {
        padding: 1.25rem 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .sidebar-close {
        display: flex;
    }

    .mobile-bottom-nav {
        display: flex;
    }

    .app-shell:has(.mobile-bottom-nav:not(:empty)) .main-content {
        padding-bottom: calc(var(--bottom-nav-height) + 1rem + env(safe-area-inset-bottom, 0px));
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100%;
        height: 100dvh;
        transform: translateX(-100%);
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.25);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem;
        width: 100%;
    }

    .top-bar-right {
        width: 100%;
        justify-content: space-between;
    }

    .clock {
        font-size: 1rem;
    }

    .date-badge {
        font-size: 0.75rem;
    }

    .welcome-banner h1 {
        font-size: 1.25rem;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .view-header h1 {
        font-size: 1.1rem;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        flex: 1;
        min-height: 44px;
        font-size: 16px;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .table-header .btn-export {
        width: 100%;
        justify-content: center;
    }

    .stat-card h2 {
        font-size: 1.5rem;
    }

    .holiday-form-row {
        flex-direction: column;
    }

    .holiday-form-row .btn-checkin {
        width: 100%;
        justify-content: center;
    }

    .leave-form-group {
        border-right: none;
        border-bottom: none;
        padding-right: 0;
        padding-bottom: 0;
    }

    .date-input-field {
        flex: 1 1 calc(50% - 6px);
        min-width: 140px;
        width: auto;
    }

    .checkin-action {
        display: none;
    }

    .leave-form-group .btn-leave {
        width: 100%;
        justify-content: center;
        min-height: 48px;
    }

    .date-input-field:has(#leave-reason) {
        flex: 1 1 100%;
    }

    .mobile-checkin-fab.visible {
        display: flex;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 18px;
    }

    .auth-brand h1 {
        font-size: 1.5rem;
    }

    .auth-logo {
        height: 52px;
    }

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

    .checkin-details {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .leave-form-group {
        flex-direction: column;
        align-items: stretch;
    }

    .date-input-field {
        flex: 1 1 100%;
    }

    th, td {
        padding: 0.65rem 0.85rem;
        font-size: 0.8rem;
    }

    .sidebar-header span {
        font-size: 0.9rem;
    }
}

/* Large screens & ultrawide */
@media (min-width: 1600px) {
    .view {
        max-width: 1500px;
    }

    .main-content {
        padding: 2rem 3rem;
    }
}

/* Landscape phones & small height devices */
@media (max-height: 500px) and (orientation: landscape) {
    .auth-wrapper {
        align-items: flex-start;
        overflow-y: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .auth-card {
        padding: 1.5rem 2rem;
        margin: auto 0;
    }

    .auth-brand {
        margin-bottom: 1.25rem;
    }

    .input-group {
        margin-bottom: 1rem;
    }
}

/* Touch devices: skip hover lift effects */
@media (hover: none) {
    .stat-card:hover,
    .btn-login:hover,
    .btn-checkin:hover {
        transform: none;
    }

    .stat-card:active {
        transform: scale(0.99);
    }
}
