/* ===== Vega6 Webware Technologies Pvt. Ltd. - HRMS Styles ===== */

/* ── Site-wide watermark (Vega6 logo behind all content) ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('../img/Vega6.svg');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 55%;
    opacity: 0.035;
    pointer-events: none;
    z-index: 0;
}

/* ── Form-submit full-page loader overlay ── */
.vg-submit-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.94);
    z-index: 999999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.vg-submit-overlay.vg-active {
    display: flex;
}
.vg-submit-overlay__ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 4px solid #dee2e6;
    border-top-color: #0d6efd;
    animation: vg-spin 0.85s linear infinite;
}
.vg-submit-overlay__logo {
    position: absolute;
    width: 44px;
    height: 44px;
    object-fit: contain;
}
.vg-submit-overlay__text {
    font-size: 0.82rem;
    color: #6c757d;
    letter-spacing: 0.05em;
    margin-top: 8px;
}
[data-bs-theme="dark"] .vg-submit-overlay {
    background: rgba(17, 20, 31, 0.94);
}
[data-bs-theme="dark"] .vg-submit-overlay__text { color: #8d96a7; }

:root {
    --primary: #0d6efd;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #0dcaf0;
    --dark: #212529;
    --light: #f8f9fa;
    --sidebar-width: 260px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding-top: 0;
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s;
}

.sidebar .brand {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.1);
    position: relative;
}

.sidebar .brand h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.2rem;
}

.sidebar .brand small {
    opacity: 0.7;
    font-size: 0.75rem;
}

.sidebar .brand .brand-logo {
    width: 70px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto 6px;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.35));
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    display: block;
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: var(--warning);
}

.sidebar .nav-section {
    padding: 15px 20px 5px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.5;
}

.sidebar .nav-link .icon {
    margin-right: 10px;
    width: 20px;
    display: inline-block;
    text-align: center;
}

/* Main content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Top navbar */
.top-navbar {
    background: white;
    padding: 15px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
}

.top-navbar .page-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
}

.top-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-navbar .user-info .badge {
    font-size: 0.75rem;
}

.content-area {
    padding: 30px;
}

/* Dashboard Cards */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s;
    border: none;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
}

