/* ==========================================================================
   LET'S G AESTHETIC & WELLNESS - EMPLOYEE ATTENDANCE MANAGEMENT SYSTEM
   Design System & Component Library (Phase 1 Approved Tokens)
   ========================================================================== */

/* --- CSS VARIABLES (Approved Brand Tokens) --- */
:root {
    /* Dark Theme Surface Canvas */
    --bg-main: #050505;          /* Deep luxury black canvas */
    --bg-darkest: #050505;       /* Root background */
    --bg-panel: #141414;         /* Primary panel/card background */
    --bg-alt: #141414;           /* Alternative secondary surface */
    --bg-card: #0c0c0c;          /* High-elevation container */
    --bg-hover: #1f1f1f;         /* Interactive hover surface */
    --bg-active: #292929;        /* Active surface */

    /* Brand Gold Accents */
    --brand-gold: #D4AF37;       /* Primary metallic gold */
    --brand-gold-hover: #AA8C2C; /* Deep antique gold hover */
    --brand-gold-light: #F2E8C8; /* Soft champagne highlight */
    --brand-gold-subtle: rgba(212, 175, 55, 0.08); /* 8% tint */
    --brand-gold-border: rgba(212, 175, 55, 0.35); /* Subtle border */
    --brand-gold-glow: rgba(212, 175, 55, 0.2);   /* Glow drop-shadow */

    /* Typography & Content Colors */
    --text-main: #FFFFFF;        /* Primary white text */
    --text-muted: #A0A0A0;       /* Secondary/metadata labels */
    --text-gold-light: #F2E8C8;  /* Warm cream highlight */
    --border-color: #333333;     /* Structural grid borders */
    --border-subtle: #222222;    /* Soft dividers */

    /* Semantic Status Colors */
    --status-success: #2ECC71;   /* Timed In, Active, On-Time */
    --status-warning: #D4AF37;   /* Break, Shift in Progress */
    --status-danger: #E74C3C;    /* Timed Out, Late, Absent */
    --status-info: #3498DB;      /* Notice, Audit update */
    --status-muted: #888888;     /* Inactive */
    --status-error: #EF4444;     /* System error banner */

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Courier New', monospace;

    /* Transitions & Layout */
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-fast: all 0.15s ease-in-out;
    --sidebar-width: 240px;
    --topbar-height: 75px;
    --radius-sharp: 0px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-full: 9999px;
}

/* --- RESET & GLOBAL SETTINGS --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100%;
    overflow-x: hidden;
    letter-spacing: 0.3px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

/* Spin Keyframe Animation */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darkest);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-gold-hover);
}

/* --- TYPOGRAPHY UTILITIES --- */
h1, h2, h3, h4, h5 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-main);
}

.text-gold {
    color: var(--brand-gold) !important;
}

.text-italic {
    font-style: italic;
}

.text-muted {
    color: var(--text-muted) !important;
}

.eyebrow-label {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--brand-gold);
    margin-bottom: 8px;
}

/* Utility Visibility Classes */
.desktop-only {
    display: block;
}
.mobile-only {
    display: none !important;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    min-height: 44px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
    user-select: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Primary Gold Button */
.btn-primary, .btn-gold {
    background-color: var(--brand-gold);
    color: #000000;
    border-color: var(--brand-gold);
    box-shadow: 0 4px 18px rgba(212, 175, 55, 0.28);
}
.btn-primary:hover, .btn-gold:hover {
    background-color: transparent;
    color: var(--brand-gold);
    box-shadow: 0 0 20px var(--brand-gold-glow);
    transform: translateY(-1px);
}
.btn-primary:active, .btn-gold:active {
    background-color: var(--brand-gold-hover);
    color: #000000;
}

/* Accent Button */
.btn-accent {
    background-color: var(--text-main);
    color: var(--bg-main);
}
.btn-accent:hover {
    background-color: transparent;
    color: var(--text-main);
    border-color: var(--text-main);
}

/* Outline Secondary Button */
.btn-outline {
    background-color: transparent;
    color: var(--text-main);
    border-color: var(--border-color);
}
.btn-outline:hover {
    border-color: var(--brand-gold);
    color: var(--brand-gold);
    background-color: var(--brand-gold-subtle);
}

/* Sign Out Action Button */
.btn-signout {
    background-color: rgba(231, 76, 60, 0.1);
    color: #FF7B72;
    border-color: rgba(231, 76, 60, 0.45);
}
.btn-signout:hover, .btn-signout:active {
    background-color: var(--status-danger);
    color: #FFFFFF;
    border-color: var(--status-danger);
    box-shadow: 0 0 14px rgba(231, 76, 60, 0.35);
}

/* Switch Role Pill Button */
.btn-switch-admin {
    background-color: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.4);
    color: var(--brand-gold-light);
}
.btn-switch-admin:hover, .btn-switch-admin:active {
    background-color: var(--brand-gold);
    color: #000000;
}

