:root {
  --bg: #f5f6f8; --card: #fff; --text: #1d2330; --muted: #6b7280; --line: #e3e6ea;
  --accent: #1f5fbf; --accent-2: #174a96;
  --done: #1e8a4c; --done-bg: #e3f4ea; --partial: #a86400; --partial-bg: #fdf1dc;
  --none: #9a2d2d; --none-bg: #f8e4e4;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 1.2rem 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
.card h2 { margin-top: 0; }
.wrap { max-width: 1150px; margin: 0 auto; padding: 0 16px; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 12px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); }
nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.who { color: var(--muted); }
main { padding-bottom: 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin: 12px 0; }
.card.narrow { max-width: 400px; margin: 60px auto; }
.card.highlight { border-color: var(--accent); background: #f2f7ff; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono, code { font-family: ui-monospace, Consolas, monospace; }
code.big { font-size: 1.2rem; background: #fff; padding: 2px 8px; border-radius: 4px; }
label { display: block; margin: 0 0 12px; font-weight: 500; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
input, select, textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid #cdd2d8; border-radius: 6px; margin-top: 4px; background: #fff; }
input[type=checkbox] { width: auto; margin: 0; }
textarea { resize: vertical; }
.btn { display: inline-block; font: inherit; padding: 8px 16px; border-radius: 6px; border: 1px solid #cdd2d8; background: #fff; color: var(--text); cursor: pointer; }
.btn:hover { background: #f0f2f5; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--none); border-color: #e2b4b4; }
.btn.full { width: 100%; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
button.link.danger { color: var(--none); }
form.inline { display: inline; }
.flash { padding: 10px 14px; border-radius: 6px; margin: 12px 0; background: #e8f0fb; }
.flash.error { background: var(--none-bg); color: var(--none); }
.flash.ok { background: var(--done-bg); color: var(--done); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.done { background: var(--done-bg); color: var(--done); }
.badge.partial { background: var(--partial-bg); color: var(--partial); }
.badge.none { background: var(--none-bg); color: var(--none); }
.badge.admin { background: #e8eefb; color: var(--accent); }
.list .video-row { display: flex; justify-content: space-between; align-items: center; color: var(--text); gap: 12px; }
.right { text-align: right; }
.head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions select { width: auto; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid2 .card { margin: 0; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* přehrávač */
.video-title { font-size: 1.3rem; }
.player-box { background: #000; border-radius: 10px; overflow: hidden; }
.player-box video { display: block; width: 100%; max-height: 78vh; background: #000; }
.progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.bar { position: relative; height: 12px; background: #e6e9ee; border-radius: 6px; overflow: hidden; }
.bar span { position: absolute; top: 0; bottom: 0; background: var(--done); }
.bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }
.bar.static { margin: 10px 0; }

/* přehled */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stat b { display: block; font-size: 1.8rem; line-height: 1.1; }
.stat span { color: var(--muted); }
.stat.done b { color: var(--done); } .stat.partial b { color: var(--partial); } .stat.none b { color: var(--none); }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.filter { display: flex; gap: 8px; margin-bottom: 8px; }
.filter input { flex: 1; margin: 0; } .filter select { width: auto; margin: 0; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.ua { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-bar { width: 120px; height: 8px; background: #e6e9ee; border-radius: 4px; overflow: hidden; margin: 4px 0; }
.mini-bar span { display: block; height: 100%; background: var(--done); }
.rename input { width: 260px; margin: 0; padding: 4px 8px; }
.danger-zone { display: flex; gap: 8px; }

/* seznam videí učitele */
.video-info { flex: 1; min-width: 0; }
.row-bar { height: 8px; background: #e6e9ee; border-radius: 4px; overflow: hidden; margin-top: 10px; max-width: 520px; }
.row-bar span { display: block; height: 100%; background: var(--partial); }
.video-row.is-done { border-color: #b9e2c9; background: #f4fbf7; }
.video-row.is-done .row-bar span { background: var(--done); }
.badge.big { font-size: .95rem; padding: 6px 14px; }
.card.is-done { border-color: #b9e2c9; background: #f4fbf7; }
/* souhrnný přehled */
.matrix th.vcol, .matrix td.vcol { text-align: center; }
.matrix th.vcol { white-space: normal; min-width: 90px; text-transform: none; letter-spacing: 0; font-size: .82rem; }
.nowrap { white-space: nowrap; }
.txt-done { color: var(--done); }
/* logo */
.brand { display: flex; align-items: center; }
.brand-logo { display: block; height: 40px; width: auto; max-width: 260px; object-fit: contain; }
.login-logo { display: block; max-height: 80px; max-width: 100%; margin: 0 auto 8px; }
.logo-preview { background: #fafbfc; border: 1px dashed var(--line); border-radius: 8px; padding: 16px; margin-bottom: 14px; text-align: center; }
.logo-preview img { max-height: 100px; max-width: 100%; }
