/* ============================================================
   main.css — SiteTracker design system (Light / In-Works Interiors)
   Brand: deep purple #7D3B9E -> magenta #EC0084 -> orange #EDA46D
   Fonts: Space Grotesk (display), Inter (body), JetBrains Mono (data)
   ============================================================ */

/* ── 1. Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html {
    font-size: 12px; /* 9pt base */
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-body);
    font-size: 9pt;
    background: var(--bg-base);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 32px 32px;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 3px;
}

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

/* ── 2. CSS Custom Properties ─────────────────────────────── */
:root {
    /* Fonts — Aptos first with modern fallbacks */
    --font-display: 'Aptos', 'Aptos Display', 'Segoe UI', Calibri, -apple-system, sans-serif;
    --font-body:    'Aptos', 'Segoe UI', Calibri, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

    /* Surfaces — soft lavender-white, cards lift as true white */
    --bg-base:      #FBF8FC;
    --bg-surface:   #FFFFFF;
    --bg-elevated:  #F5EEF9;
    --bg-hover:     #EEE1F5;
    --border:       #E7DAEF;
    --border-light: #D6C0E2;
    --grid-line:    rgba(125,59,158,.035);

    /* Text — deep purple-black for warmth, not clinical grey */
    --text-primary:   #29162F;
    --text-secondary: #6E5D78;
    --text-muted:     #9C8CA8;

    /* Signature accent — brand purple */
    --accent:         #7D3B9E;
    --accent-hover:   #632F80;
    --accent-bright:  #9C5FC0;
    --accent-soft:    rgba(125,59,158,.10);
    --accent-ring:    rgba(125,59,158,.30);
    --primary:        #7D3B9E;
    --primary-hover:  #632F80;

    /* Secondary accent — brand magenta */
    --magenta:        #E01184;
    --magenta-bright:  #F0399E;
    --magenta-soft:    rgba(224,17,132,.10);

    /* Tertiary accent — brand orange */
    --orange:      #D98A3B;
    --orange-soft: rgba(217,138,59,.14);

    /* Status semantics */
    --blue:       #5D6FD1;
    --blue-soft:  rgba(93,111,209,.12);
    --green:      #2F9E64;
    --green-soft: rgba(47,158,100,.12);
    --red:        #DC5B54;
    --red-soft:   rgba(220,91,84,.12);
    --amber:      #D98A3B;
    --amber-soft: rgba(217,138,59,.14);
    --purple:     #9C5FC0;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-xl:  20px;

    --shadow-sm:  0 1px 2px rgba(41,22,47,.06), 0 1px 1px rgba(41,22,47,.03);
    --shadow-md:  0 10px 24px -8px rgba(41,22,47,.14), 0 2px 8px rgba(41,22,47,.05);
    --shadow-lg:  0 24px 56px -16px rgba(41,22,47,.20), 0 4px 14px rgba(41,22,47,.07);
    --shadow-glow: 0 0 0 1px var(--accent-ring), 0 10px 26px -6px rgba(125,59,158,.25);

    --nav-height: 52px;
    --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* ── 3. Typography ────────────────────────────────────────── */
h1,h2,h3,h4 {
    font-family: var(--font-display);
    color: var(--text-primary); font-weight: 600; line-height: 1.2;
    letter-spacing: -.01em;
}
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p  { color: var(--text-secondary); }
code {
    background: var(--bg-elevated); padding: 2px 6px; border-radius: var(--radius-sm);
    font-family: var(--font-mono); font-size: .82rem; color: var(--accent-hover);
    border: 1px solid var(--border);
}
small { font-size: .8rem; color: var(--text-muted); }

/* ── 4. Top Navigation ────────────────────────────────────── */
.topnav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-height, 52px);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

.topnav-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 1rem;
}

.topnav-brand {
    display: flex; align-items: center; gap: .5rem;
    text-decoration: none; flex-shrink: 0;
}
.brand-logo { height: 26px; width: auto; display: block; }
.brand-meta { display: flex; align-items: baseline; gap: 0.3rem; }
.brand-name {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-weight: 700; font-size: 0.95rem;
    color: var(--text-primary); letter-spacing: -.02em; white-space: nowrap;
}
.brand-sub {
    font-style: normal; font-weight: 500; color: var(--text-muted);
    font-size: .78rem; white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: .15rem;
    margin: 0;
    padding: 0;
    flex: 1;
}

.nav-links > li {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.nav-links > li > a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    height: 32px;
    padding: 0 .58rem;
    color: var(--text-secondary);
    font-size: .8rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    border-radius: var(--radius-sm, 6px);
    transition: all var(--transition, 0.15s ease);
}
.nav-links > li > a:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.nav-links > li > a.active {
    color: #7E22CE;
    background: #F3E8FF;
    font-weight: 600;
}

.nav-links > li.nav-drawer-user-header,
.nav-links > li.nav-drawer-actions {
    display: none !important;
}

