/* Import modern premium font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Light Mode */
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-border: rgba(226, 232, 240, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    
    /* Cell Status Colors */
    --status-free-bg: rgba(240, 253, 244, 0.75);
    --status-free-border: #86efac;
    --status-free-text: #166534;
    
    --status-occupied-bg: rgba(241, 245, 249, 0.75);
    --status-occupied-border: #cbd5e1;
    --status-occupied-text: #334155;
    
    --status-warning-bg: rgba(255, 251, 235, 0.85);
    --status-warning-border: #fde047;
    --status-warning-text: #92400e;
    
    --status-critical-bg: rgba(254, 242, 242, 0.85);
    --status-critical-border: #fca5a5;
    --status-critical-text: #991b1b;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);
    --glass-blur: blur(12px);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #020617 100%);
    --card-bg: rgba(15, 23, 42, 0.6);
    --card-border: rgba(51, 65, 85, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-blue-hover: #60a5fa;
    
    --status-free-bg: rgba(6, 78, 59, 0.3);
    --status-free-border: rgba(16, 185, 129, 0.4);
    --status-free-text: #34d399;
    
    --status-occupied-bg: rgba(30, 41, 59, 0.4);
    --status-occupied-border: rgba(71, 85, 105, 0.4);
    --status-occupied-text: #cbd5e1;
    
    --status-warning-bg: rgba(120, 53, 4, 0.3);
    --status-warning-border: rgba(245, 158, 11, 0.4);
    --status-warning-text: #fbbf24;
    
    --status-critical-bg: rgba(153, 27, 27, 0.3);
    --status-critical-border: rgba(239, 68, 68, 0.4);
    --status-critical-text: #f87171;
    
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

/* Container for App */
.app-container {
    width: 100%;
    max-width: 1440px;
    min-height: 90vh;
    margin: 20px;
    padding: 24px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: background var(--transition-normal), border var(--transition-normal);
}

/* LOGIN SCREEN */
.login-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 40px 20px;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    text-align: center;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-icon {
    width: 84px;
    height: 84px;
    margin-bottom: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
    border-radius: 20px;
    overflow: hidden;
}

.login-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--radius-sm);
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-fast);
}

