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

:root {
    --color-primary: #000000;
    --color-primary-hover: #333333;
    --color-success: #74EC8D;
    --color-warning: #EBB016;
    --color-danger: #FF1A6A;
    --color-info: #21DAFF;
    --color-text: #1a1a1a;
    --color-text-light: #666666;
    --color-text-muted: #999999;
    --color-background: #f5f5f7;
    --color-white: #ffffff;
    --color-border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Gradient Header */
.gradient-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 18px;
    background: linear-gradient(to right, #21DAFF 0%, #74EC8D 20%, #E0FF20 40%, #EBB016 60%, #FF5C1A 80%, #FF1A6A 100%);
    z-index: 100;
}

/* Header */
.header {
    background: var(--color-white);
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
    margin-top: 18px;
    position: sticky;
    top: 18px;
    z-index: 50;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.header-content {
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}

.logo-separator {
    margin: 0 8px;
    color: var(--color-text-muted);
    font-weight: 300;
}

.logo-subtitle {
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--color-text-light);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--color-text-light) !important;
    cursor: pointer;
    transition: opacity 0.2s;
    font-weight: 500;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    text-decoration: none;
}

/* Forcer la couleur dans tous les états possibles */
.sync-indicator,
.sync-indicator *,
.sync-indicator:hover,
.sync-indicator:hover *,
.sync-indicator:active,
.sync-indicator:active *,
.sync-indicator:focus,
.sync-indicator:focus *,
.sync-indicator:visited,
.sync-indicator:visited *,
.sync-indicator:link,
.sync-indicator:link * {
    color: var(--color-text-light) !important;
}

.sync-indicator:hover {
    opacity: 0.8;
}

.sync-indicator:active {
    opacity: 0.8;
}

.sync-indicator:focus {
    outline: none;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-success);
    animation: pulse 2s ease-in-out infinite;
}

.sync-indicator.offline .sync-dot {
    background: var(--color-danger);
    animation: none;
}

.sync-indicator.syncing .sync-dot {
    background: var(--color-warning);
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pending-sync {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fff3cd;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-warning);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.pending-sync:hover {
    background: #ffeaa7;
    transform: scale(1.05);
}

.pending-sync:active {
    transform: scale(0.98);
}

.pending-sync.show {
    display: flex;
}

.pending-sync svg {
    animation: spin 2s linear infinite;
}

.pending-sync.syncing {
    background: #d4edda;
    color: #155724;
    opacity: 0.8;
}

.pending-sync.syncing svg {
    animation: spin 1s linear infinite;
}

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


/* Container */
.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Mode Navigation - Bottom Mobile Menu */
.mode-nav {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
}

.mode-tabs {
    display: flex;
    gap: 0;
    padding: 8px 0;
}

.mode-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 0;
    font-family: 'Poppins', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.mode-tab:hover {
    color: var(--color-text);
}

.mode-tab.active {
    color: var(--color-primary);
}

.mode-tab.active::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 3px 3px 0 0;
}

.mode-tab svg {
    stroke: currentColor;
    width: 24px;
    height: 24px;
}

/* Main Content */
.main-content {
    padding: 24px 0;
    min-height: calc(100vh - 200px);
    margin-bottom: 80px;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

.loading-state p {
    color: var(--color-text-light);
    font-size: 0.95rem;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Mode Content */
.mode-content {
    animation: fadeInUp 0.3s ease-out;
}

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

/* Section Title */
.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
}

.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 12px;
}

/* Scanner Section */
.scanner-section {
    margin-bottom: 32px;
}

