/* ==========================================================================
   SlavNET monitor — placeholder brand palette
   Tyto barvy jsou POUZE ODHAD (nepodařilo se automaticky stáhnout branding
   z www.slavnet.cz). Až pošlete přesné hex kódy / logo, stačí přepsat
   proměnné níže — zbytek stránky se přizpůsobí automaticky.
   ========================================================================== */

:root {
  color-scheme: light;

  /* --- brand: NAHRADIT presnymi hodnotami SlavNETu ------------------ */
  --brand-navy-900: #0b1a2b;
  --brand-navy-800: #10243b;
  --brand-navy-700: #163350;
  --brand-accent: #1e9bd7;   /* primarni akcentni modra */
  --brand-accent-dark: #157bab;

  /* --- povrchy a text (odvozeno z dataviz referencni palety) --------- */
  --surface-1: #fcfcfb;
  --surface-2: #f2f3f5;
  --page-plane: #f9f9f7;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --border-hairline: rgba(11, 11, 11, 0.10);
  --gridline: #e1e0d9;

  /* --- status (fixni, nikdy nemenit dle tematu) ---------------------- */
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --status-planned: #898781;

  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 2px rgba(11, 11, 11, 0.06), 0 4px 16px rgba(11, 11, 11, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page-plane);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

/* ---------------------------------------------------------------------
   Login page
   --------------------------------------------------------------------- */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, var(--brand-navy-700) 0%, transparent 55%),
    linear-gradient(160deg, var(--brand-navy-900) 0%, var(--brand-navy-800) 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  padding: 36px 32px 28px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.login-brand .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-navy-700));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  flex: none;
}

.login-brand .logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.login-brand .logo-text span {
  color: var(--brand-accent);
}

.login-card h1 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 20px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gridline);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--text-primary);
}

.field input:focus {
  outline: none;
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(30, 155, 215, 0.18);
  background: var(--surface-1);
}

.btn-primary {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--brand-accent);
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s ease;
}

.btn-primary:hover {
  background: var(--brand-accent-dark);
}

.login-error {
  background: #fdecea;
  color: var(--status-critical);
  border: 1px solid rgba(208, 59, 59, 0.25);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

.login-footnote {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------------------------------------------------------------------
   Dashboard shell
   --------------------------------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex: none;
  background: linear-gradient(180deg, var(--brand-navy-900) 0%, var(--brand-navy-800) 100%);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px 22px;
}

.sidebar-brand .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand-accent), var(--brand-navy-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex: none;
}

.sidebar-brand .logo-text {
  font-size: 16px;
  font-weight: 700;
}

.sidebar-brand .logo-text span {
  color: var(--brand-accent);
}

.nav-section-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  padding: 14px 10px 6px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  margin-bottom: 2px;
}

.nav-item a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.nav-item.active a {
  background: rgba(30, 155, 215, 0.18);
  color: #fff;
}

.nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-planned);
  flex: none;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 10px 0;
}

.logout-form button {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13px;
  cursor: pointer;
}

.logout-form button:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 36px 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.topbar h1 {
  font-size: 20px;
  margin: 0 0 2px;
}

.topbar .subtitle {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.module-card {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(11, 11, 11, 0.08), 0 10px 24px rgba(11, 11, 11, 0.10);
}

.module-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.module-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-accent);
  flex: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  white-space: nowrap;
}

.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-planned);
}

.module-card h2 {
  font-size: 15.5px;
  margin: 0;
}

.module-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

.module-detail {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  text-align: center;
  max-width: 520px;
}

.module-detail .module-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
}

.module-detail h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.module-detail p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 16px;
}

.back-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-accent);
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
  }
  .sidebar-brand {
    padding: 0;
  }
  .nav-section-label {
    display: none;
  }
  .nav-list {
    display: flex;
    gap: 4px;
  }
  .sidebar-footer {
    margin-top: 0;
    margin-left: auto;
    padding: 0;
  }
  .main {
    padding: 20px;
  }
}

/* ---------------------------------------------------------------------
   Radius modul - zivy dashboard (stat tiles, graf, tabulky)
   --------------------------------------------------------------------- */

.status-pill-live {
  background: rgba(12, 163, 12, 0.10);
  color: var(--status-good);
}

.status-pill-error {
  background: rgba(208, 59, 59, 0.10);
  color: var(--status-critical);
}

.dot-good {
  background: var(--status-good) !important;
}

.dot-critical {
  background: var(--status-critical) !important;
}

.dot-warning {
  background: var(--status-warning) !important;
}

.radius-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 18px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stat-tile {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.stat-sub .dot {
  width: 7px;
  height: 7px;
  margin-right: 2px;
}

.radius-panel {
  background: var(--surface-1);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 18px 20px;
  margin-bottom: 18px;
}

.radius-panel h3 {
  font-size: 14.5px;
  margin: 0 0 12px;
}

.panel-note {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 12.5px;
}

.radius-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.radius-panel-header h3 {
  margin: 0;
}

.chart-legend {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend .dot {
  width: 8px;
  height: 8px;
}

.auth-chart {
  width: 100%;
  height: 160px;
  display: block;
  overflow: visible;
}

.auth-chart .bar-accept {
  fill: var(--status-good);
}

.auth-chart .bar-reject {
  fill: var(--status-critical);
}

.auth-chart .chart-baseline {
  stroke: var(--baseline, var(--gridline));
  stroke-width: 1;
}

.auth-chart .chart-tick {
  font-size: 9px;
  fill: var(--text-muted);
  text-anchor: start;
}

.auth-bar-group:hover rect {
  opacity: 0.85;
}

.radius-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .radius-columns {
    grid-template-columns: 1fr;
  }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 10px;
  border-bottom: 1px solid var(--gridline);
}

.data-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--gridline);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:hover {
  background: var(--surface-2);
}

.empty-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.table-scroll {
  overflow-x: auto;
}

.sortable-table thead tr:first-child th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
  padding-right: 16px;
}

.sortable-table thead tr:first-child th:hover {
  color: var(--text-secondary);
}

.sortable-table th.sort-asc::after,
.sortable-table th.sort-desc::after {
  position: absolute;
  right: 2px;
  font-size: 10px;
  color: var(--brand-accent);
}

.sortable-table th.sort-asc::after {
  content: "▲";
}

.sortable-table th.sort-desc::after {
  content: "▼";
}

.filter-row th {
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--gridline);
}

.col-filter {
  width: 100%;
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  padding: 5px 8px;
  border: 1px solid var(--gridline);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-primary);
}

.col-filter:focus {
  outline: none;
  border-color: var(--brand-accent);
  background: var(--surface-1);
}
