/* ============================================
   BookMyCA Smart Attend — Design System v3
   ============================================ */

/* --- Tokens --- */
:root {
    --navy: #0B3C5D;
    --navy-deep: #072a42;
    --navy-light: #145580;
    --gold: #C8A951;
    --gold-light: #e6d49a;
    --accent: #27AE60;
    --accent-hover: #219a52;
    --danger: #E74C3C;
    --danger-hover: #c0392b;
    --bg: #F4F7F9;
    --bg-card: rgba(255, 255, 255, 0.82);
    --text: #1a1a2e;
    --text-muted: #6b7b8d;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 8px 32px rgba(11, 60, 93, 0.12);
    --shadow-lg: 0 20px 60px rgba(11, 60, 93, 0.18);
    --transition: 0.3s cubic-bezier(.4, 0, .2, 1);
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Reset --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============ SCREENS ============ */
.screen {
    display: none;
    min-height: 100vh;
    animation: fadeIn 0.45s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============ GLASS ============ */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* ============ MAIN GATE ============ */
.gate-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 80% 60% at 70% 20%, rgba(200,169,81,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(39,174,96,0.07) 0%, transparent 60%),
        linear-gradient(160deg, #0B3C5D 0%, #07243A 50%, #061C2E 100%);
    position: relative;
    overflow: hidden;
}

/* Subtle grid pattern overlay */
.gate-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.gate-bg::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(200,169,81,0.08) 0%, transparent 70%);
    bottom: -120px; left: -80px;
    animation: floatOrb 18s ease-in-out infinite reverse;
}

@keyframes floatOrb {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%       { transform: translate(20px, -20px) scale(1.08); }
}

.gate-card {
    width: 440px;
    max-width: 92vw;
    padding: 48px 40px;
    text-align: center;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,0.40), 0 0 0 1px rgba(200,169,81,0.08) inset;
}

.gate-card.narrow {
    width: 400px;
}

.gate-card h1 {
    font-size: 1.9rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.gold {
    color: var(--gold);
    display: block;
}

.gate-card .subtitle {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.78rem;
    margin-bottom: 32px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
}

.footer-tag {
    margin-top: 28px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.22);
    letter-spacing: 0.5px;
}

.logo-ring {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(145deg, #C8A951, #e6d49a);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
    box-shadow: 0 8px 28px rgba(200, 169, 81, 0.30);
}

.logo-ring.small {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.logo-icon {
    font-size: 1.9rem;
}

.logo-ring.small .logo-icon {
    font-size: 1.4rem;
}

/* Professional gate buttons */
.gate-card .btn.btn-primary {
    background: linear-gradient(135deg, #C8A951 0%, #D4B96A 100%);
    color: #0B3C5D;
    font-weight: 700;
    border: none;
    box-shadow: 0 4px 14px rgba(200,169,81,0.35);
}
.gate-card .btn.btn-primary:hover {
    background: linear-gradient(135deg, #D4B96A 0%, #E6CC80 100%);
    box-shadow: 0 6px 20px rgba(200,169,81,0.45);
    transform: translateY(-1px);
}
.gate-card .btn.btn-outline {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.85);
    border: 1px solid rgba(255,255,255,0.18);
    font-weight: 600;
}
.gate-card .btn.btn-outline:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.30);
    color: #fff;
    transform: translateY(-1px);
}

/* Divider line between buttons */
.gate-divider {
    display: flex; align-items: center; gap: 12px;
    margin: 8px 0;
}
.gate-divider::before, .gate-divider::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,0.10);
}
.gate-divider span {
    font-size: 11px; color: rgba(255,255,255,0.30);
    font-weight: 500; letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    padding: 12px 28px;
    width: 100%;
    margin-top: 10px;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--navy-light), var(--navy));
    box-shadow: 0 4px 18px rgba(11, 60, 93, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

.btn-outline:hover {
    background: var(--gold);
    color: var(--navy-deep);
}

.btn-outline-dark {
    background: transparent;
    border: 2px solid var(--navy);
    color: var(--navy);
}

.btn-outline-dark:hover {
    background: var(--navy);
    color: #fff;
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: #fff;
}

.btn-accent:hover {
    box-shadow: 0 4px 18px rgba(39, 174, 96, 0.35);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent), #2ecc71);
    color: #fff;
    font-size: 1.05rem;
}

