@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    line-height: 1.6;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-bottom: 1px solid #334155;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-header h1 { font-size: 1.4rem; font-weight: 700; color: #f1f5f9; }
.app-header .subtitle { color: #64748b; font-size: 0.82rem; margin-left: 12px; }
.header-right { color: #64748b; font-size: 0.78rem; }

/* Nav */
.main-nav {
    display: flex;
    gap: 0;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    padding: 0 28px;
}
.nav-link {
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 20px;
    font-weight: 500;
    font-size: 0.88rem;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover { color: #e2e8f0; }
.nav-link.active { color: #3b82f6; border-bottom-color: #3b82f6; }

/* Layout */
#app-content { padding: 20px 28px; }

.filters-row {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    flex-wrap: wrap;
    align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; min-width: 170px; }
.filter-group label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 4px;
}
.filter-group select,
.filter-group input[type="date"] {
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 7px 10px;
    font-family: inherit;
    font-size: 0.85rem;
}
.filter-group select:focus,
.filter-group input:focus { outline: none; border-color: #3b82f6; }

.btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.btn:hover { background: #2563eb; }

/* Stats row */
.stats-row { display: flex; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.stat-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 14px 20px;
    min-width: 140px;
    flex: 1;
    text-align: center;
}
.stat-card .value { font-size: 1.6rem; font-weight: 700; color: #3b82f6; }
.stat-card .label { font-size: 0.75rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px; }

/* Grid */
.grid { display: flex; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.panel {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 16px;
    flex: 1;
    min-width: 300px;
}
.panel-wide { flex: 1.5; }
.panel-full { flex: 0 0 100%; }
.panel h3 { font-size: 0.95rem; font-weight: 600; color: #f1f5f9; margin-bottom: 10px; }
.panel .sub { font-size: 0.78rem; color: #64748b; margin-top: -6px; margin-bottom: 10px; }

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}
.data-table th {
    background: #1e293b;
    color: #e2e8f0;
    font-weight: 600;
    text-align: center;
    padding: 8px 10px;
    border-bottom: 2px solid #334155;
    cursor: pointer;
    user-select: none;
}
.data-table th:hover { color: #3b82f6; }
.data-table td {
    text-align: center;
    padding: 7px 10px;
    border-bottom: 1px solid #1e293b;
    color: #cbd5e1;
}
.data-table tr:hover td { background: #1e293b; }
.data-table tr.selected td { background: #1e3a5f; }
.data-table .good { color: #6ee7b7; }
.data-table .bad { color: #fca5a5; }

/* Active filter bar */
.filter-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 10px 0;
    background: #1e3a5f;
    border: 1px solid #3b82f6;
    border-radius: 8px;
    font-size: 0.88rem;
}
.filter-bar.active { display: flex; }
.filter-bar .filter-label { color: #94a3b8; }
.filter-bar .filter-value { color: #3b82f6; font-weight: 600; }
.filter-bar .clear-btn {
    margin-left: auto;
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
    padding: 4px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.82rem;
}
.filter-bar .clear-btn:hover { background: #475569; }

/* Clickable rows/bars */
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: #1e3a5f; }

/* Loading */
.loading-msg { text-align: center; padding: 60px; color: #64748b; font-size: 1rem; }

/* Responsive */
@media (max-width: 768px) {
    .grid, .stats-row, .filters-row { flex-direction: column; }
    .panel, .stat-card { min-width: 100%; }
    .main-nav { overflow-x: auto; }
}
