/* ========================================
   自動受付・席案内システム — Premium Design System
   ======================================== */

:root {
    --primary: #1a56db;
    --primary-dark: #1648b3;
    --primary-light: #dbeafe;
    --primary-50: #eff6ff;
    --primary-glow: rgba(26, 86, 219, 0.3);
    --secondary: #059669;
    --secondary-light: #d1fae5;
    --secondary-dark: #047857;
    --accent: #d97706;
    --accent-light: #fef3c7;
    --error: #dc2626;
    --error-light: #fee2e2;
    --bg: #f1f5f9;
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-glass: rgba(255, 255, 255, 0.85);
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-dark: #cbd5e1;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
    --shadow-primary: 0 8px 24px rgba(26, 86, 219, 0.25);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --sidebar-width: 280px;
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Zen Kaku Gothic New', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#app { width: 100%; height: 100%; position: relative; }

/* ========== PAGES ========== */
.page {
    position: absolute;
    inset: 0;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-slow);
    overflow-y: auto;
    background: var(--bg-gradient);
}
.page.active { display: flex; opacity: 1; }
.page-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    width: 100%;
}
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
}
.page-header-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1;
    animation: iconFloat 3s ease-in-out infinite;
}
@keyframes iconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.page-title {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}
.page-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1.5rem;
    font-family: inherit;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-xl);
    transition: all var(--transition-normal);
}
.btn-back:hover {
    background: var(--surface);
    color: var(--primary);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    transform: translateX(-2px);
}

/* ========== SCREENSAVER ========== */
.screensaver-bg {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c1222 0%, #162044 30%, #1a3a7a 60%, #1a56db 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.screensaver-overlay {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(26, 86, 219, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 80%, rgba(5, 150, 105, 0.1) 0%, transparent 40%);
    animation: overlayShift 25s ease-in-out infinite;
}
@keyframes overlayShift {
    0%, 100% { opacity: 1; transform: scale(1); }
    33% { opacity: 0.8; transform: scale(1.05) rotate(1deg); }
    66% { opacity: 0.9; transform: scale(1.02) rotate(-0.5deg); }
}
.screensaver-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}
@keyframes particleFloat {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

.screensaver-content {
    text-align: center;
    z-index: 2;
    animation: contentFadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: ringBreath 4s ease-in-out infinite;
    backdrop-filter: blur(8px);
}
@keyframes ringBreath {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.1); }
    50% { transform: scale(1.03); box-shadow: 0 0 40px 8px rgba(26, 86, 219, 0.15); }
}
.logo-icon {
    font-size: 3.5rem;
    line-height: 1;
}
.screensaver-title {
    font-size: 4rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.screensaver-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 3.5rem;
    font-weight: 400;
    letter-spacing: 0.08em;
}

.btn-checkin-large {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
    color: #fff;
    border: none;
    padding: 1.25rem 3rem;
    border-radius: var(--radius-2xl);
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 8px 32px rgba(37, 99, 235, 0.4), inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all var(--transition-normal);
    animation: checkinGlow 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}
.btn-checkin-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}
@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}
@keyframes checkinGlow {
    0%,100% { box-shadow: 0 8px 32px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.2); }
    50% { box-shadow: 0 12px 48px rgba(37,99,235,0.55), inset 0 1px 0 rgba(255,255,255,0.2); }
}
.btn-checkin-large:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 16px 48px rgba(37,99,235,0.5);
}
.btn-checkin-large:active { transform: translateY(0) scale(0.98); }
.btn-icon-wrap {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}
.btn-checkin-large .btn-text { text-align: left; line-height: 1.3; }
.btn-checkin-large .btn-text small { font-size: 0.75rem; font-weight: 400; opacity: 0.7; }
.btn-arrow {
    font-size: 1.5rem;
    opacity: 0.5;
    transition: all var(--transition-normal);
}
.btn-checkin-large:hover .btn-arrow {
    opacity: 1;
    transform: translateX(4px);
}

