:root {
    --primary:    #1a2e5a;  
    --accent:     #e5a100;   
    --secondary:  #6c757d;
    --bg:         #f4f6fb;
    --card-bg:    #ffffff;
    --text:       #2c3e50;
    --border:     #dee2e6;
    --danger:     #dc3545;
    --success:    #198754;
    --warning:    #ffc107;
    --info:       #0dcaf0;
}


*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 0.92rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


#mainNav {
    background: var(--primary);
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
    padding: 0.5rem 0;
}
#mainNav .nav-link {
    color: rgba(255,255,255,0.82) !important;
    font-weight: 500;
    letter-spacing: 0.01em;
    padding: 0.5rem 0.9rem;
    border-radius: 6px;
    transition: background 0.18s, color 0.18s;
}
#mainNav .nav-link:hover,
#mainNav .nav-link.active {
    background: rgba(229,161,0,0.18);
    color: var(--accent) !important;
}
.brand-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: #fff;
    letter-spacing: 0.03em;
}


.card {
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    background: var(--card-bg);
    transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 6px 20px rgba(26,46,90,0.10); }
.card-header {
    background: var(--primary);
    color: #fff;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 0.75rem 1.1rem;
    border-bottom: 3px solid var(--accent);
}
.card-header .bi { color: var(--accent); }


.stat-card {
    border-left: 4px solid var(--accent);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(26,46,90,0.13); }
.stat-card .stat-icon {
    font-size: 2.2rem;
    color: var(--primary);
    opacity: 0.18;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}
.stat-card .stat-label { color: var(--secondary); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }


.table { font-size: 0.875rem; }
.table thead th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    border: none;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}
.table thead th a { color: #fff; text-decoration: none; }
.table thead th a:hover { color: var(--accent); }
.table tbody tr { transition: background 0.12s; }
.table tbody tr:hover { background: rgba(26,46,90,0.04); }
.table-wrapper { overflow-x: auto; border-radius: 0 0 12px 12px; }


.badge-stav-aktivne    { background: #d1fae5; color: #065f46; }
.badge-stav-neaktivne  { background: #fee2e2; color: #7f1d1d; }
.badge-stav-servis     { background: #fef9c3; color: #713f12; }
.badge-zavaznost-nizka    { background: #dbeafe; color: #1e3a8a; }
.badge-zavaznost-stredna  { background: #fef9c3; color: #713f12; }
.badge-zavaznost-vysoka   { background: #fed7aa; color: #7c2d12; }
.badge-zavaznost-kriticka { background: #fee2e2; color: #7f1d1d; font-weight:700; }
.badge-stav-vyriešená  { background: #d1fae5; color: #065f46; }
.badge-stav-v_rieseni  { background: #fef9c3; color: #713f12; }
.badge-stav-detekována { background: #fee2e2; color: #7f1d1d; }


.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26,46,90,0.15);
}
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #0f1e3d; border-color: #0f1e3d; }
.btn-accent  { background: var(--accent); border-color: var(--accent); color: #111; font-weight:600; }
.btn-accent:hover { background: #c88d00; border-color: #c88d00; color: #000; }


.device-slider .carousel-inner { border-radius: 0 0 12px 12px; }
.device-card-slide {
    background: linear-gradient(135deg, var(--primary), #2a4a8a);
    color: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    min-height: 160px;
}
.device-card-slide .device-type-icon { font-size: 3rem; opacity: 0.3; }
.device-card-slide .device-serial { font-size: 0.75rem; opacity: 0.7; }
.carousel-indicators [data-bs-target] { background-color: var(--accent); }
.carousel-control-prev-icon, .carousel-control-next-icon { filter: invert(0); }


.chart-container { position: relative; height: 280px; }


.flash-msg { border-radius: 8px; font-size: 0.9rem; }


.footer {
    background: var(--primary);
    border-top: 3px solid var(--accent);
    margin-top: auto;
}


.page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0; }
.page-header .bi { color: var(--accent); font-size: 1.6rem; }


.filter-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.25rem;
}


.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary) 0%, #2a4a8a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card .card-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 3px solid var(--accent);
}
.login-card .card-header img { height: 40px; }


@media (max-width: 768px) {
    .stat-card .stat-value { font-size: 1.5rem; }
    .page-header h1 { font-size: 1.2rem; }
    .chart-container { height: 220px; }
}


@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.4s ease both; }
.fade-in-up:nth-child(2) { animation-delay: 0.07s; }
.fade-in-up:nth-child(3) { animation-delay: 0.14s; }
.fade-in-up:nth-child(4) { animation-delay: 0.21s; }
