/* ═══════════════════════════════════════════
   МАНГАЛЬНАЯ ЗОНА — PREMIUM DARK THEME
   ═══════════════════════════════════════════ */

/* --- Local Fonts --- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    src: url('/data/fonts/Inter-Regular.ttf') format('truetype'),
         url('/data/fonts/Inter-Regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    src: url('/data/fonts/Inter-Medium.ttf') format('truetype'),
         url('/data/fonts/Inter-Medium.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 600;
    src: url('/data/fonts/Inter-SemiBold.ttf') format('truetype'),
         url('/data/fonts/Inter-SemiBold.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    src: url('/data/fonts/Inter-Bold.ttf') format('truetype'),
         url('/data/fonts/Inter-Bold.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 800;
    src: url('/data/fonts/Inter-ExtraBold.ttf') format('truetype'),
         url('/data/fonts/Inter-ExtraBold.woff2') format('woff2');
}

/* --- Tokens --- */
:root {
    --bg-primary: #0A0A0A;
    --bg-secondary: #111111;
    --bg-card: #1A1A1A;
    --bg-card-hover: #222222;
    --bg-input: #1E1E1E;
    --bg-modal: rgba(0,0,0,0.85);

    --accent: #FF6B2C;
    --accent-light: #FF8A50;
    --accent-warm: #FFB347;
    --accent-glow: rgba(255,107,44,0.25);
    --accent-glow-strong: rgba(255,107,44,0.45);
    --ember: #8B2500;
    --ember-light: #A63A00;

    --text-primary: #F5F5F5;
    --text-secondary: #999;
    --text-muted: #666;
    --text-accent: #FFB347;

    --success: #4CAF50;
    --success-bg: rgba(76,175,80,0.12);
    --danger: #F44336;
    --danger-bg: rgba(244,67,54,0.12);
    --warning: #FF9800;
    --warning-bg: rgba(255,152,0,0.12);
    --info: #448AFF;

    --border: #2A2A2A;
    --border-light: #333;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 50%;

    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);

    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --nav-height: 68px;
    --header-height: 56px;

    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 0.15s ease;
    --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -webkit-user-select: none;
    user-select: none;
}

a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; color: var(--text-primary); -webkit-user-select: auto; user-select: auto; }
img { max-width: 100%; display: block; }

.hidden { display: none !important; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ═══════════════════════════════════════════
   SPLASH SCREEN
   ═══════════════════════════════════════════ */
.splash {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: var(--bg-primary);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash.fade-out { opacity: 0; visibility: hidden; }

.splash-logo { animation: pulse-glow 2s ease-in-out infinite; }

.splash-fire .flame { transform-origin: center bottom; }
.splash-fire .flame-1 { animation: flicker1 1.5s ease-in-out infinite; }
.splash-fire .flame-2 { animation: flicker2 1.2s ease-in-out infinite 0.1s; }
.splash-fire .flame-3 { animation: flicker3 1s ease-in-out infinite 0.2s; }

.splash-text {
    margin-top: 20px;
    font-size: 1.5rem; font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}

.splash-loader {
    margin-top: 32px; width: 120px; height: 3px;
    background: var(--border); border-radius: 3px; overflow: hidden;
}
.splash-loader div {
    width: 40%; height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-warm));
    border-radius: 3px;
    animation: loader-slide 1.2s ease-in-out infinite;
}

/* --- Fire Animations --- */
@keyframes flicker1 {
    0%, 100% { transform: scaleY(1) scaleX(1); opacity: 1; }
    50% { transform: scaleY(1.05) scaleX(0.98); opacity: 0.9; }
}
@keyframes flicker2 {
    0%, 100% { transform: scaleY(1) translateY(0); opacity: 0.9; }
    50% { transform: scaleY(1.08) translateY(-1px); opacity: 1; }
}
@keyframes flicker3 {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50% { transform: scale(1.1); opacity: 1; }
}
@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 8px var(--accent-glow)); }
    50% { filter: drop-shadow(0 0 20px var(--accent-glow-strong)); }
}
@keyframes loader-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

