/* Koordinátor — barvy a tvary přebírá od xtream-gui, ať to vypadá jako jedna rodina. */

:root {
  --bg: #0a0d14; --bg-elev: #10141f; --surface: #161b28; --surface-2: #1d2333;
  --line: #262d3d; --text: #e8ecf6; --text-dim: #98a2b8; --text-faint: #64708a;
  --accent: #6d5efc; --accent-hi: #8a7dff; --accent-soft: #6d5efc22;
  --green: #35c58a; --amber: #f3b23c; --red: #f0556b;
  --radius: 14px; --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6fa; --bg-elev: #fff; --surface: #fff; --surface-2: #f0f2f7;
    --line: #dfe3ec; --text: #141824; --text-dim: #5b6478; --text-faint: #8c94a6;
    --accent: #5a49f0; --accent-hi: #4536dd; --accent-soft: #5a49f018;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); }
a { color: var(--accent-hi); }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 0 0 12px; }
.sub { color: var(--text-dim); font-size: 13.5px; }
.faint { color: var(--text-faint); }

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--bg-elev); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 4px; }
.brand { font-weight: 700; font-size: 16px; padding: 0 10px 18px; display: flex; gap: 10px; align-items: center; }
.brand i { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; font-style: normal; color: #fff; font-size: 15px; }
.nav { display: block; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-dim); text-decoration: none; }
.nav:hover { background: var(--surface); color: var(--text); }
.nav.active { background: var(--accent-soft); color: var(--text); }
.side .grow { flex: 1; }
.me { padding: 10px 12px; font-size: 13px; color: var(--text-dim); border-top: 1px solid var(--line); margin-top: 8px; }
.me b { color: var(--text); display: block; font-size: 14px; }
main { padding: 32px 36px; max-width: 1100px; width: 100%; }
.head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.head .grow { flex: 1; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row + .row { margin-top: 12px; }
.grow { flex: 1; min-width: 0; }

label.f { display: block; margin-bottom: 14px; }
label.f span { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }
input, select { font: inherit; color: var(--text); background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 12px; width: 100%; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
select.inline { width: auto; padding: 5px 8px; }

.btn { font: inherit; font-weight: 600; font-size: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--text-faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hi); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: default; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-dim); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.tbl { overflow-x: auto; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-dim); }
.pill.admin { background: var(--accent-soft); color: var(--accent-hi); }
.pill.externista { color: var(--amber); }
.pill.off { color: var(--red); }
.pill.ok { color: var(--green); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.login .brand { padding: 0 0 22px; font-size: 20px; }
.err { color: var(--red); font-size: 13.5px; min-height: 20px; margin: -4px 0 10px; }

.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 20px; letter-spacing: .06em; background: var(--bg-elev); border: 1px dashed var(--accent); border-radius: var(--radius-sm); padding: 12px 16px; margin: 12px 0; user-select: all; text-align: center; }

.empty { color: var(--text-dim); text-align: center; padding: 34px 10px; }

.modal-bg { position: fixed; inset: 0; background: #000a; display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 440px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--surface-2); border: 1px solid var(--line); padding: 10px 18px; border-radius: var(--radius-sm); z-index: 60; box-shadow: 0 10px 30px -12px #0009; }
.toast.err { border-color: var(--red); }

h2.sekce { margin: 26px 0 10px; }
.lide { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.lide .card { margin: 0; padding: 14px 16px; }
.tecka { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex: none; }
.tecka.on { background: var(--green); box-shadow: 0 0 0 3px #35c58a33; }
.cisla { display: flex; gap: 12px; margin-top: 8px; font-size: 13px; color: var(--text-dim); }
.cisla b { color: var(--text); }
.seznam { padding: 6px 16px; }
.titul { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.titul:last-child { border-bottom: 0; }
.hlidane .titul { align-items: center; }
.plakat { border-radius: 5px; object-fit: cover; background: var(--surface-2); flex: none; display: block; }
.nazev { font-weight: 600; }
.prace { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; margin-top: 4px; }
.prace.stary { opacity: .55; }
.prace .ikona { width: 16px; text-align: center; }
.prace .kdo { font-weight: 600; }
.pruh { width: 90px; height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.pruh i { display: block; height: 100%; background: var(--accent); }
.chyba { color: var(--red); font-size: 12.5px; }

a.titul, a.tichy { color: inherit; text-decoration: none; }
a.titul:hover .nazev, a.tichy:hover b { color: var(--accent-hi); }
.clovek { cursor: pointer; }
.clovek:hover { border-color: var(--text-faint); }
.filtry { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.filtry select { width: auto; }
.chipy { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { font: inherit; font-size: 13px; font-weight: 600; padding: 6px 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.filtry + .chipy + .sub { margin-bottom: 8px; }
.zpet { display: inline-block; margin-bottom: 14px; color: var(--text-dim); text-decoration: none; font-size: 14px; }
.detail-hlava { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 8px; }
.sezona { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sezona:last-child { border-bottom: 0; }
.dily { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.dil { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #35c58a22; color: var(--green); cursor: default; }

textarea { font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; resize: vertical; }
.varovani { background: #f3b23c18; border: 1px solid #f3b23c66; color: var(--text); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.varovani b { color: var(--amber); display: block; margin-bottom: 4px; }
.tmdb-mriz { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.tmdb-karta { display: flex; gap: 14px; margin: 0; padding: 14px; }
.tmdb-karta img { width: 70px; height: 105px; object-fit: cover; border-radius: 6px; flex: none; }
.cbs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; }
.cb { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.cb input { width: auto; }
details.rucni { margin-top: 12px; font-size: 13.5px; }
details.rucni summary { cursor: pointer; color: var(--text-dim); }
.modal { max-height: calc(100vh - 32px); overflow-y: auto; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 8px 0 0; }
  .side .grow, .me { display: none; }
  main { padding: 22px 16px; }
  .hide-m { display: none; }
}