.nav-icon {
    font-size: .88rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.nav-text {
    white-space: nowrap;
}

.nav-badge {
    background: #EF4444;
    color: #ffffff;
    font-size: .65rem;
    font-weight: 700;
    padding: .1rem .38rem;
    border-radius: 999px;
}

.nav-badge-pill {
    background: #EF4444;
    color: #ffffff;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.2;
    margin-left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ── Nav Dropdown ── */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    height: 32px;
    padding: 0 .58rem;
    color: var(--text-secondary);
    font-size: .8rem;
    font-weight: 500;
    white-space: nowrap;
    font-family: inherit;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    transition: all var(--transition, 0.15s ease);
}
.nav-dropdown-toggle:hover,
.nav-dropdown:hover .nav-dropdown-toggle,
.nav-dropdown.is-open .nav-dropdown-toggle {
    color: var(--text-primary);
    background: var(--bg-elevated);
}
.nav-dropdown-toggle.active {
    color: #7E22CE;
    background: #F3E8FF;
    font-weight: 600;
}
.dropdown-chevron {
    transition: transform 0.2s ease;
    opacity: 0.7;
    flex-shrink: 0;
}
.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown.is-open .dropdown-chevron,
.nav-user-dropdown.is-open .dropdown-chevron {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 175px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.09), 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: .25rem 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
    z-index: 250;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-dropdown-menu li {
    margin: 0;
    padding: 0;
    width: 100%;
}
.nav-dropdown-menu a {
    display: flex !important;
    align-items: center;
    gap: .5rem;
    padding: .45rem .85rem !important;
    color: var(--text-primary) !important;
    font-size: .8125rem !important;
    font-weight: 500 !important;
    text-decoration: none;
    border-radius: 0 !important;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}
.nav-dropdown-menu a:hover {
    background: var(--bg-elevated) !important;
    color: #7E22CE !important;
}
.nav-dropdown-menu a.active {
    background: #F3E8FF !important;
    color: #7E22CE !important;
    font-weight: 600 !important;
}
.dropdown-icon {
    font-size: .95rem;
    line-height: 1;
}

/* ── Desktop User Profile Dropdown ── */
.nav-user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}
.nav-user-btn {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    height: 30px;
    padding: 0 .52rem 0 .25rem;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition, 0.15s ease);
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.nav-user-btn:hover,
.nav-user-dropdown.is-open .nav-user-btn {
    background: var(--bg-elevated);
    border-color: #7E22CE;
}
.nav-user-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #F3E8FF;
    color: #7E22CE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    border: 1px solid rgba(125,59,158,0.18);
    flex-shrink: 0;
}
.nav-user-name {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1;
}
.nav-user-role-badge {
    font-size: .58rem;
    font-weight: 700;
    letter-spacing: .03em;
    font-family: var(--font-mono);
    padding: .08rem .32rem;
    border-radius: 3px;
    line-height: 1;
}
.badge-role-superadmin { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #92400E; border: 1px solid rgba(245, 158, 11, 0.4); font-weight: 700; box-shadow: 0 1px 2px rgba(245, 158, 11, 0.15); }
.badge-role-admin      { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; font-weight: 600; }
.badge-role-manager    { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; font-weight: 600; }
.badge-role-supervisor { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; font-weight: 600; }
.badge-role-hr         { background: #FDF2F8; color: #BE185D; border: 1px solid #FBCFE8; font-weight: 600; }
.badge-role-accountant { background: #FFFBEB; color: #B45309; border: 1px solid #FDE68A; font-weight: 600; }
.badge-role-sales_manager, .badge-role-salesmanager { background: #EEF2FF; color: #4338CA; border: 1px solid #C7D2FE; font-weight: 600; }
.badge-role-sales_executive, .badge-role-salesexecutive { background: #ECFEFF; color: #0E7490; border: 1px solid #A5F3FC; font-weight: 600; }
.badge-role-vendor     { background: #FFEDD5; color: #C2410C; border: 1px solid #FED7AA; font-weight: 600; }
.badge-superadmin      { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #92400E; border: 1px solid rgba(245, 158, 11, 0.4); }

.nav-user-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    min-width: 195px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.04);
    padding: .35rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.15s ease;
    z-index: 300;
}
.nav-user-dropdown.is-open .nav-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.user-menu-header {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .45rem .75rem;
}
.user-menu-avatar-lg {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #F3E8FF;
    color: #7E22CE;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}
.user-menu-user-info {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    overflow: hidden;
}
.user-menu-name {
    font-size: .82rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-menu-role-tag {
    font-size: .62rem;
    font-weight: 600;
    padding: .08rem .35rem;
    border-radius: 3px;
    width: fit-content;
}
.user-menu-divider {
    height: 1px;
    background: var(--border);
    margin: .25rem 0;
}
.user-menu-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .42rem .75rem;
    color: var(--text-primary);
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
}
.user-menu-link:hover {
    background: var(--bg-elevated);
    color: #7E22CE;
}
.user-menu-icon {
    font-size: .9rem;
    line-height: 1;
}
.user-menu-logout-btn {
    color: #DC2626;
}
.user-menu-logout-btn:hover {
    background: #FEF2F2;
    color: #B91C1C;
}

/* ── 3-Lines Hamburger Button ────────────────────────────── */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    transition: all var(--transition, 0.2s ease);
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
}

.nav-toggle:hover {
    background: var(--bg-elevated);
    border-color: var(--accent);
}

.nav-toggle .bar {
    display: block;
    width: 20px;
    height: 2.2px;
    background: var(--text-primary);
    border-radius: 2px;
    margin: 2.5px 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animate 3 lines into an X when open */
.nav-toggle.is-active .bar-1 {
    transform: translateY(7.2px) rotate(45deg);
    background: #7E22CE;
}
.nav-toggle.is-active .bar-2 {
    opacity: 0;
    transform: scale(0);
}
.nav-toggle.is-active .bar-3 {
    transform: translateY(-7.2px) rotate(-45deg);
    background: #7E22CE;
}

/* Desktop Hide for Mobile-Only Drawer Items */
.nav-drawer-user-header,
.nav-drawer-actions {
    display: none;
}

/* ── Mobile / Tablet Navigation Drawer Layout ─────────────── */
@media (max-width: 1080px) {
    .nav-toggle {
        display: flex;
    }

    .nav-user-dropdown {
        display: none !important;
    }

    .topnav {
        height: var(--nav-height, 60px);
        padding: 0 1rem;
        justify-content: space-between;
    }

    .topnav-left {
        margin-right: 0;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height, 60px);
        left: 0;
        right: 0;
        bottom: auto;
        max-height: calc(100vh - var(--nav-height, 60px));
        overflow-y: auto;
        background: #ffffff;
        border-bottom: 2px solid var(--border);
        flex-direction: column;
        padding: 1rem;
        gap: .4rem;
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
        z-index: 9999;
        animation: slideDownNav .22s ease-out both;
    }

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

    .nav-links.open {
        display: flex !important;
    }

    /* Mobile Drawer User Card Header */
    .nav-links > li.nav-drawer-user-header {
        display: block !important;
        margin-bottom: .65rem;
        padding-bottom: .75rem;
        border-bottom: 1px solid var(--border);
        width: 100%;
    }

    .drawer-user-card {
        display: flex;
        align-items: center;
        gap: .85rem;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius-sm, 8px);
        padding: .75rem 1rem;
    }

    .drawer-user-avatar {
        font-size: 1.2rem;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background: #ffffff;
        color: #7E22CE;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid var(--border);
        flex-shrink: 0;
    }

    .drawer-user-meta {
        display: flex;
        flex-direction: column;
        gap: .15rem;
    }

    .drawer-user-name {
        font-weight: 700;
        font-size: .95rem;
        color: var(--text-primary);
    }

    .drawer-user-role {
        font-size: .68rem;
        font-weight: 700;
        letter-spacing: .05em;
        font-family: var(--font-mono);
    }

    /* Mobile Nav Link Items */
    .nav-links > li {
        width: 100%;
    }

    .nav-links > li > a {
        display: flex;
        align-items: center;
        height: 44px;
        padding: 0 1rem;
        font-size: .95rem;
        font-weight: 600;
        color: var(--text-primary);
        background: transparent;
        border-radius: var(--radius-sm, 6px);
        transition: all 0.15s ease;
    }

    .nav-links > li > a:hover {
        background: var(--bg-elevated);
        color: #7E22CE;
    }

    .nav-links > li > a.active {
        background: #F3E8FF;
        color: #7E22CE;
        font-weight: 700;
    }

    /* Manage Dropdown in Mobile Drawer */
    .nav-dropdown {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-dropdown-toggle {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 44px;
        padding: 0 1rem;
        font-size: .95rem;
        font-weight: 600;
        color: var(--text-primary);
        border-radius: var(--radius-sm, 6px);
    }

    .nav-dropdown-menu {
        position: static;
        width: 100%;
        box-shadow: none;
        border: none;
        background: var(--bg-elevated);
        border-radius: var(--radius-sm, 6px);
        margin: .25rem 0 .5rem 0;
        padding: .35rem 0;
        display: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-dropdown.is-open .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown-menu a {
        padding: .65rem 1.25rem !important;
        font-size: .9rem !important;
    }

    /* Drawer Actions (Change Password + Sign Out) */
    .nav-links > li.nav-drawer-actions {
        display: flex !important;
        flex-direction: column;
        gap: .5rem;
        margin-top: .75rem;
        padding-top: .85rem;
        border-top: 1px solid var(--border);
        width: 100%;
    }

    .drawer-action-btn {
        width: 100%;
        justify-content: center;
        padding: .75rem;
        font-size: .92rem;
        font-weight: 700;
        text-align: center;
    }

    .drawer-logout-form {
        width: 100%;
    }

    .btn-danger-mobile {
        background: linear-gradient(135deg, #ef4444, #dc2626);
        color: #ffffff;
        border: none;
        border-radius: var(--radius-sm, 6px);
        cursor: pointer;
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
    }

    .btn-danger-mobile:hover {
        background: linear-gradient(135deg, #dc2626, #b91c1c);
        color: #ffffff;
    }
}

.main-content {
    margin-top: var(--nav-height);
    padding: 2rem 1.5rem;
    max-width: 1400px;
    margin-left: auto; margin-right: auto;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
    animation: fadeUpPage .35s ease both;
}
@keyframes fadeUpPage { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 768px) { .main-content { padding: 1rem .85rem; } }

/* ── 6. Page Header ───────────────────────────────────────── */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
}
.page-title    { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); }
.page-subtitle { color: var(--text-muted); font-size: .875rem; margin-top: .3rem; font-family: var(--font-mono); }
.header-actions { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }

/* ── 7. Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem 1.1rem; border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: .875rem; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; transition: all var(--transition); line-height: 1.4;
    text-decoration: none; white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--magenta));
    color: #FFFFFF; border-color: rgba(0,0,0,.04);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-hover), var(--magenta-bright)); color: #FFFFFF; transform: translateY(-1px); box-shadow: var(--shadow-glow); }

/* Cancel / secondary actions — verified: kept high-contrast in light mode
   (this is the button family used by every "Cancel" control in the app) */
.btn-outline {
    background: var(--bg-surface); color: var(--text-secondary);
    border: 1px solid var(--border-light);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-success {
    background: var(--green); color: #fff;
}
.btn-success:hover { background: #268554; color: #fff; transform: translateY(-1px); }

.btn-danger {
    background: var(--red-soft); color: #B23A34;
    border: 1px solid rgba(220,91,84,.35);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-block { width: 100%; justify-content: center; }
.btn-lg    { padding: .75rem 1.5rem; font-size: 1rem; }
.btn-sm    { padding: .35rem .75rem; font-size: .8rem; }
.btn-xs    { padding: .25rem .55rem; font-size: .75rem; }

/* ── 8. Forms ─────────────────────────────────────────────── */
.form-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 2rem; margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.form-card-compact { padding: 1.25rem 1.5rem; }
.form-card-title   {
    font-family: var(--font-display);
    font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 1.1rem;
    padding-bottom: .75rem; border-bottom: 1px solid var(--border);
    position: relative;
}
.form-card-title::after {
    content: ''; position: absolute; left: 0; bottom: -1px; width: 36px; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--magenta));
}

.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group.has-error .form-input { border-color: var(--red); }

.form-grid { display: grid; gap: 1rem; margin-bottom: 1rem; }
.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 600px) {
    .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

label {
    font-size: .78rem; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: .05em;
}
.required { color: var(--red); }

.form-input {
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-primary); border-radius: var(--radius-sm);
    padding: .65rem .9rem; font-size: .9rem; font-family: var(--font-body);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    width: 100%;
}
.form-input:focus {
    outline: none; border-color: var(--accent); background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-input::placeholder { color: var(--text-muted); }
.form-input-sm { padding: .45rem .75rem; font-size: .85rem; }

.form-textarea { resize: vertical; min-height: 80px; }

.select-wrap { position: relative; }
.select-wrap select { appearance: none; padding-right: 2rem; cursor: pointer; }
.select-wrap::after {
    content: '▾'; position: absolute; right: .75rem; top: 50%;
    transform: translateY(-50%); pointer-events: none;
    color: var(--text-muted); font-size: .75rem;
}

.field-error { font-size: .78rem; color: #B23A34; font-weight: 500; }

.form-actions {
    display: flex; gap: .75rem; justify-content: flex-end;
    margin-top: 1.5rem; padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.checkbox-label {
    display: flex; align-items: center; gap: .5rem;
    font-size: .875rem; font-weight: 500; color: var(--text-secondary);
    cursor: pointer; text-transform: none; letter-spacing: 0;
}
.checkbox-label input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }

.inline-form-row { display: flex; gap: .75rem; }
.inline-form-row .form-input { flex: 1; }

/* Input icon wrapper */
.input-wrap { position: relative; }
.input-wrap .form-input { padding-left: 2.5rem; }
.input-icon {
    position: absolute; left: .85rem; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: .95rem; pointer-events: none;
}
.toggle-password {
    position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 1rem; padding: 0;
    opacity: .55;
}
.toggle-password:hover { opacity: 1; }

/* ── 9. Alerts & Flash Messages ───────────────────────────── */
.alert {
    padding: .85rem 1.1rem; border-radius: var(--radius-sm);
    margin-bottom: 1rem; font-size: .875rem; font-weight: 500;
    display: flex; align-items: flex-start; gap: .5rem;
    animation: slideIn .25s ease;
    border: 1px solid transparent;
}
@keyframes slideIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }

.alert-success { background: var(--green-soft); border-color: rgba(47,158,100,.3); color: #1E7A4C; }
.alert-error   { background: var(--red-soft);   border-color: rgba(220,91,84,.3);  color: #B23A34; }
.alert-info    { background: var(--blue-soft); border-color: rgba(93,111,209,.3); color: #4A57AD; }

/* ── 10. Tables ───────────────────────────────────────────── */
.table-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 1.5rem; box-shadow: var(--shadow-sm); }
.table-scroll { overflow-x: auto; }

.data-table {
    width: 100%; border-collapse: collapse; font-size: .85rem;
}
.data-table th {
    background: var(--bg-elevated); color: var(--text-muted);
    font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    padding: .75rem 1rem; text-align: left; white-space: nowrap;
    border-bottom: 1px solid var(--border);
    font-family: var(--font-mono);
}
.data-table td {
    padding: .75rem 1rem; color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-hover); color: var(--text-primary); }
.data-table .col-work { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-table .col-material { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-table .col-id { color: var(--text-muted); font-size: .78rem; font-family: var(--font-mono); }
.data-table .col-date { white-space: nowrap; font-family: var(--font-mono); font-size: .8rem; }
.data-table .col-actions { text-align: right; white-space: nowrap; }
.data-table .nowrap { white-space: nowrap; }

.row-inactive td { opacity: .5; }

/* ── 11. Status Badges ────────────────────────────────────── */
.status-badge {
    display: inline-flex; align-items: center;
    padding: .2rem .6rem; border-radius: 99px;
    font-family: var(--font-mono);
    font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
    white-space: nowrap;
}
.status-pending     { background: var(--amber-soft);  color: #A8631F; border: 1px solid rgba(217,138,59,.35); }
.status-inprogress  { background: var(--blue-soft);   color: #4A57AD; border: 1px solid rgba(93,111,209,.35); }
.status-complete    { background: var(--green-soft);  color: #1E7A4C; border: 1px solid rgba(47,158,100,.35); }
.status-blocked     { background: var(--red-soft);    color: #B23A34; border: 1px solid rgba(220,91,84,.35); }

/* ── 12. Site & other tags ────────────────────────────────── */
.site-badge, .site-tag {
    display: inline-block; background: var(--accent-soft);
    color: var(--accent-hover); border: 1px solid rgba(125,59,158,.28);
    padding: .2rem .6rem; border-radius: var(--radius-sm);
    font-size: .72rem; font-weight: 600; font-family: var(--font-mono);
    letter-spacing: .02em;
    white-space: nowrap;
}

/* ── 13. Generic badges ───────────────────────────────────── */
.badge {
    display: inline-block; padding: .2rem .55rem;
    border-radius: 99px; font-size: .72rem; font-weight: 700;
    background: var(--bg-elevated); color: var(--text-secondary);
    font-family: var(--font-mono);
}
.badge-active   { background: var(--green-soft);  color: #1E7A4C; }
.badge-inactive { background: var(--red-soft);    color: #B23A34;   }
.badge-alert    { background: var(--red-soft);    color: #B23A34;   }
.badge-role-superadmin { background: linear-gradient(135deg, #FEF3C7, #FDE68A); color: #92400E; border: 1px solid rgba(245, 158, 11, 0.4); font-weight: 700; }
.badge-role-admin      { background: var(--accent-soft); color: var(--accent-hover); }
.badge-role-supervisor { background: var(--green-soft);  color: #1E7A4C; }
.badge-role-vendor     { background: #FFEDD5; color: #C2410C; }

/* ── 14. Filter Bar & Excel Toolbar ───────────────────────── */
.filter-bar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md, 8px);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
}

.excel-filters {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.filter-form {
    margin: 0;
    padding: 0;
}

.filter-row {
    display: flex;
    gap: 0.5rem 0.65rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 0 0 auto;
    min-width: 120px;
}

.filter-group label {
    font-size: 7.2pt;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    margin: 0;
    padding-left: 1px;
}

.filter-group-date {
    min-width: 125px;
}

.filter-group-search {
    flex: 1 1 200px;
    min-width: 180px;
}

.filter-actions {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

/* Standardized filter inputs across all filter bars */
.filter-bar .form-input,
.filter-bar input[type="date"],
.filter-bar input[type="text"],
.filter-bar select,
.excel-filters .form-input,
.excel-filters input[type="date"],
.excel-filters input[type="text"],
.excel-filters select {
    height: 32px;
    padding: 0 0.6rem;
    font-size: 8.5pt;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.filter-bar input[type="date"],
.excel-filters input[type="date"] {
    min-width: 120px;
    cursor: pointer;
}

.filter-bar .form-input:focus,
.filter-bar input[type="date"]:focus,
.filter-bar input[type="text"]:focus,
.filter-bar select:focus,
.excel-filters .form-input:focus,
.excel-filters input[type="date"]:focus,
.excel-filters input[type="text"]:focus,
.excel-filters select:focus {
    outline: none;
    border-color: var(--accent, #7d3b9e);
    box-shadow: 0 0 0 2px rgba(125, 59, 158, 0.15);
}

/* ── Multi-Select Dropdown ────────────────────────────────── */
.multi-select-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.multi-select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    width: 100%;
    height: 32px;
    padding: 0 0.6rem;
    font-size: 8.5pt;
    font-family: inherit;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color: #1e293b;
    cursor: pointer;
    text-align: left;
    user-select: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.multi-select-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.multi-select-btn:focus {
    outline: none;
    border-color: var(--accent, #7d3b9e);
    box-shadow: 0 0 0 2px rgba(125, 59, 158, 0.15);
}

.multi-select-btn.has-selection {
    background: #fbf7fd;
    border-color: var(--accent, #7d3b9e);
    color: var(--accent, #7d3b9e);
    font-weight: 600;
}

.multi-select-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    font-size: 8.5pt;
}

.multi-select-arrow {
    font-size: 7pt;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.15s ease;
    display: inline-block;
    line-height: 1;
}

.multi-select-dropdown.is-open .multi-select-arrow {
    transform: rotate(180deg);
    color: var(--accent, #7d3b9e);
}

.multi-select-dropdown.is-open .multi-select-btn {
    border-color: var(--accent, #7d3b9e);
    box-shadow: 0 0 0 2px rgba(125, 59, 158, 0.15);
}

/* Floating Menu Popover */
.multi-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 1050;
    min-width: 200px;
    max-width: 280px;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    box-sizing: border-box;
}

.multi-select-menu[hidden],
[hidden].multi-select-menu {
    display: none !important;
}

.multi-select-menu::-webkit-scrollbar {
    width: 5px;
}

.multi-select-menu::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.multi-select-menu::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.multi-select-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.35rem 0.35rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 0.25rem;
}

.multi-select-actions-title {
    font-size: 7.2pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
}

.multi-select-clear {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 7.5pt;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
}

.multi-select-clear:hover {
    background: #fee2e2;
    color: #dc2626;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.45rem;
    border-radius: 5px;
    font-size: 8.5pt;
    color: #334155;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease;
    margin: 0;
    font-weight: 400;
    line-height: 1.25;
}

.multi-select-option:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.multi-select-option input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent, #7d3b9e);
    border-radius: 3px;
    flex-shrink: 0;
}

.multi-select-option span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* ── Form Multi-Select Dropdown Component ─────────────────── */
.form-multi-select {
    position: relative;
    width: 100%;
}
.form-multi-select .multi-select-btn {
    height: 38px;
    padding: 0 0.75rem;
    font-size: 9pt;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: var(--radius-sm, 6px);
    background: var(--bg-surface, #ffffff);
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
.form-multi-select .multi-select-btn:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}
.form-multi-select .multi-select-btn:focus,
.form-multi-select.is-open .multi-select-btn {
    outline: none;
    border-color: var(--accent, #7d3b9e);
    box-shadow: 0 0 0 3px rgba(125, 59, 158, 0.15);
}
.form-multi-select .multi-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 220px;
    max-height: 250px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    padding: 0.4rem;
    z-index: 1050;
    box-sizing: border-box;
}

/* ── 15. Pagination ───────────────────────────────────────── */
.pagination {
    display: flex; align-items: center; gap: .4rem;
    justify-content: center; margin-top: 1.25rem; flex-wrap: wrap;
}
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 .6rem;
    background: var(--bg-surface); border: 1px solid var(--border);
    color: var(--text-secondary); border-radius: var(--radius-sm);
    font-size: .82rem; font-weight: 500; font-family: var(--font-mono);
    transition: all var(--transition);
}
.page-btn:hover, .page-btn--active {
    background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700;
}
.page-info { font-size: .82rem; color: var(--text-muted); padding: 0 .5rem; font-family: var(--font-mono); }

/* ── 16. Empty state ──────────────────────────────────────── */
.empty-state {
    text-align: center; padding: 4rem 2rem;
    background: var(--bg-surface); border: 1px dashed var(--border-light);
    border-radius: var(--radius-lg); margin: 1rem 0;
}
.empty-icon { font-size: 2.75rem; margin-bottom: 1rem; opacity: .8; }
.empty-state h2 { margin-bottom: .5rem; color: var(--text-secondary); font-weight: 600; }
.empty-state p  { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ── 17. Section helpers ──────────────────────────────────── */
.section-header { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.section-header h2 { font-size: 1.05rem; }
.section-footer { text-align: center; padding: 1rem 0; }
.link-subtle { color: var(--text-muted); font-size: .85rem; }
.link-subtle:hover { color: var(--accent); }
.link-more  { display: block; text-align: center; color: var(--text-muted); font-size: .85rem; margin-top: .75rem; }
.empty-text { color: var(--text-muted); font-size: .9rem; }
.success-text { color: var(--green); }

/* ── 18. Dashboard panels ─────────────────────────────────── */
.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ── 18. Dashboard panels ─────────────────────────────────── */
.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; gap: 1rem; } }

.dash-panel {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.panel-alert { border-color: rgba(220,91,84,.35); }
.panel-vendor { border-color: rgba(217,138,59,.35); }
.panel-header {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: #FAFAFA;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem;
}
.panel-header h2 { font-family: var(--font-display); font-size: .95rem; font-weight: 700; color: var(--text-primary); }
.panel-body { padding: 1rem; }

/* KPI Cards */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.85rem; margin-bottom: 1.5rem; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

.kpi-card {
    background: #ffffff; border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px); padding: 1.1rem 0.85rem;
    text-align: center; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); border-color: #7E22CE; }
.kpi-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-top: .35rem; }
.kpi-sub   { font-size: .7rem; color: var(--text-muted); margin-top: .2rem; font-family: var(--font-mono); }
.kpi-total    .kpi-value { color: var(--blue); }
.kpi-complete .kpi-value { color: var(--green); }
.kpi-pending  .kpi-value { color: var(--orange); }
.kpi-inprog   .kpi-value { color: var(--blue); }
.kpi-blocked  .kpi-value { color: var(--red); }
.kpi-stalled  .kpi-value { color: var(--red); }

/* ── 18. Leaderboard & Premium Timeframe Controls ─────────── */
.panel-header--flex {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .75rem;
}
.leaderboard-heading-block {
    display: flex; flex-direction: column; gap: .15rem;
}
.leaderboard-title-line {
    display: flex; align-items: center; gap: .55rem; flex-wrap: wrap;
}
.leaderboard-title {
    font-family: var(--font-display); font-size: .95rem; font-weight: 700;
    margin: 0; color: var(--text-primary);
}
.leaderboard-subtitle {
    color: var(--text-muted); font-size: .75rem;
}
.leaderboard-live-pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .15rem .5rem; border-radius: 99px;
    font-size: .68rem; font-weight: 700; font-family: var(--font-mono);
    background: #ECFDF5; color: #047857;
    border: 1px solid #A7F3D0;
    letter-spacing: .02em;
}
.pulse-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #10B981; box-shadow: 0 0 6px #10B981;
    animation: pulseDot 2s infinite ease-in-out;
}
.leaderboard-live-pill--vendor {
    background: #FFF7ED; color: #C2410C; border-color: #FED7AA;
}
.pulse-dot--vendor { background: #EA580C; box-shadow: 0 0 6px #EA580C; }
.vendor-avatar { background: linear-gradient(135deg, #EA580C, #C2410C); }
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.75); }
}

/* ── Timeframe & Leaderboard Controls Widget ── */
.leaderboard-controls-wrap {
    display: flex;
    align-items: center;
    gap: .3rem;
    flex-wrap: wrap;
}
.timeframe-select-box {
    position: relative;
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0 .35rem 0 .45rem;
    height: 26px;
    box-shadow: 0 1px 2px rgba(0,0,0,.02);
    transition: all var(--transition);
}
.timeframe-select-box:hover {
    border-color: #7E22CE;
    background: #fafafa;
}
.timeframe-select-box:focus-within {
    border-color: #7E22CE;
    box-shadow: 0 0 0 2px rgba(126,34,206,.12);
}
.timeframe-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: .72rem;
    font-weight: 600;
    padding: 0 .85rem 0 0;
    cursor: pointer;
    outline: none;
    max-width: 100%;
    line-height: 24px;
}
.timeframe-select optgroup {
    font-weight: 700;
    color: #7E22CE;
    background: #ffffff;
    font-size: .72rem;
}
.timeframe-select option {
    font-weight: 500;
    color: var(--text-primary);
    background: #ffffff;
    padding: .3rem;
    font-size: .75rem;
}
.tf-select-chevron {
    position: absolute;
    right: .35rem;
    font-size: .58rem;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
}

@media (max-width: 650px) {
    .leaderboard-controls-wrap {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: .25rem;
        width: 100%;
        margin-top: .35rem;
    }
    .timeframe-select-box {
        width: 100%;
        height: 25px;
        padding: 0 .2rem 0 .35rem;
    }
    .timeframe-select {
        font-size: .67rem;
        padding-right: .7rem;
        line-height: 23px;
    }
}

/* ── Leaderboard Rows & Rankings ── */
.supervisor-completion-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.completion-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .85rem;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    width: 100%;
}
.completion-row:hover {
    background: #FAFAFA;
    border-color: #7E22CE;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

/* Tier Accents */
.completion-row.rank-tier-1 {
    background: #FFFDF5;
    border-color: #FDE68A;
}
.completion-row.rank-tier-2 {
    background: #F8FAFC;
    border-color: #E2E8F0;
}
.completion-row.rank-tier-3 {
    background: #FFFBF5;
    border-color: #FFEDD5;
}

/* Rank Pills */
.leaderboard-rank {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.rank-pill {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 800;
    font-family: var(--font-mono);
    line-height: 1;
}
.rank-pill--1 {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FCD34D;
}
.rank-pill--2 {
    background: #E2E8F0;
    color: #334155;
    border: 1px solid #CBD5E1;
}
.rank-pill--3 {
    background: #FFEDD5;
    color: #9A3412;
    border: 1px solid #FDBA74;
}
.rank-pill--other {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;
}

/* Avatars */
.completion-avatar-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.supervisor-mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #ffffff;
    font-size: .78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.avatar-tier-1 { background: linear-gradient(135deg, #F59E0B, #D97706); }
.avatar-tier-2 { background: linear-gradient(135deg, #64748B, #475569); }
.avatar-tier-3 { background: linear-gradient(135deg, #F97316, #EA580C); }
.avatar-tier-other { background: linear-gradient(135deg, #7E22CE, #9333EA); }

/* Info Column */
.completion-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    overflow: hidden;
}
.completion-meta-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    overflow: hidden;
}
.completion-name {
    font-size: .86rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.completion-row:hover .completion-name { color: #7E22CE; }
.completion-count {
    font-size: .72rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Progress Bar */
.completion-bar-wrap {
    width: 100%;
    height: 5px;
    background: #E2E8F0;
    border-radius: 999px;
    overflow: hidden;
}
.completion-bar {
    height: 100%;
    border-radius: 999px;
    transition: width .4s cubic-bezier(.4,0,.2,1);
    min-width: 2px;
}
.completion-bar--top {
    background: linear-gradient(90deg, #10B981, #059669);
}
.completion-bar--regular {
    background: linear-gradient(90deg, #7E22CE, #9333EA);
}

/* Stat Right */
.completion-stat-right {
    flex-shrink: 0;
    margin-left: .5rem;
    text-align: right;
    display: flex;
    align-items: center;
}
.completion-pct {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    min-width: 44px;
    text-align: right;
}
.pct-gold { color: #D97706; font-weight: 800; }

.empty-state-small {
    text-align: center; padding: 2rem 1rem; color: var(--text-muted);
    font-size: .88rem;
}
.empty-state-small span { font-size: 1.6rem; display: block; margin-bottom: .4rem; }
.empty-state-small p { margin-bottom: .6rem; }


/* Stalled list */
.stalled-list { display: flex; flex-direction: column; gap: .75rem; }
.stalled-item {
    background: var(--bg-elevated); border: 1px solid rgba(220,91,84,.25);
    border-radius: var(--radius-sm); padding: .75rem 1rem;
}
.stalled-header { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .35rem; }
.stalled-age    { font-size: .72rem; font-weight: 700; color: #B23A34; background: var(--red-soft); padding: 2px 7px; border-radius: 99px; font-family: var(--font-mono); }
.stalled-desc   { font-size: .85rem; color: var(--text-secondary); margin-bottom: .25rem; }
.stalled-sup    { color: var(--text-muted); display: block; margin-bottom: .5rem; }

/* ── 19. Modal ────────────────────────────────────────────── */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(41,22,47,.45); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-card {
    background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-lg); padding: 2rem; width: 100%; max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: popIn .2s ease;
}
@keyframes popIn { from { opacity:0; transform: scale(.96) translateY(4px); } to { opacity:1; transform: scale(1) translateY(0); } }
.modal-card h3 { margin-bottom: 1.25rem; font-size: 1.1rem; }

/* ── 20. Audit Info ───────────────────────────────────────── */
.audit-info {
    padding: .75rem 1rem; background: var(--bg-elevated); border-radius: var(--radius-sm);
    border: 1px solid var(--border); margin-bottom: 1rem; color: var(--text-muted);
    font-family: var(--font-mono); font-size: .78rem;
}

/* ── 21. Login Page ───────────────────────────────────────── */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 1rem;
    background:
        radial-gradient(ellipse 900px 600px at 50% 0%, rgba(224,17,132,.07) 0%, transparent 60%),
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        var(--bg-base);
    background-size: auto, 28px 28px, 28px 28px, auto;
}
.login-wrapper { width: 100%; max-width: 420px; }
.login-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-xl); padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    animation: fadeUp .45s cubic-bezier(.16,1,.3,1);
    position: relative;
}
/* Signature: drafting-sheet registration marks on the hero card */
.login-card::before, .login-card::after {
    content: ''; position: absolute; width: 18px; height: 18px;
    border-color: var(--accent-ring); opacity: .9;
}
.login-card::before { top: 14px; left: 14px; border-top: 2px solid; border-left: 2px solid; }
.login-card::after  { bottom: 14px; right: 14px; border-bottom: 2px solid; border-right: 2px solid; }
@keyframes fadeUp { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:translateY(0); } }
.login-brand { text-align: center; margin-bottom: 2rem; }
.login-logo { height: 96px; width: auto; margin: 0 auto 1rem; display: block; filter: drop-shadow(0 8px 20px rgba(125,59,158,.18)); }
.login-icon {
    width: 62px; height: 62px; margin: 0 auto 1rem;
    background: linear-gradient(150deg, var(--accent), var(--magenta) 65%, var(--orange));
    border-radius: var(--radius-lg); display: flex; align-items: center; justify-content: center;
    font-size: 1.9rem; box-shadow: 0 10px 28px rgba(125,59,158,.3);
}
.login-brand h1 { font-size: 1.7rem; margin-bottom: .3rem; }
.login-brand p  { color: var(--text-muted); font-size: .875rem; font-family: var(--font-mono); }
.login-form { display: flex; flex-direction: column; gap: 1.1rem; }
.login-hint { text-align: center; color: var(--text-muted); font-size: .8rem; margin-top: 1.25rem; }

/* ── 22. Import page ──────────────────────────────────────── */
.import-info {
    background: var(--bg-elevated); border-radius: var(--radius-sm); padding: 1rem 1.25rem;
    margin-bottom: 1.25rem; border-left: 3px solid var(--blue);
}
.import-info p { font-size: .85rem; margin-bottom: .4rem; color: var(--text-secondary); }
.import-info p:last-child { margin-bottom: 0; }
.import-info strong { color: var(--text-primary); }

.file-drop {
    position: relative; border: 2px dashed var(--border-light); border-radius: var(--radius-md);
    padding: 2.5rem; text-align: center; cursor: pointer; transition: all var(--transition);
}
.file-drop:hover, .file-drop.dragover {
    border-color: var(--accent); background: var(--accent-soft);
}
.file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-drop-icon { font-size: 2.25rem; display: block; margin-bottom: .75rem; }
.file-drop-label { color: var(--text-secondary); font-size: .875rem; pointer-events: none; }

.import-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; }
.import-stat {
    background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 1rem; text-align: center;
}
.import-stat span { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; color: var(--blue); }
.import-stat { font-size: .78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.import-stat--success span { color: var(--green); }
.import-stat--warn    span { color: var(--orange); }

.error-list { padding: .75rem 1.25rem; list-style: disc; color: var(--text-secondary); font-size: .8rem; max-height: 200px; overflow-y: auto; }
.error-list li { margin-bottom: .25rem; }

/* ── 23. Error page ───────────────────────────────────────── */
.error-page {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
        var(--bg-base);
    background-size: 28px 28px;
}
.error-card { text-align: center; padding: 3rem; }
.error-code { font-family: var(--font-display); font-size: 5.5rem; font-weight: 700; color: var(--red); opacity: .55; line-height: 1; }
.error-card h1 { margin: .5rem 0; }
.error-card p  { margin-bottom: 1.5rem; }

/* ── 24. Footer ───────────────────────────────────────────── */
.app-footer {
    text-align: center; padding: 1.5rem; color: var(--text-muted);
    font-size: .78rem; font-family: var(--font-mono); border-top: 1px solid var(--border); margin-top: 2rem;
}
.footer-sep { margin: 0 .5rem; }

/* ── 25. Stats Strip (Supervisor) ─────────────────────────── */
.stats-strip { display: flex; gap: .75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.stat-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: .9rem 1.25rem;
    display: flex; flex-direction: column; align-items: center; gap: .2rem;
    min-width: 90px; flex: 1;
    transition: transform var(--transition), border-color var(--transition);
}
.stat-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.stat-number { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; color: var(--text-primary); line-height: 1; }
.stat-label  { font-size: .7rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.stat-card--alert .stat-number { color: var(--red); }

/* ── 26. Entry Cards (Supervisor) ─────────────────────────── */
.entry-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); margin-bottom: 1rem; }
@media (max-width: 400px) { .entry-cards { grid-template-columns: 1fr; } }

.entry-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex; flex-direction: column;
}
.entry-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--border-light); }

.entry-card-header {
    padding: .9rem 1.1rem; background: var(--bg-elevated);
    display: flex; align-items: center; justify-content: space-between; gap: .5rem;
}
.entry-card-body { padding: 1rem 1.1rem; flex: 1; }
.work-description { color: var(--text-primary); font-weight: 500; margin-bottom: .75rem; line-height: 1.5; }
.entry-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .5rem; }
.entry-meta-item { display: flex; flex-direction: column; gap: .1rem; }
.meta-label { font-size: .68rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.meta-value { font-size: .85rem; color: var(--text-secondary); }
.entry-remarks { font-size: .8rem; color: var(--text-muted); font-style: italic; padding-top: .5rem; border-top: 1px solid var(--border); }
.entry-card-footer {
    padding: .75rem 1.1rem; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: .75rem; justify-content: space-between;
    background: rgba(125,59,158,.02);
}
.status-form { display: flex; flex: 1; }
.status-select {
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-secondary); padding: .3rem .6rem;
    border-radius: var(--radius-sm); font-size: .8rem; cursor: pointer; flex: 1;
    appearance: none; font-family: var(--font-mono);
}
.status-select:focus { outline: none; border-color: var(--accent); }

/* ── 29. Combobox (live-search fields) ────────────────────── */
.combobox { position: relative; }

.combobox-menu {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
    background: var(--bg-surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    max-height: 260px; overflow-y: auto; padding: .35rem;
}

.combobox-option {
    padding: .55rem .75rem; border-radius: var(--radius-sm);
    font-size: .875rem; color: var(--text-primary); cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.combobox-option:hover, .combobox-option.is-active {
    background: var(--accent-soft); color: var(--accent-hover);
}

.combobox-option--create {
    color: var(--accent); font-weight: 600;
    border-top: 1px solid var(--border); margin-top: .3rem; padding-top: .6rem;
    white-space: normal;
}
.combobox-option--create:hover, .combobox-option--create.is-active {
    background: var(--accent-soft); color: var(--accent-hover);
}
.combobox-option--create.is-loading { color: var(--text-muted); font-weight: 500; cursor: wait; }

.combobox-option--hint {
    color: var(--text-muted); font-size: .8rem; font-style: italic;
    cursor: default; white-space: normal;
}
.combobox-option--hint:hover { background: transparent; }

/* ── 27. Misc utilities ───────────────────────────────────── */
.btn-loader { color: inherit; }
details summary { cursor: pointer; user-select: none; }

/* ── 28. Scrollbar polish ──────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── 30. Approval Workflow ─────────────────────────────────── */

/* Nav badge (live pending count in navbar) */
.nav-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.3em; height: 1.3em; padding: 0 .35em;
    background: #e53e3e; color: #fff;
    font-size: .65rem; font-weight: 700; line-height: 1;
    border-radius: 99px; vertical-align: middle;
    margin-left: .25rem; animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}
.nav-link-approval { position: relative; }

/* Badge counts on buttons */
.badge-count {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.4em; height: 1.4em; padding: 0 .4em;
    background: rgba(255,255,255,.25); color: inherit;
    font-size: .7rem; font-weight: 700; border-radius: 99px;
    margin-left: .4rem; vertical-align: middle;
}
.badge-count--inline { background: rgba(0,0,0,.12); }
.badge-count--muted  { background: rgba(0,0,0,.08); opacity: .8; }

/* Warning button for approval queue */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff; border-color: transparent;
    box-shadow: 0 2px 8px rgba(245,158,11,.35);
}
.btn-warning:hover { background: linear-gradient(135deg, #d97706, #b45309); color: #fff; }

/* Danger button */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff; border-color: transparent;
    box-shadow: 0 2px 8px rgba(239,68,68,.3);
}
.btn-danger:hover { background: linear-gradient(135deg, #dc2626, #b91c1c); color: #fff; }

/* Approval KPI card */
.kpi-approval {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid #f59e0b;
    animation: glow-approval 2s ease-in-out infinite alternate;
}
.kpi-approval .kpi-value { color: #b45309; }
.kpi-approval .kpi-label { color: #92400e; }
.kpi-approval .kpi-sub   { color: #78350f; }
@keyframes glow-approval {
    from { box-shadow: 0 0 0 0 rgba(245,158,11,.2); }
    to   { box-shadow: 0 0 12px 4px rgba(245,158,11,.35); }
}

/* Global actions bar above all pending groups */
.approval-global-actions {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.approval-global-label { flex: 1; font-size: .9rem; color: var(--text-secondary); }

/* Approval group card */
.approval-group {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.approval-group:hover { box-shadow: var(--shadow-md); }

.approval-group-header {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 1rem; padding: 1.1rem 1.4rem;
    background: linear-gradient(135deg, #fef9f0, #fdf3e3);
    border-bottom: 1px solid #f3d8a0;
}
.approval-group-info { display: flex; align-items: center; gap: .9rem; }
.approval-sup-avatar {
    width: 2.75rem; height: 2.75rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff; font-weight: 700; font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); flex-shrink: 0;
}
.approval-sup-name {
    font-size: 1.05rem; font-weight: 700; color: var(--text-primary);
    font-family: var(--font-display); margin: 0;
}
.approval-sup-count { font-size: .8rem; color: var(--text-muted); }
.approval-group-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Approval table */
.approval-table { font-size: .85rem; }

/* Row highlights */
tr.row-pending > td { background: rgba(245,158,11,.04); }
tr.row-rejected > td {
    background: rgba(239,68,68,.04);
    color: var(--text-muted);
    text-decoration-color: rgba(0,0,0,.2);
}
tr.row-rejected .site-tag { opacity: .6; }

/* Completed work rows on the vendor dashboard: sink visually so open work stands out */
tr.row-complete-dim > td {
    opacity: .5;
    filter: blur(.3px) saturate(.7);
    transition: opacity var(--transition), filter var(--transition);
}
tr.row-complete-dim:hover > td {
    opacity: .85;
    filter: none;
}
tr.row-complete-dim .status-badge { opacity: 1; filter: none; }

/* Per-row approve/reject buttons */
.approval-row-actions { display: flex; gap: .3rem; }

/* Approval badges (in supervisor entries list) */
.approval-badge {
    display: inline-flex; align-items: center; gap: .3em;
    padding: .25em .65em; border-radius: 99px;
    font-size: .75rem; font-weight: 600; line-height: 1.2;
    white-space: nowrap;
}
.approval-pending  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.approval-approved { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.approval-rejected { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── 31. Alert info variant ────────────────────────────────── */
.alert-info {
    background: #eff6ff; border-left: 4px solid #3b82f6;
    color: #1e40af; border-radius: var(--radius-md);
    padding: .85rem 1.1rem; margin-bottom: 1.25rem; font-size: .9rem;
}

/* ── 32. Supervisor status-only page ───────────────────────── */
.supervisor-readonly-notice {
    display: flex; align-items: flex-start; gap: 1rem;
    background: #fefce8; border: 1px solid #fde047;
    border-radius: var(--radius-md); padding: 1rem 1.25rem;
    margin-bottom: 1.5rem; font-size: .9rem;
}
.supervisor-readonly-notice .readonly-icon { font-size: 1.5rem; flex-shrink: 0; }
.supervisor-readonly-notice strong { display: block; color: #713f12; margin-bottom: .2rem; font-weight: 600; }
.supervisor-readonly-notice p { color: #854d0e; margin: 0; font-size: .85rem; }

.entry-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: .85rem 1.5rem;
}
.entry-detail-item { display: flex; flex-direction: column; gap: .2rem; }
.entry-detail-item--full { grid-column: 1 / -1; }
.detail-label {
    font-size: .7rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .05em;
}
.detail-value { font-size: .9rem; color: var(--text-primary); line-height: 1.5; }

/* form-actions delete button pushed left */
.form-actions { flex-wrap: wrap; }

/* ── 33. Approval queue toolbar (search + global actions) ── */
.approval-toolbar {
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: .85rem 1.2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.approval-search-wrap {
    position: relative; display: flex; align-items: center; flex: 1; min-width: 200px;
}
.approval-search-icon {
    position: absolute; left: .75rem; font-size: .95rem; pointer-events: none; user-select: none;
}
.approval-search-input {
    width: 100%; padding: .55rem .75rem .55rem 2.2rem;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-md); font-size: .9rem; color: var(--text-primary);
    font-family: var(--font-body); transition: border-color var(--transition), box-shadow var(--transition);
}
.approval-search-input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125,59,158,.15);
}
.approval-search-input::placeholder { color: var(--text-muted); }
.approval-search-clear {
    position: absolute; right: .65rem; cursor: pointer; color: var(--text-muted);
    font-size: .8rem; padding: .2rem .3rem; border-radius: 3px;
    transition: color var(--transition);
}
.approval-search-clear:hover { color: var(--text-primary); }

.approval-toolbar-actions {
    display: flex; align-items: center; gap: .75rem; flex-shrink: 0; flex-wrap: wrap;
}
.approval-global-label { font-size: .875rem; color: var(--text-secondary); white-space: nowrap; }

/* No search results message */
.approve-no-results {
    text-align: center; padding: 2.5rem 1rem;
    color: var(--text-muted); font-size: .95rem;
}
.approve-no-results span { font-size: 1.5rem; display: block; margin-bottom: .5rem; }

/* ── 34. AJAX toast notification ────────────────────────────── */
.approve-toast {
    position: fixed; bottom: 1.75rem; right: 1.75rem; z-index: 9999;
    min-width: 260px; max-width: 420px;
    padding: .85rem 1.25rem; border-radius: var(--radius-lg);
    font-size: .9rem; font-weight: 600; font-family: var(--font-body);
    box-shadow: 0 8px 30px rgba(0,0,0,.18);
    animation: slideInToast .25s cubic-bezier(.34,1.56,.64,1) forwards;
    pointer-events: none;
}
@keyframes slideInToast {
    from { opacity: 0; transform: translateY(20px) scale(.96); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.approve-toast--success { background: #065f46; color: #d1fae5; }
.approve-toast--error   { background: #991b1b; color: #fee2e2; }

/* ── 35. Inline Status Select in Tables ──────────────────────── */
.inline-status-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
}
.inline-status-select {
    padding: .35rem .75rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    font-weight: 600;
    font-family: var(--font-mono);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
}
.inline-status-select:hover {
    border-color: var(--accent);
    background: var(--bg-surface);
}
.inline-status-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(125,59,158,.18);
}
.inline-status-select[data-status="COMPLETE"] {
    background: var(--green-soft);
    color: #1E7A4C;
    border-color: rgba(47,158,100,.4);
}
.inline-status-select[data-status="IN_PROGRESS"] {
    background: var(--blue-soft);
    color: #4A57AD;
    border-color: rgba(93,111,209,.4);
}
.inline-status-select[data-status="PENDING"] {
    background: var(--amber-soft);
    color: #A8631F;
    border-color: rgba(217,138,59,.4);
}
.inline-status-select[data-status="BLOCKED"] {
    background: var(--red-soft);
    color: #B23A34;
    border-color: rgba(220,91,84,.4);
}

.status-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .55rem;
    border-radius: var(--radius-sm);
    font-size: .75rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px dashed var(--border);
}

/* ── 36. Attendance System & Timesheet UI ─────────────────────── */
.att-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: .02em;
}
.att-full {
    background: rgba(16, 185, 129, .15);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, .35);
}
.att-half {
    background: rgba(245, 158, 11, .15);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, .35);
}
.att-week-off {
    background: rgba(139, 92, 246, .15);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, .35);
}
.att-absent {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, .3);
}

/* Attendance Rules Banner */
.att-rules-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, rgba(125,59,158,.08), rgba(224,17,132,.04));
    border: 1px solid rgba(125,59,158,.2);
    border-radius: var(--radius-lg, 12px);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}
.rules-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}
.rules-banner-content h4 {
    margin: 0 0 .4rem 0;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.rules-banner-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}
.rule-badge-item {
    font-size: .8rem;
    padding: .25rem .65rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
}
.rule-badge-item.rule-full {
    background: rgba(16, 185, 129, .12);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, .25);
}
.rule-badge-item.rule-half {
    background: rgba(245, 158, 11, .12);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, .25);
}
.rule-badge-item.rule-absent {
    background: rgba(239, 68, 68, .1);
    color: #991b1b;
    border: 1px solid rgba(239, 68, 68, .2);
}

/* Supervisor Live Tracker Card */
.att-tracker-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition, .2s ease);
}
.att-theme-full_day {
    border-color: rgba(16, 185, 129, .4);
    background: linear-gradient(180deg, rgba(16, 185, 129, .04), var(--bg-surface));
}
.att-theme-half_day {
    border-color: rgba(245, 158, 11, .4);
    background: linear-gradient(180deg, rgba(245, 158, 11, .04), var(--bg-surface));
}
.att-theme-absent {
    border-color: rgba(239, 68, 68, .3);
}

.att-tracker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: 1.15rem;
    padding-bottom: .85rem;
    border-bottom: 1px solid var(--border);
}
.att-status-indicator {
    display: flex;
    align-items: center;
    gap: .65rem;
}
.att-date-pill {
    font-size: .8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.att-rules-tip {
    font-size: .82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: .4rem;
}

.att-trackers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.att-metric-box {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    padding: .9rem 1rem;
}
.att-metric-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .5rem;
}
.att-metric-title {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-primary);
}
.att-metric-score {
    font-size: .8rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
}
.att-metric-score.is-met {
    color: #10b981;
    font-weight: 700;
}
.att-metric-score.is-pending {
    color: #f59e0b;
}
.att-progress-bar-wrap {
    height: 9px;
    background: rgba(0,0,0,.08);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: .45rem;
}
.att-progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .4s ease;
}
.fill-success { background: linear-gradient(90deg, #10b981, #059669); }
.fill-warning { background: linear-gradient(90deg, #f59e0b, #d97706); }
.att-metric-hint {
    font-size: .78rem;
    font-weight: 500;
}

.att-tracker-footer {
    padding-top: .75rem;
    border-top: 1px dashed var(--border);
    font-size: .82rem;
    color: var(--text-secondary);
}

/* Filter Toolbar */
.att-filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    padding: .75rem 1rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.att-filter-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.form-select-sm {
    padding: .35rem .75rem;
    font-size: .85rem;
}

/* KPI Card Enhancements */
.kpi-sub-unit {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-muted);
}
.kpi-attendance {
    border-left: 4px solid #10b981;
}

/* Task Count Pills & Badges */
.task-count-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .65rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    white-space: nowrap;
}
.pill-att-full {
    background: rgba(16, 185, 129, .15);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, .4);
}
.pill-att-half {
    background: rgba(245, 158, 11, .15);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, .4);
}
.pill-att-absent {
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, .35);
}
.pill-done-badge {
    font-size: .75rem;
    font-weight: 600;
    opacity: .9;
}
.pill-success {
    background: rgba(16, 185, 129, .12);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, .3);
}
.pill-warning {
    background: rgba(245, 158, 11, .12);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, .3);
}
.pill-muted {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.eval-reason-text {
    font-size: .82rem;
    color: var(--text-secondary);
}

/* Timesheet Matrix Table */
.att-matrix-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    overflow: hidden;
}
.att-matrix-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}
.att-matrix-table {
    border-collapse: collapse;
    width: 100%;
    font-size: .8rem;
}
.att-matrix-table th,
.att-matrix-table td {
    padding: .45rem .3rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.matrix-sticky-col {
    position: sticky;
    left: 0;
    background: var(--bg-surface);
    z-index: 2;
    text-align: left !important;
    min-width: 140px;
    box-shadow: 2px 0 5px rgba(0,0,0,.04);
}
.matrix-sticky-right {
    position: sticky;
    right: 0;
    background: var(--bg-surface);
    z-index: 2;
    box-shadow: -2px 0 5px rgba(0,0,0,.04);
}
.user-cell-compact {
    display: flex;
    align-items: center;
    gap: .4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.supervisor-mini-avatar-sm {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--magenta));
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-name-text {
    font-weight: 600;
    color: var(--text-primary);
}
.col-day {
    min-width: 28px;
    max-width: 34px;
    padding: .35rem .15rem !important;
}
.col-sunday,
.col-friday {
    background: rgba(139, 92, 246, .04);
}
.col-friday .matrix-day-name {
    color: #8b5cf6;
    font-weight: 700;
}
.matrix-day-num {
    font-weight: 700;
    font-size: .78rem;
}
.matrix-day-name {
    font-size: .65rem;
    color: var(--text-muted);
}
.matrix-cell-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-size: .72rem;
    font-weight: 700;
    font-family: var(--font-mono);
    text-decoration: none;
    transition: transform .15s ease;
}
.matrix-cell-pill:hover {
    transform: scale(1.15);
}
.cell-full {
    background: #10b981;
    color: #ffffff;
}
.cell-half {
    background: #f59e0b;
    color: #ffffff;
}
.cell-weekoff {
    background: #8b5cf6;
    color: #ffffff;
}
.cell-absent {
    background: rgba(239, 68, 68, .18);
    color: #dc2626;
}
.pill-att-weekoff {
    background: rgba(139, 92, 246, .12);
    color: #6d28d9;
    border-color: rgba(139, 92, 246, .35);
}
.cell-future {
    color: var(--text-muted);
    font-weight: 400;
}
.matrix-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .8rem;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--text-secondary);
}
.text-primary-unit {
    color: var(--accent);
    font-size: .92rem;
}
.text-weekend {
    color: #ef4444;
    font-weight: 600;
}

/* ── 37. Premium Attendance Rules Popup Modal ─────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem;
    overflow-y: auto;
    animation: fadeInModal .2s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes fadeInModal {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-rules-dialog {
    background: var(--bg-surface);
    border: 1px solid rgba(125,59,158,.25);
    border-radius: var(--radius-lg, 18px);
    box-shadow: 0 25px 70px -10px rgba(0,0,0,.45), 0 0 0 1px rgba(125,59,158,.15);
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 2.5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
    animation: slideUpModalPrem .25s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes slideUpModalPrem {
    from { opacity: 0; transform: scale(.96) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.rules-modal-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(125,59,158,.1), rgba(224,17,132,.04), var(--bg-surface));
}
.rules-modal-icon-badge {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(125,59,158,.2), rgba(224,17,132,.15));
    border: 1px solid rgba(125,59,158,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(125,59,158,.15);
}
.modal-title {
    margin: 0;
    font-size: 1.18rem;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text-primary);
}
.modal-subtitle {
    margin: .15rem 0 0 0;
    font-size: .82rem;
    color: var(--text-secondary);
}
.modal-close-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 1rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    flex-shrink: 0;
}
.modal-close-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
    transform: rotate(90deg) scale(1.05);
}

.rules-modal-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 1.25rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(125,59,158,.3) transparent;
}
.rules-modal-body::-webkit-scrollbar {
    width: 6px;
}
.rules-modal-body::-webkit-scrollbar-thumb {
    background: rgba(125,59,158,.3);
    border-radius: 999px;
}

/* 3-Pill Quick Summary Grid */
.rules-quick-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}
@media (max-width: 600px) {
    .rules-quick-grid { grid-template-columns: 1fr; }
}
.quick-pill-card {
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--border);
    padding: .75rem .9rem;
    background: var(--bg-elevated);
    display: flex;
    flex-direction: column;
    gap: .35rem;
    transition: transform .15s ease;
}
.quick-pill-card:hover {
    transform: translateY(-2px);
}
.quick-full { border-top: 3px solid #10b981; }
.quick-half { border-top: 3px solid #f59e0b; }
.quick-absent { border-top: 3px solid #ef4444; }

.quick-pill-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.quick-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.dot-full { background: #10b981; box-shadow: 0 0 6px rgba(16,185,129,.6); }
.dot-half { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.6); }
.dot-absent { background: #ef4444; }

.quick-pill-title {
    font-size: .85rem;
    color: var(--text-primary);
}
.quick-pill-credit {
    font-size: .75rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: .15rem .45rem;
    border-radius: 999px;
}
.quick-full .quick-pill-credit { background: rgba(16,185,129,.15); color: #059669; }
.quick-half .quick-pill-credit { background: rgba(245,158,11,.15); color: #d97706; }
.quick-absent .quick-pill-credit { background: rgba(239,68,68,.15); color: #dc2626; }
.quick-pill-req {
    font-size: .76rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Premium Rule Cards */
.prem-rule-card {
    border-radius: var(--radius-md, 14px);
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.03);
    transition: all .2s ease;
}
.prem-rule-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.06);
}
.prem-rule-full {
    border-left: 5px solid #10b981;
}
.prem-rule-half {
    border-left: 5px solid #f59e0b;
}
.prem-rule-absent {
    border-left: 5px solid #94a3b8;
}

.prem-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 1.15rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: .5rem;
}
.prem-tier-title {
    display: flex;
    align-items: center;
    gap: .65rem;
}
.prem-tier-icon {
    font-size: 1.1rem;
}
.prem-tier-title h4 {
    margin: 0;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text-primary);
}
.prem-tier-credit {
    font-size: .76rem;
    color: var(--text-muted);
    font-weight: 500;
}

.prem-status-chip {
    font-size: .74rem;
    font-weight: 700;
    padding: .25rem .65rem;
    border-radius: 999px;
    letter-spacing: .02em;
}
.chip-success {
    background: rgba(16,185,129,.14);
    color: #059669;
    border: 1px solid rgba(16,185,129,.3);
}
.chip-warning {
    background: rgba(245,158,11,.14);
    color: #b45309;
    border: 1px solid rgba(245,158,11,.3);
}
.chip-danger {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.prem-card-body {
    padding: 1rem 1.15rem;
}
.prem-rule-intro {
    font-size: .84rem;
    color: var(--text-primary);
    margin: 0 0 .85rem 0;
    line-height: 1.45;
}

/* Criteria Grid for Full Day */
.prem-criteria-grid {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .85rem;
}
@media (max-width: 540px) {
    .prem-criteria-grid { flex-direction: column; align-items: stretch; }
    .prem-criterion-divider { display: none; }
}
.prem-criterion-box {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid rgba(16,185,129,.25);
    border-radius: var(--radius-sm, 8px);
    padding: .75rem .9rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.crit-icon-tag {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #10b981;
    color: #ffffff;
    font-size: .8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.crit-content {
    display: flex;
    flex-direction: column;
}
.crit-label {
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .04em;
}
.crit-value {
    font-size: .95rem;
    color: #065f46;
    font-weight: 800;
    font-family: var(--font-mono);
}
.crit-hint {
    font-size: .72rem;
    color: var(--text-secondary);
}
.prem-criterion-divider {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-muted);
}

/* Criteria Stacked for Half Day */
.prem-criteria-grid-stacked {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: .85rem;
}
.prem-criterion-row {
    background: var(--bg-surface);
    border: 1px solid rgba(245,158,11,.25);
    border-radius: var(--radius-sm, 8px);
    padding: .6rem .85rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.crit-trigger-pill {
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .5rem;
    border-radius: 4px;
    white-space: nowrap;
}
.pill-warn {
    background: rgba(245,158,11,.15);
    color: #b45309;
    border: 1px solid rgba(245,158,11,.3);
}
.crit-row-text {
    font-size: .82rem;
    color: var(--text-primary);
}

/* Example Box */
.prem-example-box {
    background: var(--bg-surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm, 8px);
    padding: .75rem .95rem;
    font-size: .8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}
.example-tag {
    font-size: .7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: .04em;
    margin-bottom: .3rem;
}
.box-success .example-tag { color: #059669; }
.box-warning .example-tag { color: #d97706; }
.example-list {
    margin: 0;
    padding-left: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

/* Punch Callout */
.prem-punch-callout {
    background: linear-gradient(135deg, rgba(125,59,158,.08), rgba(59,130,246,.06));
    border: 1px solid rgba(125,59,158,.25);
    border-radius: var(--radius-md, 12px);
    padding: .85rem 1.15rem;
    display: flex;
    align-items: center;
    gap: .85rem;
}
.punch-callout-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}
.punch-callout-text {
    font-size: .82rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Modal Footer */
.rules-modal-footer {
    display: flex;
    justify-content: flex-end;
    padding: 1.1rem 1.75rem;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}
.btn-modal-done {
    padding: .75rem 1.6rem;
    font-size: .92rem;
    font-weight: 700;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(125,59,158,.25);
    transition: all .2s ease;
}
.btn-modal-done:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(125,59,158,.35);
}


/* ── 38. Employee Punch In / Punch Out Widget ─────────────────── */
.punch-widget {
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-elevated));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 14px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 18px rgba(0,0,0,.04), 0 0 0 1px rgba(125,59,158,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    transition: all var(--transition, .2s ease);
}
.punch-widget:hover {
    border-color: rgba(125,59,158,.25);
    box-shadow: 0 6px 24px rgba(125,59,158,.08);
}

.punch-widget-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.punch-clock-block {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 10px);
    padding: .65rem 1.15rem;
    text-align: center;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.02);
}
.punch-live-clock {
    font-size: 1.35rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
    letter-spacing: .02em;
    line-height: 1.2;
}
.punch-live-date {
    font-size: .75rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: .15rem;
}

.punch-info-block {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.punch-status-tag {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .88rem;
    font-weight: 700;
    width: fit-content;
}
.tag-not-punched {
    color: var(--text-secondary);
}
.tag-active {
    color: #10b981;
}
.tag-completed {
    color: #3b82f6;
}
.punch-status-desc {
    margin: 0;
    font-size: .83rem;
    color: var(--text-secondary);
}

.punch-pulse-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: punchPulse 1.8s infinite;
}
@keyframes punchPulse {
    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 7px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.punch-widget-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.btn-punch-in {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    padding: .85rem 1.6rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, .35);
    transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.btn-punch-in:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, .45);
    color: #ffffff;
}

.btn-punch-out {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    border: none;
    padding: .85rem 1.6rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    box-shadow: 0 4px 15px rgba(245, 158, 11, .35);
    transition: all .2s cubic-bezier(.16, 1, .3, 1);
}
.btn-punch-out:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, .45);
    color: #ffffff;
}

.btn-punch-done {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: .75rem 1.4rem;
    border-radius: 999px;
    font-size: .88rem;
    font-weight: 600;
    cursor: default;
}

/* Punch Badges in Tables */
.punch-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .2rem .6rem;
    border-radius: var(--radius-sm, 6px);
    font-size: .78rem;
    font-family: var(--font-mono);
    font-weight: 600;
    white-space: nowrap;
}
.punch-pill-active {
    background: rgba(16, 185, 129, .12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, .35);
}
.punch-live-text {
    font-weight: 700;
    font-size: .74rem;
}
.punch-pill-completed {
    background: rgba(59, 130, 246, .1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, .3);
}
.punch-hours-text {
    font-weight: 700;
    color: #2563eb;
}
.punch-pill-none {
    background: var(--bg-elevated);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ==========================================================================
   Dedicated Rules & Policy Page Styles
   ========================================================================== */
.rules-hero-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.75rem 2rem;
    background: linear-gradient(135deg, rgba(125, 59, 158, 0.08) 0%, rgba(224, 17, 132, 0.04) 100%), var(--bg-surface);
    border: 1px solid rgba(125, 59, 158, 0.2);
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
}
.rules-hero-icon-wrap {
    font-size: 2.75rem;
    width: 68px;
    height: 68px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(125, 59, 158, 0.1);
    border: 1px solid rgba(125, 59, 158, 0.25);
    flex-shrink: 0;
}
.rules-hero-content h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}
.rules-hero-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

.rules-section {
    margin-bottom: 2.5rem;
}
.rules-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.section-number-pill {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #7D3B9E;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(125, 59, 158, 0.35);
    flex-shrink: 0;
}
.rules-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.rules-section-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0.15rem 0 0 0;
}

/* Tier Cards Grid */
.rules-tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.25rem;
}
.tier-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.tier-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.08);
}
.tier-card.tier-full {
    border-color: rgba(16, 185, 129, 0.4);
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.03) 0%, var(--bg-surface) 30%);
}
.tier-card.tier-half {
    border-color: rgba(245, 158, 11, 0.4);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.03) 0%, var(--bg-surface) 30%);
}
.tier-card.tier-weekoff {
    border-color: rgba(139, 92, 246, 0.4);
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.03) 0%, var(--bg-surface) 30%);
}
.tier-card.tier-absent {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.02) 0%, var(--bg-surface) 30%);
}

