:root {
    --bg: #0b0b10;
    --panel: #141420;
    --muted: #9aa3b2;
    --text: #e6e8ee;
    --brand: #8266d4;
    --accent: #6d5bd1;
    --danger: #e05d6f;
    --success: #10b981;
    --warning: #f59e0b;
    --info: #3b82f6;
    --border: #222330;
    
    /* Admin dashboard variables */
    --bg-primary: var(--bg);
    --bg-secondary: var(--panel);
    --text-primary: var(--text);
    --text-muted: var(--muted);
    --primary: var(--brand);
}

/* Alert styles */
.alert {
    padding: 12px 16px;
    margin: 16px 0;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background-color: rgba(224, 93, 111, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    border-color: var(--info);
    color: var(--info);
}

.alert-dismissible {
    padding-right: 40px;
}

.alert .btn-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 12px 16px;
    color: inherit;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
}

.alert .btn-close:hover {
    opacity: 0.7;
}

* {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Inter, Segoe UI, Roboto, system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar Layout */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    position: relative;
}

.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text);
    flex: 1;
}

.sidebar-header .brand:hover {
    color: var(--brand);
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.sidebar-header .title-details {
    display: flex;
    flex-direction: column;
}

.sidebar-header .brand-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
}

.sidebar-header .brand-text-details {
    font-size: 0.8rem;
    color: var(--muted);
}

.sidebar-content {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin: 0.25rem 0;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-link:hover {
    background: var(--border);
    color: var(--brand);
    border-left-color: var(--brand);
}

.menu-link.active {
    background: rgba(130, 102, 212, 0.1);
    color: var(--brand);
    border-left-color: var(--brand);
}

.menu-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.menu-text {
    font-weight: 500;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--border);
    border-radius: 8px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--brand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--muted);
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    color: var(--danger);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(224, 93, 111, 0.1);
    color: var(--danger);
}

/* Main Content Area */
.main-content {
    margin-left: 280px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

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

.top-header {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--border);
}

.sidebar-toggle span {
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: all 0.3s ease;
}

.page-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
}

.content-area {
    padding: 2rem;
}

/* Mobile-First Responsive Design */
/* Default mobile styles */
.sidebar {
    transform: translateX(-100%);
    width: 100%;
    max-width: 100vw;
}

.sidebar.open {
    transform: translateX(0);
}

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

.sidebar-toggle {
    display: flex;
}

.content-area {
    padding: 1rem;
}

/* Mobile overlay for sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

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

/* Mobile-optimized cards */
.card {
    margin-bottom: 1rem;
    border-radius: 12px;
    padding: 1.25rem;
}

.card-header {
    padding: 0 0 1rem 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0.25rem 0 0 0;
}

/* Mobile-optimized buttons */
.btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 8px;
    min-height: 44px; /* Touch-friendly */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    min-height: 36px;
}

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

/* Mobile-optimized forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    min-height: 44px; /* Touch-friendly */
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(130, 102, 212, 0.1);
}

/* Mobile-optimized tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    min-width: 600px; /* Ensure table doesn't get too cramped */
}

.table th,
.table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

.table th {
    font-weight: 600;
    background: var(--border);
    position: sticky;
    top: 0;
}

/* Mobile-optimized navigation */
.sidebar-menu {
    padding: 0.5rem 0;
}

.menu-link {
    padding: 1rem 1.5rem;
    font-size: 0.95rem;
    min-height: 48px; /* Touch-friendly */
}

.menu-icon {
    font-size: 1.3rem;
    width: 28px;
}

/* Mobile-optimized user info */
.user-info {
    padding: 1rem;
}

.user-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
}

.user-name {
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.85rem;
}

/* Mobile-optimized header */
.top-header {
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Mobile-optimized stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 500;
}

/* Mobile-optimized QR code display */
.qr-container {
    text-align: center;
    padding: 2rem 1rem;
}

