/* =============================================================
 * DIGITAL INVITATION SYSTEM — Premium Design System
 * Version: 2.0 | Standards: WCAG 2.1, ISO 9241
 * =============================================================
 *
 * TABLE OF CONTENTS:
 * 1. Design Tokens (CSS Variables)
 * 2. Global Resets & Base
 * 3. Typography
 * 4. Sidebar & Navigation
 * 5. Topbar
 * 6. Cards & Glass Morphism
 * 7. Stat Cards
 * 8. Buttons & Forms
 * 9. Tables
 * 10. Badges & Tags
 * 11. Progress Bars
 * 12. Toast Notifications
 * 13. QR Scanner UI
 * 14. Scan Result Cards
 * 15. Animations & Keyframes
 * 16. Public Pages
 * 17. Skeleton Loaders
 * 18. Responsive Utilities
 * ============================================================= */

/* ─────────────────────────────────────────────────────────────
 * 1. DESIGN TOKENS
 * ───────────────────────────────────────────────────────────── */
:root {
    /* Core Palette - Antigravity Indigo & Violet */
    --brand-50: #f5f7ff;
    --brand-100: #ebf0ff;
    --brand-400: #818cf8;
    --brand-500: #6366f1;
    /* Indigo */
    --brand-600: #4f46e5;
    --brand-700: #4338ca;
    --brand-900: #312e81;

    /* Neutral Dark - Antigravity Obsidian & Deep Charcoal */
    --bg-base: #0e0f12;
    --bg-surface: #17181f;
    --bg-elevated: #1e202b;
    --bg-card: #17181f;
    --bg-hover: #232530;
    --bg-input: #0b0c0e;

    /* Borders - Soft Slate & Indigo highlights */
    --border-subtle: rgba(255, 255, 255, 0.04);
    --border-dim: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(99, 102, 241, 0.25);

    /* Text - Optimized for dark mode comfort */
    --text-primary: #cbd5e1;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #818cf8;

    /* Semantic Colors */
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.08);
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --info-400: #38bdf8;
    --info-500: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.08);

    /* Gradients - Premium Indigo to Purple gradients */
    --gradient-brand: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-danger: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    --gradient-card: linear-gradient(145deg, #17181f 0%, #111217 100%);
    --gradient-sidebar: linear-gradient(180deg, #0e0f12 0%, #17181f 100%);

    /* Shadows - Glowing Indigo accents */
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.45);
    --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.08);
    --shadow-success: 0 0 20px rgba(16, 185, 129, 0.15);
    --shadow-danger: 0 0 20px rgba(244, 63, 94, 0.15);

    /* Sidebar */
    --sidebar-width: 240px;
    --sidebar-width-mobile: 100%;

    /* Animation */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --dur-fast: 150ms;
    --dur-normal: 250ms;
    --dur-slow: 400ms;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --radius-2xl: 28px;
}

/* ─────────────────────────────────────────────────────────────
 * 2. GLOBAL RESETS & BASE
 * ───────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', 'Outfit', system-ui, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

body.admin-body {
    background:
        radial-gradient(ellipse 80% 40% at 10% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse 60% 30% at 90% 100%, rgba(168, 85, 247, 0.03) 0%, transparent 50%),
        var(--bg-base);
    background-attachment: fixed;
}

::selection {
    background: rgba(59, 130, 246, 0.3);
    color: var(--text-primary);
}

/* ─────────────────────────────────────────────────────────────
 * 3. TYPOGRAPHY
 * ───────────────────────────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 600;
    color: #656565;
    line-height: 1.3;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, var(--brand-400) 50%, var(--brand-500) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────
 * 4. SIDEBAR & NAVIGATION
 * ───────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gradient-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    top: 0;
    left: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    will-change: transform;
    transition: transform var(--dur-normal) var(--ease-smooth);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

.sidebar-brand-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.sidebar-brand-sub {
    font-size: 0.62rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}

/* Nav Section Labels */
.sidebar-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 16px 20px 6px;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition:
        color var(--dur-fast) var(--ease-smooth),
        background var(--dur-fast) var(--ease-smooth),
        border-color var(--dur-fast) var(--ease-smooth),
        padding-left var(--dur-fast) var(--ease-smooth);
    position: relative;
    margin: 1px 10px;
    border-radius: var(--radius-md);
}

