/* ==========================================================================
   TELEFON-NYILVÁNTARTÓ RENDSZER - GYERMEKVASÚT (COMPACT SINGLE TOOLBAR)
   ========================================================================== */

:root {
    --bg-main: #0b132b;
    --bg-card: rgba(30, 41, 59, 0.9);
    --bg-card-border: rgba(255, 255, 255, 0.2);
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.4);
    
    --success: #10b981;
    --success-hover: #059669;
    --success-glow: rgba(16, 185, 129, 0.4);
    
    --amber: #f59e0b;
    --amber-hover: #d97706;
    --amber-glow: rgba(245, 158, 11, 0.4);
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.4);
    
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #cbd5e1;
    
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition: all 0.2s ease-in-out;
    --shadow-glass: 0 12px 40px 0 rgba(0, 0, 0, 0.55);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.18) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--bg-card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-glass);
}

/* Brand Logo Image */
.brand-logo-img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    border: 1.5px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.brand-logo-large {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

/* Alert Messages */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.alert.error-alert { background: rgba(239, 68, 68, 0.14); border: 1px solid rgba(239, 68, 68, 0.45); color: #fca5a5; }
.alert.error-alert::before { content: "⚠️"; font-size: 1.2rem; }

.alert.success-alert { background: rgba(16, 185, 129, 0.14); border: 1px solid rgba(16, 185, 129, 0.45); color: #6ee7b7; }
.alert.success-alert::before { content: "✅"; font-size: 1.2rem; }

/* Login Page */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 16px;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    padding: 36px 24px;
    text-align: center;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

/* Form Controls */
.form-group {
    text-align: left;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

input[type="text"],
input[type="password"],
input[type="time"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: #0f172a !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: var(--radius-sm);
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 600;
    outline: none;
    transition: var(--transition);
}

select option {
    background-color: #0f172a !important;
    color: #ffffff !important;
}

::placeholder {
    color: #cbd5e1 !important;
    opacity: 1 !important;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
}

/* App Header & Navigation Bar - EGYESÍTETT ULTRA-LETISZTULT SÁV */
.app-header {
    margin: 14px 20px 0 20px;
    padding: 12px 20px;
}

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

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

.brand-title {
    font-size: 1.2rem;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
    display: block;
    margin-top: 1px;
}

.header-controls-grid {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.header-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    height: 36px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.header-stat-badge.amber {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fef3c7;
}

.header-stat-badge.blue {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.35);
    color: #e0e7ff;
}

.header-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.16);
    margin: 0 4px;
}

.btn-dash-icon {
    width: 36px;
    height: 36px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-dash-icon:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.btn-dash-icon.danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--danger);
    color: #fca5a5;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--amber);
}

.dot.pulse {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Main Layout */
.main-container {
    padding: 20px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    padding: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    flex-shrink: 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--primary);
    box-shadow: 0 4px 14px var(--primary-glow);
}

.tab-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Tab Content Panels */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* Grid & Layout Utilities */
.grid-2col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
}

.panel { 
    padding: 24px; 
    min-width: 0;
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.panel-header h2 {
    font-size: 1.25rem;
    line-height: 1.3;
}

.panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Mode Selector Bar */
.mode-selector-bar {
    padding: 14px 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.mode-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.mode-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(11, 19, 43, 0.5);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.08); }
.mode-btn.active { background: var(--primary); color: white; border-color: var(--primary); box-shadow: 0 4px 14px var(--primary-glow); }
.mode-btn.turn-in-mode.active { background: var(--amber); border-color: var(--amber); box-shadow: 0 4px 14px var(--amber-glow); }
.mode-btn.retrieve-mode.active { background: var(--success); border-color: var(--success); box-shadow: 0 4px 14px var(--success-glow); }

/* QR SCANNER & SINGLE CAMERA STABILITY OVERRIDES */
.scanner-wrapper {
    margin-bottom: 16px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    contain: layout paint;
}

.qr-reader-container, 
#qr-reader, 
#public-qr-reader { 
    width: 100% !important; 
    max-width: 100% !important; 
    min-height: 240px; 
    box-sizing: border-box !important;
    overflow: hidden !important;
}

#qr-reader canvas, 
#public-qr-reader canvas {
    display: none !important;
}

#qr-reader video, 
#public-qr-reader video {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 360px !important;
    object-fit: cover !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    display: block !important;
    border-radius: var(--radius-sm);
}

#qr-reader div, 
#public-qr-reader div {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.manual-input-box {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.divider-text {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.05em;
}

.inline-form { display: flex; gap: 8px; }

/* Empty state capsule */
.empty-state-capsule {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 20px;
    background: rgba(11, 19, 43, 0.45);
    border: 1px dashed rgba(255, 255, 255, 0.16);
    border-radius: var(--radius-md);
    margin: 16px 0;
    gap: 12px;
}