/* ═══════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════ */
.header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    height: var(--header-height);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    background: rgba(10,10,10,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.header-left, .header-right { display: flex; align-items: center; gap: 8px; min-width: 40px; }
.header-title {
    font-size: 1.1rem; font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.header-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: var(--transition);
}
.header-btn:hover { color: var(--accent); background: var(--accent-glow); }

.header-logo {
    display: flex; align-items: center;
    animation: pulse-glow 3s ease-in-out infinite;
}

/* ═══════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════ */
.main {
    padding: calc(var(--header-height) + 12px) 16px calc(var(--nav-height) + 16px);
    min-height: 100dvh;
}

/* ═══════════════════════════════════════════
   BOTTOM NAV
   ═══════════════════════════════════════════ */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    height: var(--nav-height);
    display: flex; align-items: center; justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom, 0);
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
}

.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 12px;
    font-size: 0.65rem; font-weight: 500;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
    flex: 1;
}
.nav-item.active { color: var(--accent); }
.nav-item span { margin-top: 2px; }

.nav-item.fire-btn { position: relative; margin-top: -16px; }
.fire-btn-inner {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent), var(--ember-light));
    box-shadow: 0 4px 16px var(--accent-glow-strong);
    transition: var(--transition);
    animation: fire-pulse 2s ease-in-out infinite;
}
.nav-item.fire-btn:active .fire-btn-inner { transform: scale(0.92); }
.nav-item.fire-btn.active .fire-btn-inner { box-shadow: 0 4px 24px var(--accent-glow-strong); }
.nav-item.fire-btn span { color: var(--accent); font-weight: 700; }

@keyframes fire-pulse {
    0%, 100% { box-shadow: 0 4px 16px var(--accent-glow); }
    50% { box-shadow: 0 4px 24px var(--accent-glow-strong); }
}

/* Fire disabled (21:00 — 9:00) */
.nav-item.fire-btn.fire-disabled .fire-btn-inner {
    background: linear-gradient(135deg, #444, #333);
    box-shadow: none;
    animation: none;
}
.nav-item.fire-btn.fire-disabled span { color: var(--text-muted); }

/* Booking glow (ярко пульсирует когда Fire выключен) */
.nav-item.booking-glow {
    color: var(--accent) !important;
}
.nav-item.booking-glow svg {
    stroke: var(--accent);
    filter: drop-shadow(0 0 6px var(--accent-glow-strong));
    animation: booking-pulse 1.5s ease-in-out infinite;
}
.nav-item.booking-glow::before,
.nav-item.booking-glow::after {
    content: '';
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    animation: particle-fly 2s ease-out infinite;
    pointer-events: none;
}
.nav-item.booking-glow::before {
    left: 30%; bottom: 50%;
    animation-delay: 0s;
}
.nav-item.booking-glow::after {
    left: 60%; bottom: 50%;
    animation-delay: 0.8s;
}
@keyframes booking-pulse {
    0%, 100% { filter: drop-shadow(0 0 4px var(--accent-glow)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 12px var(--accent-glow-strong)); transform: scale(1.1); }
}
@keyframes particle-fly {
    0% { opacity: 0; transform: translateY(0) scale(1); }
    20% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-28px) scale(0.3); }
}

/* ═══════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px;
    transition: var(--transition);
    animation: fadeInUp 0.3s ease both;
}
.card:hover { border-color: var(--border-light); }
.card + .card { margin-top: 12px; }
/* Убираем card+card margin внутри ЛЮБЫХ grid-контейнеров */
[style*="display:grid"] > .card + .card,
.dashboard-grid > .card + .card,
.quick-actions > .card + .card,
.stat-grid > .card + .card,
.admin-grid > .card + .card,
.fire-duration-grid > .card + .card,
[style*="grid-template"] > .card + .card { margin-top: 0; }

.fire-duration-grid {
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 10px; align-items: stretch;
}
.fire-duration-grid > .card { height: 100%; }