.stat-card.primary   .stat-icon { background: rgba(13,110,253,0.1);  color: var(--primary); }
.stat-card.success   .stat-icon { background: rgba(25,135,84,0.1);   color: var(--success); }
.stat-card.warning   .stat-icon { background: rgba(255,193,7,0.1);   color: var(--warning); }
.stat-card.danger    .stat-icon { background: rgba(220,53,69,0.1);   color: var(--danger); }
.stat-card.info      .stat-icon { background: rgba(13,202,240,0.1);  color: var(--info); }
.stat-card.secondary .stat-icon { background: rgba(108,117,125,0.1); color: #6c757d; }
.stat-card.orange    .stat-icon { background: rgba(230,126,34,0.1);  color: #e67e22; }
.stat-card.orange .stat-value   { color: #e67e22; }

/* Status badges */
.status-approved {
    background-color: #d1e7dd;
    color: #0f5132;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-pending {
    background-color: #fff3cd;
    color: #664d03;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-rejected {
    background-color: #f8d7da;
    color: #842029;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-cancelled {
    background-color: #e2e3e5;
    color: #41464b;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-draft {
    background-color: #e7f0ff;
    color: #1a4fab;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.status-cancel_requested {
    background-color: #fff3cd;
    color: #856404;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid #ffc107;
}

/* Tables */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.table-container .table-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-container .table-header h5 {
    margin: 0;
    font-weight: 600;
}

.table-container table {
    margin: 0;
}

.table-container th {
    background: #f8f9fa;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    padding: 12px 15px;
    border: none;
}

.table-container td {
    padding: 12px 15px;
    vertical-align: middle;
    border-color: #f0f0f0;
}

/* Cards */
.card-custom {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.card-custom .card-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 20px;
    font-weight: 600;
}

/* Calendar */
.calendar-table {
    width: 100%;
    table-layout: fixed;
}

.calendar-table th {
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 0.85rem;
}

.calendar-table td {
    border: 1px solid #e0e0e0;
    height: 100px;
    vertical-align: top;
    padding: 5px;
    font-size: 0.8rem;
}

.calendar-table td.today {
    background-color: #e8f4fd;
}

.calendar-table td.holiday {
    background-color: #fff3cd;
}

.calendar-table .day-number {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--dark);
}

.calendar-table .leave-badge {
    display: block;
    padding: 2px 5px;
    margin: 1px 0;
    border-radius: 3px;
    font-size: 0.7rem;
    color: white;
    background: var(--primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-table .leave-badge-approved {
    background: #198754;
    color: white;
}

.calendar-table .leave-badge-pending {
    background: #fd7e14;
    color: white;
}

.leave-badge-approved {
    background: #198754 !important;
    color: white !important;
}

.leave-badge-pending {
    background: #fd7e14 !important;
    color: white !important;
}

.calendar-table .holiday-badge {
    display: block;
    padding: 2px 5px;
    margin: 1px 0;
    border-radius: 3px;
    font-size: 0.7rem;
    color: #664d03;
    background: #ffc107;
}

/* Forms */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Auth pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-card h2 {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
}

.auth-card .subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.auth-logo-wrap {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    box-shadow: 0 4px 14px rgba(30, 60, 114, 0.35);
}

.auth-logo-wrap img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* Balance cards */
.balance-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
    border-top: 4px solid var(--primary);
    /* height: 100%; */
}

.balance-card .leave-type-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.balance-card .balance-numbers {
    display: flex;
    justify-content: space-around;
}

.balance-card .balance-item .number {
    font-size: 1.5rem;
    font-weight: 700;
}

.balance-card .balance-item .label {
    font-size: 0.75rem;
    color: #6c757d;
    text-transform: uppercase;
}

.balance-card .balance-item.allocated .number { color: var(--primary); }
.balance-card .balance-item.used .number { color: var(--danger); }
.balance-card .balance-item.remaining .number { color: var(--success); }

/* Progress bar for balance */
.balance-progress {
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    margin-top: 15px;
    overflow: hidden;
}

.balance-progress .progress-fill {
    height: 100%;
    border-radius: 3px;
    background: #198754;
    width: var(--used-pct, 0%);
    transition: width 0.3s;
}

/* Alert messages */
.alert-container {
    position: fixed;
    top: 72px;    /* below the sticky navbar (~65px tall) — prevents covering navbar buttons */
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;  /* container itself never blocks clicks */
}

.alert-container .alert {
    pointer-events: auto;  /* individual alert is still clickable (dismiss button) */
}

/* Auto-close flash messages after 4 seconds */
@keyframes alert-fade-out {
    0%   { opacity: 1; transform: translateY(0); pointer-events: auto; }
    80%  { opacity: 1; transform: translateY(0); pointer-events: auto; }
    100% { opacity: 0; transform: translateY(-10px); pointer-events: none; }
}

.alert-auto-close {
    animation: alert-fade-out 4s ease-in-out forwards;
}

/* ===== CSS-Only Sidebar Toggle (Checkbox Hack) ===== */
.sidebar-toggle-input {
    display: none;
}

.hamburger-btn {
    display: none; /* Hidden on desktop */
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--dark);
    padding: 4px 8px;
    border-radius: 6px;
    line-height: 1;
}

.hamburger-btn:hover {
    background: #f0f0f0;
}

.sidebar-close-btn {
    display: none; /* Hidden on desktop */
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    font-size: 1.2rem;
    padding: 4px 8px;
    border-radius: 4px;
}

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

.sidebar-overlay {
    display: none; /* Hidden on desktop */
}

/* Profile card */
.profile-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
}

.profile-card .profile-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.profile-card .profile-body {
    padding: 25px;
}

/* Report cards (admin) */
.report-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.report-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.12);
}

/* Admin action card */
.admin-action-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 2px solid #e9ecef;
}

/* Leave history card */
.leave-history-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 15px;
    border-left: 4px solid var(--primary);
}