.btn-success:hover {
    box-shadow: 0 6px 24px rgba(39, 174, 96, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-hover));
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 4px 18px rgba(231, 76, 60, 0.35);
}

.btn-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    padding: 10px;
}

.btn-ghost:hover {
    color: #fff;
}

.btn-ghost-dark {
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    padding: 10px;
}

.btn-ghost-dark:hover {
    color: var(--text);
}

.btn-nav {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    text-align: left;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    width: 100%;
    margin-top: 6px;
}

.btn-nav.active,
.btn-nav:hover {
    background: rgba(200, 169, 81, 0.15);
    color: var(--gold);
}

.btn-lg {
    height: 52px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    width: auto;
    margin-top: 0;
}

/* ============ LAYOUT: SPLIT ============ */
.layout-split {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 270px;
    min-width: 270px;
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-deep) 100%);
    padding: 36px 24px;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    margin-bottom: 40px;
}

.sidebar-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 10px;
}

.sidebar-brand h2 {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
}

.sidebar-back {
    margin-top: auto;
}

.admin-greeting {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-bottom: 24px;
    padding: 0 4px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.content-area {
    flex: 1;
    padding: 40px 48px;
    overflow-y: auto;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 24px;
}

.section-heading {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--navy);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============ SIDEBAR STEPS ============ */
.sidebar-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
}

.step.active {
    color: var(--gold);
    background: rgba(200, 169, 81, 0.1);
}

.step.done {
    color: var(--accent);
}

.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.step.active .step-num {
    background: var(--gold);
    color: var(--navy-deep);
}

.step.done .step-num {
    background: var(--accent);
    color: #fff;
}

/* ============ FORMS ============ */
.form-card {
    padding: 32px;
    max-width: 560px;
}

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

.form-input,
.form-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    border: 2px solid #e0e6ed;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    color: var(--text);
    background: #fff;
    transition: var(--transition);
    margin-bottom: 14px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.15);
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.12);
}

.form-select {
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7b8d' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 16px center;
    cursor: pointer;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

/* ===== PASSWORD EYE TOGGLE ===== */
.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.password-wrap .form-input {
    flex: 1;
    padding-right: 44px;
}
.eye-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 17px;
    padding: 2px 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
    user-select: none;
    line-height: 1;
}
.eye-btn:hover { opacity: 1; }
.eye-btn.open { opacity: 1; }

.gate-card .form-input {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    margin-bottom: 10px;
}

.gate-card .form-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.gate-card .form-input:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.12);
}

.otp-row {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.otp-field {
    width: 180px !important;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 14px;
    padding-left: 24px;
}

@keyframes formSuccess {
    0% {
        box-shadow: var(--shadow);
    }

    30% {
        box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.3), var(--shadow);
    }

    100% {
        box-shadow: var(--shadow);
    }
}

.form-card.success-flash {
    animation: formSuccess 0.8s ease;
}

/* ============ CHECK-IN STEPS ============ */
.checkin-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.checkin-step.active {
    display: block;
}

/* ============ CAMERA ============ */
.camera-card {
    max-width: 620px;
}

.camera-container {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    position: relative;
    margin-bottom: 16px;
}

.camera-container video,
.camera-container .snapshot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.location-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(11, 60, 93, 0.06);
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    word-break: break-word;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

/* Info badge for checkout */
.info-badge {
    padding: 12px 16px;
    background: rgba(39, 174, 96, 0.08);
    border-radius: var(--radius-xs);
    font-size: 0.85rem;
    color: var(--accent);
    margin-bottom: 14px;
    font-weight: 500;
    border-left: 3px solid var(--accent);
}

/* ============ STAFF GRID ============ */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.staff-card {
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid #e8ecf1;
    transition: var(--transition);
    position: relative;
}

.staff-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.staff-card.selected {
    border-color: var(--danger);
    background: rgba(231, 76, 60, 0.03);
    box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15);
}

.staff-card .emp-code {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.staff-card .emp-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 2px;
}