/* Danger / Time Out Button */
.btn-danger {
    background-color: transparent;
    color: var(--status-danger);
    border-color: rgba(231, 76, 60, 0.6);
}
.btn-danger:hover {
    background-color: var(--status-danger);
    color: #FFFFFF;
    border-color: var(--status-danger);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.3);
}

/* Sizes */
.btn-sm {
    padding: 8px 16px;
    font-size: 0.72rem;
    letter-spacing: 1px;
}
.btn-lg {
    padding: 16px 36px;
    font-size: 0.9rem;
    letter-spacing: 2px;
}
.btn-block {
    width: 100%;
}

/* --- BADGES & STATUS PILLS --- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.status-pill::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.pill-success {
    background: rgba(46, 204, 113, 0.12);
    color: var(--status-success);
    border-color: rgba(46, 204, 113, 0.4);
}
.pill-success::before { background: var(--status-success); box-shadow: 0 0 6px var(--status-success); }

.pill-warning, .pill-gold {
    background: rgba(212, 175, 55, 0.12);
    color: var(--brand-gold);
    border-color: rgba(212, 175, 55, 0.4);
}
.pill-warning::before, .pill-gold::before { background: var(--brand-gold); box-shadow: 0 0 6px var(--brand-gold); }

.pill-danger {
    background: rgba(231, 76, 60, 0.12);
    color: var(--status-danger);
    border-color: rgba(231, 76, 60, 0.4);
}
.pill-danger::before { background: var(--status-danger); }

.pill-muted {
    background: rgba(160, 160, 160, 0.12);
    color: var(--text-muted);
    border-color: rgba(160, 160, 160, 0.3);
}
.pill-muted::before { background: var(--text-muted); }

/* --- FORMS & INPUT CONTROLS --- */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    min-height: 48px;
    padding: 13px 16px;
    background-color: var(--bg-darkest);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    outline: none;
}

.form-control:focus {
    border-color: var(--brand-gold);
    background-color: rgba(212, 175, 55, 0.05);
    box-shadow: 0 0 12px rgba(212, 175, 55, 0.22);
}

.form-control::placeholder {
    color: #8E8E8E;
    font-size: 0.88rem;
    opacity: 1;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23D4AF37'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    padding-right: 40px;
}

.form-hint {
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.error-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--status-error);
    color: var(--status-error);
    padding: 12px 16px;
    font-size: 0.82rem;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    display: none;
    align-items: center;
    gap: 10px;
}

.success-banner {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid var(--status-success);
    color: var(--status-success);
    padding: 12px 16px;
    font-size: 0.82rem;
    margin-bottom: 20px;
    border-radius: var(--radius-sm);
    display: none;
    align-items: center;
    gap: 10px;
}

/* --- PANELS & CARDS --- */
.panel {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--brand-gold);
    padding: 28px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-title span {
    color: var(--brand-gold);
    font-style: italic;
}