/* ===== Mobile Bottom Navigation Bar ===== */
.bottom-nav {
    display: none; /* Hidden on desktop, shown in mobile media queries */
}

.dashboard-page-logo{
    width: 40px;
    height: auto;
    object-fit: contain;
    display: none;
}

/* Responsive */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
        overflow-y: auto;
    }

    .sidebar-toggle-input:checked ~ .sidebar {
        transform: translateX(0);
    }

    .sidebar-toggle-input:checked ~ .sidebar-overlay {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        cursor: pointer;
    }

    .sidebar-close-btn {
        display: block;
    }

    /* Hide hamburger when bottom nav is present (mobile primary nav) */
    .hamburger-btn {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .top-navbar {
        padding: 10px 15px;
    }

    .top-navbar .page-title {
        font-size: 1rem;
    }

    .content-area {
        padding: 15px;
    }

    /* Stat cards 2-column on tablet */
    .stat-card {
        padding: 15px;
    }

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

    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    /* Tables responsive */
    .table-container .table-header {
        padding: 15px;
    }

    .table-container th,
    .table-container td {
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    /* Calendar table */
    .calendar-table td {
        height: 70px;
        padding: 3px;
        font-size: 0.7rem;
    }

    .calendar-table .day-number {
        font-size: 0.8rem;
    }

    /* Form container */
    .form-container {
        padding: 20px;
    }

    /* Balance cards */
    .balance-card {
        padding: 15px;
    }

    .balance-card .balance-item .number {
        font-size: 1.2rem;
    }

    /* Auth pages */
    .auth-card {
        margin: 15px;
        padding: 25px;
    }

    /* ===== Bottom Navigation (mobile/tablet) ===== */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        background: #ffffff;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
        border-radius: 20px 20px 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .bottom-nav::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #a0a5b8;
        font-size: 0.62rem;
        padding: 10px 6px 8px;
        flex: 0 0 auto;
        min-width: 64px;
        position: relative;
        transition: color 0.2s;
        letter-spacing: 0.2px;
        background: transparent;
        border: none;
        cursor: pointer;
        outline: none;
        flex: 1;
    }

    .bottom-nav-item i {
        font-size: 1.35rem;
        margin-bottom: 3px;
        transition: transform 0.2s;
        z-index: 1102;
    }

    .bottom-nav-item span {
        font-weight: 600;
    }

    .bottom-nav-item:hover {
        color: #6c63ff;
        text-decoration: none;
    }

    .bottom-nav-item.active {
        color: #6c63ff;
    }

    .bottom-nav-item.active i {
        transform: scale(1.1);
    }

    .bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 32px;
        height: 3px;
        border-radius: 0 0 4px 4px;
        background: linear-gradient(90deg, #6c63ff, #9c6aff);
    }

    /* Center "Apply/Add" button elevated */
    .bottom-nav-item.center-action {
        position: relative;
        margin-top: -16px;
    }

    .bottom-nav-item.center-action i {
        width: 46px;
        height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(135deg, #6c63ff 0%, #9c6aff 100%);
        color: #fff;
        border-radius: 50%;
        font-size: 1.4rem;
        box-shadow: 0 4px 15px rgba(108,99,255,0.4);
        margin-bottom: 2px;
    }

    .bottom-nav-item.center-action span {
        color: #6c63ff;
    }

    .bottom-nav-item.center-action.active::before {
        display: none;
    }



    /* Add padding at bottom of content to prevent overlap with bottom nav */
    .content-area {
        padding-bottom: 100px;
    }

    /* Ensure main-content also has bottom spacing */
    .main-content {
        min-height: 100vh;
        padding-bottom: 80px;
    }

    .dashboard-page-logo{
        display: block;
    }
}

@media (max-width: 576px) {
    .top-navbar {
        padding: 8px 12px;
        gap: 8px;
    }

    .top-navbar .page-title {
        font-size: 0.9rem;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-navbar .user-info {
        gap: 6px;
    }

    .top-navbar .user-info .btn {
        padding: 2px 6px;
        font-size: 0.75rem;
    }

    .content-area {
        padding: 10px;
    }

    /* Stat cards smaller */
    .stat-card {
        padding: 12px;
    }

    .stat-card .stat-value {
        font-size: 1.3rem;
    }

    .stat-card .stat-label {
        font-size: 0.72rem;
    }

    .stat-card .stat-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
        margin-bottom: 8px;
    }

    /* Tables: smaller font, horizontal scroll */
    .table-container .table-header {
        padding: 12px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .table-container th,
    .table-container td {
        padding: 6px 8px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    /* Calendar: very compact on phone */
    .calendar-table td {
        height: 50px;
        padding: 2px;
        font-size: 0.6rem;
    }

    .calendar-table th {
        padding: 6px 2px;
        font-size: 0.7rem;
    }

    .calendar-table .day-number {
        font-size: 0.75rem;
    }

    .calendar-table .leave-badge,
    .calendar-table .holiday-badge {
        font-size: 0.55rem;
        padding: 1px 3px;
    }

    /* Balance cards */
    .balance-card .balance-item .number {
        font-size: 1.1rem;
    }

    .balance-card .balance-item .label {
        font-size: 0.65rem;
    }

    /* Form container */
    .form-container {
        padding: 15px;
    }

    .form-container h6 {
        font-size: 0.85rem;
    }

    /* Auth pages */
    .auth-card {
        margin: 10px;
        padding: 20px;
        max-width: 100%;
    }

    .auth-card h2 {
        font-size: 1.3rem;
    }

    /* Profile card */
    .profile-card .profile-header {
        padding: 20px;
    }

    .profile-card .profile-body {
        padding: 15px;
    }

    /* Quick action buttons wrap */
    .d-flex.flex-wrap.gap-2 .btn {
        font-size: 0.82rem;
        padding: 6px 12px;
    }

    /* Alert container mobile */
    .alert-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    /* Bottom nav smaller on phone */
    .bottom-nav-item {
        font-size: 0.58rem;
        padding: 8px 4px 6px;
    }

    .bottom-nav-item i {
        font-size: 1.2rem;
    }

    .bottom-nav-item.center-action i {
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
    }

    .bottom-nav-item.center-action {
        margin-top: -14px;
    }
}

/* Print styles */
@media print {
    .sidebar, .top-navbar, .bottom-nav {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
}

/* ===== CSS-only Page Loader ===== */
@keyframes vg-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes vg-loader-out {
    0%   { opacity: 1; visibility: visible; pointer-events: none; }
    100% { opacity: 0; visibility: hidden;  pointer-events: none; }
}

.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.97);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    /* Visible immediately, then fade out after 0.9 s */
    animation: vg-loader-out 0.4s ease-out 0.9s forwards;
}

.page-loader__logo {
    width: 72px;
    height: 72px;
    object-fit: contain;
    animation: vg-spin 1s linear infinite;
    filter: drop-shadow(0 2px 8px rgba(13, 110, 253, 0.25));
}

.page-loader__ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 4px solid #dee2e6;
    border-top-color: #0d6efd;
    animation: vg-spin 0.85s linear infinite;
    position: absolute;
}

.page-loader__text {
    font-size: 0.8rem;
    color: #6c757d;
    letter-spacing: 0.05em;
    margin-top: 52px;
}

/* Submit-button loading state via :active animation */
@keyframes vg-btn-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.btn-loading-wrap {
    position: relative;
    display: inline-block;
}
.page-loader-form {
    position: relative;
}
.page-loader-form::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.7);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 10;
}
.page-loader-form:active::after,
.page-loader-form.submitting::after {
    opacity: 1;
}

