/* ==========================================================================
   DGP HRMS ENTERPRISE DESIGN SYSTEM & RESPONSIVE CORE (Mobile + Laptop + Desktop)
   ========================================================================== */

:root {
    /* Color Palette */
    --primary: #0284c7;
    --primary-dark: #0369a1;
    --primary-light: #e0f2fe;
    --primary-glow: rgba(2, 132, 199, 0.25);
    
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #0284c7;
    --sidebar-text: #94a3b8;
    --sidebar-border: #1e293b;

    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --surface-muted: #f1f5f9;
    
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;

    --success: #10b981;
    --success-light: #ecfdf5;
    --success-border: #a7f3d0;
    --success-dark: #065f46;

    --danger: #ef4444;
    --danger-light: #fef2f2;
    --danger-border: #fecaca;
    --danger-dark: #991b1b;

    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --warning-border: #fde68a;
    --warning-dark: #92400e;

    --purple: #8b5cf6;
    --purple-light: #f5f3ff;
    --purple-dark: #5b21b6;

    /* Spacing & Radii */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Elevations */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Base Reset & Setup */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden;
}

body {
    display: flex;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   SIDEBAR (Desktop & Mobile Drawer + Collapsible Rail Mode)
   ========================================================================== */
.sidebar {
    width: 260px;
    min-width: 260px;
    background: linear-gradient(180deg, #0b132b 0%, #0f172a 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.28s cubic-bezier(0.4, 0, 0.2, 1), transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    height: 100vh;
    height: 100dvh;
    user-select: none;
    position: relative;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    height: 64px;
    min-height: 64px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.sidebar-header img {
    max-width: 135px;
    max-height: 36px;
    height: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: #0f172a url('/asset/images/dgp-icon-192.png') center/contain no-repeat !important;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent !important;
    font-size: 0 !important;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sidebar-brand-text h2 {
    font-size: 14.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.sidebar-brand-text p {
    font-size: 10.5px;
    color: #94a3b8;
    font-weight: 500;
}

.sidebar-collapse-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    border-color: #0284c7;
}

.nav-menu {
    flex: 1;
    padding: 12px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #64748b;
    padding: 14px 10px 4px;
    letter-spacing: 0.9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
}

.nav-item {
    padding: 9px 12px;
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.nav-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nav-item svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
    transition: transform 0.15s ease, stroke 0.15s ease;
}

.nav-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    transform: translateX(2px);
}

.nav-item:hover svg {
    stroke: #38bdf8;
}

.nav-item.active {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transform: none;
}

.nav-item.active svg {
    stroke: #ffffff;
}

.nav-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: white;
    flex-shrink: 0;
}

.nav-badge.blue {
    background: var(--primary);
}

.nav-badge.amber {
    background: var(--warning);
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   SIDEBAR COLLAPSED (Rail Compact Mode for Desktop & Laptops)
   ========================================================================== */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 72px !important;
        min-width: 72px !important;
    }

    .sidebar.collapsed .sidebar-header {
        padding: 0 8px;
        justify-content: center;
    }

    .sidebar.collapsed .sidebar-header img,
    .sidebar.collapsed .sidebar-brand-text,
    .sidebar.collapsed .sidebar-collapse-btn {
        display: none !important;
    }

    .sidebar.collapsed .sidebar-logo-icon {
        display: flex;
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .sidebar.collapsed .nav-menu {
        padding: 12px 6px;
        align-items: center;
    }

    .sidebar.collapsed .nav-section-label {
        width: 24px;
        height: 1px;
        padding: 0;
        margin: 10px 0;
        background: rgba(255, 255, 255, 0.1);
        font-size: 0;
        line-height: 0;
    }

    .sidebar.collapsed .nav-item {
        width: 46px;
        height: 44px;
        padding: 0;
        justify-content: center;
        border-radius: 10px;
    }

    .sidebar.collapsed .nav-item-left {
        justify-content: center;
        gap: 0;
    }

    .sidebar.collapsed .nav-item span,
    .sidebar.collapsed .nav-badge {
        display: none !important;
    }

    .sidebar.collapsed .nav-item:hover {
        transform: none;
    }

    .sidebar.collapsed .sidebar-footer {
        justify-content: center;
        padding: 12px 0;
    }

    .sidebar.collapsed .sidebar-footer span {
        display: none !important;
    }

    /* Floating Tooltip */
    .sidebar.collapsed .nav-item:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: #0f172a;
        color: #ffffff;
        padding: 6px 12px;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        border-radius: 6px;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
        border: 1px solid rgba(255, 255, 255, 0.15);
        z-index: 9999;
        pointer-events: none;
        animation: tooltipFade 0.15s ease;
    }

    @keyframes tooltipFade {
        from { opacity: 0; transform: translateY(-50%) translateX(-4px); }
        to { opacity: 1; transform: translateY(-50%) translateX(0); }
    }
}

/* ==========================================================================
   MAIN CONTENT WRAPPER & TOP HEADER
   ========================================================================== */
.main-content, .main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    width: 100%;
    min-width: 0;
    background-color: var(--bg-color);
}