/* --- KPI CARDS GRID --- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: 3px solid var(--brand-gold);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

.kpi-card:hover {
    border-color: var(--brand-gold);
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(212, 175, 55, 0.12);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.kpi-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.kpi-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--brand-gold);
}

.kpi-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--text-main);
    font-style: italic;
    line-height: 1;
}

.kpi-footer {
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* --- DATA TABLES --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    background-color: var(--bg-panel);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th {
    background-color: #0c0c0c;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-main);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--bg-hover);
}

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

.table-user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.table-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #1a1813;
    border: 1px solid var(--brand-gold);
    color: var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.table-user-info strong {
    display: block;
    color: var(--text-main);
    font-size: 0.88rem;
}

.table-user-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Empty State Table */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
}
.empty-state svg {
    width: 48px;
    height: 48px;
    stroke: var(--brand-gold);
    margin-bottom: 16px;
    opacity: 0.7;
}
.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 6px;
    color: var(--text-main);
}

/* --- APP LAYOUT SHELL (ADMIN) --- */
.app-shell {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Left Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-darkest);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.sidebar-brand {
    padding: 30px 20px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.sidebar-brand img {
    width: 150px;
    margin-bottom: 8px;
}

.sidebar-badge {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--brand-gold);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 2px 10px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    list-style: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-left: 3px solid transparent;
    transition: var(--transition-fast);
}

.sidebar-link:hover {
    color: var(--text-main);
    background-color: var(--bg-hover);
}

.sidebar-link.active {
    color: var(--brand-gold);
    background-color: var(--bg-panel);
    border-left-color: var(--brand-gold);
}

.sidebar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-mini-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-mini-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #1a1813;
    border: 1px solid var(--brand-gold);
    color: var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
}

.user-mini-info {
    flex: 1;
    overflow: hidden;
}

.user-mini-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-mini-role {
    font-size: 0.7rem;
    color: var(--brand-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Main Content Workspace */
.app-workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-main);
}

.app-topbar {
    height: var(--topbar-height);
    background-color: rgba(5, 5, 5, 0.95);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(8px);
}

.topbar-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--brand-gold);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-content {
    flex: 1;
    padding: 40px;
}

/* --- EMPLOYEE TOPBAR (EMPLOYEE PORTAL) --- */
.employee-header {
    background-color: rgba(5, 5, 5, 0.96);
    border-bottom: 1px solid var(--brand-gold);
    padding: 12px 5%;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.employee-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.employee-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.employee-logo img {
    width: 140px;
    height: auto;
}

.header-user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user-text {
    text-align: left;
    line-height: 1.25;
}

.employee-mobile-subbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    margin-top: 10px;
    border-top: 1px solid var(--border-subtle);
    width: 100%;
}

/* --- RECENT ACTIVITY SCAN CARD (ADMIN DASHBOARD) --- */
.recent-scan-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-darkest);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--brand-gold);
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}
.recent-scan-card:hover {
    border-color: var(--brand-gold);
    background: var(--bg-hover);
}
.scan-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.scan-card-info {
    min-width: 0;
}
.scan-card-name {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scan-card-meta {
    font-size: 0.74rem;
    color: var(--text-muted);
}

/* --- FILTER DROPDOWNS GROUP --- */
.filter-dropdowns-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--brand-gold);
    background: transparent;
    border: none;
    cursor: pointer;
}

/* ==========================================================================
   RESPONSIVE MEDIA ENGINE (Tablets & Mobile Phones)
   ========================================================================== */