/* ===== More Panel (mobile slide-up drawer) ===== */
.more-panel-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1190;
    cursor: pointer;
}

.more-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -110vh;
    background: #ffffff;
    border-radius: 24px 24px 0 0;
    z-index: 1200;
    max-height: 82vh;
    overflow-y: auto;
    transition: bottom 0.38s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -12px 48px rgba(0,0,0,0.18);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

body.more-panel-open .more-panel-overlay { display: block; }
body.more-panel-open .more-panel { bottom: 0; }

.more-panel-handle {
    width: 40px;
    height: 4px;
    background: #d0d4dc;
    border-radius: 2px;
    margin: 12px auto 0;
}

.more-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 8px;
    border-bottom: 1px solid #e9ecef;
}

.more-panel-header span { font-size: 0.95rem; }

.more-panel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    padding: 16px 12px 8px;
}

@media (max-width: 400px) {
    .more-panel-grid { grid-template-columns: repeat(3, 1fr); }
}

.more-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none !important;
    color: inherit !important;
    gap: 5px;
    padding: 6px 4px;
    border-radius: 12px;
    transition: background 0.15s;
}

.more-tile:hover, .more-tile:active { background: rgba(0,0,0,0.05); }

.more-tile-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
    flex-shrink: 0;
}

.more-tile span.more-tile-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #495057;
    line-height: 1.2;
}