.tier-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1rem;
}
.tier-badge-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.tier-badge-title h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}
.tier-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.dot-full    { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.6); }
.dot-half    { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.6); }
.dot-weekoff { background: #8b5cf6; box-shadow: 0 0 8px rgba(139, 92, 246, 0.6); }
.dot-absent  { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }

.tier-credit-pill {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    white-space: nowrap;
}
.pill-full {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.pill-half {
    background: rgba(245, 158, 11, 0.15);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.pill-weekoff {
    background: rgba(139, 92, 246, 0.15);
    color: #6d28d9;
    border: 1px solid rgba(139, 92, 246, 0.4);
}
.pill-absent {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.tier-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    flex: 1;
}
.tier-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0;
}
.tier-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.tier-criterion {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--text-primary);
}
.crit-check {
    color: #10b981;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
}
.crit-warn {
    font-size: 0.95rem;
    flex-shrink: 0;
}
.crit-none {
    font-size: 0.85rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.tier-example {
    margin-top: auto;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.82rem;
    line-height: 1.45;
}
.box-success {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #065f46;
}
.box-warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #92400e;
}
.box-purple {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    color: #5b21b6;
}
.box-danger {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.22);
    color: #991b1b;
}

/* Policy Card & Grid */
.rules-policy-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 12px);
    padding: 1.75rem;
}
.policy-points-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.policy-point-box {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.policy-point-icon {
    font-size: 1.6rem;
    line-height: 1;
    flex-shrink: 0;
    padding: 0.5rem;
    border-radius: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}
.policy-point-box h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem 0;
}
.policy-point-box p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.policy-lead {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}
.cutoff-rules-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.cutoff-rule-item {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 0.85rem 1.15rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    font-size: 0.92rem;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}
.cutoff-badge {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: var(--radius-sm, 6px);
    background: #7D3B9E;
    color: #ffffff !important;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(125, 59, 158, 0.3);
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {
    .rules-hero-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .cutoff-rule-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ============================================================
   Camera Punch Modal & 5m Geofence Face Verification
   ============================================================ */
.cam-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(18, 10, 26, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1rem;
    animation: camFadeIn 0.25s ease-out;
}

@keyframes camFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.cam-modal-card {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-light, #d6c0e2);
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    box-shadow: 0 20px 40px rgba(41, 22, 47, 0.25), 0 0 0 1px rgba(125, 59, 158, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: camSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cam-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border, #e7daef);
    background: linear-gradient(135deg, rgba(125, 59, 158, 0.05) 0%, rgba(224, 17, 132, 0.03) 100%);
}

.cam-modal-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.2rem 0;
}

.cam-modal-subtitle {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.cam-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.cam-modal-close:hover {
    color: var(--red);
    background: var(--red-soft);
}

.cam-modal-body {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Geofence Status Strip */
.geofence-status-strip {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-elevated, #f5eef9);
    transition: all 0.3s ease;
}

.geofence-status-strip.status-success {
    background: rgba(47, 158, 100, 0.08);
    border-color: rgba(47, 158, 100, 0.35);
}

.geofence-status-strip.status-error {
    background: rgba(220, 91, 84, 0.08);
    border-color: rgba(220, 91, 84, 0.35);
}

.geofence-status-strip.status-warning {
    background: rgba(217, 138, 59, 0.08);
    border-color: rgba(217, 138, 59, 0.35);
}

.geo-status-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

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

.geo-status-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.geo-status-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.geo-status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.65rem;
    border-radius: 20px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.geo-status-badge.badge-success {
    background: #10b981;
    color: #ffffff;
}

.geo-status-badge.badge-danger {
    background: #ef4444;
    color: #ffffff;
}

.geo-status-badge.badge-warning {
    background: #f59e0b;
    color: #ffffff;
}

.geo-status-badge.badge-pending {
    background: #6366f1;
    color: #ffffff;
    animation: badgePulse 1.5s infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Viewfinder */
.cam-viewfinder-wrap {
    position: relative;
    width: 100%;
    height: 320px;
    background: #0f0714;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
}

.cam-video-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror view for natural selfie experience */
}

/* Face Reticle Overlay */
.face-target-reticle {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 0 9999px rgba(15, 7, 20, 0.45);
    pointer-events: none;
    transition: all 0.3s ease;
}

.face-target-reticle.reticle-matched {
    border-color: #10b981;
    border-style: solid;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.6), 0 0 0 9999px rgba(15, 7, 20, 0.45);
}

.face-target-reticle.reticle-mismatch {
    border-color: #ef4444;
    border-style: solid;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.6), 0 0 0 9999px rgba(15, 7, 20, 0.45);
}

.reticle-scanner-laser {
    position: absolute;
    top: 0;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e01184, #9c5fc0, transparent);
    box-shadow: 0 0 8px #e01184;
    animation: scannerScan 2s infinite ease-in-out;
}

@keyframes scannerScan {
    0% { top: 10%; opacity: 0.2; }
    50% { top: 90%; opacity: 1; }
    100% { top: 10%; opacity: 0.2; }
}

.face-live-badge {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 7, 20, 0.85);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    z-index: 10;
}

.face-live-badge.badge-matched {
    background: rgba(16, 185, 129, 0.9);
    border-color: #10b981;
}

.face-live-badge.badge-mismatch {
    background: rgba(239, 68, 68, 0.9);
    border-color: #ef4444;
}

.face-live-badge .pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    display: inline-block;
    animation: dotPulse 1s infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

.cam-modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border, #e7daef);
    background: var(--bg-surface);
}