.empty-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.12);
    border: 1.5px solid rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.empty-state-capsule p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Scan Feed List & Items */
.scan-feed-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
    min-width: 0;
}

.scan-feed-item {
    background: rgba(11, 19, 43, 0.65);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-left: 4px solid var(--amber);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.scan-feed-item.returned {
    border-color: rgba(16, 185, 129, 0.3);
    border-left-color: var(--success);
}

.feed-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.feed-avatar {
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feed-info {
    min-width: 0;
}

.feed-info h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feed-info p {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Active Cards Grid */
.active-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.active-card {
    background: rgba(11, 19, 43, 0.8);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 14px;
}

.active-card-header { display: flex; align-items: center; gap: 12px; }
.active-avatar { font-size: 1.8rem; background: rgba(245, 158, 11, 0.18); padding: 8px; border-radius: 12px; flex-shrink: 0; }

.active-timer {
    background: rgba(245, 158, 11, 0.12);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
}

.timer-label { font-size: 0.75rem; color: var(--text-muted); display: block; margin-bottom: 2px; font-weight: 500; }
.timer-clock { font-family: 'Outfit', monospace; font-size: 1.4rem; font-weight: 800; color: var(--amber); }

/* STATISZTIKÁK */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-info h3 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* MÉRFÖLDKÖVEK & JELVÉNYEK PRECIZ ELRENDEZÉSE */
.milestones-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
    align-items: center;
    padding: 4px 0;
    min-height: 38px;
}

.milestone-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1.2;
}

.milestone-chip.unlocked {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.28));
    border: 1px solid rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}

.milestone-chip.claimed {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(217, 119, 6, 0.32));
    border: 1px solid rgba(245, 158, 11, 0.55);
    color: #fef08a;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
}

.milestone-chip label {
    flex-shrink: 0;
}

/* Data Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; text-align: left; }
.data-table th { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); font-weight: 700; padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); white-space: nowrap; }
.data-table td { padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }

/* Status Badges */
.badge { display: inline-block; padding: 5px 12px; border-radius: 50px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; line-height: 1.2; }
.badge-amber { background: rgba(245, 158, 11, 0.2); color: #fef3c7; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-green { background: rgba(16, 185, 129, 0.2); color: #a7f3d0; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-purple { background: rgba(168, 85, 247, 0.2); color: #f3e8ff; border: 1px solid rgba(168, 85, 247, 0.4); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }

.panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
    max-width: 100%;
}

.panel-actions::-webkit-scrollbar {
    display: none;
}

.panel-actions .btn {
    height: 38px !important;
    padding: 0 14px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.modal-backup-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
}

.modal-backup-grid .btn {
    width: 100%;
    max-width: 280px;
    height: 38px;
    font-size: 0.85rem;
    font-weight: 700;
    justify-content: center;
    margin: 0 auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
    box-sizing: border-box;
}

.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 14px var(--primary-glow); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-success { background: var(--success); color: white; box-shadow: 0 4px 14px var(--success-glow); }
.btn-success:hover { background: var(--success-hover); transform: translateY(-1px); }

.btn-warning { background: var(--amber); color: white; box-shadow: 0 4px 14px var(--amber-glow); }
.btn-warning:hover { background: var(--amber-hover); transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-hover); transform: translateY(-1px); }

.btn-secondary { background: rgba(255, 255, 255, 0.1); color: var(--text-primary); }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.18); }

.btn-outline { background: transparent; border: 1px solid rgba(255, 255, 255, 0.22); color: var(--text-primary); }
.btn-outline:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.4); }

