* { box-sizing: border-box; margin: 0; }
:root {
  --bg: #f4f5f7; --card: #fff; --text: #1c2733; --muted: #6b7684;
  --line: #e2e6ea; --pri: #2563eb;
  --green: #16a34a; --green-bg: #e8f7ee;
  --red: #dc2626; --red-bg: #fdecec;
}
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; padding-bottom: 40px;
}

/* ---------- login ---------- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-box { background: var(--card); padding: 28px; border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.08); width: min(92vw, 360px);
  display: flex; flex-direction: column; gap: 14px; }
.login-box h1 { font-size: 1.2rem; text-align: center; }
.login-box input { padding: 13px; font-size: 1rem; border: 1px solid var(--line); border-radius: 9px; }
.login-box button { padding: 13px; font-size: 1rem; background: var(--pri); color: #fff;
  border: 0; border-radius: 9px; font-weight: 600; }
.login-error { color: var(--red); text-align: center; }

/* ---------- topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--card);
  border-bottom: 1px solid var(--line); padding: 10px 12px 8px; }
.topbar-row { display: flex; gap: 10px; align-items: center; }
.topbar h1 { font-size: 1.05rem; flex: 1; }
.icon-btn { font-size: 1.3rem; background: none; border: 1px solid var(--line);
  border-radius: 9px; padding: 4px 12px; }
#room-select { flex: 1; margin-top: 8px; padding: 12px; font-size: 1.05rem;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; width: 100%; }
.progress-wrap { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.progress-bar { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
#progress-fill { height: 100%; background: var(--green); width: 0; transition: width .25s; }
#progress-label { font-size: .82rem; color: var(--muted); white-space: nowrap; }

/* ---------- menu ---------- */
.menu-panel { position: fixed; top: 54px; right: 8px; z-index: 30; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.15);
  display: flex; flex-direction: column; min-width: 240px; overflow: hidden; }
.menu-item { padding: 14px 16px; border-bottom: 1px solid var(--line); text-decoration: none;
  color: var(--text); font-size: .95rem; background: none; cursor: pointer; }
.menu-item:last-child { border-bottom: 0; }
.menu-item.muted { color: var(--muted); font-size: .78rem; cursor: default; }

/* ---------- filtr ---------- */
.filter-row { display: flex; gap: 8px; padding: 10px 12px 0; }
#search { flex: 1; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: .95rem; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 6px 12px; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.chip.on { background: var(--pri); color: #fff; border-color: var(--pri); }