.btn-punch-capture {
    background: linear-gradient(135deg, #7D3B9E 0%, #E01184 100%);
    color: #ffffff !important;
    border: none;
    font-weight: 700;
    padding: 0.65rem 1.5rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(125, 59, 158, 0.35);
    transition: all 0.2s ease;
}

.btn-punch-capture:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(125, 59, 158, 0.45);
}

.btn-punch-capture:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

/* Punch Audit Badges in Attendance Tables */
.punch-loc-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    background: rgba(47, 158, 100, 0.12);
    color: #2F9E64;
    border: 1px solid rgba(47, 158, 100, 0.25);
    margin-top: 0.25rem;
}

.punch-loc-pill.loc-far {
    background: rgba(220, 91, 84, 0.12);
    color: #DC5B54;
    border-color: rgba(220, 91, 84, 0.25);
}

.punch-photo-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    cursor: pointer;
    vertical-align: middle;
    transition: transform 0.2s ease;
}

.punch-photo-thumb:hover {
    transform: scale(1.2);
}

.btn-face-enroll {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--border-light);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-face-enroll:hover {
    background: var(--accent);
    color: #ffffff;
}

/* ── Modern Settings Toggle Switch & Settings Layout ──────────────── */
.settings-container {
    max-width: 820px;
    margin: 0 auto 3rem auto;
}

.settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(125,59,158,0.06);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    transition: border-color var(--transition);
}

.settings-card:hover {
    border-color: var(--border-light);
}

.settings-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.settings-card-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.toggle-group-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.toggle-control-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.25rem 1.4rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: all 0.25s ease;
}

.toggle-control-card.is-active {
    background: rgba(125, 59, 158, 0.04);
    border-color: rgba(125, 59, 158, 0.35);
}

.toggle-control-card.is-inactive {
    opacity: 0.85;
    background: var(--bg-base);
}

.toggle-info-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    flex: 1;
}

.toggle-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.toggle-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
}

.toggle-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.toggle-desc {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Custom CSS iOS-Style Toggle Switch */
.switch-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.switch-label {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 30px;
    margin: 0;
    cursor: pointer;
}

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

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 30px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.25);
}

.switch-label input:checked + .switch-slider {
    background: linear-gradient(135deg, var(--accent) 0%, var(--magenta) 100%);
}

.switch-label input:focus-visible + .switch-slider {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.switch-label input:checked + .switch-slider:before {
    transform: translateX(24px);
}

.toggle-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.badge-enforced {
    background: rgba(47, 158, 100, 0.14);
    color: #2F9E64;
    border: 1px solid rgba(47, 158, 100, 0.25);
}

.badge-bypassed {
    background: rgba(217, 138, 59, 0.14);
    color: #b45309;
    border: 1px solid rgba(217, 138, 59, 0.25);
}

.gps-config-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    margin-top: 1rem;
}