.screensaver-hint {
    color: rgba(255,255,255,0.35);
    font-size: 0.85rem;
    margin-top: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.hint-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
    0%,100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.5); }
}
.screensaver-time {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.25);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* ========== METHOD CARDS ========== */
.method-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.method-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    position: relative;
    overflow: hidden;
}
.method-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-50), transparent);
    opacity: 0;
    transition: opacity var(--transition-normal);
}
.method-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 0 3px var(--primary-light);
    transform: translateY(-3px);
}
.method-card:hover::before { opacity: 1; }
.method-card:active { transform: translateY(0); }
.method-icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: all var(--transition-normal);
}
.method-card:hover .method-icon-wrap {
    background: var(--primary);
    transform: scale(1.08);
}
.method-card:hover .method-icon-wrap .method-icon {
    filter: brightness(2);
}
.method-icon { font-size: 1.6rem; }
.method-content { flex: 1; position: relative; z-index: 1; }
.method-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.25rem; color: var(--text); }
.method-card p { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4; }
.method-badge {
    position: absolute;
    top: -1px;
    right: 16px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    font-size: 0.65rem;
    padding: 4px 14px;
    border-radius: 0 0 10px 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(26,86,219,0.25);
}
.method-arrow {
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all var(--transition-normal);
    position: relative;
    z-index: 1;
}
.method-card:hover .method-arrow {
    color: var(--primary);
    transform: translateX(4px);
}

/* ========== QR SCANNER ========== */
.qr-scanner-area { text-align: center; padding: 2rem 0; }
.qr-frame {
    width: 280px;
    height: 280px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0a, #1a1a2e);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), inset 0 0 60px rgba(0,0,0,0.3);
}
.qr-corner {
    position: absolute;
    width: 44px;
    height: 44px;
    border: 3px solid var(--primary);
    filter: drop-shadow(0 0 6px var(--primary-glow));
}
.qr-corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; border-radius: 12px 0 0 0; }
.qr-corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; border-radius: 0 12px 0 0; }
.qr-corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; border-radius: 0 0 0 12px; }
.qr-corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; border-radius: 0 0 12px 0; }
.qr-laser {
    position: absolute;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scanLaser 2.5s ease-in-out infinite;
    box-shadow: 0 0 15px var(--primary-glow), 0 0 30px rgba(37,99,235,0.2);
}
@keyframes scanLaser {
    0%,100% { top: 10%; }
    50% { top: 85%; }
}
.qr-text { color: rgba(255,255,255,0.4); font-size: 0.8rem; padding: 0 1rem; }

/* ========== INPUT AREA ========== */
.input-area {
    max-width: 500px;
    margin: 0 auto;
}
.login-card {
    max-width: 420px;
    margin: 0 auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.input-group {
    margin-bottom: 1.25rem;
}
.input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}
.input-field {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    background: var(--surface);
    color: var(--text);
}
.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}
.input-large { font-size: 1.3rem; padding: 1rem 1.25rem; text-align: center; letter-spacing: 0.05em; }

/* ========== BUTTONS ========== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    box-shadow: var(--shadow-primary);
    transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1.5px solid var(--border);
    padding: 0.875rem 2rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-normal);
}
.btn-secondary:hover {
    border-color: var(--border-dark);
    background: var(--surface-alt);
    box-shadow: var(--shadow-sm);
}
.btn-lg { padding: 1.1rem 2.5rem; font-size: 1.1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 0.5rem 1.25rem; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }
.btn-group { display: flex; flex-direction: column; gap: 0.75rem; }

/* ========== RESERVATION CARD ========== */
.reservation-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 2rem;
    max-width: 500px;
    margin: 0 auto;
    border: 1px solid var(--border);
}
.reservation-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.reservation-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--secondary-light);
    color: var(--secondary-dark);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 0.9rem;
}
.reservation-details {
    background: var(--surface-alt);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}
.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-secondary); font-size: 0.9rem; }
.detail-value { font-weight: 700; font-size: 1.05rem; }
.reservation-question {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* ========== SEAT GUIDE ========== */
.seat-guide-container { max-width: 600px; }
.checkin-success { text-align: center; margin-bottom: 1.5rem; }
.success-animation { margin-bottom: 1rem; }
.success-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto;
}
.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 3;
    stroke: var(--secondary);
    stroke-miterlimit: 10;
    animation: fillCheck 0.4s ease-in-out 0.4s forwards, scaleCheck 0.3s ease-in-out 0.9s both;
}
.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke: var(--secondary);
    animation: strokeCheck 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.checkmark-check {
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: strokeCheck 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}
@keyframes strokeCheck { 100% { stroke-dashoffset: 0; } }
@keyframes fillCheck { 100% { box-shadow: inset 0px 0px 0px 30px transparent; } }
@keyframes scaleCheck {
    0%,100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}