.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.card-title {
    font-size: 0.95rem; font-weight: 700;
    display: flex; align-items: center; gap: 8px;
}
.card-title svg { color: var(--accent); flex-shrink: 0; }

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

.card-glow {
    background: linear-gradient(135deg, rgba(255,107,44,0.05), var(--bg-card));
    border-color: rgba(255,107,44,0.2);
}

/* ═══════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem; font-weight: 600;
    transition: var(--transition);
    cursor: pointer; white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--ember-light));
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 4px 20px var(--accent-glow-strong); }

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(244,67,54,0.2);
}
.btn-danger:hover { background: rgba(244,67,54,0.2); }

.btn-ghost {
    color: var(--text-secondary);
    padding: 8px 12px;
}
.btn-ghost:hover { color: var(--accent); }

.btn-full { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 24px; font-size: 1rem; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.btn:disabled, .btn.loading {
    opacity: 0.5; pointer-events: none;
}
.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
    content: ''; position: absolute;
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ═══════════════════════════════════════════
   INPUTS
   ═══════════════════════════════════════════ */
.input-group { margin-bottom: 16px; position: relative; }
.input-label {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
    font-size: 0.82rem; font-weight: 600; color: var(--text-secondary);
}
.input-hint {
    font-size: 0.7rem; color: var(--accent);
    background: var(--bg-darker); padding: 2px 6px; border-radius: 4px;
    opacity: 0; transform: translateY(4px); transition: all 0.2s;
    pointer-events: none;
}
.input:focus ~ .input-hint, .input-group:focus-within .input-hint {
    opacity: 1; transform: translateY(0);
}

.rules-checkbox {
    display: flex; align-items: flex-start; gap: 10px;
    margin: 16px 0; padding: 12px;
    background: var(--bg-darker); border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}
.rules-checkbox:hover { border-color: rgba(255,107,44,0.3); }
.rules-checkbox input[type="checkbox"] {
    appearance: none; width: 20px; height: 20px;
    border: 2px solid var(--border); border-radius: 4px;
    background: var(--bg-input); cursor: pointer;
    position: relative; flex-shrink: 0; transition: all 0.2s;
}
.rules-checkbox input[type="checkbox"]:checked {
    background: var(--accent); border-color: var(--accent);
}
.rules-checkbox input[type="checkbox"]:checked::after {
    content: ''; position: absolute; left: 6px; top: 2px;
    width: 4px; height: 10px; border: solid white;
    border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.rules-checkbox label {
    font-size: 0.8rem; color: var(--text-secondary); cursor: pointer;
    line-height: 1.4;
}
.rules-checkbox a { color: var(--accent); text-decoration: none; font-weight: 600; }
.rules-checkbox a:hover { text-decoration: underline; }

.input {
    width: 100%; padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem; color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input::placeholder { color: var(--text-muted); }
.input.error { border-color: var(--danger); }

/* ═══════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════ */
.progress-bar {
    width: 100%; height: 6px;
    background: var(--border); border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-warm));
    border-radius: 3px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}