.top-header {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: 64px;
    min-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

/* Universal High-End Toggle Button (Visible on all viewports) */
.menu-toggle, .menu-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.menu-toggle:hover, .menu-toggle-btn:hover {
    background: #f0f9ff;
    border-color: #0284c7;
    color: #0284c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.2);
}

.menu-toggle:active, .menu-toggle-btn:active {
    transform: translateY(0);
}

.menu-toggle svg, .menu-toggle-btn svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 2.2;
}

.header-title h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-badge {
    font-size: 10px;
    font-weight: 800;
    background: #e0f2fe;
    color: #0284c7;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid #bae6fd;
    letter-spacing: 0.5px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.18s ease;
    flex-shrink: 0;
}

.user-profile:hover {
    background: var(--surface-muted);
    border-color: var(--border);
}

.u-text {
    text-align: right;
    line-height: 1.25;
}

.u-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    display: block;
}

.u-role {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0284c7;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

/* Dashboard & Metric Card Accents */
.stat-icon-badge {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.stat-card:hover .stat-icon-badge {
    transform: scale(1.08);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* ==========================================================================
   GLOBAL LAYOUT CONTAINERS & PANELS
   ========================================================================== */
.page-container, .content-area {
    padding: 24px 28px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Form Controls & Universal Inputs */
.form-group, .ms-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.form-label, .ms-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.form-control, .ms-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 13.5px;
    color: var(--text-main);
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.15s ease;
}

.form-control:focus, .ms-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

/* Buttons */
.btn-primary, .btn-ms-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 6px var(--primary-glow);
}

.btn-primary:hover:not(:disabled), .btn-ms-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
}

.btn-secondary, .btn-ms-secondary {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.btn-secondary:hover, .btn-ms-secondary:hover {
    background: var(--surface-muted);
    border-color: var(--border-dark);
}

/* Status Pills */
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.st-active, .st-present, .st-approved {
    background: var(--success-light);
    color: var(--success-dark);
    border: 1px solid var(--success-border);
}

.st-onboarding, .st-pending, .st-late {
    background: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid var(--warning-border);
}

.st-absent, .st-rejected {
    background: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid var(--danger-border);
}

/* Tables */
.table-responsive, .table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table, .history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .history-table th {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
    white-space: nowrap;
}

.data-table td, .history-table td {
    padding: 14px 18px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tr:hover td, .history-table tr:hover td {
    background: #f8fafc;
}

/* Mobile Overlay */
.mobile-overlay, .drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1400;
    transition: opacity 0.2s ease;
}

.mobile-overlay.open, .drawer-overlay.open {
    display: block;
}

/* Generic Cards & Widgets */
.card, .widget {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header, .widget-header {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    flex-wrap: wrap;
    gap: 8px;
}

.card-body, .widget-body {
    padding: 20px;
    flex-grow: 1;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Mobile, Tablet, Laptop, 4K)
   ========================================================================== */
@media (max-width: 1200px) {
    .page-container, .content-area {
        padding: 20px 24px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
        min-width: 240px;
    }
    .page-container, .content-area {
        padding: 18px 20px;
    }
}

@media (max-width: 768px) {
    .menu-toggle, .menu-toggle-btn {
        display: flex;
    }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 1500;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
        width: 280px;
        max-width: 85vw;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .top-header {
        padding: 0 16px;
        height: 58px;
        min-height: 58px;
    }
    .u-role {
        display: none;
    }
    .u-name {
        font-size: 0.8rem;
    }
    .header-title h1 {
        font-size: 1rem;
        max-width: 200px;
    }
    .page-container, .content-area {
        padding: 16px 14px;
        gap: 16px;
    }
    .card-header, .widget-header {
        padding: 14px 16px;
    }
    .card-body, .widget-body {
        padding: 16px 14px;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 0 12px;
        height: 54px;
        min-height: 54px;
    }
    .u-text {
        display: none;
    }
    .avatar {
        width: 32px;
        height: 32px;
        font-size: 0.78rem;
    }
    .header-title h1 {
        font-size: 0.95rem;
        max-width: 160px;
    }
    .page-container, .content-area {
        padding: 12px 10px;
        gap: 12px;
    }
    .data-table th, .data-table td,
    .history-table th, .history-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* ==========================================================================
   ENTERPRISE MODULES: NOTIFICATIONS, HELPDESK, 2FA, AUDIT LOGS & TOASTS
   ========================================================================== */

/* 1. NOTIFICATION BELL & DROPDOWN */
.notif-wrapper {
    position: relative;
    display: inline-block;
}

.notif-bell-btn {
    background: #f1f5f9;
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.notif-bell-btn:hover {
    background: #e2e8f0;
    color: var(--primary);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 4px;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: 360px;
    max-width: 90vw;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    z-index: 2000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideDownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.notif-dropdown.show {
    display: flex;
}

@keyframes slideDownFade {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.notif-header {
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.notif-list {
    max-height: 380px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.notif-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: background 0.15s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.notif-item:hover {
    background: #f8fafc;
}

.notif-item.unread {
    background: #f0fdf4;
    border-left: 3px solid var(--accent);
}

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.notif-icon.info { background: #e0f2fe; color: #0284c7; }
.notif-icon.success { background: #dcfce7; color: #16a34a; }
.notif-icon.warning { background: #fef3c7; color: #d97706; }
.notif-icon.urgent { background: #fee2e2; color: #dc2626; }
.notif-icon.ticket { background: #f3e8ff; color: #9333ea; }
.notif-icon.leave { background: #fef9c3; color: #ca8a04; }

.notif-content {
    flex-grow: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.notif-msg {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
    word-break: break-word;
}

.notif-time {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-top: 4px;
}

.notif-footer {
    padding: 10px 16px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.notif-footer:hover {
    background: #f1f5f9;
}

/* 2. HELPDESK & TICKETS SYSTEM */
.priority-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.priority-pill.Low { background: #f1f5f9; color: #64748b; }
.priority-pill.Medium { background: #e0f2fe; color: #0284c7; }
.priority-pill.High { background: #fef3c7; color: #d97706; }
.priority-pill.Urgent { background: #fee2e2; color: #dc2626; }

.ticket-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
}
.ticket-status-pill.Open { background: #e0f2fe; color: #0369a1; }
.ticket-status-pill.InProgress, .ticket-status-pill.In-Progress { background: #fef3c7; color: #b45309; }
.ticket-status-pill.Resolved { background: #dcfce7; color: #15803d; }
.ticket-status-pill.Closed { background: #f1f5f9; color: #475569; }

.ticket-conversation {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: 400px;
    overflow-y: auto;
    padding: 14px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.reply-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    max-width: 80%;
    font-size: 0.88rem;
    line-height: 1.45;
}

.reply-bubble.admin {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.reply-bubble.user {
    align-self: flex-end;
    background: var(--primary);
    color: #ffffff;
}

.reply-meta {
    font-size: 0.72rem;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    opacity: 0.85;
}

/* 3. TWO-FACTOR AUTHENTICATION (2FA) */
.two-factor-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-xs);
}

.qr-code-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.backup-codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin: 16px 0;
    padding: 14px;
    background: #0f172a;
    border-radius: var(--radius-sm);
}

.backup-code-item {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background: #1e293b;
    color: #38bdf8;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 1px;
    border: 1px solid #334155;
}

.backup-code-item.used {
    color: #64748b;
    text-decoration: line-through;
    opacity: 0.5;
}

/* 4. AUDIT LOGS UI */
.audit-pill {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
    background: #f1f5f9;
    color: #334155;
}

.audit-pill.USER_CREATED, .audit-pill.LOGIN_SUCCESS, .audit-pill.2FA_ENABLED { background: #dcfce7; color: #166534; }
.audit-pill.USER_DELETED, .audit-pill.2FA_DISABLED, .audit-pill.LEAVE_REJECTED { background: #fee2e2; color: #991b1b; }
.audit-pill.DOCUMENTS_VERIFIED, .audit-pill.LEAVE_APPROVED { background: #e0f2fe; color: #075985; }

/* 5. GLOBAL TOAST ALERTS */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 18px;
    background: #0f172a;
    color: #ffffff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}

.toast-item.success { border-left: 4px solid #10b981; }
.toast-item.error { border-left: 4px solid #ef4444; }
.toast-item.warning { border-left: 4px solid #f59e0b; }
.toast-item.info { border-left: 4px solid #0ea5e9; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.toast-item.hide {
    opacity: 0;
    transform: translateY(-10px);
}

/* ==========================================================================
   7. FLUID BOTTOM SHEET MODALS ON MOBILE (iOS/Android Native Feel)
   ========================================================================== */
@media (max-width: 768px) {
    /* Native Bottom Sheet Modal Transformation */
    .modal-overlay {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    .modal-box {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 85dvh !important;
        border-bottom: none !important;
        margin: 0 !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3) !important;
        animation: sheetSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
        padding-bottom: max(16px, env(safe-area-inset-bottom)) !important;
    }

    /* Modal Top Drag Handle */
    .modal-box::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        border-radius: 2px;
        background: #cbd5e1;
        margin: 10px auto 4px auto;
    }

    @keyframes sheetSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    /* Mobile Toast Position Above Bottom Nav */
    #toast-container {
        left: 12px;
        right: 12px;
        bottom: calc(76px + env(safe-area-inset-bottom, 12px));
    }

    .toast-item {
        min-width: 0;
        width: 100%;
    }

    /* Full-Screen Notification Dropdown on Mobile */
    .notif-dropdown {
        position: fixed !important;
        top: 60px !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        max-width: none !important;
        max-height: 75vh !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25) !important;
    }

    /* Prevent Mobile Browser Auto-Zoom (Font size must be >= 16px) */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="tel"],
    select,
    textarea,
    .form-control,
    .ms-input {
        font-size: 16px !important;
    }
}

/* ==========================================================================
   PREMIUM SHIMMER SKELETON LOADING SYSTEM
   ========================================================================== */
@keyframes skeleton-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton,
.skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%) !important;
    background-size: 200% 100% !important;
    animation: skeleton-shimmer 1.4s infinite ease-in-out !important;
    border-radius: 4px;
    display: inline-block;
    color: transparent !important;
    user-select: none !important;
    border: none !important;
    pointer-events: none !important;
}

.sk-text {
    height: 12px;
    border-radius: 4px;
    width: 100%;
}

.sk-title {
    height: 18px;
    border-radius: 4px;
    width: 65%;
}

.sk-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.sk-badge {
    height: 20px;
    width: 70px;
    border-radius: 10px !important;
}

.sk-btn {
    height: 28px;
    width: 70px;
    border-radius: 6px !important;
}

.sk-card {
    background: #ffffff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.skeleton-tr td {
    padding: 12px 14px !important;
}

/* ================= GLOBAL TOAST CONTAINER & CARDS ================= */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 400px;
}

.toast {
    pointer-events: auto;
    background: #0f172a;
    color: #ffffff;
    padding: 12px 18px;
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: toastIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.25s ease;
}

.toast.toast-success {
    background: #064e3b;
    border-color: #059669;
    color: #ecfdf5;
}

.toast.toast-error {
    background: #7f1d1d;
    border-color: #dc2626;
    color: #fef2f2;
}

.toast.toast-warning {
    background: #78350f;
    border-color: #d97706;
    color: #fffbeb;
}

.toast.toast-info {
    background: #0c4a6e;
    border-color: #0284c7;
    color: #f0f9ff;
}

.toast.hide {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   UNIVERSAL RESPONSIVE ENGINE (MOBILE + TABLET + PC FRIENDLY)
   ========================================================================== */

/* Universal Mobile Backdrop Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9990;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

/* DESKTOP / LAPTOP SCREENS (>768px) */
@media (min-width: 769px) {
    .mobile-overlay {
        display: none !important;
    }
    
    .sidebar {
        position: relative !important;
        transform: none !important;
        flex-shrink: 0;
    }

    .main-content, .main-wrapper {
        flex: 1;
        min-width: 0;
    }
}

/* MOBILE & TABLET SCREENS (<=768px) */
@media (max-width: 768px) {
    html {
        height: auto !important;
        min-height: 100% !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: auto !important;
    }

    body {
        height: auto !important;
        min-height: 100% !important;
        min-height: 100dvh !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: auto !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative !important;
        width: 100% !important;
        -webkit-tap-highlight-color: transparent;
    }

    /* 1. OFF-CANVAS SLIDE-IN DRAWER SIDEBAR */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        min-width: 280px !important;
        max-width: 85vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 10000 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 10px 0 35px rgba(0, 0, 0, 0.45) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .sidebar.open {
        transform: translateX(0) !important;
    }

    .mobile-overlay.open {
        display: block !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    /* 2. FULL-WIDTH NATURAL-HEIGHT MAIN CONTENT WRAPPER */
    .main-content, .main-wrapper {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 100% !important;
        min-height: 100dvh !important;
        flex: 1 0 auto !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        touch-action: pan-y !important;
    }

    /* 3. CLEAN COMPACT TOP HEADER */
    .top-header {
        padding: 0 12px !important;
        height: 56px !important;
        min-height: 56px !important;
        gap: 8px !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 99 !important;
        background: rgba(255, 255, 255, 0.98) !important;
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
    }

    .header-left {
        gap: 10px !important;
        flex: 1;
        min-width: 0;
    }

    .header-title h1 {
        font-size: 14.5px !important;
        max-width: 160px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .portal-badge {
        display: none !important;
    }

    .header-right {
        gap: 8px !important;
    }

    .u-text {
        display: none !important;
    }

    .user-profile {
        padding: 2px !important;
        gap: 0 !important;
    }

    .avatar {
        width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
    }

    /* 4. RESPONSIVE CONTAINERS & SAFE-AREA PADDING */
    .dashboard-container, 
    .page-container, 
    .content-area,
    .main-container {
        padding: 16px 12px 100px 12px !important;
        gap: 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        box-sizing: border-box !important;
    }

    .welcome-text {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
    }

    .welcome-text h2 {
        font-size: 1.18rem !important;
    }

    .welcome-text p {
        font-size: 12px !important;
    }

    /* 5. 2-COLUMN COMPACT STAT / METRIC CARDS */
    .stats-grid, 
    .summary-strip, 
    .metrics-grid,
    .overview-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stat-card, .summary-card {
        padding: 14px 12px !important;
        gap: 6px !important;
    }

    .stat-value, .sc-val {
        font-size: 1.35rem !important;
    }

    .stat-header, .sc-label {
        font-size: 10px !important;
    }

    .stat-subtext, .sc-sub {
        font-size: 10.5px !important;
    }

    /* 6. SINGLE-COLUMN CONTENT WIDGETS */
    .content-grid, 
    .dash-grid, 
    .grid-2col, 
    .daily-grid,
    .two-column-layout,
    .workspace-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .terminal-widget {
        padding: 20px 14px !important;
    }

    .digital-clock {
        font-size: 2.2rem !important;
    }

    /* 7. TIMESHEET CONTROLS & ACTION BUTTONS */
    .pane-header {
        padding: 14px 12px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .pane-controls {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .pane-controls input[type="month"],
    .pane-controls input[type="date"],
    .pane-controls select,
    .pane-controls button {
        flex: 1 1 auto !important;
        min-height: 38px !important;
    }

    /* 8. HORIZONTAL TOUCH-SCROLL FOR DATA TABLES */
    .table-responsive, 
    .ts-table-wrap, 
    .table-wrapper {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 8px !important;
    }

    .ts-table th, .ts-table td,
    .data-table th, .data-table td,
    .history-table th, .history-table td {
        padding: 10px 10px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
    }

    .ts-time-input {
        width: 82px !important;
        padding: 4px 6px !important;
        font-size: 11.5px !important;
    }

    .ts-select {
        padding: 4px 6px !important;
        font-size: 11.5px !important;
    }

    /* 9. MODAL RESPONSIVENESS & TOUCH SCROLL */
    .modal-overlay {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 12px !important;
    }

    .modal-box, .update-modal {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - 24px) !important;
        margin: auto !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .modal-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        max-height: calc(100dvh - 130px) !important;
        padding: 16px !important;
    }

    .mode-nav {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* EXTRA SMALL MOBILES (<=420px) */
@media (max-width: 420px) {
    .stats-grid, 
    .summary-strip, 
    .metrics-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .stat-value, .sc-val {
        font-size: 1.2rem !important;
    }

    .btn-save-draft, .btn-final-submit, .btn-primary, .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* ==========================================================================
   EXECUTIVE LOGOUT CONFIRMATION MODAL
   ========================================================================== */
.logout-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: logoutFadeIn 0.2s ease-out;
}

.logout-modal-card {
    background: #ffffff;
    border-radius: 18px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    text-align: center;
    padding: 28px 24px;
    animation: logoutScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.logout-modal-icon {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #fee2e2;
    color: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}

.logout-modal-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
}

.logout-modal-desc {
    margin: 0 0 24px 0;
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.5;
}

.logout-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.logout-btn-cancel {
    flex: 1;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn-cancel:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.logout-btn-confirm {
    flex: 1;
    padding: 11px 16px;
    border-radius: 10px;
    border: none;
    background: #dc2626;
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    transition: background 0.2s ease, transform 0.1s ease;
}

.logout-btn-confirm:hover {
    background: #b91c1c;
    transform: translateY(-1px);
}

.logout-btn-confirm:active {
    transform: translateY(0);
}

@keyframes logoutFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes logoutScaleUp {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

/* ================= UNIVERSAL PWA INSTALLATION SYSTEM ================= */
.btn-pwa-header-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-decoration: none;
    user-select: none;
    white-space: nowrap;
}

.btn-pwa-header-pill:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
}

.btn-pwa-header-pill:active {
    transform: scale(0.95);
}

/* Floating PWA Install Bar (Disabled) */
.dgp-pwa-floating-bar {
    display: none !important;
}

.dgp-pwa-bar-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: white;
    font-size: 17px;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.4);
}

.dgp-pwa-bar-info {
    flex: 1;
    min-width: 0;
}

.dgp-pwa-bar-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dgp-pwa-bar-desc {
    font-size: 11.5px;
    color: #94a3b8;
    line-height: 1.3;
}

.dgp-pwa-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.dgp-pwa-bar-btn-install {
    background: #0284c7;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dgp-pwa-bar-btn-install:hover {
    background: #0369a1;
}

.dgp-pwa-bar-btn-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 6px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dgp-pwa-bar-btn-close:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* PWA Instruction Guide Modal */
.pwa-guide-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(5px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pwa-guide-box {
    background: #ffffff;
    border-radius: 18px;
    max-width: 480px;
    width: 100%;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: pwaPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pwaPop {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.pwa-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.pwa-guide-header h3 {
    font-size: 16.5px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.pwa-guide-close {
    background: #f1f5f9;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    transition: all 0.15s;
}

.pwa-guide-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.pwa-guide-step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    background: #f8fafc;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.pwa-guide-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #0284c7;
    color: white;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-guide-step-text {
    font-size: 13px;
    color: #334155;
    line-height: 1.45;
}

.pwa-guide-step-text strong {
    color: #0f172a;
}

/* ================= NATIVE MOBILE BOTTOM NAVIGATION (APK STYLE) ================= */
.dgp-mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(226, 232, 240, 0.85);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    align-items: center;
    justify-content: space-around;
    padding-left: 6px;
    padding-right: 6px;
    user-select: none;
    -webkit-user-select: none;
}

@media (max-width: 768px) {
    .dgp-mobile-bottom-nav {
        display: flex;
    }
    
    /* Ensure all employee pages have proper bottom breathing room */
    .dashboard-container,
    .page-container,
    .content-area,
    .main-content {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* Modern Fluid Typography for Mobile App */
    .header-title h1 {
        font-size: 1.1rem !important;
        max-width: calc(100vw - 140px) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .portal-badge {
        display: none !important;
    }

    /* Leave Balance Grid on Mobile */
    .leave-stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .leave-stat-card {
        padding: 12px 10px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px !important;
        border-radius: 10px !important;
    }
    .leave-stat-card .stat-icon-badge {
        display: none !important;
    }
    .leave-stat-card h4 {
        font-size: 10.5px !important;
        line-height: 1.15 !important;
        color: #64748b !important;
        font-weight: 700 !important;
    }
    .leave-stat-card h2 {
        font-size: 1.35rem !important;
        line-height: 1 !important;
        font-weight: 800 !important;
    }
    .leave-stat-card span {
        font-size: 10px !important;
    }

    /* Payslip Comp Cards on Mobile */
    .payroll-dashboard {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    .ytd-card {
        grid-column: 1 / -1 !important;
        padding: 16px !important;
    }
    .payroll-card {
        padding: 14px 12px !important;
    }
    .payroll-card h3 {
        font-size: 1.15rem !important;
    }

    /* Responsive tables on Mobile */
    .table-responsive,
    .accrual-table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    /* Input sizing to prevent iOS auto-zoom */
    input, select, textarea {
        font-size: 16px !important;
    }

    /* Floating PWA bar & Header install button on Mobile */
    .dgp-pwa-floating-bar {
        bottom: calc(75px + env(safe-area-inset-bottom, 0px)) !important;
        width: calc(100% - 24px) !important;
        max-width: 400px !important;
        padding: 10px 14px !important;
    }

    .btn-pwa-header-pill {
        display: none !important;
    }
}

.dgp-mob-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #64748b;
    text-decoration: none;
    padding: 6px 2px;
    border-radius: 10px;
    transition: all 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    max-width: 74px;
}

.dgp-mob-nav-item i {
    font-size: 18px;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s;
}

.dgp-mob-nav-item span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1;
    transition: color 0.15s;
}

.dgp-mob-nav-item:active {
    transform: scale(0.92);
}

.dgp-mob-nav-item.active {
    color: #0284c7;
}

.dgp-mob-nav-item.active i {
    transform: translateY(-2px) scale(1.12);
    color: #0284c7;
}

.dgp-mob-nav-item.active span {
    font-weight: 800;
    color: #0284c7;
}

.dgp-mob-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    width: 12px;
    height: 3px;
    background: #0284c7;
    border-radius: 4px;
}

/* Punch CTA in bottom nav */
.dgp-mob-nav-item.mob-punch-cta {
    color: #0284c7 !important;
}

.dgp-mob-nav-item.mob-punch-cta .mob-punch-circle {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4);
    margin-top: -14px;
    border: 3px solid #ffffff;
    color: #ffffff;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dgp-mob-nav-item.mob-punch-cta:active .mob-punch-circle {
    transform: scale(0.9);
}



