:root {
  color-scheme: light dark;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #1a2027;
  --muted: #5b6572;
  --border: #dde2e7;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --danger: #c62828;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 16px;
}

.container-wide { max-width: 960px; }

table.list {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 0.95rem;
}

table.list th, table.list td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.inline-form { display: inline; }

.card + .card { margin-top: 20px; }

/* Utility tridy nahrazujici drive opakovane inline style="" atributy
   (globalni AGENTS.md §6 - "Nekopiruj CSS a nereš kazdou stranku
   samostatnymi nesystemovymi vyjimkami"). */
.mt-16 { margin-top: 16px; }
.mt-12 { margin-top: 12px; }
.block { display: block; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.8em;
  border-radius: 4px;
}

.subheading {
  font-size: 1rem;
  margin-top: 20px;
}

.btn-sm {
  width: auto;
  padding: 4px 10px;
  margin: 0;
}

.btn-danger { background: var(--danger); }

.details-inline {
  display: inline-block;
  margin-left: 8px;
}

.details-inline summary { cursor: pointer; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}

h1 { font-size: 1.4rem; margin: 0 0 16px; }

label {
  display: block;
  font-weight: 600;
  margin: 12px 0 4px;
  font-size: 0.9rem;
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

button, .btn {
  display: inline-block;
  width: 100%;
  padding: 12px;
  margin-top: 20px;
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.error {
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.ok {
  background: #e6f4ea;
  color: #1e7a34;
  border: 1px solid #b7e1c1;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin: 16px 0 0;
}

legend {
  font-weight: 600;
  padding: 0 6px;
}

.radio-row {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
}

.radio-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  margin: 0;
}

.driver-fields[hidden] { display: none; }

code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.85em;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.topbar a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }

.lang-switch a { margin-left: 6px; }
.lang-switch a.active { color: var(--text); font-weight: 700; text-decoration: underline; }

ul.permissions { padding-left: 20px; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181d;
    --surface: #1c2128;
    --text: #e6edf3;
    --muted: #9aa5b1;
    --border: #30363d;
  }
}