@media (max-width: 1024px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .app-content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    /* Utility Visibility */
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: flex !important;
    }

    /* Base Layout Container */
    .app-shell {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }

    /* Fixed Modern Mobile Header */
    .app-sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        position: sticky;
        top: 0;
        z-index: 1000;
        background-color: var(--bg-darkest);
    }

    .sidebar-brand {
        padding: 10px 18px !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        height: 64px !important;
        border-bottom: 1px solid var(--border-color) !important;
    }

    .sidebar-brand-left {
        display: flex !important;
        align-items: center !important;
        gap: 10px !important;
    }

    .sidebar-brand-left img, .admin-brand-logo {
        width: 105px !important;
        height: auto !important;
        margin-bottom: 0 !important;
    }

    .sidebar-badge {
        font-size: 0.62rem !important;
        padding: 3px 8px !important;
        letter-spacing: 1.5px !important;
    }

    .mobile-nav-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 44px !important;
        height: 44px !important;
        font-size: 1.5rem !important;
        color: var(--brand-gold) !important;
        border: 1px solid rgba(212, 175, 55, 0.4) !important;
        border-radius: var(--radius-sm) !important;
        background: rgba(212, 175, 55, 0.08) !important;
        cursor: pointer !important;
    }

    /* Dedicated Fullscreen Mobile Navigation Drawer */
    .sidebar-nav {
        display: none;
    }

    .sidebar-nav.is-open {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(5, 5, 5, 0.98) !important;
        backdrop-filter: blur(14px) !important;
        z-index: 9999 !important;
        padding: 24px 20px max(30px, env(safe-area-inset-bottom)) !important;
        overflow-y: auto !important;
        border-bottom: 2px solid var(--brand-gold) !important;
    }

    .sidebar-nav.is-open .sidebar-link {
        padding: 16px 20px !important;
        font-size: 0.95rem !important;
        border-left: 3px solid transparent !important;
        border-bottom: 1px solid var(--border-subtle) !important;
        min-height: 52px !important;
    }

    .sidebar-nav.is-open .sidebar-link.active {
        border-left-color: var(--brand-gold) !important;
        background-color: var(--bg-panel) !important;
        color: var(--brand-gold) !important;
    }

    .sidebar-footer {
        display: none;
    }

    /* Admin Workspace Topbar Mobile Stacking */
    .app-topbar {
        height: auto !important;
        min-height: unset !important;
        padding: 18px 18px !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
        position: relative !important;
    }

    .topbar-title {
        font-size: 1.35rem !important;
    }

    .topbar-actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .topbar-actions .btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 13px 20px !important;
        min-height: 48px !important;
    }

    /* Content & Grid Spacing */
    .app-content {
        padding: 16px max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)) !important;
    }

    .kpi-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .kpi-card {
        padding: 18px 20px !important;
    }

    .kpi-value {
        font-size: 2.1rem !important;
    }

    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .panel {
        padding: 20px 16px !important;
    }

    .panel-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .panel-header .btn {
        width: 100% !important;
        justify-content: center !important;
        min-height: 44px !important;
    }

    /* Employee Portal Specific Mobile Header */
    .employee-header {
        padding: 12px 16px !important;
    }

    .employee-logo img {
        width: 120px !important;
    }

    .employee-mobile-subbar {
        display: flex !important;
    }

    /* Clock Hero Card Compact Mobile Sizing */
    .clock-hero-card {
        padding: 22px 16px 18px !important;
        margin-bottom: 20px !important;
    }

    .live-clock-time {
        font-size: clamp(2rem, 8vw, 2.6rem) !important;
        letter-spacing: 1.5px !important;
        margin: 6px 0 2px !important;
    }

    .live-clock-date {
        font-size: 0.82rem !important;
        margin-bottom: 14px !important;
    }

    .shift-status-box {
        margin-bottom: 18px !important;
        padding: 8px 14px !important;
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .attendance-actions-row {
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .attendance-action-btn {
        width: 100% !important;
        min-width: unset !important;
        padding: 16px 20px !important;
    }

    /* Filter Bar Stacking */
    .filter-bar {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .filter-dropdowns-group {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
    }

    /* Responsive Table-To-Card Engine (Eliminates clipping and horizontal cut-off!) */
    .table-responsive {
        border: none !important;
        background: transparent !important;
        overflow: visible !important;
    }

    .data-table thead {
        display: none !important;
    }

    .data-table, .data-table tbody {
        display: block !important;
        width: 100% !important;
    }

    .data-table tbody tr {
        display: block !important;
        background-color: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        border-top: 3px solid var(--brand-gold) !important;
        border-radius: var(--radius-sm) !important;
        padding: 16px !important;
        margin-bottom: 14px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    }

    .data-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid var(--border-subtle) !important;
        font-size: 0.88rem !important;
        text-align: right !important;
    }

    .data-table td:last-child {
        border-bottom: none !important;
        padding-top: 14px !important;
        justify-content: stretch !important;
    }

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

    .data-table td .btn {
        flex: 1 !important;
        min-height: 44px !important;
    }

    /* Modal Cards */
    .modal-card {
        max-width: 95vw !important;
        padding: 24px 18px !important;
    }
}

/* --- LOGIN SCREEN SPECIFICS --- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 20px max(40px, env(safe-area-inset-bottom));
    background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(212, 175, 55, 0.08) 0%, transparent 70%), var(--bg-main);
    position: relative;
}

.login-card {
    width: 100%;
    max-width: 460px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-gold);
    padding: 44px 36px 36px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    text-align: center;
    position: relative;
    z-index: 2;
    border-radius: var(--radius-sm);
}

.login-brand-logo {
    width: min(200px, 60vw);
    margin: 0 auto 20px;
}

.login-title {
    font-size: clamp(1.8rem, 5vw, 2.3rem);
    margin-bottom: 8px;
    line-height: 1.2;
}

.login-subtitle {
    color: #D4D4D4;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 28px;
    font-weight: 400;
}

.demo-credentials-box {
    margin-top: 26px;
    padding: 18px 20px;
    background-color: rgba(212, 175, 55, 0.04);
    border: 1.5px dashed var(--brand-gold-border);
    text-align: left;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.demo-credentials-box h5 {
    color: var(--brand-gold);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(180deg, #181818, #0f0f0f);
    border: 1.5px solid rgba(212, 175, 55, 0.45);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-top: 6px;
    transition: all 0.25s ease;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.demo-chip:hover, .demo-chip:active {
    background: rgba(212, 175, 55, 0.15);
    border-color: var(--brand-gold);
    color: var(--brand-gold);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.25);
}

/* --- CLOCK & ATTENDANCE HERO (EMPLOYEE DASHBOARD) --- */
.clock-hero-card {
    background: radial-gradient(ellipse 80% 50% at 50% 50%, rgba(212, 175, 55, 0.06) 0%, transparent 80%), var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-gold);
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
}