.btn-sm { height: 34px; padding: 0 12px; font-size: 0.82rem; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 0.95rem; font-weight: 700; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

/* Search & Filter Bar */
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filter-bar input { flex: 2; min-width: 200px; }
.filter-bar select { flex: 1; min-width: 150px; }

/* Password & Group Lists */
.password-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.password-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(11, 19, 43, 0.6);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 8px;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-backdrop.hidden { display: none; }
.modal-card { width: 100%; max-width: 520px; padding: 24px; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.btn-icon { background: transparent; border: none; color: var(--text-secondary); font-size: 1.5rem; cursor: pointer; }
.btn-icon:hover { color: #fff; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* EGYÉNI QR KÓD KÁRTYA STÍLUSOS ELEGÁNS MEGJELENÍTÉSE */
.qr-modal-card {
    max-width: 460px !important;
}

.qr-print-card {
    background: #ffffff !important;
    color: #0f172a !important;
    border-radius: 20px !important;
    border-top: 5px solid #6366f1 !important;
    padding: 28px 20px !important;
    text-align: center !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35) !important;
    margin-bottom: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.badge-header {
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    color: #4f46e5 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    background: #e0e7ff !important;
    padding: 6px 16px !important;
    border-radius: 50px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-bottom: 20px !important;
    border: 1px solid #c7d2fe !important;
}

.qr-code-box {
    background: #ffffff !important;
    padding: 18px !important;
    border-radius: 16px !important;
    border: 2px solid #e2e8f0 !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 20px !important;
}

.qr-code-box canvas,
.qr-box-compact canvas,
#qrCodeContainer canvas,
#posterQrBox canvas {
    display: none !important;
}

.qr-code-box img,
.qr-box-compact img,
#qrCodeContainer img,
#posterQrBox img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 auto !important;
}

.qr-print-card h2 {
    font-size: 1.5rem !important;
    font-weight: 800 !important;
    color: #0f172a !important;
    margin-bottom: 4px !important;
    line-height: 1.25 !important;
}

.qr-print-card p {
    color: #64748b !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    margin-bottom: 16px !important;
}

.badge-token {
    font-family: 'Outfit', monospace !important;
    font-weight: 700 !important;
    font-size: 0.9rem !important;
    background: #f1f5f9 !important;
    color: #1e293b !important;
    padding: 8px 18px !important;
    border-radius: 50px !important;
    border: 1px solid #cbd5e1 !important;
    display: inline-block !important;
}

/* Toasts */
.toast-container { position: fixed; bottom: 16px; right: 16px; left: 16px; max-width: 380px; margin: 0 auto; z-index: 2000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    border: 1px solid var(--bg-card-border);
    border-left: 5px solid var(--primary);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-glass);
    animation: slideInUp 0.3s ease;
    font-size: 0.88rem;
    font-weight: 500;
    pointer-events: auto;
}
.toast.success { border-left-color: var(--success); }
.toast.amber { border-left-color: var(--amber); }
.toast.error { border-left-color: var(--danger); }

@keyframes slideInUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hidden { display: none !important; }

/* ==========================================================================
   MOBILE RESPONSIVE BREAKPOINTS (320px - 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .app-header {
        margin: 10px 10px 0 10px;
        padding: 12px 14px;
    }
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .brand {
        justify-content: flex-start;
    }
    .brand-title {
        font-size: 1.15rem;
    }
    .header-controls-grid {
        width: 100%;
        justify-content: space-between;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .main-container {
        padding: 12px 10px;
    }
    .panel {
        padding: 16px;
    }
    .grid-2col {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }
    .mode-selector-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .mode-buttons {
        width: 100%;
    }
    .mode-btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    .inline-form {
        flex-direction: column;
    }
    .inline-form button {
        width: 100%;
    }
    .stats-overview-grid {
        grid-template-columns: 1fr;
    }
    .stat-card {
        padding: 16px;
    }
    .active-grid {
        grid-template-columns: 1fr;
    }
}

#printableBulkArea {
    display: none !important;
}

/* ==========================================================================
   PRINT STYLES OPTIMIZED (TÖMEGES A4 NYOMTATÁS)
   ========================================================================== */