.sidebar .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
    padding-left: 24px;
}

.sidebar .nav-link.active {
    color: var(--brand-400);
    background: rgba(212, 175, 55, 0.08);
    font-weight: 600;
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--gradient-brand);
    border-radius: 0 3px 3px 0;
}

.sidebar .nav-link .fa-solid,
.sidebar .nav-link .fa-regular {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* Sidebar User Profile */
.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
    margin-top: auto;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

/* ─────────────────────────────────────────────────────────────
 * 5. TOPBAR
 * ───────────────────────────────────────────────────────────── */
.topbar {
    background: rgba(14, 15, 18, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 900;
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.breadcrumb-nav .bc-sep {
    color: var(--border-accent);
}

.breadcrumb-nav .bc-current {
    color: var(--text-secondary);
    font-weight: 500;
}

.topbar-live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success-500);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(34, 197, 94, 0);
    }
}

/* ─────────────────────────────────────────────────────────────
 * 6. CARDS & GLASSMORPHISM
 * ───────────────────────────────────────────────────────────── */
.card-glass {
    background: var(--gradient-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow var(--dur-normal) var(--ease-smooth),
        transform var(--dur-normal) var(--ease-smooth),
        border-color var(--dur-normal) var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.card-glass::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.3), transparent);
}

.card-glass:hover {
    box-shadow: var(--shadow-card), var(--shadow-glow);
    border-color: var(--border-accent);
    transform: translateY(-1px);
}

.card-glass .card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-glass .card-body {
    padding: 20px;
}

/* Card Icon */
.card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
 * 7. STAT CARDS
 * ───────────────────────────────────────────────────────────── */
.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-xl);
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--dur-normal) var(--ease-smooth);
    cursor: default;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(96, 165, 250, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    border-color: var(--border-accent);
}

.stat-card.success:hover {
    box-shadow: var(--shadow-card), var(--shadow-success);
    border-color: rgba(34, 197, 94, 0.3);
}

.stat-card.danger:hover {
    box-shadow: var(--shadow-card), var(--shadow-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    transition: all var(--dur-normal) var(--ease-smooth);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-icon.brand {
    background: rgba(59, 130, 246, 0.15);
    color: var(--brand-400);
}

.stat-icon.success {
    background: var(--success-bg);
    color: var(--success-400);
}

.stat-icon.warning {
    background: var(--warning-bg);
    color: var(--warning-400);
}

.stat-icon.danger {
    background: var(--danger-bg);
    color: var(--danger-400);
}

.stat-icon.info {
    background: var(--info-bg);
    color: var(--info-400);
}

/* Animated count-up number */
.stat-value.updating {
    animation: value-flash var(--dur-slow) var(--ease-smooth);
}

@keyframes value-flash {
    0% {
        opacity: 0.4;
        transform: scale(0.96);
    }

    60% {
        opacity: 1;
        transform: scale(1.02);
    }

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

/* ─────────────────────────────────────────────────────────────
 * 8. BUTTONS & FORMS
 * ───────────────────────────────────────────────────────────── */
.btn {
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--dur-fast) var(--ease-smooth);
    font-size: 0.875rem;
    letter-spacing: 0.01em;
}

.btn-brand,
.btn-premium-primary {
    background: var(--gradient-brand);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.btn-brand:hover,
.btn-premium-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
    color: #fff;
}

.btn-brand:active,
.btn-premium-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-dim);
    color: var(--text-secondary);
    backdrop-filter: blur(8px);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-accent);
    color: var(--text-primary);
}