.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -50%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: progress-shimmer 2s ease-in-out infinite;
}
@keyframes progress-shimmer {
    0% { left: -50%; }
    100% { left: 150%; }
}
.progress-fill.danger { background: linear-gradient(90deg, var(--danger), #FF6B6B); }
.progress-fill.success { background: linear-gradient(90deg, var(--success), #66BB6A); }

/* Ember particles background for active grill block */
.card-ember {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(139,37,0,0.15), rgba(255,107,44,0.08), var(--bg-card));
    border-color: rgba(255,107,44,0.3);
}
.card-ember::before,
.card-ember::after {
    content: '';
    position: absolute;
    width: 3px; height: 3px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}
.card-ember::before {
    background: var(--accent);
    bottom: 10%; left: 12%;
    animation: ember-float 4s ease-in-out infinite;
    box-shadow:
        30px 5px 0 0 var(--accent-warm),
        70px -8px 0 0 var(--accent),
        120px 3px 0 -1px var(--accent-warm),
        180px -5px 0 0 var(--accent),
        250px 8px 0 -1px rgba(255,179,71,0.8);
    filter: blur(0.3px);
}
.card-ember::after {
    background: var(--accent-warm);
    bottom: 25%; right: 15%;
    animation: ember-float2 4.5s ease-in-out infinite 1s;
    box-shadow:
        -25px 10px 0 0 var(--accent),
        -60px -3px 0 -1px var(--accent-warm),
        -110px 6px 0 0 var(--accent),
        -160px -8px 0 -1px rgba(255,107,44,0.7),
        -220px 4px 0 0 var(--accent-warm);
    filter: blur(0.3px);
}
@keyframes ember-float {
    0% { opacity: 0; transform: translateY(0) scale(0.5); }
    10% { opacity: 0.9; }
    50% { opacity: 0.7; transform: translateY(-60px) scale(1); }
    85% { opacity: 0.3; }
    100% { opacity: 0; transform: translateY(-120px) scale(0.2); }
}
@keyframes ember-float2 {
    0% { opacity: 0; transform: translateY(0) scale(0.4); }
    12% { opacity: 0.7; }
    50% { opacity: 0.6; transform: translateY(-50px) translateX(5px) scale(0.9); }
    80% { opacity: 0.2; }
    100% { opacity: 0; transform: translateY(-110px) translateX(-3px) scale(0.2); }
}

/* ═══════════════════════════════════════════
   BADGE / TAG
   ═══════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem; font-weight: 600;
}
.badge-fire { background: var(--accent-glow); color: var(--accent); }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-muted { background: rgba(255,255,255,0.05); color: var(--text-secondary); }

/* ═══════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: flex-end; justify-content: center;
    background: var(--bg-modal);
    backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden;
    transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    width: 100%; max-width: 480px; max-height: 85dvh;
    background: var(--bg-secondary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 24px 20px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow-y: auto;
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-handle {
    width: 40px; height: 4px;
    background: var(--border-light);
    border-radius: 4px;
    margin: 0 auto 16px;
}

.modal-title {
    font-size: 1.2rem; font-weight: 700;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════ */
#toast-container {
    position: fixed; bottom: calc(var(--nav-height) + 16px);
    left: 50%; transform: translateX(-50%);
    z-index: 600; display: flex; flex-direction: column; gap: 8px;
    width: calc(100% - 32px); max-width: 400px;
    pointer-events: none;
}

.toast {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: center; gap: 10px;
    animation: toastIn 0.3s ease both;
    pointer-events: all;
    box-shadow: var(--shadow-md);
}
.toast.toast-out { animation: toastOut 0.25s ease both; }

.toast-success { background: #1B3D1F; color: var(--success); border: 1px solid rgba(76,175,80,0.3); }
.toast-error { background: #3D1B1B; color: var(--danger); border: 1px solid rgba(244,67,54,0.3); }
.toast-info { background: #1B2B3D; color: var(--info); border: 1px solid rgba(68,138,255,0.3); }
.toast-warning { background: #3D2B1B; color: var(--warning); border: 1px solid rgba(255,152,0,0.3); }

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

/* ═══════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInScale { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideInLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }

.animate-in { animation: fadeInUp 0.3s ease both; }
.animate-in-delay-1 { animation-delay: 0.05s; }
.animate-in-delay-2 { animation-delay: 0.1s; }
.animate-in-delay-3 { animation-delay: 0.15s; }
.animate-in-delay-4 { animation-delay: 0.2s; }
.animate-in-delay-5 { animation-delay: 0.25s; }

/* ═══════════════════════════════════════════
   AUTH PAGES
   ═══════════════════════════════════════════ */
.auth-page {
    min-height: 100dvh;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px;
}

.auth-logo {
    margin-bottom: 8px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.auth-title {
    font-size: 1.6rem; font-weight: 800; margin-bottom: 4px;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.auth-subtitle {
    font-size: 0.85rem; color: var(--text-secondary);
    margin-bottom: 32px;
}

.auth-form {
    width: 100%; max-width: 360px;
}

.auth-footer {
    margin-top: 20px;
    font-size: 0.82rem; color: var(--text-muted);
    text-align: center;
}
.auth-footer a { color: var(--accent); font-weight: 600; }

.auth-message {
    text-align: center; padding: 24px;
}
.auth-message svg { margin: 0 auto 16px; }
.auth-message h2 { font-size: 1.2rem; margin-bottom: 8px; }
.auth-message p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* ═══════════════════════════════════════════
   DASHBOARD
   ═══════════════════════════════════════════ */
.dashboard-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-top: 12px;
    align-items: stretch;
}

.status-card {
    padding: 14px; text-align: center;
    display: flex; flex-direction: column;
    align-items: center;
    height: 100%;
}
.status-card .mangal-number { font-size: 0.9rem; }
.status-card .status-details {
    font-size: 0.78rem; color: var(--text-secondary);
    margin-top: 6px; flex: 1;
    display: flex; flex-direction: column; justify-content: center;
    width: 100%;
}
.status-card .progress-bar { width: 100%; }
.status-card.free .badge { color: var(--success); }
.status-card.busy .badge { color: var(--accent); }

.quick-actions {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-top: 12px;
}

.action-card {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px; padding: 18px 12px;
    cursor: pointer;
}
.action-card svg { color: var(--accent); transition: var(--transition); }
.action-card:hover svg { transform: scale(1.1); }
.action-card span {
    font-size: 0.78rem; font-weight: 600; color: var(--text-secondary);
    text-align: center;
}

/* ═══════════════════════════════════════════
   FLIP CARD (Dashboard wish)
   ═══════════════════════════════════════════ */
/* Wish animation handled via JS opacity transition */

/* ═══════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════ */
.calendar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 16px; margin-bottom: 16px;
}

.calendar-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.calendar-title { font-weight: 700; font-size: 0.95rem; }
.calendar-nav {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: var(--transition);
}
.calendar-nav:hover { color: var(--accent); background: var(--accent-glow); }

.calendar-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 2px; margin-bottom: 6px;
}
.calendar-weekday {
    text-align: center; font-size: 0.7rem;
    color: var(--text-muted); font-weight: 600; padding: 4px;
}

.calendar-days {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1; display: flex;
    flex-direction: column; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 500;
    cursor: pointer; transition: var(--transition);
    position: relative;
}
.calendar-day:hover { background: var(--bg-card-hover); }
.calendar-day.today { color: var(--accent); font-weight: 700; }
.calendar-day.selected {
    background: var(--accent); color: #fff; font-weight: 700;
    box-shadow: 0 0 12px var(--accent-glow);
}
.calendar-day.has-booking::after {
    content: ''; position: absolute; bottom: 4px;
    width: 4px; height: 4px;
    background: var(--accent); border-radius: 50%;
}
.calendar-day.has-mine::after { background: var(--success); }
.calendar-day.past { opacity: 0.3; pointer-events: none; }
.calendar-day.empty { pointer-events: none; }
.calendar-day.full-day {
    opacity: 0.4; color: var(--danger);
    text-decoration: line-through;
    cursor: pointer;
}
.calendar-day.full-day::after {
    content: ''; position: absolute; bottom: 4px;
    width: 4px; height: 4px;
    background: var(--danger); border-radius: 50%;
}

/* ═══════════════════════════════════════════
   TIME SLOTS
   ═══════════════════════════════════════════ */
.time-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.time-slot {
    padding: 10px 4px; text-align: center;
    border-radius: var(--radius-sm);
    font-size: 0.85rem; font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer; transition: var(--transition);
    min-height: 44px;
    display: flex; align-items: center; justify-content: center; gap: 2px;
}
.time-slot-duration { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }
.time-slot:hover { border-color: var(--accent); }
.time-slot.selected {
    background: var(--accent); color: #fff;
    border-color: var(--accent);
}
.time-slot.booked {
    opacity: 0.35; pointer-events: none;
    background: var(--danger-bg); border-color: transparent;
}
.time-slot.mine {
    background: var(--success-bg); border-color: var(--success);
    color: var(--success); pointer-events: none;
}

/* ═══════════════════════════════════════════
   MANGAL STATUS
   ═══════════════════════════════════════════ */
.mangal-card { padding: 16px; }

.mangal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.mangal-number { font-size: 1.1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.mangal-badge { font-size: 0.72rem; }

.mangal-info { font-size: 0.85rem; color: var(--text-secondary); }
.mangal-info .user-name { color: var(--text-primary); font-weight: 600; }
.mangal-info .time-range { color: var(--accent); font-weight: 600; }
.mangal-progress { margin-top: 10px; }
.mangal-remaining { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* ═══════════════════════════════════════════
   VOTING
   ═══════════════════════════════════════════ */
.vote-option {
    padding: 14px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    cursor: pointer; transition: var(--transition);
    position: relative; overflow: hidden;
}
.vote-option:hover { border-color: var(--accent); }
.vote-option.selected { border-color: var(--accent); background: rgba(255,107,44,0.08); }
.vote-option.voted { cursor: default; }

.vote-bg {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--accent-glow), transparent);
    transform-origin: left; transition: transform 0.6s ease;
}
.vote-content { position: relative; z-index: 1; }
.vote-text { font-size: 0.9rem; font-weight: 500; margin-bottom: 4px; }
.vote-stats {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.78rem; color: var(--text-secondary);
}

/* ═══════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════ */
.stat-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.stat-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 14px; text-align: center;
}
.stat-value {
    font-size: 1.5rem; font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }

/* ═══════════════════════════════════════════
   ADMIN
   ═══════════════════════════════════════════ */
.admin-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.admin-card {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    padding: 16px 8px; cursor: pointer;
}
.admin-card svg { color: var(--accent); }
.admin-card span { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); text-align: center; }

.user-list-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    cursor: pointer; transition: var(--transition);
}
.user-list-item:hover { border-color: var(--accent); }
.user-avatar {
    width: 40px; height: 40px;
    border-radius: var(--radius-full);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9rem;
    flex-shrink: 0;
}
.user-avatar.active { background: var(--success-bg); color: var(--success); }
.user-avatar.pending { background: var(--warning-bg); color: var(--warning); }
.user-avatar.blocked { background: var(--danger-bg); color: var(--danger); }

.user-info { flex: 1; min-width: 0; }
.user-name-text { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ═══════════════════════════════════════════
   RULES
   ═══════════════════════════════════════════ */
.rule-section { margin-bottom: 20px; }
.rule-section-title {
    font-size: 0.95rem; font-weight: 700; color: var(--accent);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}
.rule-item {
    padding: 8px 0 8px 16px;
    font-size: 0.85rem; color: var(--text-secondary);
    position: relative; line-height: 1.5;
}
.rule-item::before {
    content: ''; position: absolute; left: 0; top: 14px;
    width: 5px; height: 5px;
    background: var(--accent); border-radius: 50%;
}

/* ═══════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════ */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin-top: 16px;
}
.page-info { font-size: 0.82rem; color: var(--text-secondary); }

/* ═══════════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════════ */
.section-title {
    font-size: 0.82rem; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 10px; margin-top: 20px;
}
.section-title:first-child { margin-top: 0; }

.divider {
    height: 1px; background: var(--border);
    margin: 16px 0;
}

/* ═══════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════ */
.empty-state {
    text-align: center; padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state svg { margin: 0 auto 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; }

/* ═══════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════ */
.tabs {
    display: flex; gap: 4px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 3px; margin-bottom: 16px;
}
.tab {
    flex: 1; padding: 8px;
    text-align: center; border-radius: var(--radius-sm);
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
}
.tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.short { width: 60%; }
.skeleton-card { height: 80px; margin-bottom: 10px; border-radius: var(--radius-lg); }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ═══════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════ */
@media (min-width: 480px) {
    .main { max-width: 480px; margin: 0 auto; }
    .bottom-nav { max-width: 480px; left: 50%; transform: translateX(-50%); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}

/* --- Safe areas --- */
@supports (padding-bottom: env(safe-area-inset-bottom, 0)) {
    .bottom-nav { padding-bottom: env(safe-area-inset-bottom, 0); }
    .main { padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0) + 16px); }
}

/* ═══════════════════════════════════════════
   PUSH TOGGLE
   ═══════════════════════════════════════════ */
.push-toggle {
    width: 48px; height: 28px;
    background: var(--border-light);
    border-radius: 28px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}
.push-toggle.active { background: var(--success); }
.push-toggle-knob {
    width: 22px; height: 22px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px; left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.push-toggle.active .push-toggle-knob { transform: translateX(20px); }

/* ═══════════════════════════════════════════
   MANGAL DETAIL OVERLAY
   ═══════════════════════════════════════════ */
.mangal-detail-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,0);
    display: flex; align-items: center; justify-content: center;
    transition: background 0.25s ease;
    padding: 20px;
}
.mangal-detail-overlay.active { background: rgba(0,0,0,0.6); }
.mangal-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px; width: 100%; max-width: 380px;
    transform: scale(0.85); opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.mangal-detail-overlay.active .mangal-detail-card {
    transform: scale(1); opacity: 1;
}

/* ═══════════════════════════════════════════
   NOTIFICATIONS BELL BADGE
   ═══════════════════════════════════════════ */
#btn-notifications {
    position: relative;
}
.notif-badge {
    position: absolute;
    top: 2px; right: 2px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: #F44336;
    color: white;
    font-size: 0.65rem; font-weight: 700;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(244,67,54,0.4);
    animation: badgePulse 2s ease-in-out infinite;
}
@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Header title кликабельный */
.header-title {
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: underline;
    text-decoration-color: rgba(255,107,44,0.3);
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
}
.header-title:active {
    color: var(--accent);
    text-decoration-color: var(--accent);
}