@media print {
    @page {
        size: A4 portrait;
        margin: 5mm;
    }

    @page posterPage {
        size: A4 landscape;
        margin: 5mm;
    }

    .poster-card-landscape {
        page: posterPage;
    }

    html, body {
        background: #ffffff !important;
        color: #000000 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    /* Elrejtjük az ÖSSZES nem-nyomtatandó elemet, hogy 0px magasságot foglaljanak */
    body > *:not(.print-active-target) {
        display: none !important;
        height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .app-header,
    .main-container,
    .toast-container,
    .modal-backdrop:not(.print-active-target) {
        display: none !important;
    }

    /* Csak az aktív nyomtatási konténer jelenik meg */
    .print-active-target,
    #printableBulkArea.print-active-target,
    #printablePosterArea.print-active-target {
        display: block !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        visibility: visible !important;
        margin: 0 auto !important;
        padding: 0 !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    .print-active-target * {
        visibility: visible !important;
    }

    .print-active-target img,
    .qr-box-compact img,
    #qrCodeContainer img,
    #posterQrBox img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        background: #ffffff !important;
    }

    /* Tömeges A4 Rács (Pontosan 40 cetli: 4 oszlop x 10 sor, 0mm margó, A4 Álló lap) */
    @page bulkQrPage {
        size: A4 portrait;
        margin: 0 !important;
    }

    #printableBulkArea.print-active-target {
        page: bulkQrPage;
        display: block !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        background: #ffffff !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .print-a4-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 52.5mm) !important;
        grid-template-rows: repeat(10, 29.7mm) !important;
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        box-sizing: border-box !important;
    }

    .qr-compact-card {
        width: 52.5mm !important;
        max-width: 52.5mm !important;
        height: 29.7mm !important;
        max-height: 29.7mm !important;
        border: 0.5px dashed #cbd5e1 !important;
        border-radius: 0 !important;
        padding: 2mm 3.5mm !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 1.5mm !important;
        text-align: left !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        background: #ffffff !important;
        color: #0f172a !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        position: relative !important;
    }

    .qr-box-compact {
        width: 21mm !important;
        height: 21mm !important;
        flex-shrink: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
    }

    .qr-box-compact img {
        width: 21mm !important;
        height: 21mm !important;
        display: block !important;
    }

    .qr-compact-info {
        flex: 1 !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: flex-start !important;
        overflow: hidden !important;
    }

    .qr-compact-card h3 {
        font-size: 8pt !important;
        font-weight: 800 !important;
        color: #0f172a !important;
        margin: 0 !important;
        line-height: 1.15 !important;
        word-break: break-word !important;
        overflow: hidden !important;
        max-height: 16mm !important;
    }

    .compact-token {
        font-family: monospace !important;
        font-weight: 800 !important;
        font-size: 7pt !important;
        color: #1e1b4b !important;
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
        padding: 1px 3px !important;
        border-radius: 3px !important;
        display: inline-block !important;
        margin-top: 1mm !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    /* Egyéni QR Kártya Nyomtatási Stílus (Szigorúan Álló A4 - Garantáltan 1 oldal) */
    #printablePosterArea.print-active-target .qr-card {
        border: 2.5px solid #000000 !important;
        border-radius: 16px !important;
        padding: 20px !important;
        max-width: 380px !important;
        margin: 15mm auto !important;
        text-align: center !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    /* A4 Fekvő Plakát Nyomtatási Stílus */
    #printablePosterArea.print-active-target {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 4mm !important;
        box-sizing: border-box !important;
        background: #ffffff !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }

    #printablePosterArea.print-active-target .poster-card-landscape {
        width: 100% !important;
        border: 4px double #000000 !important;
        border-radius: 16px !important;
        padding: 24px 36px !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        page-break-after: avoid !important;
        break-after: avoid !important;
    }
}

    #printablePosterArea.print-active-target .poster-main-heading {
        font-size: 2.4rem !important;
        color: #000000 !important;
    }

    #printablePosterArea.print-active-target .poster-subheading {
        font-size: 1.25rem !important;
        color: #333333 !important;
    }

    #printablePosterArea.print-active-target .poster-instruction-box {
        font-size: 1.1rem !important;
        border: 2px dashed #000000 !important;
        background: #fafafa !important;
        padding: 18px 24px !important;
    }

    #printablePosterArea.print-active-target .poster-qr-frame {
        border: 4px double #000000 !important;
        padding: 18px !important;
    }

    #printablePosterArea.print-active-target .poster-url-pill {
        font-size: 1.2rem !important;
        background: #eeeeee !important;
        color: #000000 !important;
    }
}

/* ==========================================================================
   PUBLIKUS PLAKÁT ELRENDEZÉS (SCREEN PREVIEW)
   ========================================================================== */

.poster-card-landscape {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 4px double #0f172a;
    border-radius: 20px;
    padding: 24px;
    color: #0f172a;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    text-align: left;
}

.poster-top-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.poster-badge-tag {
    background: #e0e7ff;
    color: #4f46e5;
    font-weight: 800;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    padding: 6px 18px;
    border-radius: 50px;
    border: 1px solid #c7d2fe;
    text-transform: uppercase;
}

.poster-body-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
}

.poster-left-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.poster-main-heading {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin: 0;
}