/* Form Inputs */
.form-control,
.form-select,
.input-group-text {
    background-color: var(--bg-input);
    border: 1px solid var(--border-dim);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-size: 0.875rem;
    color-scheme: dark;
    transition: border-color var(--dur-fast) var(--ease-smooth),
        box-shadow var(--dur-fast) var(--ease-smooth);
}

input[type="date"].custom-date-input {
    position: relative;
    color: transparent !important;
}

input[type="date"].custom-date-input::-webkit-datetime-edit {
    color: transparent !important;
}

input[type="date"].custom-date-input::before {
    content: attr(data-formatted-date);
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-primary);
    pointer-events: none;
    font-family: inherit;
    font-size: 0.875rem;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: brightness(0) invert(1);
    cursor: pointer;
    opacity: 0.9;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-input);
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    color: var(--text-primary);
    outline: none;
}

/* Allow input-groups to merge properly by targeting focus state on the group */
.input-group:focus-within .input-group-text {
    border-color: var(--brand-500);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────────────────────────
 * 9. TABLES
 * ───────────────────────────────────────────────────────────── */
.table-dark-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.table-dark-custom thead th {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-dim);
    white-space: nowrap;
}

.table-dark-custom tbody tr {
    transition: background var(--dur-fast) var(--ease-smooth);
    border-bottom: 1px solid var(--border-subtle);
}

.table-dark-custom tbody tr:hover {
    background: var(--bg-hover);
}

.table-dark-custom tbody td {
    padding: 13px 16px;
    color: var(--text-secondary);
    vertical-align: middle;
    border-bottom: 1px solid var(--border-subtle);
}

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

/* ─────────────────────────────────────────────────────────────
 * 10. BADGES & TAGS
 * ───────────────────────────────────────────────────────────── */
