* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --gray-dark: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --light: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f1f5f9;
    color: var(--dark);
    line-height: 1.5;
    min-height: 100vh;
}

/* Landing Page */
.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-align: center;
}

.landing-logo {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: -1.8rem;
}

.landing-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    margin-bottom: 3rem;
}

.landing-buttons {
    display: flex;
    gap: 1rem;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    max-width: 1440px;
    margin: 0 auto;
    padding-bottom: 0;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--white);
    border-right: 1px solid var(--border);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

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

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    display: none;
}

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

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

@media (min-width: 768px) {

    .sidebar-header { 
        justify-content: center; 
    }

}
.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.sidebar-close {
    display: block;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray);
    cursor: pointer;
}

.sidebar-menu {
    list-style: none;
    flex: 1;
}

.sidebar-menu li {
    margin-bottom: 0.3rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    color: var(--gray-dark);
    text-decoration: none;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-menu a:hover {
    background: var(--light);
    color: var(--primary);
}

.sidebar-menu a.active {
    background: #ede9fe;
    color: var(--primary);
    font-weight: 600;
}

.sidebar-menu a i {
    width: 20px;
    text-align: center;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 1rem;
    min-height: 100vh;
    padding-bottom: 5rem;
    max-width: 100%;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .main-content {
        margin-left: 250px;
        padding: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: none;
    }
    
    .bottom-nav {
        display: none;
    }
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.mobile-menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-dark);
    padding: 0.5rem;
}

@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}
/* Cards */
.card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .card-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    text-decoration: none;
    justify-content: center;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

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

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

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

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-white {
    background: white;
    color: var(--primary);
    font-weight: 600;
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--gray);
    font-size: 1.2rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--light);
    color: var(--primary);
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-dark);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 0.75rem;
    font-size: 0.95rem;
    color: var(--dark);
    transition: border-color 0.2s;
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.input-with-icon {
    position: relative;
}

.input-with-icon .form-input {
    padding-left: 2.75rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-light);
    font-size: 1rem;
}

.pin-input {
    letter-spacing: 0.5em;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    background: var(--white);
    padding: 1.25rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Event Grid */
.event-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 768px) {
    .event-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }
}

.event-card {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.event-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.event-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--dark);
}

.event-date {
    font-size: 0.8rem;
    color: var(--gray);
}

.event-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.event-stat {
    font-size: 0.8rem;
    color: var(--gray);
}

.event-stat strong {
    color: var(--dark);
    display: block;
    font-size: 1.1rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 0 -1.5rem;
    padding: 0 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
    background: var(--light);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

tr:hover td {
    background: var(--light);
}

/* Profile */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 1rem;
    padding: 2rem;
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    border: 3px solid rgba(255,255,255,0.3);
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.profile-email {
    opacity: 0.9;
    font-size: 0.95rem;
}

.profile-section {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.profile-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Scanner */
.scanner-container {
    background: #000;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/3;
    max-height: 400px;
}

.scanner-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-container canvas {
    display: none;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-frame {
    width: 200px;
    height: 200px;
    position: relative;
}

.scan-frame::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid rgba(99,102,241,0.6);
    border-radius: 1rem;
}

.scan-corner {
    position: absolute;
    width: 25px;
    height: 25px;
    border-color: var(--primary);
    border-style: solid;
}

.scan-corner.top-left { top: -2px; left: -2px; border-width: 4px 0 0 4px; border-radius: 4px 0 0 0; }
.scan-corner.top-right { top: -2px; right: -2px; border-width: 4px 4px 0 0; border-radius: 0 4px 0 0; }
.scan-corner.bottom-left { bottom: -2px; left: -2px; border-width: 0 0 4px 4px; border-radius: 0 0 0 4px; }
.scan-corner.bottom-right { bottom: -2px; right: -2px; border-width: 0 4px 4px 0; border-radius: 0 0 4px 0; }

.scan-line {
    position: absolute;
    left: 10%;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanAnim 2s linear infinite;
}

@keyframes scanAnim {
    0% { top: 15%; }
    50% { top: 85%; }
    100% { top: 15%; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: var(--white);
    border-radius: 1.5rem;
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.modal-icon.success { color: var(--success); }
.modal-icon.error { color: var(--danger); }
.modal-icon.warning { color: var(--warning); }
.modal-icon.info { color: var(--primary); }

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.75rem;
}

.modal-message {
    color: var(--gray);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

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

/* Bottom Navigation */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 0.5rem;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--gray);
    text-decoration: none;
    font-size: 0.65rem;
    padding: 0.4rem;
    border-radius: 0.5rem;
    transition: 0.2s;
}

.bottom-nav a.active {
    color: var(--primary);
}

.bottom-nav a i {
    font-size: 1.2rem;
}

.bottom-nav .nav-scan {
    background: var(--primary);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    box-shadow: 0 4px 15px rgba(99,102,241,0.4);
}

.bottom-nav .nav-scan i {
    font-size: 1.3rem;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

/* Help page */
.help-section {
    background: var(--white);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.help-section h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.help-section ul li {
    padding: 0.5rem 0;
    color: var(--gray-dark);
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.help-section ul li i {
    color: var(--primary);
    margin-top: 0.2rem;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Scanner Result Toast */
.result-toast {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    animation: slideUp 0.3s ease;
}

.result-toast.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.result-toast.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.result-toast.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
/* Customize Modal Styles */
.customize-modal .field-list {
    max-height: 350px;
    overflow-y: auto;
    text-align: left;
    margin-bottom: 1rem;
}

.customize-modal .field-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.customize-modal .field-option:hover {
    border-color: #6366f1;
    background: #f8f7ff;
}

.customize-modal .field-option.selected {
    border-color: #6366f1;
    background: #ede9fe;
}

.customize-modal .field-option input[type="radio"] {
    accent-color: #6366f1;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.customize-modal .field-option label {
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: #374151;
    flex: 1;
}

.customize-modal .field-type-badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.5rem;
    background: #f3f4f6;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.customize-modal .current-selection {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.customize-modal .current-selection strong {
    color: #6366f1;
}

.btn-action-customize {
    background: #fef3c7;
    color: #92400e;
    border: 1.5px solid #fde68a;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.6rem;
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-action-customize:hover {
    background: #fde68a;
    border-color: #fbbf24;
    transform: translateY(-1px);
}