.staff-card .emp-dept {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.staff-card .emp-email {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
    word-break: break-all;
}

.staff-card .card-actions {
    display: flex;
    gap: 4px;
    position: absolute;
    top: 12px;
    right: 12px;
}

.staff-card .btn-card-action {
    background: transparent;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.35;
    transition: var(--transition);
    padding: 4px;
    border-radius: 4px;
}

.staff-card .btn-card-action:hover {
    opacity: 1;
}

.staff-card .btn-card-action.edit:hover {
    color: var(--navy);
    background: rgba(11, 60, 93, 0.08);
}

.staff-card .btn-card-action.delete:hover {
    color: var(--danger);
    background: rgba(231, 76, 60, 0.08);
}

/* ── Staff Avatar on Card ── */
.staff-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}
.staff-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #38BDF8;
    display: block;
}
.staff-avatar-initials {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0F172A, #1E293B);
    color: #38BDF8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
}
/* ── Docs Button ── */
.staff-card .btn-card-action.docs:hover {
    color: #2563EB;
    background: rgba(37,99,235,0.08);
}

/* ── Staff Documents Modal ── */
.doc-item-card {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 16px 18px;
}
.doc-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.doc-item-title {
    font-weight: 700;
    font-size: .95rem;
    color: #0F172A;
}
.doc-item-sub {
    font-size: .75rem;
    margin-top: 2px;
}
.doc-preview-area {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 36px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.doc-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.doc-file-input {
    flex: 1;
    font-size: .8rem;
    border: 1px dashed #CBD5E1;
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
    cursor: pointer;
    min-width: 0;
}
.doc-view-btn {
    display: inline-block;
    padding: 4px 14px;
    background: #0F172A;
    color: #fff !important;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s;
    white-space: nowrap;
}
.doc-view-btn:hover { background: #1E293B; }


.staff-card .card-checkbox {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    accent-color: var(--danger);
    cursor: pointer;
}

/* ============ STAFF TOOLBAR ============ */
.staff-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 32px 0 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    background: var(--navy);
    color: #fff;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--navy);
    cursor: pointer;
}

/* ============ BULK / EXCEL SECTION ============ */
.bulk-section {
    padding: 28px 32px;
    margin-top: 20px;
    max-width: 560px;
}

.bulk-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 16px;
}

.bulk-actions-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.drop-zone {
    border: 2px dashed #c8cfd8;
    border-radius: var(--radius-sm);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--gold);
    background: rgba(200, 169, 81, 0.04);
    box-shadow: 0 0 0 3px rgba(200, 169, 81, 0.1);
}

.drop-zone.drag-over {
    background: rgba(200, 169, 81, 0.08);
}

.drop-zone-content {
    pointer-events: none;
}

.drop-icon {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 8px;
}

.drop-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
}