.badge-custom {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-success {
    background: var(--success-bg);
    color: var(--success-400);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-danger {
    background: var(--danger-bg);
    color: var(--danger-400);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning-400);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info-400);
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-brand {
    background: rgba(59, 130, 246, 0.12);
    color: var(--brand-400);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-muted {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.success {
    background: var(--success-500);
    box-shadow: 0 0 6px var(--success-500);
}

.status-dot.danger {
    background: var(--danger-500);
    box-shadow: 0 0 6px var(--danger-500);
}

.status-dot.warning {
    background: var(--warning-500);
    box-shadow: 0 0 6px var(--warning-500);
}

.status-dot.muted {
    background: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────
 * 11. PROGRESS BARS
 * ───────────────────────────────────────────────────────────── */
.progress-modern {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
}

.progress-modern .fill {
    height: 100%;
    border-radius: 999px;
    background: var(--gradient-brand);
    transition: width 0.8s var(--ease-smooth);
    position: relative;
}

.progress-modern .fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 12px;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    filter: blur(4px);
}

.progress-modern .fill.success {
    background: var(--gradient-success);
}

/* ─────────────────────────────────────────────────────────────
 * 12. TOAST NOTIFICATIONS
 * ───────────────────────────────────────────────────────────── */
.toast-container-custom {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-custom {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border-dim);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    min-width: 280px;
    max-width: 360px;
    animation: toast-in var(--dur-slow) var(--ease-spring) forwards;
}

.toast-custom.dismissing {
    animation: toast-out var(--dur-normal) var(--ease-smooth) forwards;
}

.toast-custom.success {
    border-left: 3px solid var(--success-500);
}

.toast-custom.error {
    border-left: 3px solid var(--danger-500);
}

.toast-custom.warning {
    border-left: 3px solid var(--warning-500);
}

.toast-icon {
    font-size: 1.1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.toast-custom.success .toast-icon {
    color: var(--success-400);
}

.toast-custom.error .toast-icon {
    color: var(--danger-400);
}

.toast-custom.warning .toast-icon {
    color: var(--warning-400);
}

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

.toast-msg {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* ─────────────────────────────────────────────────────────────
 * 13. QR SCANNER UI
 * ───────────────────────────────────────────────────────────── */
.scanner-wrapper {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #000;
    aspect-ratio: 1;
    max-width: 320px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px var(--border-accent), var(--shadow-glow);
}

.scanner-corner {
    position: absolute;
    width: 28px;
    height: 28px;
    z-index: 10;
    pointer-events: none;
}

.scanner-corner::before,
.scanner-corner::after {
    content: '';
    position: absolute;
    background: var(--brand-400);
    border-radius: 2px;
}

.scanner-corner.tl {
    top: 10px;
    left: 10px;
}

.scanner-corner.tl::before {
    width: 3px;
    height: 100%;
    top: 0;
    left: 0;
}

.scanner-corner.tl::after {
    width: 100%;
    height: 3px;
    top: 0;
    left: 0;
}

.scanner-corner.tr {
    top: 10px;
    right: 10px;
}

.scanner-corner.tr::before {
    width: 3px;
    height: 100%;
    top: 0;
    right: 0;
}

.scanner-corner.tr::after {
    width: 100%;
    height: 3px;
    top: 0;
    right: 0;
}

.scanner-corner.bl {
    bottom: 10px;
    left: 10px;
}

.scanner-corner.bl::before {
    width: 3px;
    height: 100%;
    bottom: 0;
    left: 0;
}

.scanner-corner.bl::after {
    width: 100%;
    height: 3px;
    bottom: 0;
    left: 0;
}

.scanner-corner.br {
    bottom: 10px;
    right: 10px;
}

.scanner-corner.br::before {
    width: 3px;
    height: 100%;
    bottom: 0;
    right: 0;
}

.scanner-corner.br::after {
    width: 100%;
    height: 3px;
    bottom: 0;
    right: 0;
}

.scanner-line {
    position: absolute;
    left: 12px;
    right: 12px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brand-400), transparent);
    border-radius: 2px;
    box-shadow: 0 0 12px var(--brand-500);
    animation: scan-line 2.5s ease-in-out infinite;
    z-index: 9;
}

@keyframes scan-line {
    0% {
        top: 12%;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    95% {
        opacity: 1;
    }

    100% {
        top: 88%;
        opacity: 0;
    }
}

#qr-reader {
    width: 100% !important;
    border: none !important;
}

#qr-reader video {
    width: 100% !important;
    object-fit: cover;
    border-radius: 0;
}

#qr-reader__scan_region {
    border: none !important;
}

#qr-reader__dashboard {
    display: none !important;
}

/* ─────────────────────────────────────────────────────────────
 * 14. SCAN RESULT CARDS
 * ───────────────────────────────────────────────────────────── */
.scan-result-card {
    border-radius: var(--radius-xl);
    padding: 24px;
    position: relative;
    overflow: hidden;
    animation: result-slide-up var(--dur-slow) var(--ease-spring);
}

.scan-result-card.result-success {
    background: linear-gradient(145deg, rgba(5, 150, 105, 0.12), rgba(16, 185, 129, 0.06));
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: var(--shadow-success);
}

.scan-result-card.result-warning {
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.12), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.scan-result-card.result-error {
    background: linear-gradient(145deg, rgba(185, 28, 28, 0.12), rgba(239, 68, 68, 0.06));
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: var(--shadow-danger);
}

.result-badge-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 16px;
    animation: badge-pop 0.5s var(--ease-spring) 0.1s both;
}

.result-success .result-badge-icon {
    background: var(--success-bg);
    color: var(--success-400);
    box-shadow: var(--shadow-success);
}

.result-warning .result-badge-icon {
    background: var(--warning-bg);
    color: var(--warning-400);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
}

.result-error .result-badge-icon {
    background: var(--danger-bg);
    color: var(--danger-400);
    box-shadow: var(--shadow-danger);
}

.participant-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.info-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
}

