/* === VARIABLES Y RESET === */
:root {
    /* Colors - Dark theme with vibrant accents */
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #252542;
    --bg-elevated: #2d2d4a;
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b80;
    
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6);
    
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    
    /* Urnas y Bolsines */
    --urna-color: #6366f1;
    --bolsin-color: #f59e0b;
    
    /* Spacing */
    --nav-height: 70px;
    --header-height: 60px;
    
    /* Borders */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
}

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

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: var(--nav-height);
    padding-top: var(--header-height);
}

/* === HEADER === */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.logo-text {
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: 0.75rem;
}

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

.connection-status.offline .status-dot {
    background: var(--danger);
    animation: none;
}

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

/* === MAIN CONTENT === */
.app-main {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

/* === SCANNER SECTION === */
.scanner-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scanner-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

#scanner-container {
    width: 100%;
    height: 100%;
}

#scanner-container video,
#scanner-container canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
}

.scanner-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.scanner-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.scan-line {
    position: absolute;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--accent-gradient);
    box-shadow: var(--shadow-glow);
    animation: scanLine 2s ease-in-out infinite;
}

@keyframes scanLine {
    0%, 100% { top: 20%; opacity: 0.8; }
    50% { top: 80%; opacity: 1; }
}

.corner {
    position: absolute;
    width: 30px;
    height: 30px;
    border: 3px solid var(--accent-primary);
}

.corner.tl { top: 15px; left: 15px; border-right: none; border-bottom: none; border-radius: 8px 0 0 0; }
.corner.tr { top: 15px; right: 15px; border-left: none; border-bottom: none; border-radius: 0 8px 0 0; }
.corner.bl { bottom: 15px; left: 15px; border-right: none; border-top: none; border-radius: 0 0 0 8px; }
.corner.br { bottom: 15px; right: 15px; border-left: none; border-top: none; border-radius: 0 0 8px 0; }

/* Camera Controls */
.camera-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 12px;
    padding: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.camera-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

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

.camera-btn.active {
    background: var(--warning);
    color: black;
}

.zoom-control {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: 25px;
}

.zoom-control .camera-btn {
    width: 36px;
    height: 36px;
    font-size: 1.4rem;
    font-weight: bold;
}

#zoomLevel {
    min-width: 40px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.scan-result {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.scan-result.success {
    background: var(--success-bg);
    border: 1px solid var(--success);
}

.scan-result.warning {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
}

.scan-result.error {
    background: var(--danger-bg);
    border: 1px solid var(--danger);
}

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

.result-text {
    flex: 1;
    font-size: 0.9rem;
}

.result-detail {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Manual Input */
.manual-input {
    display: flex;
    gap: 10px;
}

.manual-input input {
    flex: 1;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.manual-input input:focus {
    border-color: var(--accent-primary);
}

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

.btn-scan {
    padding: 14px 24px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-scan:active {
    transform: scale(0.96);
}

/* Toggle Scanner Mode Button */
.toggle-scanner-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 2px solid var(--accent-primary);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 16px;
}

.toggle-scanner-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.toggle-scanner-btn.reader-mode {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
}

/* Barcode Reader Mode */
.barcode-reader-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 40px 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    min-height: 300px;
}

.reader-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
}

.reader-icon {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    transition: all 0.3s ease;
}

.reader-icon svg {
    width: 50px;
    height: 50px;
    color: var(--accent-primary);
}

.reader-icon.pulse {
    transform: scale(1.1);
    border-color: var(--success);
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}

.reader-icon.pulse svg {
    color: var(--success);
}

.reader-status {
    text-align: center;
}

.reader-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.reader-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 280px;
}

.reader-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.pulse-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border: 2px solid var(--accent-primary);
    border-radius: 50%;
    opacity: 0;
    transform: translate(-50%, -50%);
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring.delay {
    animation-delay: 1s;
}