.success-title {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--secondary);
    background: linear-gradient(135deg, var(--secondary), #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.success-subtitle { font-size: 1.1rem; color: var(--text-secondary); margin-top: 0.25rem; }

.seat-info-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border);
}
.seat-number {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 50%, #60a5fa 100%);
    color: #fff;
    text-align: center;
    padding: 1.75rem;
    position: relative;
}
.seat-number::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1));
}
.seat-label { display: block; font-size: 0.85rem; opacity: 0.8; margin-bottom: 0.25rem; position: relative; }
.seat-value { font-size: 3rem; font-weight: 900; letter-spacing: 0.1em; position: relative; text-shadow: 0 2px 10px rgba(0,0,0,0.2); }
.seat-direction {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.direction-icon {
    font-size: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 700;
}
.direction-main { font-weight: 600; margin-bottom: 0.25rem; }
.direction-sub { font-size: 0.8rem; color: var(--text-muted); }

/* Floor Map V2 */
.floor-map { padding: 1.25rem 1.5rem; }
.map-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.map-container {
    position: relative;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(135deg, #fafbfc, #f1f5f9);
}

.map-entrance-v2 {
    background: linear-gradient(90deg, var(--accent-light), #fff7ed);
    color: var(--accent);
    text-align: center;
    padding: 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-bottom: 2px dashed var(--accent);
}
.entrance-icon { font-size: 1.2rem; }

.map-floor {
    position: relative;
    padding: 2rem 0.75rem 1rem;
}

.zone-label {
    position: absolute;
    top: 0.4rem;
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
}
.zone-left { left: 1rem; }
.zone-right { right: 1rem; }

.map-row {
    display: grid;
    grid-template-columns: 1fr 1fr 28px 1fr 1fr;
    gap: 5px;
    margin-bottom: 5px;
}

.map-walkway-v {
    position: relative;
}
.map-walkway-v::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: repeating-linear-gradient(to bottom, var(--border-dark) 0, var(--border-dark) 4px, transparent 4px, transparent 8px);
}

.map-table {
    padding: 0.5rem 0.25rem;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 600;
    background: var(--secondary-light);
    color: var(--secondary);
    border-radius: 6px;
    border: 1.5px solid rgba(5,150,105,0.2);
    transition: all 0.3s;
    position: relative;
}
.map-table.occupied {
    background: #f1f5f9;
    color: var(--text-muted);
    border-color: var(--border);
}
.map-table.highlight {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    border-color: var(--primary-dark);
    font-size: 0.7rem;
    font-weight: 800;
    animation: highlightPulse 1.5s ease-in-out infinite;
    z-index: 2;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.2);
}
@keyframes highlightPulse {
    0%,100% { box-shadow: 0 0 0 3px rgba(37,99,235,0.2); }
    50% { box-shadow: 0 0 0 6px rgba(37,99,235,0.15), 0 0 16px rgba(37,99,235,0.1); }
}

.map-aisle-h {
    text-align: center;
    padding: 0.25rem 0;
    margin: 3px 0;
    font-size: 0.55rem;
    color: var(--text-muted);
    background: linear-gradient(90deg, transparent 0%, var(--border) 20%, var(--border) 80%, transparent 100%);
    border-radius: 2px;
    letter-spacing: 0.1em;
}
.map-aisle-h span { background: #f8fafc; padding: 0 0.5rem; }

/* SVG Arrow */
.map-arrow-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 3;
}
.walk-path {
    stroke-dasharray: 8, 6;
    animation: dashFlow 1s linear infinite;
    opacity: 0.8;
}
@keyframes dashFlow { to { stroke-dashoffset: -28; } }

/* Walking indicator */
.walk-indicator {
    position: absolute;
    z-index: 5;
    display: none;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    animation: bounceIndicator 1.2s ease-in-out infinite;
    pointer-events: none;
}
.walk-indicator.active { display: flex; }
.walk-dot {
    width: 14px;
    height: 14px;
    background: var(--primary);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(37,99,235,0.4);
}
.walk-label {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 8px;
    margin-top: 4px;
    text-align: center;
    line-height: 1.3;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
    white-space: nowrap;
}
@keyframes bounceIndicator {
    0%, 100% { transform: translate(-50%, -100%) translateY(0); }
    50% { transform: translate(-50%, -100%) translateY(-6px); }
}

/* Map Legend */
.map-legend {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    padding: 0.75rem 0 0;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}
.legend-dot.available { background: var(--secondary-light); border: 1px solid rgba(5,150,105,0.3); }
.legend-dot.occupied { background: #f1f5f9; border: 1px solid var(--border); }
.legend-dot.yours { background: linear-gradient(135deg, var(--primary), #3b82f6); border: 1px solid var(--primary-dark); }

.auto-return {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* ========== SEARCH RESULTS ========== */
.search-results { margin-top: 1.25rem; }
.search-result-item {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.search-result-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-light);
    transform: translateY(-1px);
}
.result-info h4 { font-size: 1.05rem; font-weight: 700; }
.result-info p { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.result-arrow { color: var(--primary); font-size: 1.2rem; }

/* ========== ADMIN LAYOUT ========== */
#page-admin-dashboard {
    overflow: hidden;
}
#page-admin-dashboard.active {
    display: block;
}
.admin-layout {
    display: flex;
    height: 100%;
}
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
}
.sidebar-logo-icon {
    font-size: 1.5rem;
}
.logo-text {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
}
.sidebar-nav { flex: 1; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    cursor: pointer;
    margin-bottom: 0.25rem;
}
.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    transform: translateX(2px);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(37,99,235,0.2), rgba(37,99,235,0.1));
    color: #fff;
    box-shadow: inset 3px 0 0 var(--primary);
}
.nav-icon { font-size: 1.1rem; }
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1rem;
}
.user-avatar {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}
.user-info { display: flex; flex-direction: column; }
.user-name { color: #fff; font-size: 0.85rem; font-weight: 500; }
.user-role { color: rgba(255,255,255,0.35); font-size: 0.7rem; }
.btn-logout {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.45);
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 0.75rem;
    font-family: inherit;
    transition: all var(--transition-normal);
}
.btn-logout:hover { background: rgba(255,255,255,0.1); color: #fff; }

.admin-main {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
    background: var(--bg-gradient);
}
.admin-tab { display: none; }
.admin-tab.active { display: block; animation: tabFadeIn 0.3s ease; }
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.admin-header h2 { font-size: 1.6rem; font-weight: 900; color: var(--text); }
.admin-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    background: var(--surface);
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.header-actions { display: flex; gap: 0.75rem; align-items: center; }
.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
}
.input-search {
    max-width: 280px;
    padding: 0.5rem 1rem 0.5rem 2.5rem !important;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-normal);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}
