/* Qest tokeny (qest-uxui/brand-system/tokens.css) + vzhled kartiček a mřížky z tiskových podkladů. */
:root {
  --cyan: #83E1FF; --cyan600: #0C87B8; --cyan-ink: #04222E; --cyan-hover: #5BC7EE;
  --ink: #0A0A0B; --muted: #52525B; --border: #EBEBEF; --line: #A1A1AA; --grey: #D4D4D8; --sun: #FDDF74;
  --bg: #F4F4F5; --surface: #FFFFFF;
  --success: #16A34A; --warning: #D97706; --danger: #DC2626;
  --fd: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --fb: 'Inter', system-ui, sans-serif;
  --fm: 'Geist Mono', ui-monospace, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--fb); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.kicker { font-family: var(--fm); font-weight: 200; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan600); }
.kicker::before { content: "// "; }
h1, h2, h3 { font-family: var(--fd); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.mono { font-family: var(--fm); }
.muted { color: var(--muted); }

/* tlačítka – aplikace: primary cyan s černým textem, radius 0 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border: 1px solid transparent; border-radius: 0; cursor: pointer; font-size: 14px; white-space: nowrap; background: transparent; transition: background-color .15s ease-out, border-color .15s ease-out, color .15s ease-out; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--cyan); color: var(--cyan-ink); }
.btn-primary:hover:not(:disabled) { background: var(--cyan-hover); }
.btn-secondary { border-color: var(--ink); color: var(--ink); background: var(--surface); }
.btn-secondary:hover:not(:disabled) { background: var(--bg); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-link { border: 0; background: none; padding: 0; height: auto; color: var(--cyan600); text-decoration: underline; cursor: pointer; }
.bg-dark .btn-secondary { border-color: #fff; color: #fff; background: transparent; }
.bg-dark .btn-link { color: var(--cyan); }

input[type=text], input[type=password], input[type=time], input[type=number], select, textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); outline: none;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan600); box-shadow: 0 0 0 1px var(--cyan600); }
.bg-dark input { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.25); color: #fff; }
.bg-dark input::placeholder { color: rgba(255,255,255,.45); }
.bg-dark input:focus { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.bg-dark label.field { color: rgba(255,255,255,.72); }

/* tmavé pozadí s bloby (jako bg-dark slidy) */
.bg-dark {
  background:
    radial-gradient(70% 90% at 2% 50%, rgba(91,199,238,.26), transparent 60%),
    radial-gradient(60% 80% at 55% 6%, rgba(255,161,159,.16), transparent 60%),
    radial-gradient(65% 85% at 102% 60%, rgba(253,223,116,.20), transparent 60%),
    #0A0A0B;
  color: #FAFAFA;
}
.bg-dark .kicker { color: var(--cyan); }

/* vstup / lobby */
.hero { min-height: 100vh; display: flex; flex-direction: column; padding: 36px 56px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; }
.hero-top .logo { height: 44px; }
.hero-main { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 680px; padding: 40px 0; }
.hero h1 { font-size: 50px; letter-spacing: -.035em; margin: 14px 0 16px; }
.hero .lead { font-size: 18px; line-height: 1.6; color: rgba(255,255,255,.72); max-width: 560px; }
.entry-form { display: flex; flex-direction: column; gap: 14px; margin-top: 36px; max-width: 520px; }
.entry-form .row { display: flex; }
.entry-form input { flex: 1; height: 48px; font-size: 16px; }
.entry-form .btn { height: 48px; padding: 0 24px; }
.callout { display: flex; gap: 12px; align-items: baseline; margin-top: 28px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.18); max-width: 520px; }
.callout strong { font-weight: 600; }
.callout .kicker { white-space: nowrap; }
.form-error { color: #F87171; font-size: 14px; min-height: 20px; }
.rules { list-style: none; margin-top: 28px; display: grid; gap: 8px; font-size: 15px; }
.rules li { padding-left: 22px; position: relative; color: rgba(255,255,255,.85); }
.rules li::before { content: "—"; position: absolute; left: 0; color: var(--cyan); }
.hero-foot { display: flex; justify-content: space-between; border-top: 1px solid rgba(255,255,255,.9); padding-top: 10px; font-family: var(--fm); font-weight: 200; font-size: 12px; letter-spacing: .08em; color: rgba(255,255,255,.72); }
.pulse { display: inline-block; width: 8px; height: 8px; background: var(--cyan); margin-right: 10px; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* pracovní obrazovka */
.work { height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.topbar .logo { height: 30px; display: block; }
.topbar .who { display: flex; flex-direction: column; min-width: 0; }
.topbar .who .name { font-family: var(--fd); font-weight: 800; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.timer { font-family: var(--fm); font-weight: 400; font-size: 28px; letter-spacing: .02em; min-width: 92px; }
.timer.over { color: var(--warning); }
.timer.ended { font-size: 16px; color: var(--muted); }
.stats { display: flex; gap: 20px; flex-wrap: wrap; margin-left: auto; }
.stat { display: flex; flex-direction: column; }
.stat .l { font-family: var(--fm); font-weight: 200; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.stat .v { font-family: var(--fm); font-size: 15px; white-space: nowrap; }
.stat.warn .v { color: var(--warning); }
.stat.ok .v { color: var(--success); }
.stat i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; }
.savestate { font-family: var(--fm); font-weight: 200; font-size: 11px; letter-spacing: .08em; color: var(--muted); min-width: 90px; text-align: right; }
.savestate.err { color: var(--danger); }
.banner { background: var(--ink); color: #fff; padding: 10px 20px; font-size: 14px; display: flex; gap: 10px; align-items: center; }
.banner .kicker { color: var(--cyan); }

.events { display: flex; gap: 12px; padding: 12px 20px 0; }
.evc { flex: 1; max-width: 440px; border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
  background: radial-gradient(60% 70% at 100% 0%, rgba(187,239,255,.55), transparent 70%), #fff; }
.evc .when { font-family: var(--fm); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan600); }
.evc .what { font-family: var(--fd); font-weight: 800; font-size: 15px; letter-spacing: -.01em; line-height: 1.25; }
.evc .imp { font-size: 12px; color: var(--muted); }
.evc .adds { font-family: var(--fm); font-size: 11px; color: var(--ink); }

.main { flex: 1; display: grid; grid-template-columns: 300px 1fr; min-height: 0; }
.side { background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.pool { flex: 1; overflow: auto; padding: 14px 16px; }
.pool-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pool h3 { font-family: var(--fm); font-weight: 200; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; display: flex; align-items: center; gap: 6px; }
.pool h3 i { width: 8px; height: 8px; display: inline-block; }
.pool-empty { font-size: 13px; color: var(--muted); padding: 20px 0; }
.side.over-pool .pool { background: #F2FBFF; }

/* kartička – levý pruh podle kategorie */
.kc { position: relative; border: 1px solid var(--line); background: #fff; padding: 6px 10px 6px 16px; user-select: none; -webkit-user-select: none; touch-action: none; }
.kc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--grey); }
/* barvy kategorií .cat-* doplňuje week-grid.js z workshop-karticky.json */
.kc.blank { border-style: dashed; }
.kc.blank::before { background: #fff; border-right: 1px dashed var(--line); }
.kc.blank .t { color: var(--muted); font-weight: 400; }
.kc .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.kc .t { font-weight: 600; font-size: 13px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kc .d { font-family: var(--fm); font-size: 11px; white-space: nowrap; }
.kc .n { font-size: 11px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.kc .tag { font-family: var(--fm); font-weight: 200; font-size: 9px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kc .x { position: absolute; top: 0; right: 0; width: 22px; height: 22px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; display: none; }
.kc:hover .x { display: block; }
.kc .x:hover { color: var(--ink); background: var(--bg); }
.editable .kc { cursor: grab; }
.pool .kc { margin-bottom: 6px; }
.pool .kc .cnt { font-family: var(--fm); font-size: 11px; color: var(--muted); margin-left: 6px; }
.kc.src-dragging { opacity: .35; }

.aside-zone { border-top: 1px solid var(--border); padding: 12px 16px 16px; background: var(--bg); max-height: 42%; overflow: auto; }
.dropzone { border: 1px dashed var(--line); padding: 10px; margin-top: 8px; min-height: 58px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.dropzone .hint { font-size: 12px; color: var(--muted); text-align: center; padding: 8px 0; }
.dropzone.over { border-color: var(--cyan600); background: #EAF9FF; }
.aside-item .why { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: normal; }
.aside-item .why::before { content: "Důvod: "; color: var(--ink); }
.aside-item .acts { margin-top: 4px; }

/* týdenní mřížka */
.grid-wrap { overflow: auto; padding: 12px 20px 20px; min-height: 0; }
.wk { display: grid; grid-template-columns: 44px repeat(5, minmax(110px, 1fr)); min-width: 640px; }
.wk-dayh { height: 28px; font-family: var(--fm); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--ink); background: var(--bg); }
.wk-times { position: relative; }
.wk-t { position: absolute; right: 6px; font-family: var(--fm); font-weight: 200; font-size: 10px; color: var(--muted); transform: translateY(-50%); }
.wk-t.first { transform: none; padding-top: 2px; }
.wk-col { position: relative; background: var(--surface); border-left: 1px solid var(--border); }
.wk-col:last-child { border-right: 1px solid var(--border); }
.wk-line { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--border); }
.wk-line.hour { border-top: 1px solid #C9C9CF; }
.wk-fixed { position: absolute; left: 2px; right: 2px; background: repeating-linear-gradient(135deg, #F4F4F5 0 5px, #EBEBEF 5px 10px); border: 1px solid var(--grey); font-family: var(--fm); font-size: 9px; letter-spacing: .08em; display: flex; align-items: center; padding-left: 6px; color: var(--muted); overflow: hidden; white-space: nowrap; }
.wk .kc { position: absolute; left: 3px; right: 3px; padding: 2px 6px 2px 11px; overflow: hidden; }
.wk .kc::before { width: 5px; }
.wk .kc .t { font-size: 12px; }
.wk .kc .d, .wk .kc .tm { font-family: var(--fm); font-size: 10px; color: var(--muted); }
.wk .kc .tm { margin-top: 1px; }
.wk .kc.compact { padding-top: 0; padding-bottom: 0; display: flex; align-items: center; }
.wk .kc.compact .row { flex: 1; min-width: 0; }
.wk.ro .kc { cursor: default; }
.preview { position: absolute; left: 3px; right: 3px; border: 2px solid var(--cyan600); background: rgba(131,225,255,.25); pointer-events: none; z-index: 5; font-family: var(--fm); font-size: 10px; padding: 2px 6px; color: var(--cyan-ink); overflow: hidden; }
.preview.bad { border-color: var(--danger); background: rgba(220,38,38,.08); color: var(--danger); }
.ghost { position: fixed; z-index: 100; pointer-events: none; opacity: .94; box-shadow: 0 10px 28px rgba(0,0,0,.18); overflow: hidden; }
.ghost.wkcard { padding: 2px 6px 2px 11px; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }

/* dialog a toast */
dialog { border: 1px solid var(--border); border-radius: 0; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.25); margin: auto; }
dialog::backdrop { background: rgba(10,10,11,.45); }
dialog form { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
dialog h2 { font-size: 22px; }
dialog .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
dialog .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 520px; animation: toast-in .2s ease-out; }
.toast.bad { border-left: 4px solid var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* admin */
.admin { min-height: 100vh; display: flex; flex-direction: column; }
.admin .topbar { position: sticky; top: 0; z-index: 10; }
.admin .phase-label { font-family: var(--fd); font-weight: 800; font-size: 18px; }
.admin .ctrl { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.tabs { display: flex; gap: 0; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.tabs button { border: 0; background: none; padding: 12px 16px; cursor: pointer; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--cyan); }
.page { padding: 24px 28px 48px; max-width: 1600px; width: 100%; }
.page h2 { font-size: 26px; margin: 6px 0 16px; }
.page h3 { font-size: 18px; margin: 22px 0 10px; letter-spacing: -.01em; }
.card { background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(10,10,11,.04); padding: 18px 20px; }
table.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); }
.tbl th { font-family: var(--fm); font-weight: 400; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--ink); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 13px; }
.tbl td.num { font-family: var(--fm); white-space: nowrap; }
.tbl td.name { font-weight: 600; max-width: 280px; overflow-wrap: anywhere; }
.tbl .acts { display: flex; gap: 8px; justify-content: flex-end; }
.empty { padding: 32px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); }
.detail-grids { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-grids .wk { min-width: 0; grid-template-columns: 36px repeat(5, minmax(0, 1fr)); }
.detail-grids .wk .kc .t { font-size: 11px; }
.plain { list-style: none; display: grid; gap: 6px; font-size: 13px; }
.plain li { padding-left: 18px; position: relative; }
.plain li::before { content: "—"; position: absolute; left: 0; color: var(--cyan600); }
.diff-out::before { color: var(--danger) !important; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.kpi .l { font-family: var(--fm); font-weight: 200; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.kpi .v { font-family: var(--fd); font-weight: 800; font-size: 30px; letter-spacing: -.02em; margin-top: 4px; }
.kpi .s { font-family: var(--fm); font-size: 12px; color: var(--muted); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 220px 1fr 70px; gap: 12px; align-items: center; font-size: 13px; }
.bar .track { height: 12px; background: var(--bg); position: relative; }
.bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cyan); }
.bar .fill.r2 { background: var(--ink); }
.bar .n { font-family: var(--fm); font-size: 12px; text-align: right; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.standups { display: grid; grid-template-columns: 110px 90px 130px 130px; gap: 8px 12px; align-items: center; font-size: 13px; }
.ev-edit { border: 1px solid var(--border); background: var(--surface); padding: 14px 16px; display: grid; gap: 10px; margin-bottom: 12px; }
.ev-edit .r { display: grid; grid-template-columns: 180px 1fr; gap: 10px; }
.ev-edit .x-row { display: grid; grid-template-columns: 1fr 110px 170px 80px auto; gap: 8px; align-items: center; }
.locked-note { font-size: 13px; color: var(--warning); margin-bottom: 10px; }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0; display: flex; gap: 10px; border-top: 1px solid var(--border); margin-top: 20px; }
.login { max-width: 420px; }