/* ── 36. Task Completion Modal & Mandatory Photo Upload ────────── */
.completion-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeInModal .2s ease-out forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.completion-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 45px -10px rgba(0,0,0,.35);
    overflow: hidden;
    animation: scaleInModal .25s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes scaleInModal {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.completion-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elevated);
}

.comp-header-title {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.comp-icon {
    font-size: 1.6rem;
}

.comp-header-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.comp-subtitle {
    font-size: .8rem;
    color: var(--text-muted);
    margin: .15rem 0 0;
}

.comp-close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: .3rem .5rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.comp-close-btn:hover {
    color: var(--text-primary);
    background: rgba(0,0,0,.06);
}

.comp-modal-body {
    padding: 1.5rem;
    max-height: 75vh;
    overflow-y: auto;
}

.comp-task-summary {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: .85rem 1rem;
    margin-bottom: 1rem;
    font-size: .85rem;
}

.comp-task-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: .75rem;
    background: var(--accent);
    color: #fff;
    padding: .15rem .5rem;
    border-radius: 4px;
    margin-bottom: .4rem;
}

.comp-task-site, .comp-task-desc {
    color: var(--text-secondary);
    line-height: 1.4;
}

.comp-task-desc {
    margin-top: .2rem;
}

.comp-alert {
    display: flex;
    gap: .65rem;
    padding: .75rem 1rem;
    border-radius: var(--radius-md);
    font-size: .82rem;
    line-height: 1.4;
    margin-bottom: 1.25rem;
}

.comp-alert--info {
    background: rgba(217, 138, 59, 0.12);
    border: 1px solid rgba(217, 138, 59, 0.3);
    color: #92400e;
}

.comp-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.comp-dropzone:hover, .comp-dropzone.is-dragover {
    border-color: var(--accent);
    background: rgba(125, 59, 158, 0.04);
}

.comp-file-input {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.comp-camera-icon {
    font-size: 2.2rem;
    margin-bottom: .5rem;
}

.comp-prompt-text strong {
    display: block;
    font-size: .95rem;
    color: var(--text-primary);
    margin-bottom: .2rem;
}

.comp-prompt-text span {
    font-size: .8rem;
    color: var(--text-muted);
}

.comp-camera-btn {
    margin-top: .85rem;
}

.comp-preview-wrap {
    animation: fadeInModal .2s ease-out;
}

.comp-img-container {
    position: relative;
    max-width: 240px;
    margin: 0 auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

.comp-img-container img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.comp-remove-photo {
    position: absolute;
    top: .4rem;
    right: .4rem;
    background: rgba(0,0,0,.65);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: .8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}

.comp-remove-photo:hover {
    background: #ef4444;
}

.comp-file-info {
    margin-top: .6rem;
    font-size: .8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.comp-error-msg {
    margin-top: .75rem;
    padding: .6rem .85rem;
    background: #fee2e2;
    border: 1px solid #f87171;
    color: #991b1b;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
}

.completion-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.btn-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.6s linear infinite;
    margin-right: .4rem;
    vertical-align: middle;
}

/* ── 37. Task Photo Thumbnails & Lightbox ────────────────────── */
.status-with-thumb {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: nowrap;
}

.status-photo-thumb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1.5px solid var(--accent);
    overflow: hidden;
    cursor: pointer;
    background: #000;
    padding: 0;
    flex-shrink: 0;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.status-photo-thumb:hover {
    transform: scale(1.22);
    box-shadow: 0 4px 14px rgba(125,59,158,0.4);
    border-color: #10b981;
    z-index: 5;
}

.status-mini-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.status-photo-thumb .thumb-zoom-icon {
    position: absolute;
    bottom: 0px;
    right: 0px;
    font-size: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border-top-left-radius: 3px;
    padding: 1px 2px;
    line-height: 1;
    pointer-events: none;
}

.task-photo-thumb {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .25rem .6rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-sm);
    color: #065f46;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    margin-top: .3rem;
}

.task-photo-thumb:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    transform: translateY(-1px);
}

.task-photo-badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--accent);
}

.photo-lightbox-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: fadeInModal .2s ease-out forwards;
}

.photo-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: #18181b;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,.18);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,.8);
    display: flex;
    flex-direction: column;
}

.photo-lightbox-close {
    position: absolute;
    top: .85rem;
    right: .85rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all .2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.photo-lightbox-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: rotate(90deg) scale(1.1);
}

.photo-lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #09090b;
    max-height: 72vh;
    overflow: hidden;
}

.photo-lightbox-img-wrap img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
}

.photo-lightbox-info {
    padding: 1rem 1.25rem;
    color: #e4e4e7;
    font-size: .88rem;
    background: #18181b;
    border-top: 1px solid rgba(255,255,255,.08);
}

.lightbox-title {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    margin-bottom: .25rem;
}

.lightbox-meta {
    color: #a1a1aa;
    font-size: .82rem;
}

/* ── 37. Nature of Task Badges & Auto-Assignment UI ─────────── */
.nature-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.2;
    background: var(--bg-base);
    border: 1px solid var(--border);
    white-space: nowrap;
    transition: all .15s ease;
}

.nature-auto-assign-pill {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: linear-gradient(135deg, rgba(125,59,158,.08), rgba(5,150,105,.06));
    border: 1px solid rgba(125,59,158,.25);
    border-radius: var(--radius-md, 8px);
    padding: .65rem .95rem;
    font-size: .84rem;
    color: var(--text-primary);
    animation: fadeIn .2s ease-in;
}

.assign-pill-icon {
    font-size: 1.15rem;
    color: var(--accent);
    flex-shrink: 0;
}

.assign-pill-text {
    line-height: 1.4;
}

.assign-pill-text strong {
    color: var(--text-primary);
}

/* ── Status Flow Locks ─────────────────────────────────────── */
.status-locked-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(148, 163, 184, 0.12);
    border: 1px dashed rgba(148, 163, 184, 0.4);
    border-radius: var(--radius-sm, 6px);
    padding: .4rem .75rem;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
}
.status-locked-chip small {
    font-size: .72rem;
    font-weight: normal;
    color: var(--text-muted);
}