.live-clock-time {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 7vw, 4.2rem);
    color: var(--brand-gold);
    font-weight: 600;
    letter-spacing: 3px;
    line-height: 1.1;
    margin: 12px 0 6px;
}

.live-clock-date {
    color: var(--text-muted);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.shift-status-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-darkest);
    border-radius: var(--radius-sm);
    margin-bottom: 30px;
}

.shift-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-muted);
}
.shift-status-dot.active {
    background: var(--status-success);
    box-shadow: 0 0 10px var(--status-success);
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.attendance-actions-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.attendance-action-btn {
    flex: 1;
    min-width: 220px;
    padding: 18px 28px;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.attendance-action-btn span.subtext {
    font-size: 0.68rem;
    font-weight: 400;
    opacity: 0.8;
    text-transform: none;
    letter-spacing: 0.5px;
}

/* --- QR SCANNER MODAL & VIEWFINDER --- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-backdrop.show {
    display: flex;
    opacity: 1;
}

.modal-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-gold);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.show .modal-card {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--brand-gold);
}

/* Camera Scanner Viewfinder */
.scanner-viewport {
    position: relative;
    width: min(280px, 72vw);
    height: min(280px, 72vw);
    max-width: 100%;
    margin: 20px auto;
    background: #000000;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-corner {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid var(--brand-gold);
}
.scanner-corner.top-left { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.scanner-corner.top-right { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.scanner-corner.bottom-left { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.scanner-corner.bottom-right { bottom: 12px; right: 12px; border-left: none; border-top: none; }

.scanner-laser {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brand-gold), transparent);
    box-shadow: 0 0 12px var(--brand-gold);
    top: 0;
    animation: laser-scan 2.4s ease-in-out infinite;
}

@keyframes laser-scan {
    0% { top: 12px; opacity: 0.2; }
    50% { top: calc(100% - 14px); opacity: 1; }
    100% { top: 12px; opacity: 0.2; }
}

.qr-code-display {
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;
    padding: 16px;
    background: #FFFFFF;
    border: 2px solid var(--brand-gold);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: #141414;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--brand-gold);
    padding: 14px 20px;
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    font-size: 0.85rem;
    pointer-events: auto;
    animation: toast-in 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.toast.toast-success { border-left-color: var(--status-success); }
.toast.toast-danger { border-left-color: var(--status-danger); }
.toast.toast-info { border-left-color: var(--brand-gold); }

@keyframes toast-in {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- FILTER BAR --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-input-wrap {
    flex: 1;
    min-width: 240px;
    position: relative;
}

.search-input-wrap svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.search-input-wrap input {
    padding-left: 42px;
}

/* ==========================================================================
   PHASE 4: WORKPLACE QR & GEOFENCE LOCATION VERIFICATION STYLES
   ========================================================================== */

/* QR Container Canvas & Images */
.qr-code-display canvas,
.qr-code-display img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.qr-terminal-meta {
    background: var(--bg-darkest);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    margin: 16px 0;
    text-align: left;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
}

.qr-terminal-url {
    font-family: var(--font-mono);
    color: var(--brand-gold);
    word-break: break-all;
    display: block;
    margin-top: 4px;
}

/* Switch Toggle for Location Verification */
.toggle-switch-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-darkest);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    margin-bottom: 18px;
    border-radius: var(--radius-sm);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333333;
    transition: 0.3s;
    border-radius: 26px;
    border: 1px solid var(--border-color);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #FFFFFF;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--brand-gold);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
    background-color: #000000;
}

/* Location Status Banner on Employee Dashboard */
.location-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
}

.location-status-badge.enabled {
    background: rgba(46, 204, 113, 0.15);
    color: var(--status-success);
    border: 1px solid rgba(46, 204, 113, 0.4);
}

.location-status-badge.disabled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.qr-arrival-alert {
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid var(--brand-gold);
    border-left: 4px solid var(--brand-gold);
    padding: 14px 18px;
    color: var(--champagne);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border-radius: var(--radius-sm);
    animation: fadeIn 0.4s ease;
}

/* ==========================================================================
   PRINT-FRIENDLY CLINIC RECEPTION POSTER
   ========================================================================== */
#printablePosterSection {
    display: none;
}

@media print {
    /* Hide all web application chrome */
    body * {
        visibility: hidden !important;
    }

    #printablePosterSection,
    #printablePosterSection * {
        visibility: visible !important;
    }

    #printablePosterSection {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        min-height: 100vh !important;
        background: #FFFFFF !important;
        color: #111111 !important;
        padding: 40px !important;
        box-sizing: border-box !important;
        font-family: 'Lato', sans-serif !important;
    }

    .poster-sheet {
        max-width: 680px;
        margin: 0 auto;
        border: 4px double #D4AF37;
        padding: 36px 30px;
        text-align: center;
        background: #FFFFFF;
    }

    .poster-header h1 {
        font-family: 'Playfair Display', serif !important;
        font-size: 26pt !important;
        color: #111111 !important;
        margin: 12px 0 4px !important;
        letter-spacing: 1px !important;
    }

    .poster-branch {
        font-size: 13pt !important;
        color: #AA8C2C !important;
        text-transform: uppercase !important;
        letter-spacing: 3px !important;
        font-weight: 700 !important;
        margin-bottom: 24px !important;
    }

    .poster-qr-frame {
        width: 280px;
        height: 280px;
        margin: 0 auto 20px;
        padding: 16px;
        border: 2px solid #111111;
        background: #FFFFFF;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .poster-qr-frame canvas,
    .poster-qr-frame img {
        width: 100% !important;
        height: 100% !important;
    }

    .poster-instructions {
        margin: 24px auto 20px;
        text-align: left;
        max-width: 480px;
        background: #FDFBF7;
        border: 1px solid #EAE0D0;
        padding: 16px 22px;
        border-radius: 4px;
    }

    .poster-instructions ol {
        margin: 0;
        padding-left: 20px;
        line-height: 1.6;
        font-size: 11pt;
        color: #333333;
    }

    .poster-notice {
        font-size: 9pt !important;
        color: #666666 !important;
        margin-top: 24px !important;
        border-top: 1px solid #DDDDDD !important;
        padding-top: 14px !important;
        line-height: 1.4 !important;
    }
}