/* ═══════════════════════════════════════════
   NOTIFICATIONS PANEL (slide-in)
   ═══════════════════════════════════════════ */
.notifications-overlay {
    position: fixed; inset: 0; z-index: 400;
    background: rgba(0,0,0,0);
    transition: background 0.3s ease;
}
.notifications-overlay.active { background: rgba(0,0,0,0.5); }

.notifications-drawer {
    position: absolute;
    top: 0; right: 0;
    width: 100%; max-width: 380px;
    height: 100%;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.2);
}
.notifications-overlay.active .notifications-drawer {
    transform: translateX(0);
}

.notifications-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.notifications-header-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 1.05rem; font-weight: 700;
    color: var(--text-primary);
}
.notifications-close {
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer; padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}
.notifications-close:hover { color: var(--text-primary); background: var(--bg-card-hover); }

.notifications-actions {
    display: flex; gap: 8px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem; font-weight: 600;
    border-radius: var(--radius-sm);
}
.btn-ghost {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-danger-text { color: #F44336; }
.btn-danger-text:hover { background: rgba(244,67,54,0.1); color: #F44336; }

.notifications-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.notifications-loading,
.notifications-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 48px 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ═══════════════════════════════════════════
   NOTIFICATION ITEM
   ═══════════════════════════════════════════ */
.notification-item {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
    position: relative;
}
.notification-item.unread {
    background: rgba(255,107,44,0.04);
    border-left: 3px solid var(--accent);
}
.notification-item:last-child { border-bottom: none; }

.notification-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-card);
    border-radius: 50%;
    border: 1px solid var(--border);
    margin-top: 2px;
}

.notification-content {
    flex: 1; min-width: 0;
}
.notification-title {
    font-size: 0.85rem; font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.notification-body {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.notification-time {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.notification-dot {
    flex-shrink: 0;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    margin-top: 6px;
}