.status-completed-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-sm, 6px);
    padding: .4rem .75rem;
    font-size: .82rem;
    font-weight: 700;
    color: #059669;
    user-select: none;
}
.status-completed-chip small {
    font-size: .72rem;
    font-weight: normal;
    color: #059669;
    opacity: .85;
}

.status-locked-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-size: .72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: .15rem .45rem;
    border-radius: var(--radius-sm, 4px);
}

/* ── Daily Reporting Card & Modals ──────────────────────────────────────── */
.daily-reporting-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-left: 5px solid var(--amber);
    border-radius: var(--radius-md, 8px);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0,0,0,0.03));
    transition: all var(--transition, 0.2s ease);
}

.daily-reporting-card.is-submitted {
    border-left-color: var(--green);
    background: #f0fdf4;
}

.daily-report-left {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.daily-report-icon-wrap {
    font-size: 1.75rem;
    line-height: 1;
    background: var(--bg-elevated);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.daily-report-header-line {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: .35rem;
}

.daily-report-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.daily-report-tag {
    font-size: .78rem;
    font-weight: 700;
    padding: .2rem .65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.daily-report-tag.tag-pending {
    background: var(--amber-soft);
    color: #b45309;
    border: 1px solid rgba(217, 138, 59, 0.4);
}

.daily-report-tag.tag-submitted {
    background: var(--green-soft);
    color: #15803d;
    border: 1px solid rgba(47, 158, 100, 0.4);
}

.daily-report-desc {
    font-size: .88rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

.btn-submit-report {
    font-weight: 700;
    padding: .65rem 1.25rem;
    white-space: nowrap;
}

/* Incompletion Reason Item List in Modal */
.incomp-task-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 50vh;
    overflow-y: auto;
    padding-right: .5rem;
}

.incomp-task-row {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    padding: .85rem 1rem;
}

.incomp-task-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .5rem;
}

.incomp-task-num {
    font-weight: 700;
    color: var(--accent);
    font-size: .85rem;
}

.incomp-task-desc {
    flex: 1;
    font-size: .9rem;
    color: var(--text-primary);
}

.incomp-input-group label {
    display: block;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: .25rem;
}

.incomp-reason-input.is-invalid {
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(220, 91, 84, 0.2);
}

.report-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    margin-top: .75rem;
}

.rep-stat-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm, 6px);
    padding: .75rem;
    text-align: center;
}

.rep-stat-val {
    display: block;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rep-stat-lbl {
    font-size: .75rem;
    color: var(--text-muted);
}

.entry-incomp-reason {
    font-size: .82rem;
    color: #b45309;
    background: rgba(217, 138, 59, 0.08);
    border-left: 3px solid var(--amber);
    padding: .35rem .6rem;
    border-radius: 4px;
    margin-top: .4rem;
}

.entry-incomp-missing {
    font-size: .82rem;
    color: var(--red);
    background: rgba(220, 91, 84, 0.08);
    border-left: 3px solid var(--red);
    padding: .35rem .6rem;
    border-radius: 4px;
    margin-top: .4rem;
}

/* ── Salary Calculator & Breakdown Styles ────────────────────────────────── */
.salary-control-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.salary-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.salary-input-col {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    min-width: 140px;
}

.salary-sim-col {
    flex: 1;
    min-width: 260px;
}

.salary-quick-input-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    position: relative;
}

.currency-prefix {
    position: absolute;
    left: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    font-size: .95rem;
}

.salary-input-box {
    padding-left: 1.75rem !important;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
}

.salary-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
    width: 100%;
    min-width: 0;
}

.salary-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    padding: 1.25rem 1.2rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition), box-shadow var(--transition);
    min-width: 0;
}

.salary-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.06));
}

.salary-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .35rem;
    margin-bottom: .5rem;
}

.salary-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.salary-tag {
    font-size: .72rem;
    font-weight: 700;
    padding: .15rem .5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.tag-base { background: var(--blue-soft); color: var(--blue); }
.tag-earned { background: rgba(125,59,158,0.12); color: var(--accent); }
.tag-bonus { background: var(--green-soft); color: var(--green); }
.tag-fine { background: var(--red-soft); color: var(--red); }
.tag-net { background: #fae8ff; color: #a21caf; border: 1px solid rgba(162, 28, 175, 0.3); }

.salary-val {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: .25rem 0;
    letter-spacing: -0.01em;
}

.salary-net-val {
    font-size: 1.75rem;
    color: var(--accent);
}

.salary-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.salary-sub {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .25rem;
    line-height: 1.35;
}

.salary-details-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    width: 100%;
    min-width: 0;
}

@media (max-width: 960px) {
    .salary-details-grid { grid-template-columns: 1fr; }
}

.salary-ledger-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    padding: 1.5rem;
    width: 100%;
    min-width: 0;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.04));
}

.salary-breakdown-table {
    width: 100%;
    margin-top: .75rem;
    border-collapse: separate;
    border-spacing: 0;
}

.salary-breakdown-table thead th {
    background: var(--bg-elevated);
    padding: .75rem .9rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.salary-breakdown-table thead th:first-child {
    border-top-left-radius: var(--radius-sm, 6px);
}

.salary-breakdown-table thead th:last-child {
    border-top-right-radius: var(--radius-sm, 6px);
}

.salary-breakdown-table td {
    padding: .85rem .9rem;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.salary-breakdown-table .table-sub-row td {
    font-size: .84rem;
    color: var(--text-secondary);
    border-bottom: 1px dashed var(--border);
    padding: .7rem .9rem;
}

.ledger-comp-name {
    font-weight: 600;
    color: var(--text-primary);
}

.ledger-comp-sub {
    font-size: .76rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
}

.ledger-sub-item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    padding-left: .35rem;
}

.ledger-branch {
    color: var(--text-muted);
    font-size: .95rem;
    line-height: 1.2;
    flex-shrink: 0;
}

.ledger-sub-title {
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ledger-unit-pill {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: .75rem;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.ledger-unit-pill.pill-success {
    background: var(--green-soft);
    border-color: rgba(47, 158, 100, 0.25);
    color: var(--green);
}

.ledger-unit-pill.pill-warning {
    background: var(--orange-soft);
    border-color: rgba(217, 138, 59, 0.25);
    color: var(--orange);
}

.ledger-unit-pill.pill-info {
    background: var(--blue-soft);
    border-color: rgba(93, 111, 209, 0.25);
    color: var(--blue);
}

.ledger-unit-pill.pill-danger {
    background: var(--red-soft);
    border-color: rgba(220, 91, 84, 0.25);
    color: var(--red);
}

.ledger-calc-rate {
    font-family: var(--font-mono);
    font-size: .78rem;
    color: var(--text-muted);
}

.ledger-amt-val {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ledger-amt-sub {
    font-family: var(--font-mono);
    font-size: .88rem;
    color: var(--text-primary);
}

.table-section-head-row td {
    background: var(--bg-elevated);
    font-weight: 700;
    font-size: .84rem;
    color: var(--green);
    padding: .65rem .9rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.table-section-head-row.head-penalties td {
    color: var(--red);
}

.table-highlight-row td {
    background: rgba(125, 59, 158, 0.05);
    border-top: 1.5px solid rgba(125, 59, 158, 0.2);
    border-bottom: 1.5px solid rgba(125, 59, 158, 0.2);
    padding: .85rem .9rem;
}

.table-total-row td {
    background: linear-gradient(135deg, rgba(250, 232, 255, 0.65) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-top: 2px solid var(--accent) !important;
    border-bottom: 2px solid var(--accent) !important;
    padding: 1.1rem .9rem;
}

.ledger-net-total-display {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.01em;
}

.salary-side-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
    min-width: 0;
}

.compliance-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    padding: 1.25rem;
}

.compliance-box-head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
}

.compliance-icon {
    font-size: 1.75rem;
}

.compliance-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.compliance-sub {
    font-size: .78rem;
    color: var(--text-muted);
    margin: 0;
}

.compliance-stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm, 6px);
    padding: .75rem .5rem;
    text-align: center;
}

.comp-stat-val {
    display: block;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
}

.comp-stat-lbl {
    font-size: .7rem;
    color: var(--text-muted);
}

.unsubmitted-audit-list {
    margin-top: 1rem;
    font-size: .82rem;
}

.unsubmitted-audit-list h4 {
    font-size: .85rem;
    color: var(--red);
    margin-bottom: .4rem;
}

.unsubmitted-audit-list ul {
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.unsubmitted-audit-list li {
    background: rgba(220, 91, 84, 0.08);
    border-left: 3px solid var(--red);
    padding: .35rem .5rem;
    border-radius: 3px;
}

.salary-settings-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    padding: 1.25rem;
}

/* ── Reports & Analytics Tab Styles ──────────────────────────────────────── */
.report-nav-tabs {
    display: flex;
    align-items: center;
    gap: .5rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
    margin-top: .75rem;
    overflow-x: auto;
}

.report-tab-btn {
    padding: .65rem 1.25rem;
    font-weight: 600;
    font-size: .92rem;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: all var(--transition);
}

.report-tab-btn:hover {
    color: var(--accent);
}

.report-tab-btn.is-active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 700;
}

.charts-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 900px) {
    .charts-grid-2 { grid-template-columns: 1fr; }
}

.chart-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 8px);
    padding: 1.5rem;
}

.chart-header {
    margin-bottom: 1.25rem;
}

.chart-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.chart-sub {
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: .2rem;
}

.chart-canvas-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}

.table-row-active {
    background: rgba(125, 59, 158, 0.05);
}

/* ── Universal Responsive Polish for All Pages (Mobile & Tablet) ─────────── */
@media (max-width: 768px) {
    /* Responsive Content Area */
    .main-content {
        padding: 1rem .85rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: .85rem;
    }

    .header-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: .5rem;
    }

    .header-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
        text-align: center;
    }

    /* Form Grids Mobile Collapse */
    .form-grid-2,
    .form-grid-3,
    .form-grid-4,
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: .85rem;
    }

    /* Punch In/Out Widget Mobile Stack */
    .punch-widget {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1rem;
    }

    .punch-widget-left {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: .75rem;
        width: 100%;
    }

    .punch-clock-block {
        width: 100%;
    }

    .punch-widget-right {
        width: 100%;
        justify-content: center;
    }

    .btn-punch-in,
    .btn-punch-out,
    .btn-punch-done {
        width: 100%;
        justify-content: center;
        padding: .85rem;
    }

    /* Daily Reporting Card Mobile Stack */
    .daily-reporting-card {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1rem;
    }

    .daily-report-left {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem;
    }

    .daily-report-right {
        width: 100%;
    }

    .btn-submit-report,
    .btn-report-done {
        width: 100%;
        justify-content: center;
        padding: .75rem;
    }

    /* Attendance & KPI Tracker Grids */
    .att-trackers-grid,
    .rules-tier-grid,
    .policy-points-grid {
        grid-template-columns: 1fr !important;
    }

    .stats-strip,
    .stats-strip--4,
    .stats-strip--5 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: .5rem;
    }

    .stat-card {
        padding: .75rem .65rem;
    }

    .stat-number {
        font-size: 1.35rem;
    }

    .stat-label {
        font-size: .72rem;
    }

    /* Salary Calculator Mobile Stack */
    .salary-control-panel {
        padding: .85rem .75rem;
        margin-bottom: 1rem;
    }

    .salary-filter-form {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: .65rem;
        align-items: stretch;
    }

    .salary-input-col {
        width: 100%;
        min-width: 0;
    }

    /* When form has supervisor select, allow full row */
    .salary-filter-form .salary-input-col:first-child:has(select[name="supervisor_id"]) {
        grid-column: 1 / -1;
    }

    .salary-sim-col {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        margin-top: .2rem;
    }

    .salary-quick-input-wrap {
        width: 100%;
        display: flex;
        gap: .4rem;
    }

    .salary-quick-input-wrap .form-input {
        flex: 1;
        min-width: 0;
    }

    .salary-quick-input-wrap .btn {
        flex-shrink: 0;
        padding: .5rem .85rem;
        white-space: nowrap;
    }

    /* 2-column mobile KPI grid with full-width Net Take-Home Hero card */
    .salary-kpi-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: .65rem;
        margin-bottom: 1.25rem;
        width: 100%;
    }

    .salary-card {
        padding: .85rem .75rem;
    }

    .salary-card-head {
        margin-bottom: .3rem;
    }

    .salary-icon {
        font-size: 1.15rem;
    }

    .salary-tag {
        font-size: .65rem;
        padding: .12rem .4rem;
    }

    .salary-val {
        font-size: 1.25rem;
        margin: .15rem 0;
    }

    .salary-label {
        font-size: .78rem;
    }

    .salary-sub {
        font-size: .68rem;
    }

    .salary-kpi-grid .card-net {
        grid-column: 1 / -1;
        background: linear-gradient(135deg, rgba(250, 232, 255, 0.75) 0%, #ffffff 100%);
        border: 1.5px solid rgba(162, 28, 175, 0.4);
        box-shadow: 0 4px 14px rgba(162, 28, 175, 0.08);
        padding: 1.1rem 1rem;
    }

    .salary-kpi-grid .card-net .salary-net-val {
        font-size: 1.65rem;
    }

    .salary-details-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        width: 100%;
        min-width: 0;
    }

    .salary-ledger-card {
        padding: 1rem .75rem;
        width: 100%;
        min-width: 0;
    }

    .salary-breakdown-table {
        margin-top: .35rem;
    }

    .salary-breakdown-table thead th {
        padding: .6rem .65rem;
        font-size: .72rem;
    }

    .salary-breakdown-table td {
        padding: .65rem .65rem;
        font-size: .82rem;
    }

    .salary-breakdown-table .table-sub-row td {
        padding: .55rem .65rem;
        font-size: .78rem;
    }

    .ledger-sub-item {
        padding-left: 0;
        gap: .35rem;
    }

    .ledger-unit-pill {
        padding: .15rem .45rem;
        font-size: .7rem;
    }

    .ledger-net-total-display {
        font-size: 1.2rem;
    }

    .salary-side-col {
        gap: 1.25rem;
        width: 100%;
        min-width: 0;
    }

    .compliance-box,
    .salary-settings-card {
        padding: 1rem .85rem;
        width: 100%;
        min-width: 0;
    }

    /* Tables Mobile Touch Horizontal Scroll */
    .table-responsive,
    .all-payroll-table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1rem;
        border-radius: var(--radius-sm, 6px);
    }

    .table th,
    .table td {
        white-space: nowrap;
        padding: .55rem .65rem;
        font-size: .82rem;
    }

    /* Modals Responsive */
    .modal-box {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 90vh !important;
        padding: 1.25rem 1rem !important;
        margin: .5rem auto;
    }

    .modal-header {
        margin-bottom: .85rem;
    }

    .modal-footer {
        flex-direction: column-reverse;
        gap: .5rem;
    }

    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }

    /* Toolbar & Search row */
    .today-toolbar,
    .search-filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: .65rem;
    }

    .status-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: .35rem;
        -webkit-overflow-scrolling: touch;
    }

    .status-pill {
        flex-shrink: 0;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: .92rem;
    }

    .brand-logo {
        height: 28px;
    }

    .btn-logout-compact .lbl-signout {
        display: none;
    }

    .btn-logout-compact {
        padding: .35rem .45rem;
    }

    .stats-strip,
    .stats-strip--4,
    .stats-strip--5 {
        grid-template-columns: 1fr !important;
    }

    .report-stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-canvas-wrap {
        height: 240px;
    }
}