.poster-subheading {
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.poster-instruction-box {
    background: #f1f5f9;
    border: 1.5px dashed #94a3b8;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.45;
}

.poster-instruction-box p {
    margin: 0 0 4px 0;
}

.poster-subtext {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 6px !important;
}

.poster-right-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.poster-qr-frame {
    background: #ffffff;
    padding: 14px;
    border-radius: 16px;
    border: 3px double #0f172a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.poster-url-pill {
    font-family: monospace;
    font-weight: 800;
    font-size: 0.85rem;
    color: #4f46e5;
    background: #e0e7ff;
    padding: 6px 14px;
    border-radius: 8px;
}

/* ==========================================================================
   VILÁGOS MÓD (NAPSÜTÉSES / OUTDOOR MAGAS KONTRASZTÚ TÉMA)
   ========================================================================== */

body.sun-mode {
    background: #f1f5f9 !important;
    background-image: none !important;
    color: #020617 !important;
}

body.sun-mode .glass-panel,
body.sun-mode .app-header,
body.sun-mode .nav-tabs,
body.sun-mode .panel,
body.sun-mode .stat-card,
body.sun-mode .mode-selector-bar,
body.sun-mode .modal-card,
body.sun-mode .lookup-box,
body.sun-mode .room-card-box,
body.sun-mode .quick-assign-item,
body.sun-mode .leaderboard-item-card,
body.sun-mode .active-card,
body.sun-mode .scan-feed-item,
body.sun-mode .empty-state-capsule,
body.sun-mode .active-scorer-card {
    background: #ffffff !important;
    border: 2px solid #0f172a !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    color: #020617 !important;
}

body.sun-mode .room-occupant-item {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #020617 !important;
}

body.sun-mode .occupant-sub,
body.sun-mode .quick-assign-item span,
body.sun-mode .leaderboard-room-info span,
body.sun-mode .feed-info p,
body.sun-mode .stat-label {
    color: #475569 !important;
}

body.sun-mode h1, 
body.sun-mode h2, 
body.sun-mode h3, 
body.sun-mode h4,
body.sun-mode label,
body.sun-mode span,
body.sun-mode p,
body.sun-mode strong,
body.sun-mode th,
body.sun-mode td,
body.sun-mode div {
    color: #020617 !important;
}

body.sun-mode input,
body.sun-mode select,
body.sun-mode textarea {
    background: #ffffff !important;
    color: #020617 !important;
    border: 2px solid #020617 !important;
    font-weight: 700 !important;
}

body.sun-mode .tab-btn {
    color: #020617 !important;
    border: 1.5px solid #020617 !important;
    background: #f8fafc !important;
}

body.sun-mode .tab-btn.active {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border-color: #4f46e5 !important;
}

body.sun-mode .tab-btn.active span {
    color: #ffffff !important;
}

body.sun-mode .data-table th {
    background: #e2e8f0 !important;
    color: #020617 !important;
    border-bottom: 2px solid #020617 !important;
}

body.sun-mode .data-table td {
    border-bottom: 1px solid #cbd5e1 !important;
    color: #020617 !important;
}

/* Gombok kontrasztja Világos módban - KERETEK NÉLKÜL */
body.sun-mode .btn,
body.sun-mode .btn-primary,
body.sun-mode .btn-secondary,
body.sun-mode .btn-success,
body.sun-mode .btn-warning,
body.sun-mode .btn-danger,
body.sun-mode .btn-outline,
body.sun-mode .mode-btn {
    border: none !important;
    box-shadow: none !important;
    font-weight: 700 !important;
}

body.sun-mode .btn-primary,
body.sun-mode .btn-primary span {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border: none !important;
}

body.sun-mode .btn-success,
body.sun-mode .btn-success span {
    background: #16a34a !important;
    color: #ffffff !important;
    border: none !important;
}

body.sun-mode .btn-warning,
body.sun-mode .btn-warning span {
    background: #d97706 !important;
    color: #ffffff !important;
    border: none !important;
}

body.sun-mode .btn-danger,
body.sun-mode .btn-danger span {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: none !important;
}

body.sun-mode .btn-secondary,
body.sun-mode .btn-secondary span {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: none !important;
}

body.sun-mode .btn-secondary:hover {
    background: #cbd5e1 !important;
    color: #020617 !important;
    border: none !important;
}

/* Modal bezárás (X) gomb stílusai Világos módban - Keret és csúnya szegély nélkül */
body.sun-mode .closeModalBtn,
body.sun-mode .modal-close,
body.sun-mode .modal-header .btn-icon,
body.sun-mode .modal-header button,
body.sun-mode .btn-icon {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    color: #475569 !important;
    font-size: 1.6rem !important;
    line-height: 1 !important;
    padding: 4px 8px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
}

body.sun-mode .closeModalBtn:hover,
body.sun-mode .modal-close:hover,
body.sun-mode .modal-header .btn-icon:hover,
body.sun-mode .modal-header button:hover,
body.sun-mode .btn-icon:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* 1. Kapacitás (8/8 és <8 fő) kontrasztja és egysoros megjelenítése Világos módban */
.room-capacity-tag {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

body.sun-mode .room-capacity-tag {
    background: #ffffff !important;
    border: 1.5px solid #475569 !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

body.sun-mode .room-capacity-tag.full {
    background: #dc2626 !important;
    border: 1.5px solid #991b1b !important;
    color: #ffffff !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
}

/* 2. Csere és Törlés gombok kontrasztja a kártyákon Világos módban */
body.sun-mode .btn-occupant-action {
    background: #ffffff !important;
    border: none !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

body.sun-mode .btn-occupant-action.transfer {
    background: #dbeafe !important;
    border: none !important;
    color: #1e40af !important;
}

body.sun-mode .btn-occupant-action.depart {
    background: #fee2e2 !important;
    border: none !important;
    color: #991b1b !important;
}

body.sun-mode .btn-occupant-action:hover {
    transform: scale(1.1);
}

/* 3. Nyomtatás gomb és belső felirata Világos módban */
body.sun-mode #printA3Btn {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

body.sun-mode #printA3Btn span {
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* 4. Gyors szobapontozó pontszám gombjai (0-10) Világos módban */
body.sun-mode .btn-point-selector {
    background: #e2e8f0 !important;
    border: none !important;
    color: #0f172a !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}

body.sun-mode .btn-point-selector:hover {
    background: #cbd5e1 !important;
    border: none !important;
}

body.sun-mode .btn-point-selector.selected {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* 5. Következő szoba gomb és belső felirata Világos módban */
body.sun-mode #nextRoomBtn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

body.sun-mode #nextRoomBtn span {
    border: none !important;
    background: transparent !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* Belső span elemek keretének eltávolítása a gombokon */
body.sun-mode .btn span {
    border: none !important;
    box-shadow: none !important;
}

/* Badgek telített háttere és éles fehér felirata Világos módban (Napló & Kártyák) */
body.sun-mode .badge-purple {
    background: #7c3aed !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode .badge-danger {
    background: #dc2626 !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode .badge-amber {
    background: #d97706 !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode .badge-green,
body.sun-mode .badge-success {
    background: #16a34a !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode .btn-outline {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: none !important;
    font-weight: 700 !important;
}

/* 1. Szkennelési üzemmód gombjai Világos módban - keret nélkül */
body.sun-mode .mode-selector-bar {
    background: #ffffff !important;
    border: none !important;
}

body.sun-mode .mode-btn {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: none !important;
    font-weight: 700 !important;
}

body.sun-mode .mode-btn span {
    color: #0f172a !important;
}

body.sun-mode .mode-btn.active,
body.sun-mode .mode-btn.active span {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border: none !important;
}

body.sun-mode .mode-btn.turn-in-mode.active,
body.sun-mode .mode-btn.turn-in-mode.active span {
    background: #16a34a !important;
    color: #ffffff !important;
    border: none !important;
}

body.sun-mode .mode-btn.retrieve-mode.active,
body.sun-mode .mode-btn.retrieve-mode.active span {
    background: #d97706 !important;
    color: #ffffff !important;
    border: none !important;
}

/* 2. Kamera indítása / leállítása gomb Világos módban - keret nélkül */
body.sun-mode #startScanBtn,
body.sun-mode #startScanBtn span {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode #stopScanBtn,
body.sun-mode #stopScanBtn span {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

/* 3. Szolgálatos nap indítása / leállítása gomb Világos módban - keret nélkül */
body.sun-mode #serviceDayBtn,
body.sun-mode #serviceDayBtn span,
body.sun-mode #toggleServiceDayBtn,
body.sun-mode #toggleServiceDayBtn span {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

/* 4. Új gyermek, tömeges nyomtatás, táborzárás gombok Világos módban - keret nélkül */
body.sun-mode #openAddChildBtn,
body.sun-mode #openAddChildBtn span {
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode #printAllQrBtn,
body.sun-mode #printAllQrBtn span {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode #openCloseCampModalBtn,
body.sun-mode #openCloseCampModalBtn span {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode #openBulkAddBtn,
body.sun-mode #openGroupManagerBtn,
body.sun-mode #openPublicPosterBtn {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: none !important;
    font-weight: 700 !important;
}

body.sun-mode #openBulkAddBtn span,
body.sun-mode #openGroupManagerBtn span,
body.sun-mode #openPublicPosterBtn span {
    color: #0f172a !important;
}

/* 5. Pontok gombok Világos módban - keret nélkül */
body.sun-mode .adjust-points-btn,
body.sun-mode .adjust-points-btn span,
body.sun-mode .grant-equity-btn,
body.sun-mode .grant-equity-btn span {
    background: #4f46e5 !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
}

/* 6. Új mérföldkő gomb Világos módban - keret nélkül */
body.sun-mode #openAddMilestoneBtn,
body.sun-mode #openAddMilestoneBtn span {
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode #openMilestoneManagerBtn {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: none !important;
}

/* 7. Excel export és Összegző riport gombok Világos módban - keret nélkül */
body.sun-mode #exportExcelBtn,
body.sun-mode #exportExcelBtn span {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode #exportPdfBtn,
body.sun-mode #exportPdfBtn span {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode #exportCsvBtn,
body.sun-mode #exportCsvBtn span {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    border: none !important;
    font-weight: 700 !important;
}

/* 8. Mentés és Új jelszó gombok Világos módban - keret nélkül */
body.sun-mode #settingsForm button[type="submit"],
body.sun-mode #settingsForm button[type="submit"] span {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

body.sun-mode #addPasswordForm button[type="submit"],
body.sun-mode #addPasswordForm button[type="submit"] span {
    background: linear-gradient(135deg, #4f46e5, #4338ca) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
}

/* 9. Aktív jelszavak kártyái Világos módban */
body.sun-mode .password-list li {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    color: #0f172a !important;
}

body.sun-mode .password-list li strong {
    color: #0f172a !important;
}

/* 10. Mérföldkövek & Jutalmak kártyái (Chips) Világos módban - Éles Kerettel */
body.sun-mode .milestone-chip {
    background: #f1f5f9 !important;
    border: 1.5px solid #64748b !important;
    color: #334155 !important;
    font-weight: 700 !important;
}

body.sun-mode .milestone-chip.unlocked {
    background: #dcfce7 !important;
    border: 2px solid #16a34a !important;
    color: #14532d !important;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.15) !important;
}

body.sun-mode .milestone-chip.claimed {
    background: #fef3c7 !important;
    border: 2px solid #d97706 !important;
    color: #78350f !important;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.2) !important;
}

body.sun-mode .milestone-chip label {
    background: rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.2) !important;
}

body.sun-mode .milestone-chip label small {
    color: #0f172a !important;
    font-weight: 800 !important;
}

body.sun-mode .mode-btn {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.sun-mode .mode-btn.active {
    background: #4f46e5 !important;
    color: #ffffff !important;
}

body.sun-mode .btn-dash-icon {
    background: #ffffff !important;
    border: 2px solid #020617 !important;
    color: #020617 !important;
}

body.sun-mode .header-stat-badge {
    background: #ffffff !important;
    border: 2px solid #020617 !important;
    color: #020617 !important;
}

body.sun-mode .header-stat-badge strong {
    color: #4f46e5 !important;
}

body.sun-mode .header-divider {
    background: #020617 !important;
}

/* Felugró üzenetek (Toast értesítések) Világos módban */
body.sun-mode .toast {
    background: #0f172a !important;
    color: #ffffff !important;
    border: 2px solid #0f172a !important;
    font-weight: 700 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3) !important;
}

body.sun-mode .toast.success {
    border-left: 6px solid #22c55e !important;
}

body.sun-mode .toast.amber {
    border-left: 6px solid #f59e0b !important;
}

body.sun-mode .toast.error {
    border-left: 6px solid #ef4444 !important;
}

/* ==========================================================================
   SZOBAKEZELŐ & 10-NAPOS PONTVERSENY STÍLUSOK (ROOMS.PHP)
   ========================================================================== */

#printableA3Area {
    display: none !important;
}

.version-control-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.version-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 260px;
}

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