.more-panel-footer {
    padding: 12px 16px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

.more-panel-footer .btn { flex: 1; font-size: 0.82rem; }

.input-eye{
    position: relative;
}
.input-eye input{
    padding-right: 2.5rem;
}
.input-eye i{
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    cursor: pointer;
    user-select: none;
    color: #6c757d;
    font-size: 1rem;
}
.input-eye i:hover{
    color: #343a40;
}

/* Dark mode toggle switcher (profile page) */
.dark-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.form-switch .form-check-input {
    width: 3em;
    height: 1.5em;
    cursor: pointer;
}

/* ===== Dark Mode Overrides ===== */
/* Bootstrap 5.3 handles its own components via data-bs-theme="dark".
   These rules cover our custom (non-Bootstrap) elements. */

[data-bs-theme="dark"] body {
    background-color: #0f1117;
    color: #dde1ea;
}

[data-bs-theme="dark"] .top-navbar {
    background: #16191f;
    border-bottom-color: rgba(255,255,255,0.1);
    color: #dde1ea;
}

[data-bs-theme="dark"] .top-navbar .page-title {
    color: #dde1ea;
}

[data-bs-theme="dark"] .hamburger-btn {
    color: #dde1ea;
}

[data-bs-theme="dark"] .hamburger-btn:hover {
    background: rgba(255,255,255,0.08);
}

[data-bs-theme="dark"] .stat-card {
    background: #1c2030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    color: #dde1ea;
}

[data-bs-theme="dark"] .stat-card .stat-label { color: #8d96a7; }
[data-bs-theme="dark"] .stat-card.orange .stat-icon { background: rgba(230,126,34,0.15); }
[data-bs-theme="dark"] .stat-card.orange .stat-value { color: #f0963a; }

[data-bs-theme="dark"] .table-container {
    background: #1c2030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

[data-bs-theme="dark"] .table-container .table-header {
    border-bottom-color: rgba(255,255,255,0.1);
}

[data-bs-theme="dark"] .table-container th {
    background: #141720;
    color: #8d96a7;
}

[data-bs-theme="dark"] .table-container td {
    border-color: rgba(255,255,255,0.07);
    color: #dde1ea;
}

[data-bs-theme="dark"] .table-container .table-hover > tbody > tr:hover > * {
    background-color: rgba(255,255,255,0.04);
}

[data-bs-theme="dark"] .card-custom {
    background: #1c2030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

[data-bs-theme="dark"] .card-custom .card-header {
    background: #1c2030;
    border-bottom-color: rgba(255,255,255,0.1);
    color: #dde1ea;
}

[data-bs-theme="dark"] .card-body { color: #dde1ea; }
[data-bs-theme="dark"] .card { background: #1c2030; }

[data-bs-theme="dark"] .form-container {
    background: #1c2030;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    color: #dde1ea;
}

[data-bs-theme="dark"] .balance-card {
    background: #1c2030;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

[data-bs-theme="dark"] .balance-card .leave-type-name { color: #dde1ea; }

[data-bs-theme="dark"] .leave-history-card {
    background: #1c2030;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

[data-bs-theme="dark"] .report-card {
    background: #1c2030;
}

[data-bs-theme="dark"] .admin-action-card {
    background: #141720;
    border-color: rgba(255,255,255,0.1);
}

[data-bs-theme="dark"] .calendar-table td {
    border-color: rgba(255,255,255,0.1);
    color: #dde1ea;
    background: #1c2030;
}

[data-bs-theme="dark"] .calendar-table td.today { background: #1a2a3a; }
[data-bs-theme="dark"] .calendar-table td.holiday { background: #2a2210; }
[data-bs-theme="dark"] .calendar-table .day-number { color: #dde1ea; }

[data-bs-theme="dark"] .bottom-nav {
    background: #16191f;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.35);
}

[data-bs-theme="dark"] .bottom-nav-item {
    color: #5a6278;
    background: transparent;
    border: none;
}

[data-bs-theme="dark"] .bottom-nav-item:hover { color: #9c6aff; }
[data-bs-theme="dark"] .bottom-nav-item.active { color: #9c6aff; }

[data-bs-theme="dark"] .more-panel {
    background: #16191f;
}

[data-bs-theme="dark"] .more-panel-handle { background: #3a3f4e; }
[data-bs-theme="dark"] .more-panel-header { border-bottom-color: rgba(255,255,255,0.1); color: #dde1ea; }
[data-bs-theme="dark"] .more-panel-footer { border-top-color: rgba(255,255,255,0.1); }

[data-bs-theme="dark"] .more-tile:hover, [data-bs-theme="dark"] .more-tile:active {
    background: rgba(255,255,255,0.06);
}

[data-bs-theme="dark"] .more-tile span.more-tile-label { color: #b0b8c9; }

[data-bs-theme="dark"] .dark-toggle-card {
    background: #141720;
    border-color: rgba(255,255,255,0.1);
    color: #dde1ea;
}

[data-bs-theme="dark"] .page-loader {
    background: rgba(15, 17, 23, 0.97);
}

[data-bs-theme="dark"] .page-loader__text { color: #8d96a7; }

[data-bs-theme="dark"] .sidebar .nav-link { color: rgba(255,255,255,0.75); }
[data-bs-theme="dark"] .sidebar .nav-link:hover,
[data-bs-theme="dark"] .sidebar .nav-link.active {
    color: #ffffff;
    background: rgba(255,255,255,0.12);
}

[data-bs-theme="dark"] .balance-progress { background: rgba(255,255,255,0.1); }

[data-bs-theme="dark"] .text-muted { color: #8d96a7 !important; }
[data-bs-theme="dark"] .border-bottom { border-bottom-color: rgba(255,255,255,0.1) !important; }
[data-bs-theme="dark"] hr { border-color: rgba(255,255,255,0.12); }

[data-bs-theme="dark"] .auth-card { background: #1c2030; }
[data-bs-theme="dark"] .auth-card h2 { color: #dde1ea; }

/* Status badges keep readable colours in dark mode */
[data-bs-theme="dark"] .status-approved { background: #0d3f26; color: #6ee7b7; }
[data-bs-theme="dark"] .status-pending  { background: #3d2e00; color: #fde68a; }
[data-bs-theme="dark"] .status-rejected { background: #3d0a10; color: #fca5af; }
[data-bs-theme="dark"] .status-cancelled { background: #23262c; color: #9ca3af; }
[data-bs-theme="dark"] .status-draft     { background: #0d1e3d; color: #93c5fd; }


/* ═══════════════════════════════════════════════════════════════════════════
   Attendance Module
═══════════════════════════════════════════════════════════════════════════ */

/* Weekly overview progress bar */
.attendance-week-progress { height: 6px; border-radius: 3px; }
.attendance-week-progress .progress-bar { width: var(--bar-pct, 0%); border-radius: 3px; }

/* Yearly overview progress bar (per-month) */
.attendance-year-progress { height: 4px; border-radius: 3px; }
.attendance-year-progress .progress-bar { width: var(--bar-pct, 0%); border-radius: 3px; }

/* Weekly day cell */
.attendance-day-cell { min-width: 50px; }

/* Export toolbar */
.attendance-export-bar {
    background: #fff;
    border-radius: 10px;
    padding: 14px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    margin-bottom: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}
.attendance-export-bar label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    margin-bottom: 3px;
    display: block;
}

/* Status indicator dots */
.att-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}
.att-status-dot.working   { background-color: #198754; }
.att-status-dot.on-break  { background-color: #ffc107; }
.att-status-dot.completed { background-color: #6c757d; }
.att-status-dot.absent    { background-color: #dee2e6; }

/* Attendance session break row */
.att-break-row { font-size: 0.78rem; line-height: 1.4; }

/* Download banner */
.attendance-download-banner { border-left: 4px solid #2563eb; border-radius: 8px; }

/* Bulk export button group */
.bulk-export-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }

/* Who's in / out panel — mobile: full-width row; desktop xl+: sticky sidebar */
.who-inout-panel { width: 100%; }
@media (min-width: 1200px) {
    .who-inout-panel {
        width: 280px;
        position: sticky;
        top: 80px;
        max-height: calc(100vh - 100px);
        display: flex;
        flex-direction: column;
    }
}

/* Who's in/out pill-nav active state colours */
.wio-nav .nav-link { color: #6c757d; font-size: 13px; padding: .25rem .6rem; }
.wio-nav .nav-link.active { background: transparent; font-weight: 700; }
.wio-nav .nav-link[data-bs-target$='wioIn'].active    { color: #198754; border-bottom: 2px solid #198754; border-radius: 0; }
.wio-nav .nav-link[data-bs-target$='wioBreak'].active { color: #e6a817; border-bottom: 2px solid #e6a817; border-radius: 0; }
.wio-nav .nav-link[data-bs-target$='wioOut'].active   { color: #6c757d; border-bottom: 2px solid #6c757d; border-radius: 0; }

/* Floating mobile who's in/out toggle — fixed bottom-right, hidden on xl+ */
.wio-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    z-index: 1050;
    align-items: center;
    justify-content: center;
}
@media (max-width: 1199.98px) { .wio-mobile-toggle { display: flex; } }

/* Screenshot card hover */
.emp-screenshot-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12) !important;
    transform: translateY(-2px);
    transition: box-shadow .15s, transform .15s;
}

/* Screenshot employee detail — date sidebar */
.screenshot-date-sidebar {
    /* Desktop: fixed narrow column */
    min-width: 130px;
    max-width: 160px;
}
.screenshot-date-list {
    max-height: calc(100vh - 220px);
    overflow-y: auto;
}

/* Mobile: date sidebar becomes a full-width horizontal scroll strip */
@media (max-width: 767.98px) {
    .screenshot-date-sidebar {
        min-width: unset;
        max-width: unset;
        width: 100%;
        border-right: none !important;
        border-bottom: 1px solid #dee2e6;
    }
    .screenshot-date-list {
        max-height: none;
        overflow-y: visible;
        overflow-x: auto;
        display: flex;
        flex-wrap: nowrap;
        gap: 4px;
        padding-bottom: 4px;
    }
    .screenshot-date-list a,
    .screenshot-date-list p {
        white-space: nowrap;
        flex-shrink: 0;
    }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Resignation form — CSS-only custom-reason row
   No JS required; browser support: Chrome 105+, Firefox 121+, Safari 15.4+
═══════════════════════════════════════════════════════════════════════════ */
#custom-reason-row { display: none; }
form:has(select[name="reason"] option[value="others"]:checked) #custom-reason-row { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   Reimbursement form — CSS-only description block
═══════════════════════════════════════════════════════════════════════════ */
#descriptionBlock { display: none; }
form:has(select[name="expense_category"] option[value="other"]:checked) #descriptionBlock { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   Leave type form — CSS-only carry-forward limit row
═══════════════════════════════════════════════════════════════════════════ */
#carry-forward-limit-row { display: none; }
form:has([name="is_carry_forward"]:checked) #carry-forward-limit-row { display: block; }

/* Leave type form — medical certificate days (shown only when cert required is checked) */
#medical-cert-days-row { display: none; }
form:has([name="requires_medical_certificate"]:checked) #medical-cert-days-row { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   Leave requests list — CSS-only bulk action buttons
═══════════════════════════════════════════════════════════════════════════ */
#bulkForm .bulk-action-btn { display: none; }
#bulkForm:has(input[name="leave_ids"]:checked) .bulk-action-btn { display: inline-flex; }


/* ═══════════════════════════════════════════════════════════════════════════
   Apply Leave form — CSS-only conditional visibility using :has()
   No JS required; browser support: Chrome 105+, Firefox 121+, Safari 15.4+
═══════════════════════════════════════════════════════════════════════════ */

/* Day-type row: shown only for casual / earned leave */
.day-type-wrapper { display: none; }
form:has(select[name="leave_type"] option[data-category="casual"]:checked)  .day-type-wrapper,
form:has(select[name="leave_type"] option[data-category="earned"]:checked)  .day-type-wrapper {
    display: block;
}

/* End-date row: hidden for maternity / paternity / marriage (server auto-calculates) */
.end-date-wrapper { display: block; }
form:has(select[name="leave_type"] option[data-category="maternity"]:checked) .end-date-wrapper,
form:has(select[name="leave_type"] option[data-category="paternity"]:checked) .end-date-wrapper,
form:has(select[name="leave_type"] option[data-category="marriage"]:checked)  .end-date-wrapper {
    display: none;
}

/* WFH note */
.wfh-note { display: none; }
form:has(select[name="leave_type"] option[data-category="wfh"]:checked) .wfh-note { display: block; }

/* Special leave info notes */
.maternity-note, .paternity-note, .marriage-note { display: none; }
form:has(select[name="leave_type"] option[data-category="maternity"]:checked) .maternity-note { display: block; }
form:has(select[name="leave_type"] option[data-category="paternity"]:checked) .paternity-note { display: block; }
form:has(select[name="leave_type"] option[data-category="marriage"]:checked)  .marriage-note  { display: block; }

/* Unpaid leave warning */
.unpaid-note { display: none; }
form:has(select[name="leave_type"] option[data-category="unpaid"]:checked) .unpaid-note { display: block; }

/* Medical certificate — always hidden */
.medical-cert-wrapper { display: none; }

/* Make date inputs fully clickable */
input[type="date"] { position: relative; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    color: transparent; background: transparent;
    cursor: pointer;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Employee Leave Calendar
═══════════════════════════════════════════════════════════════════════════ */
.cal-grid { width: 100%; border-collapse: collapse; }
.cal-grid th {
    background: var(--primary, #1e3c72);
    color: #fff;
    padding: 8px 4px;
    text-align: center;
    font-size: .85rem;
}
.cal-grid td {
    border: 1px solid #e0e6f0;
    vertical-align: top;
    padding: 4px;
    height: 90px;
    width: 14.28%;
    position: relative;
}
.cal-grid td.other-month { background: #f9fafb; opacity: .6; }
.cal-grid td.today-cell  { background: #eff6ff; }
.cal-grid td.today-cell .day-num {
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
}
.day-num { font-size: .8rem; font-weight: 600; color: #374151; margin-bottom: 2px; }

.cal-badge {
    font-size: .68rem;
    border-radius: 3px;
    padding: 1px 4px;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
    max-width: 100%;
}
.badge-approved          { background: #baebd2; color: #065f46; }
.badge-pending           { background: #e9e0b7; color: #92400e; }
.badge-cancel_requested  { background: #ebbcbc; color: #991b1b; }
.badge-holiday           { background: #c5bee4; color: #5b21b6; }

.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; font-size: .8rem; }
.cal-legend-dot  { width: 12px; height: 12px; border-radius: 2px; }

@media (max-width: 600px) {
    .cal-grid td { height: 55px; }
    .cal-badge { display: none; }
    .cal-grid td.has-event::after {
        content: '';
        display: block;
        width: 6px; height: 6px;
        border-radius: 50%;
        background: #2563eb;
        margin: 2px auto 0;
    }
}

/* Grievance form — anonymous info box hidden until checkbox checked */
#anon-info { display: none; }

.status-filter{
    padding-left: 10px;
    padding-right: 10px;
}