.info-item-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.info-item-value {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 2px;
}

.stage-badge-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.stage-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.stage-chip.done {
    background: var(--success-bg);
    color: var(--success-400);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.stage-chip.await {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

@keyframes result-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

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

@keyframes badge-pop {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ─────────────────────────────────────────────────────────────
 * 15. ANIMATIONS & KEYFRAMES
 * ───────────────────────────────────────────────────────────── */
@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

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

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    from {
        background-position: -400px 0;
    }

    to {
        background-position: 400px 0;
    }
}

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

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.anim-fade-in {
    animation: fade-in var(--dur-slow) var(--ease-out) both;
}

.anim-slide-up {
    animation: slide-up var(--dur-slow) var(--ease-out) both;
}

.anim-scale-in {
    animation: scale-in var(--dur-slow) var(--ease-spring) both;
}

.anim-delay-1 {
    animation-delay: 50ms;
}

.anim-delay-2 {
    animation-delay: 100ms;
}

.anim-delay-3 {
    animation-delay: 150ms;
}

.anim-delay-4 {
    animation-delay: 200ms;
}

/* ─────────────────────────────────────────────────────────────
 * 16. PUBLIC PAGES (BRIGHT / LIGHT THEME)
 * ───────────────────────────────────────────────────────────── */
.public-body {
    background: linear-gradient(-45deg, #cbd5e1, #e2e8f0, #93c5fd, #c7d2fe);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    color: #1e293b;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Light Theme Overrides */
.public-body .text-muted {
    color: #64748b !important;
}

.public-body .text-secondary {
    color: #475569 !important;
}

.public-body .text-dark {
    color: #0f172a !important;
}

.public-body .text-light {
    color: #ffffff !important;
}

.public-body .text-white {
    color: #ffffff !important;
}

.public-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
}

.public-body .form-control,
.public-body .form-select {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

.public-body .form-control:focus,
.public-body .form-select:focus {
    background-color: #ffffff;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    color: #0f172a;
}

.public-body .form-control::placeholder {
    color: #94a3b8;
}

.public-hero {
    text-align: center;
    padding: 48px 20px 32px;
}

.public-hero-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-2xl);
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    margin: 0 auto 20px;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    animation: float 3s ease-in-out infinite;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 32px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid #cbd5e1;
    color: #64748b;
    background: #ffffff;
    transition: all var(--dur-normal) var(--ease-smooth);
    position: relative;
    z-index: 1;
}

.step-circle.active {
    border-color: var(--brand-500);
    background: rgba(59, 130, 246, 0.1);
    color: var(--brand-600);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.2);
}

.step-circle.done {
    border-color: var(--success-500);
    background: var(--success-bg);
    color: var(--success-600);
}

.step-line {
    height: 2px;
    width: 60px;
    background: #cbd5e1;
    margin-top: -15px;
    position: relative;
    z-index: 0;
}

.step-line.done {
    background: linear-gradient(90deg, var(--success-500), var(--brand-500));
}

.step-label {
    font-size: 0.68rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

/* QR Code Box (success page) */
.qr-box {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.3);
    animation: float 3s ease-in-out infinite;
}

/* ─────────────────────────────────────────────────────────────
 * 17. SKELETON LOADERS
 * ───────────────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-elevated) 25%,
            rgba(255, 255, 255, 0.04) 50%,
            var(--bg-elevated) 75%);
    background-size: 400px 100%;
    border-radius: var(--radius-md);
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-stat {
    height: 100px;
    border-radius: var(--radius-xl);
}

/* ─────────────────────────────────────────────────────────────
 * 18. RESPONSIVE UTILITIES
 * ───────────────────────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-inner {
    padding: 24px;
    flex: 1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.6);
    }

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

    .stat-value {
        font-size: 1.8rem;
    }

    .participant-info-grid {
        grid-template-columns: 1fr;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        backdrop-filter: blur(2px);
    }

    .sidebar-overlay.visible {
        display: block;
    }
}

/* ─────────────────────────────────────────────────────────────
 * UTILITIES
 * ───────────────────────────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 20px 0;
}

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

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

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

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

/* Global Override for Bootstrap Text Classes */
.text-muted {
    color: var(--text-muted) !important;
}

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

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

.text-white {
    color: #cbd5e1 !important;
}

.bg-brand-subtle {
    background: rgba(59, 130, 246, 0.1);
}

.bg-success-subtle {
    background: var(--success-bg);
}

.bg-danger-subtle {
    background: var(--danger-bg);
}

.rounded-custom {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: 999px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border-accent);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-500);
}