.form-select-custom,
.form-input-custom {
    background: #0f172a !important;
    border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: var(--radius-sm);
    color: #ffffff !important;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    outline: none;
}

.form-select-custom option {
    background-color: #0f172a !important;
    color: #ffffff !important;
}

.rooms-grid-24 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.room-card-box {
    background: rgba(30, 41, 59, 0.92) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: var(--transition);
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.room-card-box.boy {
    border-color: rgba(96, 165, 250, 0.6) !important;
    border-top: 4px solid #60a5fa !important;
}

.room-card-box.girl {
    border-color: rgba(244, 114, 182, 0.6) !important;
    border-top: 4px solid #f472b6 !important;
}

.room-card-box.unoccupied {
    border-color: rgba(239, 68, 68, 0.5) !important;
    border-top: 4px solid #ef4444 !important;
    background: rgba(30, 41, 59, 0.75) !important;
    opacity: 0.9;
}

.room-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.room-number-badge {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #ffffff !important;
}

.room-capacity-tag {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    color: #e2e8f0 !important;
}

.room-capacity-tag.full {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

.room-occupants-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0;
    min-height: 80px;
}

.room-occupant-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.09) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: #ffffff !important;
}

.room-occupant-item strong {
    color: #ffffff !important;
}

.occupant-sub {
    display: block;
    font-size: 0.75rem;
    color: #cbd5e1 !important;
}