/* ---------- položky ---------- */
#items { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.item.st-found { border-left: 5px solid var(--green); background: var(--green-bg); }
.item.st-missing { border-left: 5px solid var(--red); background: var(--red-bg); }
.item-name { font-weight: 600; line-height: 1.3; }
.item-meta { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.item-inv { font-weight: 700; font-size: .92rem; color: var(--text); }
.item-note-preview { font-size: .84rem; color: #92400e; margin-top: 5px; white-space: pre-wrap; }
.item-actions { display: flex; gap: 8px; margin-top: 10px; }
.item-actions button { flex: 1; padding: 12px 4px; font-size: .95rem; font-weight: 600;
  border-radius: 9px; border: 1px solid var(--line); background: #fff; }
.btn-found.on { background: var(--green); border-color: var(--green); color: #fff; }
.btn-missing.on { background: var(--red); border-color: var(--red); color: #fff; }
.btn-mini { flex: 0 0 52px !important; font-size: 1.05rem !important; }
.empty-hint { text-align: center; color: var(--muted); padding: 40px 20px; line-height: 1.6; }

/* ---------- modaly ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--card); border-radius: 14px; padding: 18px;
  width: min(94vw, 440px); display: flex; flex-direction: column; gap: 12px;
  max-height: 86vh; overflow-y: auto; }
.modal-box h2 { font-size: 1rem; }
.modal-box textarea { width: 100%; padding: 10px; border: 1px solid var(--line);
  border-radius: 9px; font-size: 1rem; font-family: inherit; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }
.btn-pri { background: var(--pri); color: #fff; border: 0; border-radius: 9px;
  padding: 11px 18px; font-size: .95rem; font-weight: 600; }
.btn-sec { background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 11px 18px; font-size: .95rem; }
.file-label { display: block; cursor: pointer; }
.photo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-thumb { position: relative; }
.photo-thumb img { width: 90px; height: 90px; object-fit: cover; border-radius: 8px; }
.photo-del { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff;
  border: 0; border-radius: 50%; width: 24px; height: 24px; font-size: .8rem; }
.photo-del.arm { width: auto; height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: .78rem; font-weight: 700; }

.lightbox { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #1c2733; color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: .88rem; z-index: 60; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.toast.err { background: var(--red); }

.hidden { display: none !important; }

/* ==========================================================================
   Věci navíc + drobné doladění (2026-07-28)
   ========================================================================== */
:root { --amber: #b45309; --amber-bg: #fff7ed; --amber-line: #fdba74; }

/* odznaky a pilulky */
.tag { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 999px; background: var(--line); color: var(--muted);
  vertical-align: middle; }
.tag.extra { background: var(--amber-line); color: #7c2d12; }
.tag.bad { background: var(--red-bg); color: var(--red); }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: var(--line); color: var(--text); }
.badge-count:not(:empty) { display: inline-block; min-width: 20px; padding: 1px 6px;
  border-radius: 999px; background: var(--pri); color: #fff; font-size: .72rem;
  font-weight: 700; text-align: center; }

.item.is-extra { border-left: 5px solid var(--amber-line); background: var(--amber-bg); }

/* velké tlačítko „něco navíc" — musí jít trefit palcem bez míření */
.btn-extra { display: block; width: calc(100% - 24px); margin: 4px 12px 24px;
  padding: 16px; font-size: 1rem; font-weight: 700; color: var(--amber);
  background: var(--amber-bg); border: 2px dashed var(--amber-line);
  border-radius: 12px; }
.btn-extra:active { background: #ffedd5; }

/* formulář v modalu */
.modal-hint { font-size: .84rem; color: var(--muted); line-height: 1.45; }
.fld { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--muted); }
.fld input, .fld textarea { padding: 12px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: 9px; color: var(--text); }
.fld .req { color: var(--red); }
.fld .opt { font-weight: 400; opacity: .8; }

.extras-list { display: flex; flex-direction: column; gap: 8px; }
.extra-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between;
  background: var(--amber-bg); border: 1px solid var(--amber-line);
  border-radius: 10px; padding: 10px; }
.extra-del { flex: 0 0 auto !important; background: #fff; }
.extra-del.arm { background: var(--red); color: #fff; border-color: var(--red); }

/* ==========================================================================
   Přehled na velké obrazovce
   ========================================================================== */
body.wide { padding-bottom: 60px; }
.wide-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  justify-content: space-between; padding: 16px 24px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.wide-head h1 { font-size: 1.15rem; }
.wide-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wide-head-actions a, .wide-head-actions button { text-decoration: none; cursor: pointer; }
.wide-main { max-width: 1500px; margin: 0 auto; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 18px; }
.small { font-size: .8rem; }
.muted { color: var(--muted); }

.stat-row { display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; }
.stat-num { font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.stat-lbl { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.stat.ok .stat-num { color: var(--green); }
.stat.bad .stat-num { color: var(--red); }
.stat.wait .stat-num { color: var(--pri); }
.stat.extra .stat-num { color: var(--amber); }
.stat.big { grid-column: span 2; }
.wide-bar { margin-top: 10px; height: 10px; }
.progress-bar > div { height: 100%; background: var(--green); border-radius: 4px;
  transition: width .3s; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px 20px; }
.panel h2 { font-size: 1rem; margin-bottom: 4px; }
details.panel > summary { display: flex; align-items: center; gap: 10px;
  cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "▸"; color: var(--muted); font-size: .9rem; }
details.panel[open] > summary::before { content: "▾"; }
details.panel[open] > summary .small { visibility: hidden; }
.two-col { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; }
  .stat.big { grid-column: span 1; } }

.rooms-grid { display: grid; gap: 10px; margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.room-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.room-card.started { border-color: var(--pri); }
.room-card.done { border-color: var(--green); background: var(--green-bg); }
.room-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.room-card .progress-bar { height: 6px; background: var(--line); border-radius: 3px;
  overflow: hidden; margin: 7px 0 5px; }
.room-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.tbl { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .88rem; }
.tbl th { text-align: left; color: var(--muted); font-size: .76rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em; padding: 6px 8px;
  border-bottom: 2px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: #fafbfc; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84rem; }
.note-cell { color: #92400e; white-space: pre-wrap; max-width: 380px; }

@media print {
  .wide-head-actions, #refresh { display: none; }
  body.wide { background: #fff; }
  .panel, .stat { border-color: #ccc; break-inside: avoid; }
}
