:root {
  --sidebar-bg: #1a2332;
  --sidebar-width: 260px;
  --accent: #00b4d8;
  --accent-dark: #0096c7;
  --text-muted: #8899aa;
  --card-border: #e8edf2;
  --chart-1: #00b4d8;
  --chart-2: #f77f00;
  --chart-3: #06d6a0;
  --chart-4: #ef233c;
  --chart-5: #7209b7;
  --chart-6: #ffd166;
}

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: #f4f7fb;
  margin: 0;
  padding: 0;
}

/* ── Sidebar ────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

#sidebar .brand {
  padding: 20px 20px 12px;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
  display: block;
  letter-spacing: .3px;
}
#sidebar .brand span { color: var(--accent); }

.file-selector {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.file-selector label {
  color: var(--text-muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  display: block;
  margin-bottom: 4px;
}

/* ── Country switcher ───────────────────────────────── */
.zeme-switcher {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.zeme-switcher label {
  color: var(--text-muted);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  display: block;
  margin-bottom: 6px;
}
.zeme-btns {
  display: flex;
  gap: 4px;
}
.zeme-btn {
  flex: 1;
  padding: 5px 0;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  color: #a0b4c8;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.zeme-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.zeme-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.file-selector select {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  color: #d0dce8;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: .8rem;
}

.nav-section {
  padding: 12px 0 4px;
}
.nav-section-title {
  padding: 0 20px 4px;
  color: var(--text-muted);
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}
#sidebar a.nav-link {
  display: block;
  padding: 7px 20px 7px 28px;
  color: #b8cad8;
  text-decoration: none;
  font-size: .85rem;
  border-left: 3px solid transparent;
  transition: all .15s;
}
#sidebar a.nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
#sidebar a.nav-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(0,180,216,.08);
  font-weight: 600;
}
#sidebar a.nav-link-section {
  padding-left: 20px;
  font-size: .82rem;
  font-weight: 600;
  color: #cdd8e3;
  cursor: default;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-footer a {
  color: var(--text-muted);
  font-size: .78rem;
  text-decoration: none;
}
.sidebar-footer a:hover { color: #ef233c; }

/* ── Main content ───────────────────────────────── */
#main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 28px 32px;
}

.page-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #1a2332;
  margin-bottom: 4px;
}
.page-subtitle {
  color: #6b7a8d;
  font-size: .88rem;
  margin-bottom: 22px;
}

/* ── KPI Cards ──────────────────────────────────── */
.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.kpi-card.c2 { border-left-color: var(--chart-2); }
.kpi-card.c3 { border-left-color: var(--chart-3); }
.kpi-card.c4 { border-left-color: var(--chart-4); }
.kpi-card.c5 { border-left-color: var(--chart-5); }
.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: #1a2332;
  line-height: 1;
}
.kpi-label {
  font-size: .78rem;
  color: #6b7a8d;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.kpi-sub {
  font-size: .8rem;
  color: #9aacba;
  margin-top: 2px;
}

/* ── Chart cards ────────────────────────────────── */
.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  margin-bottom: 20px;
}
.chart-card h6 {
  font-size: .82rem;
  font-weight: 700;
  color: #3a4a5c;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
}
.chart-wrap { width: 100%; min-height: 300px; }

/* ── Tables ─────────────────────────────────────── */
.table-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  margin-bottom: 20px;
  overflow-x: auto;
}
.table-card h6 {
  font-size: .82rem;
  font-weight: 700;
  color: #3a4a5c;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
}
table.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
table.report-table th {
  background: #f4f7fb;
  color: #5a6a7a;
  font-weight: 600;
  padding: 8px 12px;
  text-align: left;
  border-bottom: 2px solid #e0e8ef;
  white-space: nowrap;
}
table.report-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #edf1f5;
  color: #2a3a4a;
}
table.report-table tr:last-child td { border-bottom: none; }
table.report-table tr:hover td { background: #f8fafc; }
table.report-table a { color: var(--accent); text-decoration: none; font-weight: 600; }
table.report-table a:hover { text-decoration: underline; }

.badge-kraj {
  background: rgba(0,180,216,.1);
  color: var(--accent-dark);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: .75rem;
  font-weight: 600;
}

/* ── Login page ─────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a2332 0%, #0f3460 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 44px;
  width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo {
  font-size: 1.6rem;
  font-weight: 800;
  color: #1a2332;
  margin-bottom: 4px;
}
.login-logo span { color: var(--accent); }
.login-sub { color: #6b7a8d; font-size: .88rem; margin-bottom: 28px; }
.login-card .form-control {
  border-radius: 8px;
  border: 1.5px solid #dce4ec;
  padding: 10px 14px;
}
.login-card .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,180,216,.15);
}
.btn-login {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px;
  font-weight: 700;
  width: 100%;
  font-size: .95rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-login:hover { background: var(--accent-dark); }

/* ── Filters bar ────────────────────────────────── */
.filter-bar {
  background: #fff;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar label { font-size: .8rem; color: #6b7a8d; margin-bottom: 0; }
.filter-bar select, .filter-bar input {
  font-size: .84rem;
  border-radius: 6px;
  border: 1.5px solid #dce4ec;
  padding: 5px 10px;
  background: #f8fafc;
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  #sidebar { transform: translateX(-100%); transition: transform .25s; }
  #sidebar.open { transform: translateX(0); }
  #main { margin-left: 0; padding: 16px; }
  .hamburger { display: block !important; }
}
.hamburger {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 200;
  background: var(--sidebar-bg);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 40px; height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ── Util ───────────────────────────────────────── */
.pct-bar {
  background: #edf1f5;
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  min-width: 60px;
}
.pct-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
}
.text-accent { color: var(--accent); }
.fw-700 { font-weight: 700; }

/* ── Upload ─────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(79,140,255,.05);
}
.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  color: var(--text-muted);
  font-size: .95rem;
}
.upload-icon { font-size: 2.2rem; color: var(--accent); }
.alert {
  padding: .75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: .95rem;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-error   { background: #f8d7da; color: #721c24; }
.badge {
  display: inline-block;
  padding: .2em .6em;
  border-radius: 4px;
  font-size: .8rem;
  font-weight: 600;
}
.badge-kurzy  { background: #dbeafe; color: #1e40af; }
.badge-skoly  { background: #dcfce7; color: #166534; }
.badge-unknown { background: #fef3c7; color: #92400e; }
.btn { display:inline-block; padding:.5rem 1rem; border-radius:7px; border:none; cursor:pointer; font-size:.95rem; font-weight:600; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { opacity:.9; }
.btn-danger  { background:#e74c3c; color:#fff; }
.btn-danger:hover { opacity:.9; }
.btn-sm { padding:.3rem .7rem; font-size:.8rem; }

/* ── Navolávání / Pivot ──────────────────────────────────────────────── */
.pivot-table th, .pivot-table td { white-space: nowrap; }
.pivot-highlight td { background: rgba(6,214,160,.07); }
.pivot-total td { background: #edf1f5; color: var(--text); font-weight: 700; border-top: 2px solid var(--border); }
.conv-cell { background: rgba(6,214,160,.15); font-weight: 700; }
.empty-state { color: var(--text-muted); padding: 1rem; font-size: .9rem; }
