/**
 * Card-Based UI Styles - Unity Run & Ride
 * Clean, modern, desktop-optimized design
 */

/* ═══════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Better touch performance */
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.5;
    /* Prevent text size adjustment on mobile */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    /* Smooth scrolling */
    scroll-behavior: smooth;
}

/* ═══════════════════════════════════════════════════════════
   HEADER - Compact & Clean
   ═══════════════════════════════════════════════════════════ */

.header {
    background: white;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.session-info {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: #64748b;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.session-item strong {
    color: #1e293b;
    font-weight: 600;
}

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

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    background: #fee2e2;
    color: #991b1b;
}

.status-indicator.online {
    background: #d1fae5;
    color: #065f46;
}

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

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

.btn-header {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    color: #64748b;
    font-weight: 600;
}

.btn-header:hover {
    background: #f8fafc;
}

/* ═══════════════════════════════════════════════════════════
   AUTH SECTION
   ═══════════════════════════════════════════════════════════ */

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 60px);
    padding: 40px;
}

.auth-box {
    background: white;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
    max-width: 400px;
}

.auth-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.auth-box h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: #1e293b;
}

.auth-box p {
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTAINER
   ═══════════════════════════════════════════════════════════ */

.main-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ═══════════════════════════════════════════════════════════
   SEARCH BOX - Primary Action
   ═══════════════════════════════════════════════════════════ */

.search-container {
    margin-bottom: 24px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 0 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.search-wrapper:focus-within {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.search-icon {
    font-size: 20px;
    margin-right: 12px;
    color: #64748b;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 16px 0;
    font-size: 16px;
    color: #1e293b;
}

.search-input::placeholder {
    color: #94a3b8;
}

.btn-clear {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
}

.btn-clear:hover {
    color: #64748b;
}

.search-shortcut {
    padding: 4px 8px;
    background: #f8fafc;
    border-radius: 4px;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 600;
    border: 1px solid #e2e8f0;
}

.search-hint {
    margin-top: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════
   STATS BAR
   ═══════════════════════════════════════════════════════════ */

.stats-bar {
    background: rgba(255,255,255,0.95);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
    color: #64748b;
    text-align: center;
}

.stats-bar span:first-child {
    font-weight: 600;
    margin-right: 8px;
}

/* ═══════════════════════════════════════════════════════════
   RESULT CARDS - The Heart of the UI
   ═══════════════════════════════════════════════════════════ */

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.participant-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-left: 4px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.participant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* Card States */
.participant-card.no-bib {
    border-left-color: #f59e0b;
}

.participant-card.has-bib {
    border-left-color: #10b981;
}

.participant-card.editing {
    background: #dbeafe;
    border-left-color: #3b82f6;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.card-identity {
    flex: 1;
}

.card-name {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.card-demographics {
    font-size: 14px;
    color: #64748b;
}

.card-demographics span {
    margin-right: 8px;
}

.card-demographics span:not(:last-child)::after {
    content: "•";
    margin-left: 8px;
    color: #cbd5e1;
}

.card-contact {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Card Status Line */
.card-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.card-tshirt {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.tshirt-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.card-bib-status {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bib-info {
    font-size: 14px;
    font-weight: 600;
}

.bib-info.assigned {
    color: #10b981;
}

.bib-info.pending {
    color: #f59e0b;
}

/* Card Expansion Area */
.card-expansion {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.card-expansion.expanded {
    max-height: 400px;
    margin-top: 20px;
}

.expansion-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 2px solid #e2e8f0;
}

.expansion-context {
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #64748b;
}

.expansion-form {
    margin-top: 16px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.form-input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    padding: 14px 60px 14px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
}

.form-input.valid {
    border-color: #10b981;
}

.form-input.invalid {
    border-color: #dc2626;
}

.input-validation {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
}

.input-validation.valid {
    color: #10b981;
}

.input-validation.invalid {
    color: #dc2626;
}

.form-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */

button {
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    border: none;
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-small:hover {
    background: #f1f5f9;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

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

.btn-action {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit:hover {
    background: #bfdbfe;
}

.btn-assign {
    background: #fef3c7;
    color: #92400e;
}

.btn-assign:hover {
    background: #fde68a;
}

.btn-full {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   SETTINGS PANEL - Slide-out
   ═══════════════════════════════════════════════════════════ */

.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.settings-panel.open {
    pointer-events: all;
    opacity: 1;
}

.settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.settings-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    background: white;
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.settings-panel.open .settings-content {
    transform: translateX(0);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
}

.settings-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
}

.btn-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
}

.btn-close:hover {
    color: #64748b;
}

.settings-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.setting-group {
    margin-bottom: 24px;
}

.setting-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.radio-option input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #667eea;
}

.desk-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.desk-btn {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.desk-btn:hover {
    border-color: #cbd5e1;
}

.desk-btn.active {
    border-color: #667eea;
    background: #f0f4ff;
    color: #667eea;
}

.setting-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.setting-input:focus {
    outline: none;
    border-color: #667eea;
}

.settings-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 24px 0;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.95);
}

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

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: white;
}

.empty-state p {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
}

.empty-hint {
    margin-top: 20px;
    font-size: 14px;
}

kbd {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    font-family: monospace;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   QUEUE BANNER
   ═══════════════════════════════════════════════════════════ */

.queue-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    max-width: 600px;
    z-index: 50;
}

.queue-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
}

.queue-icon {
    font-size: 20px;
}

.queue-actions {
    display: flex;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════
   LOADING OVERLAY
   ═══════════════════════════════════════════════════════════ */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    color: white;
    margin-top: 20px;
    font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   DASHBOARD STYLES
   ═══════════════════════════════════════════════════════════ */

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.dashboard-header {
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-header .header-left h1 {
    font-size: 28px;
    margin-bottom: 5px;
    color: #1e293b;
}

.dashboard-header .header-left p {
    color: #64748b;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    font-size: 48px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    color: white;
}

.stat-card.primary .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card.success .stat-icon {
    background: #10b981;
}

.stat-card.warning .stat-icon {
    background: #f59e0b;
}

.stat-card.info .stat-icon {
    background: #3b82f6;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #1e293b;
}

.stat-label {
    font-size: 14px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.charts-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.charts-container h2 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #1e293b;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.chart-item {
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.chart-item h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #64748b;
}

/* Section Cards */
.section-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section-card h2 {
    font-size: 22px;
    margin-bottom: 25px;
    color: #1e293b;
    font-weight: 600;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.category-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    border-color: #667eea;
}

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

.category-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.category-count {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    background: white;
    padding: 4px 12px;
    border-radius: 20px;
}

.progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.category-percentage {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Venue and Desk Grids */
.venue-grid,
.desk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.stat-item-label {
    font-size: 15px;
    color: #475569;
    font-weight: 500;
}

.stat-item-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
}

/* Assignments List */
.assignments-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 600px;
    overflow-y: auto;
}

.assignment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.assignment-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.assignment-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.assignment-details {
    flex: 1;
}

.assignment-name {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 5px;
}

.assignment-meta {
    font-size: 13px;
    color: #64748b;
}

.assignment-meta strong {
    color: #667eea;
    font-weight: 600;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 16px;
}

/* Auth Section for Dashboard */
.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.auth-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    text-align: center;
    max-width: 400px;
}

.auth-card h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #1e293b;
}

.auth-card p {
    color: #64748b;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE - DESKTOP FIRST (Mobile as backup)
   ═══════════════════════════════════════════════════════════ */

/* Tablet & Below (768px - 1023px) */
@media (max-width: 1023px) {
    /* Header adjustments */
    .header {
        padding: 12px 15px;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .header-left-info {
        flex: 1 1 100%;
        margin-bottom: 8px;
    }
    
    .header-title {
        font-size: 18px;
    }
    
    .session-info {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .session-item {
        font-size: 12px;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .btn-header {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Main container */
    .main-container {
        max-width: 100%;
        padding: 15px;
    }
    
    /* Search */
    .search-container {
        padding: 0;
    }
    
    .search-input {
        font-size: 15px;
        padding: 12px 45px 12px 45px;
    }
    
    /* Cards */
    .participant-card {
        padding: 15px;
    }
    
    .card-header h3 {
        font-size: 17px;
    }
    
    .card-actions {
        gap: 8px;
    }
    
    .btn-card {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    /* Settings Panel - Overlay on smaller screens */
    .settings-panel.active .settings-content {
        width: 90%;
        max-width: 400px;
    }
    
    .settings-body {
        padding: 20px 15px;
    }
    
    /* Dashboard */
    .dashboard-container {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .venue-grid,
    .desk-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* Mobile Large (480px - 767px) */
@media (max-width: 767px) {
    /* Header - More compact */
    .header {
        padding: 10px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .session-info {
        font-size: 11px;
    }
    
    .status-indicator {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .btn-header {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Main container */
    .main-container {
        padding: 12px;
    }
    
    /* Search */
    .search-wrapper {
        padding: 0;
    }
    
    .search-input {
        height: 48px;
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 12px 50px 12px 45px;
    }
    
    .search-hint {
        font-size: 12px;
        padding: 8px 0;
    }
    
    /* Cards - Full width, larger touch targets */
    .participant-card {
        padding: 14px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn-card {
        flex: 1;
        padding: 10px 12px;
        font-size: 14px;
        min-height: 44px; /* Touch-friendly */
    }
    
    /* Expanded card form */
    .card-expanded {
        padding: 15px;
    }
    
    .bib-input-group input {
        height: 48px;
        font-size: 16px;
    }
    
    .btn-assign,
    .btn-cancel {
        padding: 12px 20px;
        font-size: 15px;
        min-height: 48px;
    }
    
    /* Settings Panel - Full screen on mobile */
    .settings-panel.active .settings-content {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
    }
    
    .settings-header {
        padding: 15px;
    }
    
    .settings-body {
        padding: 15px;
    }
    
    .desk-btn {
        min-width: 50px;
        height: 50px;
        font-size: 18px;
    }
    
    .setting-input {
        height: 48px;
        font-size: 16px;
    }
    
    .btn-primary {
        height: 50px;
        font-size: 16px;
    }
    
    /* Dashboard - Single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 18px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .venue-grid,
    .desk-grid {
        grid-template-columns: 1fr;
    }
    
    .section-card {
        padding: 20px 15px;
    }
    
    .assignment-item {
        padding: 12px;
    }
}

/* Mobile Small (< 480px) */
@media (max-width: 479px) {
    /* Header - Stack everything */
    .header {
        padding: 8px;
    }
    
    .header-left-info {
        margin-bottom: 6px;
    }
    
    .header-title {
        font-size: 14px;
    }
    
    .session-info {
        font-size: 10px;
        gap: 6px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-header {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    /* Auth container */
    .auth-box,
    .auth-card {
        padding: 25px 20px;
        max-width: 100%;
    }
    
    /* Main container */
    .main-container {
        padding: 10px;
    }
    
    /* Search */
    .search-input {
        height: 46px;
        font-size: 16px;
        padding: 10px 45px 10px 40px;
    }
    
    .search-icon {
        left: 12px;
        font-size: 18px;
    }
    
    .btn-clear {
        right: 12px;
        font-size: 20px;
    }
    
    .search-hint {
        font-size: 11px;
    }
    
    /* Cards */
    .participant-card {
        padding: 12px;
    }
    
    .card-header h3 {
        font-size: 15px;
    }
    
    .card-bib-badge {
        padding: 5px 12px;
        font-size: 13px;
    }
    
    .card-demographics,
    .card-contact {
        font-size: 12px;
    }
    
    .tshirt-badge {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .btn-card {
        padding: 8px 10px;
        font-size: 13px;
        min-height: 44px;
    }
    
    /* Expanded form */
    .card-info {
        font-size: 13px;
        padding: 12px;
    }
    
    /* Empty state */
    .empty-state h3 {
        font-size: 18px;
    }
    
    .empty-state p {
        font-size: 13px;
    }
    
    /* Stats bar */
    .stats-bar {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    /* Queue banner */
    .queue-banner {
        flex-direction: column;
        gap: 10px;
        padding: 12px 10px;
    }
    
    .queue-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .btn-small {
        flex: 1;
        min-height: 40px;
    }
    
    /* Dashboard */
    .dashboard-header {
        padding: 15px;
    }
    
    .dashboard-header h1 {
        font-size: 20px;
    }
    
    .stat-card {
        padding: 15px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 32px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 12px;
    }
    
    .section-card {
        padding: 15px 12px;
    }
    
    .section-card h2 {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .category-header h3 {
        font-size: 15px;
    }
    
    .category-count {
        font-size: 13px;
        padding: 3px 8px;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-item-label {
        font-size: 13px;
    }
    
    .stat-item-value {
        font-size: 20px;
    }
    
    .assignment-item {
        padding: 10px;
        gap: 10px;
    }
    
    .assignment-icon {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .assignment-name {
        font-size: 14px;
    }
    
    .assignment-meta {
        font-size: 12px;
    }
}

/* Landscape phones */
@media (max-height: 500px) and (orientation: landscape) {
    .settings-panel.active .settings-content {
        height: 100vh;
        overflow-y: auto;
    }
    
    .settings-body {
        padding-bottom: 80px;
    }
}

/* Print styles */
@media print {
    .header,
    .settings-panel,
    .loading-overlay,
    .queue-banner,
    .btn-card,
    .search-container {
        display: none !important;
    }
    
    .participant-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