.qr-code {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Mobile-optimized scan interface */
.scan-interface {
    text-align: center;
    padding: 2rem 1rem;
}

.scan-button {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    padding: 1.5rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* Tablet styles */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
        width: 280px;
        max-width: none;
    }
    
    .sidebar-overlay {
        display: none !important;
    }
    
    .main-content {
        margin-left: 280px;
    }
    
    .sidebar-toggle {
        display: none;
    }
    
    .content-area {
        padding: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table th,
    .table td {
        padding: 1rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* Desktop styles */
@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .content-area {
        padding: 2.5rem;
    }
    
    .card {
        padding: 2rem;
    }
    
    .table th,
    .table td {
        padding: 1.25rem 1rem;
        font-size: 0.95rem;
    }
}

/* Large desktop styles */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .content-area {
        padding: 3rem;
    }
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
    /* Touch-friendly interactions */
    .btn, .menu-link, .sidebar-toggle {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Prevent zoom on form inputs */
    input[type="text"], 
    input[type="email"], 
    input[type="password"], 
    textarea, 
    select {
        font-size: 16px;
    }
    
    /* Better mobile scrolling */
    .sidebar-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Mobile-optimized video scanner */
    .scanner-video {
        width: 100%;
        height: auto;
        max-height: 50vh;
        border-radius: 12px;
    }
    
    /* Mobile-optimized QR display */
    .qr-code {
        max-width: 280px;
        width: 100%;
    }
    
    /* Mobile-optimized tables with horizontal scroll */
    .table-responsive {
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile-optimized cards */
    .card {
        margin-bottom: 1.5rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    /* Mobile-optimized buttons */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Mobile-optimized grid */
    .row {
        margin: 0;
    }
    
    .col-md-6 {
        padding: 0;
        margin-bottom: 1rem;
    }
    
    /* Mobile-optimized text */
    .card-title {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .card-subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Mobile-optimized stats */
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.95rem;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .content-area {
        padding: 0.75rem;
    }
    
    .card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .card-header {
        padding: 0 0 0.75rem 0;
        margin-bottom: 0.75rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .btn {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .menu-link {
        padding: 1.25rem 1.5rem;
        font-size: 1rem;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .user-info {
        padding: 0.75rem;
        margin: 0.25rem 0.75rem 0.75rem 0.75rem;
    }
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.375rem;
}

.badge-primary {
    background-color: var(--brand);
    color: white;
}

.badge-secondary {
    background-color: var(--muted);
    color: white;
}

.badge-success {
    background-color: #10b981;
    color: white;
}

.badge-danger {
    background-color: var(--danger);
    color: white;
}

.badge-warning {
    background-color: #f59e0b;
    color: white;
}

.badge-info {
    background-color: #3b82f6;
    color: white;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
}

.page-title-section h1 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.page-subtitle {
    margin: 0.5rem 0 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.page-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--brand);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-toggle:hover {
    background: var(--brand);
    opacity: 0.9;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    display: none;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background: var(--border);
    color: var(--text);
}

/* Quick Access Navbar */
.quick-access-nav {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

.nav-item {
    flex-shrink: 0;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    min-width: 100px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.nav-icon {
    font-size: 1.5rem;
}

.nav-text {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 0.5rem 0;
    color: var(--text);
    font-size: 1.5rem;
}

.empty-state p {
    margin: 0 0 2rem 0;
    color: var(--muted);
    font-size: 1rem;
}

/* User Info in Tables */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.user-id, .user-role {
    font-size: 0.8rem;
    color: var(--muted);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--brand);
    color: var(--brand);
}

.btn-outline-primary:hover {
    background: var(--brand);
    color: white;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.page-link:hover {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

.page-link.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-dialog {
    max-width: 800px;
    width: 90%;
    margin: 0 auto;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

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

.modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: 60vh;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .quick-access-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .nav-link {
        min-width: 80px;
        padding: 0.75rem 0.5rem;
    }
    
    .nav-text {
        font-size: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .modal-dialog {
        width: 95%;
        margin: 1rem auto;
    }
}

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

/* Header Styles */
.site-header {
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text);
}

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

.logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.title-details {
    display: flex;
    flex-direction: column;
}

.brand-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.brand-text-details {
    font-size: 0.875rem;
    color: var(--muted);
}

/* Navigation */
.nav {
    display: flex;
    align-items: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile {
    position: relative;
}

.avatar {
    background: var(--brand);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: white;
}

.profile .menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.profile .menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s;
}

.profile .menu a:hover {
    background: var(--border);
}

.menu-header {
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.menu-role {
    padding: 0.25rem 1rem 0.75rem;
    font-size: 0.875rem;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}

.icon-link {
    background: var(--brand);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s;
}

.icon-link:hover {
    background: var(--accent);
}

/* Main Content */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Cards */
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.card.narrow {
    max-width: 550px;
    margin: 24px auto
}

.card h1, .card h2, .card h3 {
    margin-top: 0;
    color: var(--text);
}

.card h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(130, 102, 212, 0.1);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary {
    background: var(--brand);
    color: white;
}

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

.btn-secondary {
    background: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--muted);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-info:hover {
    background: #2563eb;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: var(--border);
    font-weight: 600;
    color: var(--text);
}

.table td {
    color: var(--text);
}

.table tr:hover {
    background: var(--border);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(204px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.stat-card h3 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    color: var(--brand);
}

.stat-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
}

.export-btn {
    font-size: 15px;
    text-wrap: nowrap;
    font-weight: 400;
    padding: 3px 10px;
    height: 31px;
    min-height: auto !important;
}

/* QR Code Styles */
.qr-container {
    text-align: center;
    padding: 2rem;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.qr-code {
    max-width: 300px;
    margin: 0 auto 1rem;
    border-radius: 8px;
}

.qr-info {
    display: none;
    margin-top: 1rem;
}

.qr-info h3 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.qr-info p {
    color: var(--muted);
    margin: 0.25rem 0;
}

/* Scanner Styles */
.scanner-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.scanner-video {
    width: 100%;
    max-width: 400px;
    border-radius: 8px;
    border: 2px solid var(--border);
}

.scanner-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--success);
    color: white;
    border-radius: 6px;
    display: none;
}

.scanner-error {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--danger);
    color: white;
    border-radius: 6px;
    display: none;
}

/* Flash Messages */
.flash {
    background: var(--success);
    color: white;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
}

.flash.error {
    background: var(--danger);
}

.flash.warning {
    background: var(--warning);
}

.flash.info {
    background: var(--info);
}

/* Footer */
.site-footer {
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 2rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text);
    margin-bottom: 1rem;
}

.footer-section p,
.footer-section li {
    color: var(--muted);
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section a {
    color: var(--muted);
    text-decoration: none;
}

.footer-section a:hover {
    color: var(--brand);
}

.footer-bottom {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }
    
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 12px; }

.shadow { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }

/* Activities Page Styles */
.active-activity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    border-radius: 12px;
    color: white;
    margin-top: 1rem;
}

.activity-info {
    flex: 1;
}

.activity-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.activity-date {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.activity-description {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.4;
}

.activity-stats {
    text-align: center;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

/* Table Enhancements */
.active-row {
    background: rgba(var(--brand-rgb), 0.05);
    border-left: 4px solid var(--brand);
}

.activity-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.activity-name {
    font-weight: 600;
    color: var(--text);
}

.activity-description {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.3;
}

.date-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-icon {
    font-size: 0.9rem;
}

.date-range {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.start-date {
    font-weight: 500;
    color: var(--text);
}

.date-separator {
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
    font-style: italic;
}

.end-date {
    font-weight: 500;
    color: var(--text);
    font-size: 0.9rem;
}

.attendance-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.attendance-count {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brand);
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.user-name {
    font-weight: 500;
    color: var(--text);
}

.date-info {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Badge Enhancements */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-icon {
    font-size: 0.7rem;
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-secondary {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.2);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-icon {
    margin-right: 0.25rem;
}

/* Info Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(var(--brand-rgb), 0.05);
    border: 1px solid rgba(var(--brand-rgb), 0.1);
    border-radius: 8px;
    margin-top: 1rem;
}

.info-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text);
}

.info-text strong {
    color: var(--brand);
}

/* Form Check Styles */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid var(--border);
    border-radius: 4px;
    background: var(--panel);
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-check-input:checked {
    background: var(--brand);
    border-color: var(--brand);
}

.form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.2);
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.form-help {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.25rem;
    display: block;
}

/* Day Input Styles */
.day-input {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.day-input:last-child {
    margin-bottom: 0;
}

.day-input .form-label {
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

/* Days Container Grid Layout */
#days_container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

/* Single column for mobile */
@media (max-width: 768px) {
    #days_container {
        grid-template-columns: 1fr;
    }
}

/* Date Input Enhancements */
input[type="date"] {
    position: relative;
    cursor: pointer;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: transparent;
    bottom: 0;
    color: transparent;
    cursor: pointer;
    height: auto;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    width: auto;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3e%3cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff'%3e%3cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd'/%3e%3c/svg%3e");
}

/* Firefox date input styling */
input[type="date"]::-moz-calendar-picker-indicator {
    background: transparent;
    border: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3e%3cpath fill-rule='evenodd' d='M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z' clip-rule='evenodd'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
}

/* Mobile Responsiveness for Activities */
@media (max-width: 768px) {
    .active-activity {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .activity-stats {
        order: -1;
    }
    
    .activity-name {
        font-size: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .activity-cell,
    .date-cell,
    .attendance-cell,
    .user-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .action-buttons .btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Mobile Modal Adjustments */
    .modal {
        padding: 0.5rem;
    }
    
    .modal-dialog {
        max-height: 95vh;
        width: 95%;
        max-width: 95%;
    }
    
    .modal-body {
        max-height: 70vh;
        padding: 1rem;
    }
    
    .modal-header,
    .modal-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Force single column on mobile for day inputs */
    #days_container {
        grid-template-columns: 1fr !important;
    }
}

/* QR Scanner Styles */
.scan-interface {
    text-align: center;
    padding: 2rem;
}

#scanner {
    position: relative;
    max-width: 500px;
    margin: 0 auto 2rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.scanner-video {
    width: 100%;
    height: auto;
    display: block;
    background: var(--background);
}

#scanner-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.scan-button {
    margin: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.scan-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.scan-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.scan-button:disabled:hover {
    transform: none;
    box-shadow: none;
}

.scanner-result,
.scanner-error {
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.scanner-result {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.scanner-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.scanner-result h3,
.scanner-error h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
}

.scanner-result p,
.scanner-error p {
    margin: 0;
    font-size: 1rem;
}

.scanner-controls {
    margin: 2rem 0;
}

.scanner-instructions {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.scanner-instructions h4 {
    margin: 0 0 1rem 0;
    color: var(--text);
    font-size: 1.1rem;
}

.scanner-instructions ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--muted);
}

.scanner-instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.btn-icon {
    margin-right: 0.5rem;
}

/* Mobile Scanner Adjustments */
@media (max-width: 768px) {
    .scan-interface {
        padding: 1rem;
    }
    
    #scanner {
        max-width: 100%;
        margin: 0 auto 1rem;
    }
    
    .scan-button {
        width: 100%;
        margin: 0.25rem 0;
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }
}