[data-theme="dark"] .form-control {
    background: rgba(15, 23, 42, 0.4);
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .form-control:focus {
    background: rgba(15, 23, 42, 0.8);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

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

/* APP LAYOUT */
.dashboard-wrapper {
    display: none; /* Shown dynamically when logged in */
    flex-direction: column;
    flex-grow: 1;
    animation: fadeIn 0.5s ease-out;
}

/* HEADER */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 24px;
}

.app-branding h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-branding h1 span {
    font-weight: 400;
    color: var(--text-secondary);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.user-tag {
    background: var(--card-border);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.btn-icon {
    background: var(--card-border);
    border: none;
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    transform: scale(1.05);
    background: var(--text-secondary);
    color: var(--card-bg);
}

/* ==========================================
   TOP NAV — DOCK ŠTÝL
   ========================================== */
.topnav {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    row-gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 10px 14px;
    box-shadow: var(--shadow-sm);
}

/* Skupina — vizuálne ohraničenie */
.tnav-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 6px;
    border-radius: 10px;
}
.tnav-group:hover { background: rgba(128,128,128,0.05); }

.tnav-group-label {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    opacity: 0.5;
    text-align: center;
    padding: 0 2px;
    user-select: none;
}

.tnav-group-btns {
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

/* Tlačidlo — ikona nad textom */
.tnav-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 11px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.13s, color 0.13s, transform 0.1s;
    min-width: 58px;
    position: relative;
}
.tnav-btn i {
    font-size: 16px;
    transition: transform 0.13s;
}
.tnav-btn span {
    white-space: nowrap;
}
.tnav-btn:hover {
    background: rgba(128,128,128,0.1);
    color: var(--text-primary);
}
.tnav-btn:hover i { transform: translateY(-1px); }
.tnav-btn:active { transform: scale(0.96); }

/* Farebné ikony pre jednotlivé tlačidlá */
.tnav-btn:nth-child(1) i { color: inherit; }

/* Špeciálne varianty */
.tnav-btn.tnav-btn-danger i { color: #ef4444; }
.tnav-btn.tnav-btn-danger:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
.tnav-btn.tnav-btn-vc i { color: #f59e0b; }
.tnav-btn.tnav-btn-vc { color: #f59e0b; }

.tnav-sep {
    width: 1px;
    background: var(--border-color);
    margin: 4px 10px;
    opacity: 0.4;
    flex-shrink: 0;
    align-self: stretch;
}

/* btn-action pre JS-vkladané tlačidlá (moduly.js) */
.btn-action {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 13px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.13s, color 0.13s;
    min-width: 64px;
}
.btn-action i { font-size: 17px; }
.btn-action:hover { background: rgba(128,128,128,0.1); color: var(--text-primary); }
.btn-action.btn-green i { color: #10b981; }
.btn-action.btn-blue i  { color: #3b82f6; }
.btn-action.btn-cyan i  { color: #06b6d4; }
.btn-action.btn-orange i{ color: #f97316; }
.btn-action.btn-purple i{ color: #a855f7; }
.btn-action.btn-red i   { color: #ef4444; }
.btn-action.btn-grey i  { color: #64748b; }

/* ==========================================
   TOOLTIP SYSTÉM — riadený cez JS engine (app-hafiz.js)
   CSS pseudo-elementy nahradené JS fixed tooltip #hafizTip
   aby fungoval aj v overflow-y: auto kontajneroch (modaly).
   ========================================== */

/* "?" nápoveda v rohu tlačidiel — popis sa ukáže len keď prejdeš myšou na tento otáznik
   (aby text neprekrýval susedné tlačidlá). Otáznik je stále jemne viditeľný, nech vieš, kam mieriť. */
.btn-menu-opt[data-tip],
.tnav-btn[data-tip],
.tnav-btn[data-tip-down] {
    position: relative;
}
.btn-menu-opt[data-tip]::after,
.tnav-btn[data-tip]::after,
.tnav-btn[data-tip-down]::after {
    content: '?';
    position: absolute;
    top: 4px;
    right: 5px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: rgba(59,130,246,0.16);
    border: 1px solid rgba(59,130,246,0.4);
    color: #3b82f6;
    font-size: 9px;
    font-weight: 800;
    line-height: 15px;
    text-align: center;
    opacity: 0.5;
    transition: opacity 0.15s, background 0.15s;
    pointer-events: none;
    z-index: 4;
}
.btn-menu-opt[data-tip]:hover::after,
.tnav-btn[data-tip]:hover::after,
.tnav-btn[data-tip-down]:hover::after {
    opacity: 1;
    background: rgba(59,130,246,0.32);
}

/* CELLS GRID */
.cells-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    min-height: 680px;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.cell-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    border-top: 3px solid var(--card-border);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 310px;
    overflow-y: auto;
    box-sizing: border-box;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.cell-card::after {
    content: '';
    display: none;
}

.cell-card.cell-free {
    background: var(--status-free-bg);
    border-color: var(--status-free-border);
}
.cell-card.cell-free::after { background: var(--status-free-text); }

.cell-card.cell-occupied {
    background: var(--status-occupied-bg);
    border-color: var(--status-occupied-border);
}
.cell-card.cell-occupied::after { background: var(--status-occupied-text); }

.cell-card.cell-warning {
    background: var(--status-warning-bg);
    border-color: var(--status-warning-border);
}
.cell-card.cell-warning::after { background: var(--status-warning-text); }

.cell-card.cell-critical {
    background: var(--status-critical-bg);
    border-color: var(--status-critical-border);
    animation: pulseBorder 2.5s infinite;
}
.cell-card.cell-critical::after { background: var(--status-critical-text); }

/* MÔJ ÚČET — stat karty */
.ucet-stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.ucet-stat-val {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}
.ucet-stat-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.ucet-stat-sub {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Avatar color swatches */
.avatar-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.avatar-color-swatch:hover {
    transform: scale(1.2);
    border-color: rgba(255,255,255,0.5);
}
.avatar-color-swatch.active {
    border-color: #fff;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* Odznaky */
.ucet-odznak {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: default;
    transition: transform 0.15s;
    position: relative;
}
.ucet-odznak:hover { transform: scale(1.2); }
.ucet-odznak.earned {
    background: rgba(59,130,246,0.15);
    border: 2px solid rgba(59,130,246,0.4);
    box-shadow: 0 2px 8px rgba(59,130,246,0.2);
}
.ucet-odznak.locked {
    background: rgba(100,116,139,0.1);
    border: 2px solid rgba(100,116,139,0.2);
    filter: grayscale(1);
    opacity: 0.45;
}

/* Rekord / tím karty */
.ucet-rekord-card { background: rgba(245,158,11,0.05) !important; border-color: rgba(245,158,11,0.2) !important; }
.ucet-tim-card    { background: rgba(59,130,246,0.05) !important; border-color: rgba(59,130,246,0.2) !important; }

/* Mini graf stĺpce */
.ucet-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #3b82f6, #6366f1);
    min-height: 4px;
    transition: height 0.4s cubic-bezier(0.34,1.56,0.64,1);
    position: relative;
}
.ucet-bar:hover { filter: brightness(1.2); }
.ucet-bar-label {
    flex: 1;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* User tag v hlavičke — hover efekt */
.user-tag {
    transition: background 0.15s, color 0.15s;
    padding: 4px 8px;
    border-radius: 8px;
}
.user-tag:hover {
    background: rgba(59,130,246,0.1);
    color: #3b82f6;
}

.cell-card.cell-blocked {
    background: rgba(239, 68, 68, 0.04);
    border: 2px dashed rgba(239, 68, 68, 0.35) !important;
    border-top: 2px dashed rgba(239, 68, 68, 0.35) !important;
    cursor: default;
    opacity: 0.92;
}
.cell-card.cell-blocked:hover {
    transform: none !important;
    box-shadow: 0 0 0 1px rgba(239,68,68,0.2) !important;
}

.cell-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

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

.cell-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.cell-status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255,255,255,0.4);
}

.cell-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-bottom: 12px;
}

.detainee-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    word-break: break-word;
}

.cell-free-placeholder {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 14px;
    opacity: 0.7;
}

.cell-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 12px;
}

[data-theme="dark"] .cell-footer {
    border-top: 1px solid rgba(255,255,255,0.05);
}

.cell-case-no {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.cell-timer {
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.cell-timer-expired {
    animation: flashText 1.5s infinite;
}

/* VIRTUAL CELL BUTTON IN ACTION BAR */
.vc-btn-active {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.25), 0 4px 12px rgba(245,158,11,0.3);
    animation: vcPulse 2s infinite;
}
@keyframes vcPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(245,158,11,0.25), 0 4px 12px rgba(245,158,11,0.3); }
    50%       { box-shadow: 0 0 0 6px rgba(245,158,11,0.1),  0 4px 20px rgba(245,158,11,0.5); }
}

/* COMMAND PALETTE */
.cmd-item:hover {
    background: var(--card-border) !important;
}

/* MODALS */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.25s ease-out;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 750px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

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

.modal-footer {
    padding: 18px 24px;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.btn-secondary {
    background: var(--card-border);
    color: var(--text-primary);
    width: auto;
}
.btn-secondary:hover {
    background: var(--text-secondary);
    color: var(--card-bg);
}

.btn-danger {
    background: #dc2626;
    color: white;
    width: auto;
}
.btn-danger:hover {
    background: #b91c1c;
}

/* WIZARD FORM MULTIPAGE */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 12px;
}

.wizard-step {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    position: relative;
}

.wizard-step.active {
    color: var(--accent-blue);
    font-weight: 700;
}

.wizard-step.active::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.wizard-page {
    display: none;
}

.wizard-page.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* DETAINEE CONTROL MENU (TlacivaOsoby replacement) */
.control-menu-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
    min-height: 380px;
}

.control-menu-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(15,23,42,0.5);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 12px;
    overflow-y: auto;
}

.info-row {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s;
}

.info-row:hover {
    background: rgba(59,130,246,0.07);
    border-color: rgba(59,130,246,0.15);
}

.info-label {
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.8px;
    line-height: 1;
}

.info-val {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.3;
    word-break: break-word;
}

.control-menu-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-content: start;
}

.btn-menu-opt {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    color: var(--text-primary);
    padding: 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-menu-opt:hover {
    background: var(--card-border);
    transform: translateY(-2px);
    border-color: var(--text-secondary);
}

.btn-menu-opt i {
    font-size: 20px;
    color: var(--accent-blue);
}

/* MEAL LOGGER & BELONGINGS LIST STYLING */
.log-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

.log-table th, .log-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

.log-table th {
    font-weight: 700;
    background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .log-table th {
    background: rgba(255,255,255,0.02);
}

/* LOG TAB PANELS */
.tab-headers {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 16px;
}

.tab-btn {
    padding: 10px 18px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    position: relative;
}

.ciselnik-card-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}
.ciselnik-card-btn:hover {
    background: rgba(59,130,246,0.08);
    color: var(--text-primary);
}
.ciselnik-card-btn.active {
    background: rgba(59,130,246,0.15);
    color: var(--accent-blue);
    font-weight: 700;
}

.tab-btn.active {
    color: var(--text-primary);
    font-weight: 700;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel:not(.active) {
    display: none !important;
}

/* OS KÓD — ALARM ANIMÁCIA */
@keyframes osKodAlarm {
    0%   { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.45); box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    40%  { background: rgba(239,68,68,0.40); border-color: rgba(239,68,68,1);    box-shadow: 0 0 0 7px rgba(239,68,68,0.22); }
    100% { background: rgba(239,68,68,0.12); border-color: rgba(239,68,68,0.45); box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.os-kod-alarm {
    animation: osKodAlarm 1.2s ease-in-out infinite !important;
    color: #ef4444 !important;
    cursor: pointer !important;
}

/* PÁS: nahlásiť zmenu na operačné stredisko — bliká celý objekt (oranžovo) */
@keyframes osReportAlarm {
    0%   { background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.55); box-shadow: 0 0 0 0 rgba(245,158,11,0); }
    50%  { background: rgba(245,158,11,0.28); border-color: rgba(245,158,11,1);    box-shadow: 0 0 0 6px rgba(245,158,11,0.18); }
    100% { background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.55); box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}
.os-report-alarm {
    animation: osReportAlarm 1.35s ease-in-out infinite;
}

/* Zadaný kód OS — zvýraznený celý objekt v modrom (bez blikania) */
.os-kod-ok {
    background: rgba(59,130,246,0.20) !important;
    border-color: rgba(59,130,246,0.85) !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulseBorder {
    0% { border-color: rgba(239, 68, 68, 0.4); }
    50% { border-color: rgba(239, 68, 68, 0.9); }
    100% { border-color: rgba(239, 68, 68, 0.4); }
}

@keyframes flashText {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ==========================================
   PRINT MEDIA AND A4 LAYOUT STYLES
   ========================================== */
@media print {
    /* Hide screen UI completely */
    body * {
        visibility: hidden;
    }
    
    /* Force print container and its contents to print */
    #printContainer, #printContainer * {
        visibility: visible;
    }
    
    #printContainer {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: #000;
        background: #fff;
        font-family: "Times New Roman", Times, serif;
    }
    
    .print-page {
        width: 210mm;
        min-height: 297mm;
        padding: 20mm;
        margin: 0 auto;
        page-break-after: always;
        box-sizing: border-box;
        position: relative;
    }
    
    .print-header-dept {
        font-size: 12px;
        font-weight: bold;
        text-transform: uppercase;
        border-bottom: 2px solid #000;
        padding-bottom: 5px;
        margin-bottom: 30px;
    }
    
    .print-title {
        text-align: center;
        font-size: 22px;
        font-weight: bold;
        text-transform: uppercase;
        margin-top: 20px;
        margin-bottom: 35px;
        letter-spacing: 0.5px;
    }
    
    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 20px;
        margin-bottom: 20px;
    }
    
    .print-table th, .print-table td {
        border: 1px solid #000;
        padding: 6px 10px;
        font-size: 13px;
        text-align: left;
        vertical-align: middle;
        line-height: 1.4;
    }
    
    .print-table th {
        font-weight: bold;
        background-color: #f2f2f2;
    }
    
    .print-table td.center, .print-table th.center {
        text-align: center;
    }
    
    .print-table td.bold {
        font-weight: bold;
    }
    
    .print-meta-list {
        margin-bottom: 25px;
        font-size: 14px;
        line-height: 1.8;
    }
    
    .print-meta-item {
        display: flex;
        margin-bottom: 6px;
    }
    
    .print-meta-label {
        width: 180mm;
        font-weight: bold;
        flex-shrink: 0;
    }
    
    .print-meta-value {
        flex-grow: 1;
        border-bottom: 1px dotted #000;
    }
    
    .print-signatures-block {
        display: flex;
        justify-content: space-between;
        margin-top: 60px;
        font-size: 13px;
    }
    
    .print-sig-field {
        width: 45%;
        text-align: center;
        border-top: 1px dashed #000;
        padding-top: 6px;
    }
}

/* Blikajúci badge na admin karte Správa problémov */
@keyframes hafizPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
    50%       { opacity: 0.85; transform: scale(1.15); box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

#adminHlaseniaBadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    margin-left: 4px;
    line-height: 1;
}

/* Filtre v Prehľade osôb */
.db-filter {
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: rgba(255,255,255,0.04);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.db-filter:hover { border-color: var(--accent-blue); color: var(--text-primary); }
.db-filter.active {
    background: rgba(37,99,235,0.15);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* Zdieľané dáta – blikanie tlačidiel Uložiť/Načítať */
@keyframes hafizBlinkRed {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0.7); }
}
@keyframes hafizBlinkAmber {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
    50%      { box-shadow: 0 0 0 4px rgba(245,158,11,0.75); }
}
.hafiz-blink-red { animation: hafizBlinkRed 1s infinite; }
.hafiz-blink-amber { animation: hafizBlinkAmber 1.1s infinite; }

/* Rozbalené natívne zoznamy (datalist aj select) – vždy tmavý text na svetlom podklade.
   Bez tohto v Chrome/Edge pri tmavej téme svietil biely text na bielom pozadí. */
option {
    color: #1a1a1a !important;
    background-color: #ffffff !important;
}

/* Moderné podsvietené logo HAFIZ v hlavičke (vyššia špecifickosť, aby neprepisovalo .app-branding h1 span) */
.app-branding h1 span.brand-hafiz {
    font-weight: 900;
    letter-spacing: 2.5px;
    background: linear-gradient(120deg, #93c5fd 0%, #3b82f6 45%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #60a5fa;
    filter: drop-shadow(0 0 7px rgba(96,165,250,0.45));
}
.app-branding h1 span#appHeaderDept {
    font-weight: 700;
    font-size: 0.62em;
    letter-spacing: 0.8px;
    background: linear-gradient(120deg, #7dd3fc 0%, #60a5fa 60%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #7dd3fc;
    filter: drop-shadow(0 0 5px rgba(125,211,252,0.45));
    white-space: nowrap;
}

/* Malý podnadpis pod HAFIZ / CPZ v hlavičke */
.app-branding .brand-subtitle {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.75;
    margin-top: 2px;
    margin-left: 37px;
    white-space: nowrap;
}

/* Podsvietené logo HAFIZ aj na prihlasovacej obrazovke (rovnako ako v hlavičke) */
.login-card h2 {
    background: linear-gradient(120deg, #93c5fd 0%, #3b82f6 45%, #a78bfa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #60a5fa;
    filter: drop-shadow(0 0 10px rgba(96,165,250,0.45));
    letter-spacing: 3px;
    font-weight: 900;
}

/* ================= MOBILNÁ RESPONZÍVNOSŤ (online demo) ================= */
@media (max-width: 820px) {
    .app-container { margin: 0; padding: 12px; border-radius: 0; max-width: 100%; min-height: 100vh; }
    .app-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .app-branding h1 { font-size: 16px; flex-wrap: wrap; }
    .app-branding .brand-subtitle { margin-left: 34px; font-size: 8px; }
    .header-meta { flex-wrap: wrap; gap: 8px; width: 100%; }
    .control-buttons { flex-wrap: wrap; }
    .stats-strip { flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
    .stats-strip > div[style*="width:1px"] { display: none; }
    .main-row { flex-direction: column; }
    .right-panel { width: 100% !important; align-self: stretch; }
    .cells-grid { grid-template-columns: repeat(2, 1fr); grid-template-rows: auto; min-height: 0; gap: 12px; }
    .modal { padding: 8px; }
    .modal-content { max-width: 100%; max-height: 94vh; }
    .modal-header { padding: 14px 16px; }
    .modal-body { padding: 14px 16px; overflow-x: auto; }
    .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
    .login-card { padding: 28px 20px; }
}
@media (max-width: 560px) {
    .app-container { padding: 8px; }
    .cells-grid { grid-template-columns: 1fr; }
    .modal-header h3 { font-size: 15px; }
    .form-control, .btn { font-size: 14px; }
    .app-branding h1 { font-size: 15px; }
}

/* ===== MOBIL – silnejšie pravidlá (pretečenie, štatistiky, modály) ===== */
@media (max-width: 820px) {
    html, body { overflow-x: hidden; max-width: 100%; }
    .app-container { width: 100%; max-width: 100%; }
    /* Štatistický pás pod seba (prijal/ukončil/kód/vedenie/export) */
    .stats-strip { flex-direction: column; align-items: stretch; gap: 8px; }
    .stats-strip > div { justify-content: flex-start; width: 100%; }
    #osKodCard { width: 100%; justify-content: center; }
    /* Pravý panel (kasa, odovzdávka) – zalamovať vnútorné riadky */
    .right-panel [style*="display:flex"], .right-panel [style*="display: flex"] { flex-wrap: wrap; }
    /* MODÁLY – celá šírka, dvojstĺpce a gridy pod seba */
    .modal { padding: 6px; }
    .modal-content { max-width: 100% !important; width: 100% !important; }
    .modal-body [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
    .modal-body [style*="display:flex"], .modal-body [style*="display: flex"] { flex-wrap: wrap; }
    .modal-body [style*="min-width"] { min-width: 0 !important; }
    .modal-body table { display: block; width: 100%; overflow-x: auto; }
    /* Päta programu – menšia, nech sa nekrája */
    #appFooter { font-size: 8px; padding: 3px 8px; line-height: 1.25; }
}

/* ===== MOBIL – vynulovanie pevných min-width na dashboarde (roztláčali stránku) ===== */
@media (max-width: 820px) {
    .dashboard-wrapper [style*="min-width:"] { min-width: 0 !important; }
    .dashboard-wrapper [style*="min-width :"] { min-width: 0 !important; }
    /* poistka: nič v appke nesmie byť širšie ako obrazovka */
    .dashboard-wrapper, .dashboard-wrapper * { max-width: 100%; }
    .cells-grid > * { min-width: 0 !important; }
}

/* ================= MOBILNÁ BRÁNA (logo + "pripravujeme") ================= */
#mobileGate { display: none; }
.mg-inner { max-width: 340px; }
.mg-title {
    font-size: 34px; font-weight: 900; letter-spacing: 6px; margin: 16px 0 4px;
    background: linear-gradient(120deg, #93c5fd 0%, #3b82f6 50%, #a78bfa 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.mg-sub { font-size: 11px; letter-spacing: 2px; color: #94a3b8; text-transform: uppercase; margin-bottom: 26px; }
.mg-msg { font-size: 17px; font-weight: 800; color: #f1f5f9; margin-bottom: 6px; }
.mg-note { font-size: 13px; color: #94a3b8; }
/* Mobilná brána bola nahradená plnou mobilnou verziou (mobile.css + mobile.js) */
