/* NAUT Reporting System - Light, vivid, data-focused */

:root {
    --navy: #0A1A3A;
    --navy-light: #1A2A4A;
    --orange: #F27A1A;
    --orange-light: #FF9A4A;
    --teal: #4ECDC4;
    --coral: #FF6B6B;
    --mint: #6BCB77;
    --gold: #FFD93D;
    --green: #27AE60;
    --yellow: #F39C12;
    --red: #E74C3C;
    --bg: #F8F9FA;
    --bg-card: #FFFFFF;
    --text: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --border: #E8E8E8;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ── Layout ── */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: var(--navy);
    color: white;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-logo {
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 16px;
}

.sidebar-logo h1 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-logo span {
    color: var(--orange);
}

.sidebar-logo small {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: rgba(255,255,255,0.08);
    color: white;
    border-left-color: var(--orange);
}

.sidebar nav a.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 12px;
    color: rgba(255,255,255,0.4);
}

.sidebar-footer a {
    color: rgba(255,255,255,0.6);
    text-decoration: none;
}

.main {
    margin-left: 240px;
    flex: 1;
    padding: 24px 32px;
    min-height: 100vh;
}

/* ── Header ── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--navy);
}

.page-header .meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--teal);
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.kpi-card.orange { border-left-color: var(--orange); }
.kpi-card.mint { border-left-color: var(--mint); }
.kpi-card.gold { border-left-color: var(--gold); }
.kpi-card.coral { border-left-color: var(--coral); }

.kpi-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
}

.kpi-card .label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ── Filter Bar ── */
.filter-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: white;
    color: var(--text);
    min-width: 160px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--navy);
    color: white;
}

.btn-primary:hover {
    background: var(--navy-light);
}

.btn-teal {
    background: var(--teal);
    color: white;
}

.btn-teal:hover {
    background: #3dbdb5;
}

.btn-orange {
    background: var(--orange);
    color: white;
}

.btn-orange:hover {
    background: var(--orange-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--navy);
    background: var(--bg);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* ── Cards / Panels ── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
}

.card-body {
    padding: 20px;
}

/* ── Grid ── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 24px;
}

/* ── Tables ── */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--navy);
    color: white;
    padding: 10px 14px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    white-space: nowrap;
}

table tr:hover td {
    background: rgba(78, 205, 196, 0.04);
}

table a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 500;
}

table a:hover {
    color: var(--orange);
}

/* ── Score Badge ── */
.score-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    color: white;
    min-width: 60px;
    text-align: center;
}

.zona-vyborny { background: var(--green); }
.zona-dobry { background: var(--yellow); }
.zona-slaby { background: var(--red); }

/* ── DQ Badges ── */
.dq-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.dq-high { background: #FADBD8; color: #C0392B; }
.dq-medium { background: #FDF2E9; color: #E67E22; }
.dq-info { background: #D6EAF8; color: #2980B9; }

/* ── Bar Chart (CSS) ── */
.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.bar-label {
    width: 140px;
    font-size: 13px;
    text-align: right;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    flex: 1;
    height: 28px;
    background: var(--bg);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.6s ease;
    display: flex;
    align-items: center;
    padding-left: 8px;
}

.bar-value {
    font-size: 12px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
}

/* ── Login Page ── */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.login-box {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    width: 400px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.login-box h1 {
    color: var(--navy);
    font-size: 24px;
    margin-bottom: 8px;
}

.login-box .subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

.login-box .form-group {
    margin-bottom: 16px;
}

.login-box label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.login-box input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.login-box input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.login-box .btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
}

.login-error {
    background: #FADBD8;
    color: #C0392B;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}

/* ── Back link ── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 16px;
}

.back-link:hover {
    color: var(--navy);
}

/* ── Detail header ── */
.detail-header {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.detail-header h2 {
    font-size: 22px;
    color: var(--navy);
    margin-bottom: 8px;
}

.detail-header .meta-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-light);
}

.detail-header .meta-row strong {
    color: var(--text);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 16px; }
    .kpi-grid { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .filter-bar { flex-direction: column; }
}

/* ── Placeholder pages ── */
.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-page h3 {
    font-size: 24px;
    color: var(--navy);
    margin-bottom: 8px;
}

.placeholder-page p {
    font-size: 14px;
    max-width: 400px;
}

/* ── View Toggle ── */
.view-toggle {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg);
}

.view-toggle .toggle-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-light);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.view-toggle .toggle-btn.active {
    background: var(--navy);
    color: white;
}

.view-toggle .toggle-btn:hover:not(.active) {
    background: var(--bg-card);
    color: var(--navy);
}

/* ── Sortable Tables ── */
table.sortable th[data-sort] {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px;
}

table.sortable th[data-sort]::after {
    content: '\2195';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    opacity: 0.5;
}

table.sortable th.sort-asc::after {
    content: '\2191';
    opacity: 1;
}

table.sortable th.sort-desc::after {
    content: '\2193';
    opacity: 1;
}

/* ── Animations ── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.card, .kpi-card {
    animation: fadeIn 0.3s ease;
}