.occupant-actions {
    display: flex;
    gap: 4px;
}

.btn-occupant-action {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
}

.btn-occupant-action.transfer:hover { background: #6366f1; }
.btn-occupant-action.depart:hover { background: #ef4444; }

.room-occupant-empty {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 12px 0;
    text-align: center;
}

.quick-scorer-setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.active-scorer-card {
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid #6366f1;
    border-radius: 16px;
    padding: 20px;
}

.scorer-room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.scorer-room-badge {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
}

.scorer-kids-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.scorer-kid-chip {
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 0.78rem;
    color: #e0e7ff;
    font-weight: 600;
}

.point-buttons-grid {
    display: grid;
    grid-template-columns: repeat(11, 1fr);
    gap: 6px;
}

.btn-point-selector {
    background: rgba(255, 255, 255, 0.08);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
    height: 48px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-point-selector:hover {
    background: rgba(99, 102, 241, 0.4);
    border-color: #6366f1;
    transform: translateY(-2px);
}

.btn-point-selector.selected {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border-color: #fef08a !important;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    transform: scale(1.08);
}

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

.leaderboard-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .leaderboard-dual-grid { grid-template-columns: 1fr; }
    .quick-scorer-setup-grid { grid-template-columns: 1fr; }
    .point-buttons-grid { grid-template-columns: repeat(6, 1fr) !important; gap: 4px !important; }
    .version-control-bar { justify-content: center !important; text-align: center; }
    .version-left { justify-content: center !important; width: 100%; }
    .version-actions { justify-content: center !important; width: 100%; margin-top: 6px; }
}

@media (max-width: 600px) {
    .active-scorer-card { padding: 14px 10px !important; }
    .btn-point-selector { height: 42px !important; font-size: 1.05rem !important; padding: 0 !important; }
    .scorer-actions { flex-direction: column !important; gap: 8px !important; }
    .scorer-actions button { width: 100% !important; flex: none !important; justify-content: center !important; }
    .scorer-room-header { flex-wrap: wrap; gap: 8px; justify-content: center; text-align: center; }
}

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

.leaderboard-item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    gap: 12px;
}

.leaderboard-item-card.first-place-gold {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35)) !important;
    border: 2px solid #f59e0b !important;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.3) !important;
}