.drop-sub {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============ EDIT MODAL ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 42, 66, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

.modal-card {
    width: 440px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px 32px;
    background: #ffffff !important;
    border: 1px solid #e0e6ed;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    /* Force all text dark — overrides dark-theme CSS var inheritance */
    color: #1a1a2e !important;
}

/* All inputs/labels inside any white modal — force readable dark text */
.modal-card .form-input,
.modal-card .form-select,
.modal-card input:not([type="hidden"]):not([type="checkbox"]),
.modal-card select,
.modal-card textarea {
    color: #1a1a2e !important;
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
}
.modal-card .form-input:focus,
.modal-card .form-select:focus,
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus {
    border-color: #C8A84C !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(200,168,76,0.15) !important;
    outline: none !important;
}
.modal-card .form-input::placeholder,
.modal-card input::placeholder {
    color: #94a3b8 !important;
    opacity: 1 !important;
}
.modal-card .form-label,
.modal-card label {
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 0.78rem !important;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0F172A !important;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.modal-actions .btn {
    flex: 1;
}

/* ============ SETTINGS ============ */
.settings-card {
    max-width: 480px;
}

.setting-note {
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ============ REPORTS TAB ============ */
.report-toolbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 28px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.late-label {
    color: var(--danger);
}

.report-toolbar .btn {
    width: auto;
    margin-top: 0;
    margin-left: auto;
}

.table-wrapper {
    overflow-x: auto;
}

.att-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
}

.att-table thead th {
    background: var(--navy);
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.att-table thead th:first-child {
    border-radius: var(--radius-xs) 0 0 0;
}

.att-table thead th:last-child {
    border-radius: 0 var(--radius-xs) 0 0;
}

.att-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    vertical-align: middle;
    color: var(--txt, #E8EFF7);
}

.att-table tbody tr:hover {
    background: rgba(200, 169, 81, 0.05);
}

.att-table .thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    border: 2px solid #e0e6ed;
}

.empty-msg {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-ontime {
    background: rgba(39, 174, 96, 0.12);
    color: var(--accent);
}

.badge-late {
    background: rgba(231, 76, 60, 0.12);
    color: var(--danger);
}

.badge-in {
    background: rgba(11, 60, 93, 0.1);
    color: var(--navy);
}

.badge-out {
    background: rgba(200, 169, 81, 0.15);
    color: #8a7030;
}

/* Coords link */
.coords-link {
    font-size: 0.72rem;
    color: var(--navy-light);
    text-decoration: none;
}

.coords-link:hover {
    text-decoration: underline;
    color: var(--navy);
}

/* ============ TABS ============ */
.tab-panel {
    display: none;
    animation: fadeIn 0.35s ease;
}

.tab-panel.active {
    display: block;
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    min-width: 300px;
    max-width: 440px;
    padding: 16px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 500;
    color: #fff;
    z-index: 99999; /* Above bottom nav (z-50) and all modals */
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, var(--accent), #2ecc71);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger), var(--danger-hover));
}

.toast.info {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
}

.toast.warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .layout-split {
        flex-direction: column;
    }

    /* Admin sidebar: hidden by default on mobile, toggled via JS */
    #screen-admin-portal .sidebar {
        display: none;
        width: 100%;
        min-width: 100%;
        max-height: 60vh;
        overflow-y: auto;
    }

    .sidebar {
        width: 100%;
        min-width: 100%;
        flex-direction: row;
        padding: 16px 20px;
        align-items: center;
        gap: 16px;
        overflow-x: auto;
    }

    .sidebar-brand h2 {
        font-size: 1rem;
    }

    .sidebar-steps {
        flex-direction: row;
    }

    .sidebar-back {
        margin-top: 0;
        margin-left: auto;
    }

    .sidebar-nav {
        flex-direction: row;
    }

    .content-area {
        padding: 24px 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .report-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .report-toolbar .btn {
        margin-left: 0;
        width: 100%;
    }

    .admin-greeting {
        display: none;
    }

    .bulk-section {
        max-width: 100%;
    }

    .staff-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-card {
        padding: 24px 20px;
    }

    .settings-card {
        max-width: 100%;
    }

    .dash-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .filter-bar {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .emp-info-sidebar {
        display: none;
    }

    .sidebar-actions {
        flex-direction: row;
    }

    .sidebar-btn {
        width: auto;
        flex: 1;
    }
}

/* ============ DASHBOARD ============ */
.dash-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.dash-stat-card {
    background: var(--surface, #1e2d3d);
    border-radius: var(--radius-sm);
    padding: 20px 16px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    transition: var(--transition);
}

.dash-stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    background: var(--surface2, #243548);
}

.dash-stat-card.present { border-left: 4px solid var(--accent); }
.dash-stat-card.absent { border-left: 4px solid var(--danger); }
.dash-stat-card.late { border-left: 4px solid #f39c12; }
.dash-stat-card.ontime { border-left: 4px solid #22c55e; }
.dash-stat-card.leave-stat { border-left: 4px solid #a855f7; }
.dash-stat-card.hours { border-left: 4px solid #38bdf8; }
.dash-stat-card.pending { border-left: 4px solid #f97316; }

.dash-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
}

.dash-label {
    display: block;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 6px;
    font-weight: 600;
}

/* ============ CHARTS ============ */
.charts-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.chart-card {
    padding: 24px;
}

.chart-card h3,
.form-card h3,
.form-card h2,
.glass h3,
.glass h2 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    height: 260px;
}

.chart-container.small {
    height: 220px;
}

/* ============ FILTER BAR ============ */
.filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 20px 24px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 4px;
}

.filter-group .form-input,
.filter-group .form-select {
    margin-bottom: 0;
    height: 38px;
    font-size: 0.82rem;
}

.filter-bar .btn {
    height: 38px;
    margin-top: 0;
}

/* ============ PAYROLL EXPORT ============ */
.payroll-export {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.payroll-export .form-input {
    margin-bottom: 0;
    height: 38px;
    width: 160px;
    font-size: 0.82rem;
}

/* ============ LEAVE CARDS ============ */
.leaves-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leave-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--surface, #1e2d3d);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border, rgba(255,255,255,.08));
    color: inherit;
    transition: var(--transition);
    gap: 16px;
}

.leave-card:hover {
    box-shadow: var(--shadow, 0 4px 16px rgba(0,0,0,.25));
    border-color: var(--gold, rgba(201,168,76,.4));
}

.leave-card.pending  { border-left: 4px solid #f39c12; }
.leave-card.approved { border-left: 4px solid var(--accent); }
.leave-card.rejected { border-left: 4px solid var(--danger); }
.leave-info strong   { color: inherit; }
.leave-info small    { color: var(--text-muted, rgba(255,255,255,.5)); }

.leave-info {
    flex: 1;
    font-size: 0.9rem;
}

.leave-info small {
    color: var(--text-muted);
}

.leave-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.leave-actions small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.badge-pending { background: rgba(243, 156, 18, 0.12); color: #d68910; }
.badge-approved { background: rgba(39, 174, 96, 0.12); color: var(--accent); }
.badge-rejected { background: rgba(231, 76, 60, 0.12); color: var(--danger); }
.badge-absent { background: rgba(231, 76, 60, 0.1); color: var(--danger); }
.badge-role { background: rgba(200, 169, 81, 0.15); color: #8a7030; font-size: 0.65rem; margin-left: 6px; vertical-align: middle; }

/* ============ SHIFT MANAGEMENT ============ */
.shift-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 80px 40px;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-bottom: 1px solid #e8ecf1;
    margin-bottom: 8px;
}

.shift-card {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 80px 40px;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f3f6;
}

.shift-card .form-input {
    margin-bottom: 0;
    height: 36px;
    font-size: 0.82rem;
}

/* ============ EMPLOYEE SIDEBAR ============ */
.emp-info-sidebar {
    margin-bottom: 24px;
    padding: 0 4px;
}

.emp-info-sidebar p {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.emp-info-sidebar strong {
    color: rgba(255,255,255,0.85);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.sidebar-btn {
    width: 100%;
}

/* ============ TODAY STATUS BOX ============ */
.today-status-box {
    padding: 12px 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ============ OTP INFO ============ */
.otp-info {
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* ============ EMPLOYEE SHIFT TAG ============ */
.emp-shift {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ COORDS LINK ============ */
.coords-link {
    font-size: 0.72rem;
    color: var(--navy-light);
    text-decoration: none;
}

.coords-link:hover {
    text-decoration: underline;
    color: var(--navy);
}

/* ============ MODULE HUB ============ */
.module-hub {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 8px;
}

.module-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px 24px 22px;
    border-radius: 18px;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    height: 230px;
}

.module-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    opacity: 0;
    transition: opacity 0.3s;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
}

.module-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    text-decoration: none;
    color: #fff;
}

.module-card:hover::before {
    opacity: 1;
}

/* Card color themes */
.mc-tasks {
    background: linear-gradient(135deg, #0891B2 0%, #0E7490 50%, #155E75 100%);
}
.mc-clients {
    background: linear-gradient(135deg, #7C3AED 0%, #6D28D9 50%, #5B21B6 100%);
}
.mc-invoices {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 50%, #1E40AF 100%);
}
.mc-reports {
    background: linear-gradient(135deg, #059669 0%, #047857 50%, #065F46 100%);
}
.mc-agreements {
    background: linear-gradient(135deg, #D97706 0%, #B45309 50%, #92400E 100%);
}
.mc-portal {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 50%, #991B1B 100%);
}
.mc-attendance {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 40%, #334155 100%);
    border: 1px solid rgba(200,169,81,0.3);
}

/* ============ ATTENDANCE SUB-NAVIGATION ============ */
.att-sub-nav {
    display: flex;
    gap: 6px;
    padding: 6px;
    background: rgba(15,23,42,0.04);
    border-radius: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.att-sub-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #64748B;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.att-sub-btn:hover {
    background: rgba(15,23,42,0.06);
    color: #1E293B;
}

.att-sub-btn.active {
    background: var(--navy);
    color: #fff;
    box-shadow: 0 2px 8px rgba(15,23,42,0.25);
}

.att-sub-panel {
    animation: fadeIn 0.3s ease;
}
/* Icon ring */
.mc-icon-ring {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 14px;
    transition: transform 0.3s;
}

.module-card:hover .mc-icon-ring {
    transform: scale(1.12) rotate(-4deg);
}

/* Info section */
.mc-info {
    flex: 1;
    z-index: 2;
}

.mc-info h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.mc-info p {
    font-size: 0.78rem;
    opacity: 0.8;
    margin: 0;
    line-height: 1.4;
}

/* Stats row */
.mc-stats {
    display: flex;
    gap: 16px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.mc-stat {
    display: flex;
    flex-direction: column;
}

.mc-stat-val {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.mc-stat-lbl {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.75;
    font-weight: 600;
}

/* Arrow indicator */
.mc-arrow {
    position: absolute;
    top: 24px;
    right: 20px;
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.4;
    transition: all 0.3s;
}

.module-card:hover .mc-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* Responsive: 2 cols on tablet, 1 col on mobile */
@media (max-width: 1024px) {
    .module-hub {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .module-hub {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .module-card {
        min-height: 140px;
        padding: 20px 18px;
    }
}

/* ============================================================
   ATTENDANCE MODULE — DARK THEME BRIGHTNESS FIX
   Problem: .form-input has background:#fff but color:var(--text)
   which in dark theme = #E8EFF7 (near-white) → white text on
   white input = invisible. Fix by making inputs dark-themed
   inside .glass cards.
   ============================================================ */

/* Labels inside glass cards — make bright & readable */
.glass .form-label,
.form-card.glass .form-label {
    color: #94B4CC;
    font-weight: 700;
    letter-spacing: 0.6px;
}

/* Inputs & selects inside glass cards — dark bg + bright text */
.glass .form-input,
.glass .form-select,
.form-card.glass .form-input,
.form-card.glass .form-select {
    background: rgba(255, 255, 255, 0.08);
    color: #E8EFF7;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
}

.glass .form-input:focus,
.glass .form-select:focus,
.form-card.glass .form-input:focus,
.form-card.glass .form-select:focus {
    background: rgba(255, 255, 255, 0.13);
    border-color: #C9A84C;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
}

.glass .form-input::placeholder,
.form-card.glass .form-input::placeholder {
    color: rgba(232, 239, 247, 0.35);
}

/* Shift card inputs specifically */
.shift-card .form-input {
    background: rgba(255, 255, 255, 0.08);
    color: #E8EFF7;
    border-color: rgba(255, 255, 255, 0.16);
}

/* Shift header labels */
.shift-header {
    color: #94B4CC !important;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* Holiday calendar items in dark card */
.glass #holidays-list input,
.form-card.glass #holidays-list input {
    background: rgba(255, 255, 255, 0.08);
    color: #E8EFF7;
    border-color: rgba(255, 255, 255, 0.15);
}

/* Attendance log table — brighter cell text */
.att-table tbody td {
    color: #D4E3F0 !important;
    font-weight: 500;
}
.att-table tbody td strong,
.att-table tbody td b {
    color: #FFFFFF;
}

/* Filter bar labels in attendance */
.filter-group label {
    color: #94B4CC !important;
}
.filter-group .form-input,
.filter-group .form-select {
    background: rgba(255, 255, 255, 0.08);
    color: #E8EFF7;
    border-color: rgba(255, 255, 255, 0.16);
}

/* Settings card paragraph text */
.form-card.glass p,
.glass p {
    color: #94B4CC;
}
}