/* ── 38. Material Source Auto-Fill Badge & Highlighting ───────── */
.autofill-hint-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .35rem;
    padding: .2rem .55rem;
    background: linear-gradient(135deg, rgba(5,150,105,.12), rgba(125,59,158,.08));
    border: 1px solid rgba(5,150,105,.3);
    border-radius: var(--radius-sm);
    color: #059669;
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.2;
    animation: fadeInModal .2s ease-out;
}

.autofill-hint-pill strong {
    color: var(--text-primary);
    font-weight: 700;
}

.autofill-hint-sub {
    color: var(--text-muted);
    font-size: .7rem;
}

.input-autofill-flash {
    border-color: #059669 !important;
    box-shadow: 0 0 0 3px rgba(5,150,105,.18) !important;
    transition: all .2s ease;
}

/* ── Live Sync Floating Pill ──────────────────────────────────────────────── */
.live-sync-pill {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .9rem;
    background: #FFFFFF;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill, 9999px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    font-size: .82rem;
    font-weight: 500;
    animation: liveSyncSlideIn .25s ease-out;
}

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

.live-sync-indicator {
    display: inline-block;
    font-size: .65rem;
    animation: liveSyncPulse 2s infinite ease-in-out;
}

@keyframes liveSyncPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50%      { transform: scale(1.3); opacity: 1; }
}

.live-sync-btn {
    background: var(--accent, #7D3B9E);
    color: #FFFFFF;
    border: none;
    padding: .25rem .65rem;
    border-radius: var(--radius-pill, 9999px);
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}

.live-sync-btn:hover {
    background: var(--accent-hover, #632F80);
}

.live-sync-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: .85rem;
    cursor: pointer;
    padding: 0 .2rem;
    line-height: 1;
}

.live-sync-close:hover {
    color: var(--text-primary);
}

/* ============================================================
   ERP & Excel Design Enhancements
   ============================================================ */

/* ── Priority Badges ───────────────────────────────────────── */
.badge-priority-low    { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; font-weight: 600; }
.badge-priority-mid    { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; font-weight: 600; }
.badge-priority-high   { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; font-weight: 600; }
.badge-priority-urgent { background: #fee2e2; color: #b91c1c; border: 1px solid #fca5a5; font-weight: 700; animation: pulseUrgent 2s infinite ease-in-out; }

@keyframes pulseUrgent {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.05); }
}

/* ── Full-Width Excel Stretch Layout ───────────────────────── */
.page-container--wide {
    max-width: 99vw !important;
    width: 98.5% !important;
    margin: 0 auto;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.table-excel {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.75pt;
}

.table-excel th {
    background: #f8fafc;
    color: #334155;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 8pt;
    letter-spacing: 0.03em;
    padding: 0.45rem 0.5rem;
    border: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
    user-select: none;
    cursor: pointer;
}

.table-excel th:hover {
    background: #f1f5f9;
}

.table-excel th.sort-asc::after { content: ' ▲'; font-size: 0.65rem; color: var(--accent); }
.table-excel th.sort-desc::after { content: ' ▼'; font-size: 0.65rem; color: var(--accent); }

.table-excel td {
    padding: 0.4rem 0.5rem;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
}

.table-excel tr:nth-child(even) td {
    background: #fafafa;
}

.table-excel tr:hover td {
    background: #f5f3ff !important;
}

.col-sno {
    width: 45px;
    text-align: center;
    font-weight: 600;
    color: #64748b;
    font-family: var(--font-mono);
}

/* ── Multi-select Filters Bar ──────────────────────────────── */
.filter-bar-excel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.filter-chip-group {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.filter-chip-group label {
    font-size: 7.75pt;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
}

/* ── Notification Bell & Drawer ────────────────────────────── */
.nav-notif-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-notif-btn {
    background: rgba(125,59,158,.08);
    border: 1px solid rgba(125,59,158,.15);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    transition: all 0.2s ease;
}

.nav-notif-btn:hover {
    background: rgba(125,59,158,.15);
    transform: scale(1.05);
}

.notif-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #ffffff;
    animation: pulseBadge 2.5s infinite ease-in-out;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}

.notif-drawer {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: 90vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInDown 0.2s ease-out;
}

.notif-drawer.is-open {
    display: flex;
}

.notif-drawer-header {
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-drawer-title {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 9pt;
    color: #1e293b;
}

.notif-mark-all-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 8pt;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.notif-drawer-list {
    max-height: 380px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s ease;
    position: relative;
}

.notif-item.is-unread {
    background: #f5f3ff;
}

.notif-item:hover {
    background: #f8fafc;
}

.notif-item-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-weight: 700;
    font-size: 8.5pt;
    color: #1e293b;
    margin-bottom: 0.15rem;
}

.notif-item-msg {
    font-size: 8pt;
    color: #475569;
    line-height: 1.35;
    word-break: break-word;
}

.notif-item-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
}

.notif-item-time {
    font-size: 7.5pt;
    color: #94a3b8;
}

.notif-item-link {
    font-size: 7.75pt;
    color: var(--accent);
    font-weight: 600;
}

.notif-mark-read-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    align-self: center;
}

.notif-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
}

.notif-empty span {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.25rem;
}

/* ── Forced Update Modal ───────────────────────────────────── */
.forced-update-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.forced-update-card {
    background: #ffffff;
    border-radius: 12px;
    width: 480px;
    max-width: 92vw;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    border-top: 4px solid #f59e0b;
}

.forced-update-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.forced-icon {
    font-size: 2rem;
}

.forced-update-header h3 {
    font-size: 11pt;
    font-weight: 700;
    color: #1e293b;
}

.forced-update-header p {
    font-size: 8pt;
    color: #64748b;
}

.forced-update-body {
    font-size: 8.75pt;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.forced-alert {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #92400e;
    font-size: 8pt;
}

.forced-update-footer {
    display: flex;
    justify-content: flex-end;
}

/* ── Combobox Cross Delete Button (x) ──────────────────────── */
.combobox-opt-delete {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    margin-left: auto;
    transition: all 0.15s ease;
}

.combobox-opt-delete:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* ============================================================
   EXCEL-LIKE BULK TASK ENTRY SYSTEM
   ============================================================ */
.bulk-entry-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 2.5rem;
}

.bulk-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    box-shadow: var(--shadow-xs, 0 1px 2px rgba(0,0,0,0.05));
}

.bulk-toolbar-left,
.bulk-toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.bulk-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 8.5pt;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    line-height: 1.2;
    text-decoration: none;
    user-select: none;
}

.bulk-btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
}

.bulk-btn-primary {
    background: var(--accent);
    color: #ffffff !important;
    border-color: var(--accent);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(125,59,158,0.25);
}

.bulk-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}

.bulk-btn-danger {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fff5f5;
}

.bulk-btn-danger:hover {
    background: #fee2e2;
    border-color: #ef4444;
}

.bulk-sheet-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: relative;
}

.bulk-table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    min-height: 280px;
    position: relative;
}

.bulk-excel-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-body);
    font-size: 9pt;
    color: var(--text-primary);
    table-layout: fixed;
}

.bulk-excel-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    font-size: 8pt;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-top: none;
    position: sticky;
    top: 0;
    z-index: 10;
    user-select: none;
    white-space: nowrap;
    text-align: left;
}

.bulk-excel-table thead th.th-center {
    text-align: center;
}

.bulk-excel-table tbody tr {
    transition: background 0.1s ease;
}

.bulk-excel-table tbody tr:hover {
    background: rgba(125, 59, 158, 0.025);
}

.bulk-excel-table tbody tr.row-selected {
    background: rgba(125, 59, 158, 0.08) !important;
}

.bulk-excel-table tbody tr.row-has-error {
    background: #fff8f8;
}

.bulk-excel-table td {
    padding: 2px 3px;
    border: 1px solid #e2e8f0;
    vertical-align: middle;
    font-size: 9pt;
    position: relative;
    background: inherit;
}

.bulk-excel-table td.cell-num {
    text-align: center;
    color: #64748b;
    font-weight: 600;
    font-size: 8.5pt;
    background: #f8fafc;
    user-select: none;
    width: 38px;
}

.bulk-excel-table td.cell-actions {
    text-align: center;
    white-space: nowrap;
    padding: 2px 4px;
}

/* In-cell form controls */
.bulk-cell-ctrl {
    width: 100%;
    font-family: var(--font-body);
    font-size: 9pt;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 4px 6px;
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.bulk-cell-ctrl:focus {
    background: #ffffff;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.bulk-cell-ctrl.cell-invalid {
    border-color: #ef4444 !important;
    background: #fef2f2 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.bulk-cell-textarea {
    resize: vertical;
    min-height: 32px;
    line-height: 1.35;
    font-family: var(--font-body);
}

.bulk-select {
    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='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 11px;
    padding-right: 18px;
}

/* Priority Cell Badges */
.bulk-priority-select {
    font-weight: 600;
    font-size: 8.5pt;
    border-radius: 4px;
}
.bulk-priority-select[data-val="Urgent"] { color: #b91c1c; font-weight: 700; }
.bulk-priority-select[data-val="High"]   { color: #c2410c; font-weight: 700; }
.bulk-priority-select[data-val="Mid"]    { color: #d97706; }
.bulk-priority-select[data-val="Low"]    { color: #4b5563; }

/* Site cell combobox styling */
.bulk-site-box {
    position: relative;
    display: flex;
    align-items: center;
}

.bulk-site-input {
    padding-right: 20px;
}

.bulk-site-clear {
    position: absolute;
    right: 4px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 11pt;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    display: none;
}

.bulk-site-box:hover .bulk-site-clear,
.bulk-site-box:focus-within .bulk-site-clear {
    display: block;
}

.bulk-site-clear:hover {
    color: #ef4444;
}

.bulk-suggestions-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    min-width: 200px;
    max-width: 280px;
    max-height: 200px;
    overflow-y: auto;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.bulk-sug-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    font-size: 8.5pt;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
}

.bulk-sug-item:last-child {
    border-bottom: none;
}

.bulk-sug-item:hover,
.bulk-sug-item.is-focused {
    background: var(--bg-hover);
    color: var(--accent);
}

.bulk-sug-item .sug-del-btn {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 9pt;
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 3px;
}

.bulk-site-picker-btn {
    position: absolute;
    right: 18px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 8pt;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.bulk-site-picker-btn:hover {
    color: var(--accent);
    background: var(--bg-hover);
}

.bulk-site-picker-popover {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    width: 280px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.16);
    z-index: 1000;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-picker-title {
    font-size: 8pt;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 4px;
}

.site-picker-steps {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.site-picker-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.site-picker-pill {
    font-size: 8pt;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: #f8fafc;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
}

.site-picker-pill:hover {
    background: var(--bg-hover);
    border-color: var(--accent-soft);
}

.site-picker-pill.is-selected {
    background: var(--accent) !important;
    color: #ffffff !important;
    border-color: var(--accent) !important;
}

.site-office-scroll {
    max-height: 120px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding-top: 2px;
}

.site-office-btn {
    font-size: 7.5pt;
    font-weight: 600;
    padding: 3px 2px;
    text-align: center;
    border-radius: 3px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.1s ease;
}

.site-office-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}

/* Multi-Associate Cell Popover */
.bulk-assoc-wrap {
    position: relative;
    width: 100%;
}

.bulk-assoc-btn {
    width: 100%;
    min-height: 30px;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 3px 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    font-size: 8.5pt;
    font-family: var(--font-body);
}

.bulk-assoc-btn:hover,
.bulk-assoc-btn:focus {
    background: #ffffff;
    border-color: var(--accent);
}

.bulk-assoc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: center;
    flex: 1;
    overflow: hidden;
}

.bulk-chip {
    display: inline-flex;
    align-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 7.5pt;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1.1;
    white-space: nowrap;
}

.bulk-chip-placeholder {
    color: #94a3b8;
    font-size: 8.5pt;
}

.bulk-assoc-popover {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    width: 230px;
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.14);
    z-index: 1000;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.bulk-assoc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 4px;
    font-size: 7.5pt;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
}

.bulk-assoc-header button {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 7.5pt;
    font-weight: 600;
}

.bulk-assoc-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bulk-assoc-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 5px;
    font-size: 8.5pt;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s ease;
}

.bulk-assoc-option:hover {
    background: var(--bg-hover);
}

.bulk-assoc-option input[type="checkbox"] {
    accent-color: var(--accent);
    cursor: pointer;
}

/* Row Action Buttons */
.row-act-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 9pt;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.row-act-btn:hover {
    color: var(--text-primary);
    background: #e2e8f0;
}

.row-act-btn.btn-del:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* Toast Notification for Excel Paste & Validation */
.bulk-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e293b;
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 8.5pt;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toastSlideUp 0.25s ease-out;
}

.bulk-toast.toast-success {
    background: #166534;
    border-left: 4px solid #22c55e;
}

.bulk-toast.toast-error {
    background: #991b1b;
    border-left: 4px solid #ef4444;
}

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