.leaderboard-rank-badge {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    white-space: nowrap;
    flex-shrink: 0;
}

.leaderboard-rank-badge.gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    font-size: 1.15rem;
    white-space: nowrap;
}

.leaderboard-room-info h4 {
    font-size: 1rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.leaderboard-room-info span {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.leaderboard-score {
    text-align: right;
}

.leaderboard-score span {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: #f59e0b;
    display: block;
}

.leaderboard-score small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==========================================================================
   A3 LANDSCAPE 1-PAGE PRINT STYLES
   ========================================================================== */

@media print {
    @page roomAssignmentA3 {
        size: A3 landscape;
        margin: 4mm;
    }

    #printableA3Area.print-a3-active {
        page: roomAssignmentA3;
        display: block !important;
        position: relative !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        background: #ffffff !important;
        color: #000000 !important;
        visibility: visible !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .a3-print-wrapper {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .a3-print-header {
        text-align: center !important;
        margin-bottom: 4mm !important;
        border-bottom: 2px solid #000000 !important;
        padding-bottom: 2mm !important;
    }

    .a3-print-header h2 {
        font-size: 14pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
        margin: 0 !important;
    }

    .a3-print-header p {
        font-size: 9pt !important;
        color: #333333 !important;
        margin: 1mm 0 0 0 !important;
    }

    /* 24 Rooms in a 6 columns x 4 rows A3 Grid - Strict Single Page Fit */
    .a3-grid-24 {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        grid-template-rows: repeat(4, 1fr) !important;
        gap: 3mm !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .a3-room-box {
        border: 1.5px solid #000000 !important;
        border-radius: 4px !important;
        padding: 2mm !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-sizing: border-box !important;
        page-break-inside: avoid !important;
        break-inside: avoid !important;
        height: 60mm !important;
        max-height: 60mm !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }

    .a3-room-box.boy { border-top: 4px solid #1e40af !important; }
    .a3-room-box.girl { border-top: 4px solid #be185d !important; }
    .a3-room-box.unoccupied { border-top: 4px solid #6b7280 !important; opacity: 0.6 !important; }

    .a3-room-head {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        border-bottom: 1px solid #ccc !important;
        padding-bottom: 1mm !important;
        margin-bottom: 1mm !important;
    }

    .a3-room-title {
        font-size: 10pt !important;
        font-weight: 800 !important;
        color: #000000 !important;
    }

    .a3-room-tag {
        font-size: 7.5pt !important;
        font-weight: 700 !important;
        color: #333333 !important;
    }

    .a3-room-count {
        font-size: 8pt !important;
        font-weight: 700 !important;
    }

    .a3-kids-list {
        margin: 1mm 0 0 0 !important;
        padding-left: 4.5mm !important;
        font-size: 8.5pt !important;
        line-height: 1.3 !important;
        color: #000000 !important;
    }

    .a3-kids-list li {
        margin-bottom: 0.5mm !important;
    }
}

/* Subtle Footer Link */
.app-footer-subtle {
    text-align: center;
    padding: 24px 0 16px 0;
    font-size: 0.8rem;
    font-weight: 500;
}

.app-footer-subtle a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    transition: all 0.2s ease;
}

.app-footer-subtle a:hover {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

body.sun-mode .app-footer-subtle a {
    color: rgba(15, 23, 42, 0.4);
}

body.sun-mode .app-footer-subtle a:hover {
    color: rgba(15, 23, 42, 0.85);
}