/* Focus ring override for accessibility */
*:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Alert overrides */
.alert {
    border-radius: var(--radius-lg) !important;
    border: none !important;
    font-size: 0.875rem;
}

.alert-success {
    background: var(--success-bg) !important;
    color: var(--success-400) !important;
    border-left: 3px solid var(--success-500) !important;
}

.alert-danger {
    background: var(--danger-bg) !important;
    color: var(--danger-400) !important;
    border-left: 3px solid var(--danger-500) !important;
}

/* Pagination */
.pagination .page-item .page-link {
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    color: var(--text-secondary);
    font-size: 0.8rem;
    padding: 6px 12px;
    transition: all var(--dur-fast) var(--ease-smooth);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-brand);
    border-color: transparent;
    color: #fff;
}

.pagination .page-item .page-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-accent);
}

/* ─────────────────────────────────────────────────────────────
 * TABLE VISIBILITY ENHANCEMENTS (Brighter text and icons)
 * ───────────────────────────────────────────────────────────── */
.table,
.table td {
    color: #cbd5e1 !important;
}

.table th,
.table thead th,
.table th a,
.table thead th a,
.table thead .text-muted {
    color: var(--text-secondary) !important;
}

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

.table .text-secondary {
    color: #cbd5e1 !important;
}

.table i.text-muted,
.table i {
    color: var(--brand-400) !important;
    opacity: 1 !important;
}

/* Maintain semantic colors for specific table icons but brighter */
.table i.fa-hourglass-start {
    color: #cbd5e1 !important;
}

.table i.fa-circle-check {
    color: var(--success-400) !important;
}

.table i.fa-pen-to-square {
    color: var(--info-400) !important;
}

.table i.fa-trash-can {
    color: var(--danger-400) !important;
}

.table i.fa-square-parking {
    color: var(--warning-400) !important;
}

.table i.fa-triangle-exclamation {
    color: var(--warning-400) !important;
}

.table i.fa-users,
.table i.fa-tags {
    color: #94a3b8 !important;
}

/* Empty state icons */

.table code.text-muted,
.table code {
    color: var(--brand-400) !important;
    font-weight: 700 !important;
}

/* ─────────────────────────────────────────────────────────────
 * BUTTON VISIBILITY ENHANCEMENTS (Brighter text and icons)
 * ───────────────────────────────────────────────────────────── */
.btn,
.btn i,
.btn span,
.btn .text-muted,
.btn .text-light {
    color: #e4e9f0 !important;
    opacity: 1 !important;
    font-weight: 600 !important;
}

/* Specific adjustment for outline buttons to ensure they have bright text but keep their background behavior */
.btn-outline-light,
.btn-outline-secondary,
.btn-outline-success,
.btn-outline-danger,
.btn-outline-warning,
.btn-outline-info {
    color: #cbd5e1 !important;
}

/* Make reset/refresh icon stand out */
.btn i.fa-arrows-rotate {
    color: var(--danger-400) !important;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.btn-outline-light i,
.btn-outline-secondary i,
.btn-outline-success i,
.btn-outline-danger i,
.btn-outline-warning i,
.btn-outline-info i {
    color: #cbd5e1 !important;
}

/* Make glass buttons text pop more */
.btn-glass {
    color: #cbd5e1 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}