.scanner-card {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.btn-scan {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 32px;
    background: linear-gradient(135deg, #21DAFF, #74EC8D);
    color: var(--color-text);
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.btn-scan:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-scan svg {
    stroke: currentColor;
}

.scanner-hint {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Video Scanner */
.video-scanner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.scanner-frame {
    width: 280px;
    height: 280px;
    border: 3px solid var(--color-success);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    animation: scannerPulse 2s ease-in-out infinite;
}

@keyframes scannerPulse {
    0%, 100% { border-color: var(--color-success); }
    50% { border-color: var(--color-info); }
}

.btn-close-scanner {
    position: absolute;
    top: 32px;
    right: 16px;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.btn-close-scanner:hover {
    background: var(--color-white);
    transform: scale(1.1);
}

.btn-next-scan {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 56px;
    background: linear-gradient(135deg, #74EC8D, #21DAFF);
    color: var(--color-text);
    border: none;
    border-radius: var(--radius-lg);
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    transition: var(--transition);
    animation: pulse-button 1.5s ease-in-out infinite;
    z-index: 10;
}

.btn-next-scan:active {
    transform: translate(-50%, -50%) scale(0.95);
}

@keyframes pulse-button {
    0%, 100% {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        box-shadow: 0 12px 48px rgba(116, 236, 141, 0.8);
        transform: translate(-50%, -50%) scale(1.05);
    }
}

/* Search Section */
.search-section {
    margin-bottom: 32px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
}

.search-box svg {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    padding: 16px 12px;
    border: none;
    background: transparent;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: var(--color-text);
    outline: none;
}

.search-box input::placeholder {
    color: var(--color-text-muted);
}

.search-results {
    margin-top: 12px;
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--color-background);
}

.search-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.search-result-name {
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-id {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.badge-icon-recupere {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-success);
    color: white;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.search-result-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.result-badge.orateur {
    background: linear-gradient(135deg, #21DAFF, #74EC8D);
    color: var(--color-text);
}

.result-badge.moderateur {
    background: linear-gradient(135deg, #FF5C1A, #FF1A6A);
    color: var(--color-white);
}

.result-badge.badged {
    background: var(--color-success);
    color: var(--color-text);
}

.result-badge.comcs {
    background: #E0FF20;
    color: var(--color-text);
    font-size: 0.65rem;
}

.result-badge.compara {
    background: #EBB016;
    color: var(--color-white);
    font-size: 0.65rem;
}

.search-no-results {
    padding: 24px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Stats Section */
.stats-section {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-item svg {
    color: var(--color-primary);
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Progress Section */
.progress-section {
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

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

.progress-percent {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    height: 8px;
    background: var(--color-background);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #21DAFF, #74EC8D);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill[style*="100%"] {
    background: var(--color-success);
}

/* Frequentation Stats Section */
.frequentation-section {
    margin-top: 24px;
}

.frequentation-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.frequentation-placeholder,
.frequentation-loading,
.frequentation-error,
.frequentation-empty {
    text-align: center;
    color: var(--color-text-muted);
    padding: 24px;
    font-size: 0.9rem;
}

.frequentation-error {
    color: var(--color-error);
}

.frequentation-jour {
    background: var(--color-background);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.frequentation-jour-titre {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-border);
}

.frequentation-lieu {
    margin-bottom: 16px;
}

.frequentation-lieu:last-child {
    margin-bottom: 0;
}

.frequentation-lieu-titre {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 10px 0;
}

.frequentation-sessions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.frequentation-session {
    background: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 12px;
    border-left: 4px solid #21DAFF;
}

.frequentation-session.soiree {
    border-left-color: #EBB016;
}

.session-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.session-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 45px;
    font-variant-numeric: tabular-nums;
}

.session-title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.session-count {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

.session-count small {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.session-gauge {
    height: 6px;
    background: var(--color-background);
    border-radius: 3px;
    overflow: hidden;
}

.session-gauge-fill {
    height: 100%;
    background: linear-gradient(to right, #21DAFF, #74EC8D);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.session-gauge-fill.soiree {
    background: linear-gradient(to right, #EBB016, #FF5C1A);
}

/* Synthèse par Quarts de journée */
.synthese-quarts {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--color-border);
}

.synthese-titre {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 20px 0;
}

.synthese-jour {
    margin-bottom: 24px;
}

.synthese-jour:last-child {
    margin-bottom: 0;
}

.synthese-jour-titre {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border);
}

.synthese-lieu {
    background: var(--color-white);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.synthese-lieu:last-child {
    margin-bottom: 0;
}

.synthese-lieu-titre {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 12px 0;
}

.synthese-quarts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (max-width: 480px) {
    .synthese-quarts-grid {
        grid-template-columns: 1fr;
    }
}

.synthese-quart {
    background: var(--color-background);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.synthese-quart-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.synthese-quart-icon {
    font-size: 1.1rem;
}

.synthese-quart-label {
    flex: 1;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
}

.synthese-quart-count {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
}

.synthese-quart-gauge {
    height: 8px;
    background: var(--color-white);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.synthese-quart-gauge-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.synthese-quart-percent {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-align: right;
}

/* Grille single pour soirée */
.synthese-quarts-grid.single {
    grid-template-columns: 1fr;
}


/* Session Selector */
.session-selector {
    margin-bottom: 24px;
}

.session-select-box {
    position: relative;
}

.session-select-box select {
    width: 100%;
    padding: 16px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    color: var(--color-text);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.session-select-box select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* Session Info Banner */
.session-info-banner {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-left: 4px solid var(--color-info);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.session-info-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 4px;
}

.session-info-time {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* Participant Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.15s ease-out;
}

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

.modal-content {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.2s ease-out;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: var(--color-background);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--color-border);
    transform: rotate(90deg);
}

.participant-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
}

.participant-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}

.participant-id {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 16px;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, #21DAFF 0%, #74EC8D 25%, #EBB016 75%, #FF5C1A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    text-align: center;
}

.participant-badges {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.participant-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1;
}

.participant-badge.orateur {
    background: linear-gradient(135deg, #21DAFF, #74EC8D);
    color: var(--color-text);
}

.participant-badge.moderateur {
    background: linear-gradient(135deg, #FF5C1A, #FF1A6A);
    color: var(--color-white);
}

.participant-badge.badged {
    background: var(--color-success);
    color: var(--color-text);
}

.participant-badge.comcs {
    background: #E0FF20;
    color: var(--color-text);
    font-size: 0.7rem;
    padding: 5px 12px;
}

.participant-badge.compara {
    background: #EBB016;
    color: var(--color-white);
    font-size: 0.7rem;
    padding: 5px 12px;
}

.participant-status {
    margin-bottom: 20px;
}

.status-alert {
    padding: 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-alert.success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #16a34a;
}

.status-alert.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #d97706;
}

.status-alert-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.participant-program {
    margin-top: 20px;
}

.program-section {
    margin-bottom: 20px;
}

.program-section:last-child {
    margin-bottom: 0;
}

.program-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.program-item {
    background: var(--color-background);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 8px;
}

.program-item:last-child {
    margin-bottom: 0;
}

.program-time {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-bottom: 4px;
}

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

.program-subtitle {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.modal-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

.btn-primary {
    flex: 1;
    padding: 14px 20px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.btn-secondary {
    flex: 1;
    padding: 14px 20px;
    background: var(--color-background);
    color: var(--color-text);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Scan Flash Feedback */
.scan-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    opacity: 0;
    z-index: 9999;
    transition: opacity 0.1s ease;
}

.scan-flash.active {
    opacity: 1;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: calc(100% - 48px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    font-weight: 500;
    animation: toastSlideIn 0.3s ease-out;
    min-width: 280px;
}

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

.toast.fade-out {
    animation: toastFadeOut 0.3s ease-out forwards;
}

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

.toast.success {
    background: #22c55e;
    color: white;
}

.toast.error {
    background: #ef4444;
    color: white;
}

.toast.info {
    background: var(--color-info);
    color: var(--color-text);
}

.toast.warning {
    background: var(--color-warning);
    color: var(--color-text);
}

.toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}


/* Responsive - Tablet */
@media (min-width: 640px) {
    .container {
        max-width: 640px;
        padding: 0 24px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .logo-subtitle {
        font-size: 1.5rem;
    }

    .mode-tab {
        font-size: 1rem;
    }

    .stats-section {
        padding: 24px;
    }

    .stats-grid {
        gap: 24px;
    }
}

/* Responsive - Desktop */
@media (min-width: 768px) {
    .container {
        max-width: 768px;
    }

    .header {
        padding: 24px 0;
    }

    .main-content {
        padding: 32px 0;
        margin-bottom: 90px;
    }

    .scanner-card {
        padding: 40px 32px;
    }

    .modal-content {
        max-width: 600px;
        padding: 32px;
    }

    .toast-container {
        bottom: 100px;
        right: 32px;
    }
    
    .mode-nav {
        box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.1);
    }
    
    .mode-tabs {
        padding: 10px 0;
    }
    
    .mode-tab {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .mode-tab svg {
        width: 26px;
        height: 26px;
    }
}

/* Responsive - Mobile Small */
@media (max-width: 380px) {
    .logo-separator,
    .logo-subtitle {
        display: none;
    }

    .sync-indicator span {
        display: none;
    }
    
    .mode-tab {
        font-size: 0.7rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 80px;
    left: 16px;
    right: 16px;
    z-index: 1500;
    animation: slideUp 0.3s ease-out;
}

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

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
}

.pwa-install-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.pwa-install-icon img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
}

.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pwa-install-text strong {
    font-size: 0.95rem;
    color: var(--color-text);
}

.pwa-install-text span {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.pwa-install-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.pwa-install-btn:hover {
    background: var(--color-primary-hover);
}

.pwa-install-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: var(--transition);
}

.pwa-install-close:hover {
    background: var(--color-background);
    color: var(--color-text);
}

/* PWA Loading Screen */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.pwa-loading::after {
    content: 'A';
    font-size: 80px;
    font-weight: bold;
    color: #fff;
    font-family: Arial, sans-serif;
    animation: pulseLogo 1.5s ease-in-out infinite;
}

@keyframes pulseLogo {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.95); }
}


/* PWA Standalone mode adjustments */
.pwa-standalone .gradient-header {
    height: calc(18px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
}

.pwa-standalone .header {
    margin-top: calc(18px + env(safe-area-inset-top, 0px));
    top: calc(18px + env(safe-area-inset-top, 0px));
}

.pwa-standalone .mode-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.pwa-standalone .main-content {
    margin-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
}

/* Responsive PWA Install Banner */
@media (max-width: 480px) {
    .pwa-install-content {
        flex-wrap: wrap;
    }
    
    .pwa-install-text {
        flex-basis: calc(100% - 100px);
    }
    
    .pwa-install-btn {
        flex-basis: 100%;
        margin-top: 8px;
    }
    
    .pwa-install-close {
        position: absolute;
        top: 8px;
        right: 8px;
    }
    
    .pwa-install-content {
        position: relative;
        padding-right: 40px;
    }
}

/* ============================================================================
   Login Screen
   ============================================================================ */

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #21DAFF 0%, #74EC8D 20%, #E0FF20 40%, #EBB016 60%, #FF5C1A 80%, #FF1A6A 100%);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: loginFadeIn 0.4s ease;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo img {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.login-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.login-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text);
}

.login-field input {
    padding: 14px 16px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--color-background);
}

.login-field input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-white);
}

.login-field input::placeholder {
    color: var(--color-text-muted);
}

.login-error {
    background: rgba(255, 26, 106, 0.1);
    color: var(--color-danger);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid rgba(255, 26, 106, 0.2);
}

.login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    background: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.login-button:hover:not(:disabled) {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-button svg {
    flex-shrink: 0;
}

/* ============================================================================
   Logout Button
   ============================================================================ */

.logout-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.logout-button:hover {
    background: var(--color-danger);
    border-color: var(--color-danger);
    color: var(--color-white);
}

.header-content {
    display: flex;
    align-items: center;
}

/* Print */
@media print {
    .gradient-header,
    .header,
    .mode-nav,
    .footer,
    .btn-scan,
    .search-box,
    .modal-actions,
    .pwa-install-banner,
    .pwa-loading,
    .login-screen {
        display: none;
    }
}
