/* Jednoduché štýly bez JavaScriptu. Farby sú tokeny, tmavý režim sa riadi nastavením zariadenia. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #1c2430;
  --muted: #5d6877;
  --border: #d9dee6;
  --accent: #1d4ed8;
  --accent-text: #ffffff;
  --ok-bg: #e7f6ec;
  --ok-text: #14532d;
  --warn-bg: #fff4e0;
  --warn-text: #7a3e00;
  --new-bg: #e0ecff;
  --new-text: #1e3a8a;
  --approved-bg: #e7f6ec;
  --approved-text: #14532d;
  --rejected-bg: #fde8e8;
  --rejected-text: #7f1d1d;
  --waitlist-bg: #fff4e0;
  --waitlist-text: #7a3e00;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --surface: #1b212a;
    --text: #e8ecf2;
    --muted: #9aa5b5;
    --border: #2f3743;
    --accent: #6ea0ff;
    --accent-text: #0b1220;
    --ok-bg: #123320;
    --ok-text: #b7ebc8;
    --warn-bg: #3a2a0c;
    --warn-text: #ffd9a0;
    --new-bg: #172a52;
    --new-text: #c4d7ff;
    --approved-bg: #123320;
    --approved-text: #b7ebc8;
    --rejected-bg: #411818;
    --rejected-text: #ffc9c9;
    --waitlist-bg: #3a2a0c;
    --waitlist-text: #ffd9a0;
  }
}

* {
  box-sizing: border-box;
}

body {
  /* dlhý text bez medzier (názov tímu, e-mail) sa zalomí, nerozšíri stránku.
     break-word (nie anywhere): nezmenšuje stĺpce tabuliek na šírku jedného písmena */
  overflow-wrap: break-word;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

a {
  color: var(--accent);
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.6rem;
  margin: 0.4em 0;
}

h2 {
  font-size: 1.15rem;
  margin: 0 0 0.5em;
}

section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 0.9rem;
}

.user {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.button,
button {
  display: inline-block;
  font: inherit;
  padding: 10px 16px;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--accent);
}

button.link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 4px 8px;
  min-height: 0;
  text-decoration: underline;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions .button {
  background: transparent;
  color: var(--accent);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.tabs a {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.tabs a.active {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
  font-weight: 700;
}

.count {
  color: var(--muted);
  font-size: 0.9em;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

table {
  width: 100%;
  min-width: 560px; /* na úzkom displeji sa tabuľka posúva vo vlastnom rámiku, nie celá stránka */
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

th {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-new {
  background: var(--new-bg);
  color: var(--new-text);
}

.badge-approved {
  background: var(--approved-bg);
  color: var(--approved-text);
}

.badge-rejected {
  background: var(--rejected-bg);
  color: var(--rejected-text);
}

.badge-waitlist {
  background: var(--waitlist-bg);
  color: var(--waitlist-text);
}

.note-flag {
  font-size: 0.8rem;
  color: var(--muted);
}

.muted,
.empty {
  color: var(--muted);
}

.notice {
  padding: 12px 16px;
  border-radius: 10px;
  margin: 12px 0;
  font-weight: 600;
}

.notice-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.notice-warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.current-note {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.facts,
.answers {
  display: grid;
  grid-template-columns: minmax(140px, 28%) minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
}

.facts dt,
.answers dt {
  color: var(--muted);
}

.facts dd,
.answers dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.pre {
  white-space: pre-wrap;
}

.files {
  margin: 4px 0 0;
  padding-left: 20px;
}

textarea {
  width: 100%;
  font: inherit;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  margin-bottom: 10px;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .facts,
  .answers {
    grid-template-columns: minmax(0, 1fr);
  }
}

.nowrap {
  white-space: nowrap;
}

.titlebar h1 {
  flex: 1 1 220px;
  min-width: 0;
}

/* Na úzkom displeji zoznam ukáže len tím a stav, ostatné údaje sú v detaile. */
@media (max-width: 600px) {
  .list-table {
    min-width: 0;
  }

  .list-table th:nth-child(n + 3),
  .list-table td:nth-child(n + 3) {
    display: none;
  }

  .list-table td:first-child {
    overflow-wrap: anywhere;
  }
}