.stat-blue::before { background: linear-gradient(180deg, var(--primary), #3b82f6); }
.stat-green::before { background: linear-gradient(180deg, var(--secondary), #10b981); }
.stat-orange::before { background: linear-gradient(180deg, var(--accent), #f59e0b); }
.stat-red::before { background: linear-gradient(180deg, var(--error), #ef4444); }
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-blue .stat-icon-wrap { background: var(--primary-light); }
.stat-green .stat-icon-wrap { background: var(--secondary-light); }
.stat-orange .stat-icon-wrap { background: var(--accent-light); }
.stat-red .stat-icon-wrap { background: var(--error-light); }
.stat-value { display: block; font-size: 1.8rem; font-weight: 900; line-height: 1; }
.stat-label { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 0.25rem; font-weight: 500; }
.stat-trend {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}
.stat-trend.up { background: var(--secondary-light); color: var(--secondary-dark); }
.stat-trend.down { background: var(--error-light); color: var(--error); }
.stat-trend.neutral { background: var(--surface-alt); color: var(--text-muted); }

/* Chart */
.chart-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.chart-header h3 { font-size: 1rem; font-weight: 700; }
.chart-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--surface-alt);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}
.bar-chart { display: flex; flex-direction: column; gap: 0.6rem; }
.bar-item { display: flex; align-items: center; gap: 0.75rem; }
.bar-label { font-size: 0.8rem; color: var(--text-muted); width: 50px; text-align: right; flex-shrink: 0; font-weight: 500; }
.bar {
    height: 32px;
    background: linear-gradient(90deg, var(--primary), #3b82f6);
    border-radius: 6px;
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 30px;
    position: relative;
    overflow: hidden;
}
.bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
}
.bar.peak {
    background: linear-gradient(90deg, #059669, #10b981);
}

/* Filters */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 0.45rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xl);
    background: var(--surface);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    font-weight: 500;
}
.filter-btn:hover { border-color: var(--primary); color: var(--primary); }
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(26,86,219,0.2);
}

/* Table */
.table-container {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    border: 1px solid var(--border);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th {
    background: var(--surface-alt);
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table tbody tr { transition: background var(--transition-fast); }
.data-table tbody tr:hover { background: var(--primary-50); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
}
.badge-success { background: var(--secondary-light); color: var(--secondary-dark); }
.badge-pending { background: var(--accent-light); color: var(--accent); }
.badge-cancelled { background: var(--error-light); color: var(--error); }

.btn-checkin-sm {
    padding: 0.35rem 0.85rem;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-normal);
}
.btn-checkin-sm:hover { box-shadow: var(--shadow-primary); transform: translateY(-1px); }

/* Settings */
.settings-sections { display: flex; flex-direction: column; gap: 1.5rem; }
.settings-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.settings-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.settings-icon { font-size: 1.2rem; }
.settings-section-header h3 {
    font-size: 1rem;
    font-weight: 700;
}
.settings-form { display: flex; flex-direction: column; gap: 0.75rem; }
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.5rem 0;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot.green {
    background: var(--secondary);
    box-shadow: 0 0 6px var(--secondary), 0 0 12px rgba(5,150,105,0.3);
    animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ========== TOAST ========== */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #fff;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--shadow-2xl);
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
}
.toast.show { bottom: 2.5rem; }

/* ========== ADMIN TRIGGER ========== */
.admin-trigger {
    position: fixed;
    bottom: 0.75rem;
    right: 0.75rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    cursor: pointer;
    opacity: 0.1;
    transition: all var(--transition-normal);
    z-index: 100;
    border-radius: 50%;
}
.admin-trigger:hover {
    opacity: 0.6;
    background: rgba(0,0,0,0.05);
}

/* ========== RESPONSIVE ========== */

/* --- Large tablets / small laptops --- */
@media (max-width: 1200px) {
    .admin-sidebar { width: 240px; }
    .admin-main { padding: 1.5rem 2rem; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-header { flex-direction: column; align-items: flex-start; }
    .header-actions { width: 100%; }
    .input-search { max-width: 100%; flex: 1; }
}

/* --- Tablets --- */
@media (max-width: 1024px) {
    .admin-sidebar { width: 220px; }
    .admin-sidebar .sidebar-logo { padding: 0.5rem; }
    .logo-text { font-size: 0.95rem; }
    .nav-item { font-size: 0.82rem; padding: 0.65rem 0.75rem; }
    .admin-main { padding: 1.25rem 1.5rem; }
    .admin-header h2 { font-size: 1.3rem; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.5rem; }
    .stat-icon-wrap { width: 40px; height: 40px; font-size: 1.2rem; }
    .chart-section { padding: 1.25rem; }
    .data-table th, .data-table td { padding: 0.625rem 0.75rem; font-size: 0.8rem; }
    .filter-bar { gap: 0.35rem; }
    .filter-btn { padding: 0.35rem 0.75rem; font-size: 0.75rem; }
    .settings-section { padding: 1.25rem; }
}

/* --- Small tablets / large phones --- */
@media (max-width: 768px) {
    .screensaver-title { font-size: 2.8rem; }
    .btn-checkin-large { padding: 1.2rem 2rem; font-size: 1.1rem; }

    /* Admin: sidebar collapse to top nav */
    .admin-layout { flex-direction: column; height: 100%; }
    .admin-sidebar {
        width: 100%;
        flex-direction: row;
        padding: 0.5rem 0.75rem;
        align-items: center;
        flex-shrink: 0;
        gap: 0.5rem;
        background: linear-gradient(90deg, #0f172a, #1e293b);
        overflow-x: auto;
    }
    .sidebar-logo {
        margin-bottom: 0;
        padding: 0.4rem 0.6rem;
        flex-shrink: 0;
        background: transparent;
    }
    .sidebar-logo-icon { font-size: 1.2rem; }
    .logo-text { font-size: 0.9rem; white-space: nowrap; }
    .sidebar-nav {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        gap: 0.25rem;
        flex: 1;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .sidebar-nav::-webkit-scrollbar { display: none; }
    .nav-item {
        white-space: nowrap;
        padding: 0.5rem 0.75rem;
        font-size: 0.78rem;
        margin-bottom: 0;
        border-radius: var(--radius-sm);
        flex-shrink: 0;
    }
    .nav-item.active {
        box-shadow: none;
        background: rgba(37,99,235,0.25);
    }
    .sidebar-user { display: none; }
    .btn-logout { display: none; }

    /* Admin main */
    .admin-main {
        flex: 1;
        padding: 1.25rem;
        overflow-y: auto;
    }
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1.25rem;
    }
    .admin-header h2 { font-size: 1.25rem; }
    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    .search-input-wrap { width: 100%; }
    .input-search { max-width: 100% !important; width: 100%; }
    .header-actions .btn-primary { width: 100%; text-align: center; }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-card { padding: 1rem; gap: 0.75rem; }
    .stat-value { font-size: 1.4rem; }
    .stat-label { font-size: 0.68rem; }
    .stat-icon-wrap { width: 38px; height: 38px; }
    .stat-trend { font-size: 0.6rem; top: 0.5rem; right: 0.5rem; }

    /* Chart */
    .chart-section { padding: 1rem; }
    .chart-header h3 { font-size: 0.9rem; }

    /* Table */
    .table-container { border-radius: var(--radius-md); }
    .data-table { font-size: 0.78rem; }
    .data-table th { padding: 0.6rem 0.75rem; font-size: 0.68rem; }
    .data-table td { padding: 0.6rem 0.75rem; }

    /* Filters */
    .filter-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 0.25rem; }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-btn { flex-shrink: 0; }

    /* Settings */
    .settings-section { padding: 1rem; }
    .settings-section-header h3 { font-size: 0.9rem; }
}

/* --- Phones --- */
@media (max-width: 600px) {
    .page-container { padding: 1.5rem 1rem; }
    .page-title { font-size: 1.4rem; }
    .page-subtitle { font-size: 0.85rem; }
    .page-header-icon { font-size: 2.5rem; }
    .screensaver-title { font-size: 2.2rem; letter-spacing: 0.08em; }
    .screensaver-subtitle { font-size: 1rem; margin-bottom: 2.5rem; }
    .logo-ring { width: 90px; height: 90px; }
    .logo-icon { font-size: 2.8rem; }
    .btn-checkin-large { padding: 1rem 1.5rem; font-size: 1rem; gap: 0.75rem; }
    .btn-icon-wrap { width: 40px; height: 40px; font-size: 1.3rem; }

    /* Admin: single column stats */
    .stats-grid { grid-template-columns: 1fr; gap: 0.5rem; }
    .stat-card { flex-direction: row; align-items: center; }

    /* Admin: scrollable table */
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .data-table { min-width: 650px; }

    /* Admin header */
    .admin-header h2 { font-size: 1.15rem; }
    .admin-date { font-size: 0.75rem; }

    /* Method cards */
    .method-card { padding: 1.25rem 1rem; gap: 1rem; }
    .method-icon-wrap { width: 44px; height: 44px; }
    .method-icon { font-size: 1.3rem; }
    .method-card h3 { font-size: 1rem; }
    .method-card p { font-size: 0.78rem; }

    /* QR scanner */
    .qr-frame { width: 220px; height: 220px; }

    /* Input */
    .input-large { font-size: 1.1rem; }
    .btn-lg { padding: 0.9rem 1.5rem; font-size: 1rem; }

    /* Seat guide */
    .seat-value { font-size: 2.2rem; }
    .seat-number { padding: 1.25rem; }
}

/* --- Very small phones --- */
@media (max-width: 400px) {
    .admin-sidebar { padding: 0.35rem 0.5rem; }
    .sidebar-logo { display: none; }
    .nav-item { padding: 0.4rem 0.6rem; font-size: 0.72rem; }
    .admin-main { padding: 0.75rem; }
    .stats-grid { gap: 0.35rem; }
    .stat-card { padding: 0.75rem; }
    .stat-value { font-size: 1.2rem; }
    .chart-section { padding: 0.75rem; }
    .bar { height: 26px; }
    .filter-btn { padding: 0.3rem 0.6rem; font-size: 0.7rem; }
    .data-table { min-width: 550px; }
    .settings-section { padding: 0.75rem; }
}