@keyframes pulseRing {
    0% {
        width: 100px;
        height: 100px;
        opacity: 0.6;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

.reader-tips {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 320px;
}

.tip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tip-icon {
    font-size: 1.1rem;
}

/* Queue Banner */
.queue-banner {
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Recent Scans */
.recent-scans {
    margin-top: 24px;
}

.recent-scans h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.recent-item .type-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.recent-item .type-badge.urna {
    background: rgba(99, 102, 241, 0.2);
    color: var(--urna-color);
}

.recent-item .type-badge.bolsin {
    background: rgba(245, 158, 11, 0.2);
    color: var(--bolsin-color);
}

.recent-item .type-badge.offline,
.recent-item .type-badge.pendiente {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.recent-item .info {
    flex: 1;
}

.recent-item .mesa {
    font-weight: 600;
}

.recent-item .escuela {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-item .time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.recent-item .status-icon {
    font-size: 0.85rem;
    margin-right: 4px;
}

.recent-item .status-icon.success {
    color: var(--success);
}

.recent-item .status-icon.offline {
    color: var(--warning);
}

.recent-item.offline {
    border-left: 3px solid var(--warning);
}

.recent-item.success {
    border-left: 3px solid var(--success);
}

/* === DASHBOARD SECTION === */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dashboard-header h1 {
    font-size: 1.5rem;
}

.btn-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background: var(--bg-elevated);
}

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

/* Filter Container */
.filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.filter-container label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-container select,
.filters-row select {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.filter-container select:focus,
.filters-row select:focus {
    border-color: var(--accent-primary);
}

/* Filters Row (Pendientes) */
.filters-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

/* Pendientes Summary */
.pendientes-summary {
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pendientes-summary .summary-count {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--warning);
}

/* Pendientes List */
.pendientes-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pendientes-group {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.group-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.group-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

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

.pendiente-item {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.pendiente-mesa {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mesa-num {
    font-weight: 600;
    font-size: 1rem;
}

.pendiente-badges {
    display: flex;
    gap: 6px;
}

.pendiente-badges .badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 4px;
}

.pendiente-badges .badge.urna {
    background: rgba(99, 102, 241, 0.2);
    color: var(--urna-color);
}

.pendiente-badges .badge.bolsin {
    background: rgba(245, 158, 11, 0.2);
    color: var(--bolsin-color);
}

.pendiente-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pendiente-escuela {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pendiente-circuito {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pendiente-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.code-item {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.code-item code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state p {
    margin-bottom: 8px;
}

.empty-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stat-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow: hidden;
}

.stat-card.primary {
    border-left: 3px solid var(--urna-color);
}

.stat-card.secondary {
    border-left: 3px solid var(--bolsin-color);
}

.stat-card.accent {
    grid-column: span 2;
    background: var(--accent-gradient);
    border: none;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

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

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-card.accent .stat-label {
    color: rgba(255, 255, 255, 0.8);
}

.stat-detail {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.stat-card.accent .stat-detail {
    color: rgba(255, 255, 255, 0.6);
}

/* Charts */
.charts-container {
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
}

.chart-card h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.chart-wrapper {
    max-width: 280px;
    margin: 0 auto;
}

/* Sections List */
.sections-container h3 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sections-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.section-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.section-card:hover {
    background: var(--bg-elevated);
    transform: translateX(4px);
}

.section-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-name {
    font-weight: 600;
    font-size: 1rem;
}

.section-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-label {
    font-size: 0.7rem;
    width: 60px;
    color: var(--text-secondary);
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

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

.progress-fill.urna {
    background: var(--urna-color);
}

.progress-fill.bolsin {
    background: var(--bolsin-color);
}

.progress-value {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 90px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
}

.progress-value small {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* === DETAIL SECTION === */
.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.btn-back {
    padding: 8px 16px;
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.circuito-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
}

.circuito-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* === SEARCH SECTION === */
.search-container h2 {
    margin-bottom: 16px;
}

.search-box {
    position: relative;
    margin-bottom: 16px;
}

.search-box input {
    width: 100%;
    padding: 16px 50px 16px 16px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.search-box input:focus {
    border-color: var(--accent-primary);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mesa-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
}

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

.mesa-number {
    font-size: 1.2rem;
    font-weight: 700;
}

.mesa-status {
    display: flex;
    gap: 6px;
}

.status-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.status-badge.received {
    background: var(--success-bg);
    border: 2px solid var(--success);
}

.status-badge.pending {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.mesa-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.mesa-info p {
    margin-bottom: 4px;
}

/* === ADMIN SECTION === */
.admin-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-container h2 {
    margin-bottom: 8px;
}

.admin-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
}

.admin-card.danger {
    border: 1px solid var(--danger);
}

.admin-card.warning {
    border: 1px solid var(--warning);
}

.admin-card.export {
    border: 1px solid var(--success);
    background: linear-gradient(135deg, var(--bg-card), rgba(34, 197, 94, 0.05));
}

.admin-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.admin-icon {
    font-size: 1.3rem;
}

.admin-card h3 {
    font-size: 1rem;
}

.admin-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Export Button */
.btn-export {
    width: 100%;
    padding: 14px;
    background: var(--success);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: #1db954;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-export:active {
    transform: translateY(0);
}

/* Warning Button */
.btn-warning {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    color: var(--warning);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s;
}

.btn-warning:hover {
    background: var(--warning-bg);
}

/* Icon inside buttons */
.btn-icon {
    font-size: 1.1rem;
}

.upload-area {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    margin-bottom: 16px;
    transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.upload-placeholder p {
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.file-name {
    font-weight: 500;
    color: var(--accent-primary);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

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

.btn-primary:not(:disabled):hover {
    transform: translateY(-2px);
}

.btn-danger {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s;
}

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

.upload-status {
    margin-top: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: none;
}

.upload-status.success {
    display: block;
    background: var(--success-bg);
    color: var(--success);
}

.upload-status.error {
    display: block;
    background: var(--danger-bg);
    color: var(--danger);
}

/* === BOTTOM NAVIGATION === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--accent-primary);
}

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

.nav-label {
    font-size: 0.7rem;
    font-weight: 500;
}

/* === TOAST === */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 16px;
    right: 16px;
    max-width: 400px;
    margin: 0 auto;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

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

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

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

/* === LOADING === */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* === RESPONSIVE === */
@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-card.accent {
        grid-column: span 1;
    }
}

/* === FILTROS === */
.filter-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-container label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.filter-container select {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.filter-container select:focus {
    border-color: var(--accent-primary);
}

.filters-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.filter-group {
    flex: 1;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 12px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.filter-group select {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.filter-group select:focus {
    border-color: var(--accent-primary);
}

/* === PENDIENTES === */
.pendientes-summary {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pendientes-summary .summary-count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warning);
    display: block;
    margin-bottom: 4px;
}

.pendientes-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pendientes-group {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.group-header {
    background: var(--bg-elevated);
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.group-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.group-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
}

.group-items {
    padding: 8px;
}

.pendiente-item {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    margin-bottom: 8px;
    transition: background 0.2s;
}

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

.pendiente-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

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

.mesa-num {
    font-weight: 700;
    font-size: 1rem;
}

.pendiente-badges {
    display: flex;
    gap: 6px;
}

.pendiente-badges .badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.pendiente-badges .badge.urna {
    background: rgba(99, 102, 241, 0.2);
    color: var(--urna-color);
}

.pendiente-badges .badge.bolsin {
    background: rgba(245, 158, 11, 0.2);
    color: var(--bolsin-color);
}

.pendiente-info {
    margin-bottom: 8px;
}

.pendiente-escuela {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.pendiente-circuito {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pendiente-codes {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.code-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
}

.code-label {
    color: var(--text-muted);
}

.code-item code {
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.empty-detail {
    font-size: 0.85rem !important;
    color: var(--text-muted);
}
