/* DSV aplikace — hutný, datový styl (rodina produktů, viz _SPOLECNE/design-dna.md) */
:root {
  --c-primary: #1F6F5C;       /* tlumená zelenomodrá — DSV */
  --c-primary-d: #17574A;
  --c-dark: #0F1F1B;
  --c-text: #14211E;
  --c-muted: #5E716C;
  --c-line: #E2E9E7;
  --c-bg: #F4F7F6;
  --c-card: #FFFFFF;
  --c-ok: #1FB57A;
  --c-warn: #D9822B;
  --c-err: #C8423B;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 31, 27, .06), 0 4px 14px rgba(15, 31, 27, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
}
a { color: var(--c-primary); }
.muted { color: var(--c-muted); }
.small { font-size: 13px; }
.ico { display: block; }

/* --- Horní lišta --- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  height: 60px; padding: 0 24px;
  background: var(--c-dark); color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: .3px; white-space: nowrap; }
.brand span { font-weight: 400; opacity: .7; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.nav a {
  color: rgba(255,255,255,.75); text-decoration: none; padding: 8px 12px; border-radius: 6px; white-space: nowrap; font-size: 14px;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a.active { color: #fff; background: var(--c-primary); }
.user { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.user-name { display: flex; flex-direction: column; line-height: 1.2; font-size: 14px; text-align: right; }
.user-name small { opacity: .6; font-size: 12px; }
.topbar-link { color: rgba(255,255,255,.8); text-decoration: none; font-size: 14px; }
.topbar-link:hover { color: #fff; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; }

/* --- Obsah --- */
.main { max-width: 1240px; margin: 0 auto; padding: 24px; }
.page-title { font-size: 24px; margin: 4px 0 18px; }
.lead { font-size: 16px; margin: -8px 0 18px; }
.card {
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px;
}
.card h2 { font-size: 16px; margin: 0 0 12px; }
.card.empty { text-align: center; padding: 40px 20px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--c-card); border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px;
}
.kpi-ico { color: var(--c-primary); background: #E6F1EE; border-radius: 8px; padding: 8px; }
.kpi-label { color: var(--c-muted); font-size: 13px; }
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1.15; }
.kpi-sub { color: var(--c-muted); font-size: 12.5px; }

/* --- Tabulky --- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--c-line); white-space: nowrap; }
th { color: var(--c-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
td.num, th.num { text-align: right; }
tbody tr:hover { background: #F8FBFA; }
tr.row-warn td { color: var(--c-err); }
.bar { width: 120px; height: 8px; background: var(--c-line); border-radius: 4px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c-primary); }

/* --- Tlačítka, formuláře, hlášky --- */
.btn {
  display: inline-block; background: var(--c-primary); color: #fff; border: 0; border-radius: 8px;
  padding: 10px 18px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--c-primary-d); }
.btn-block { width: 100%; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 14px; }
label input[type=text], label input[type=password], label input[type=email], label input[type=date], label select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid #C9D5D2; border-radius: 8px; background: #fff;
}
label input:focus, label select:focus { outline: 2px solid var(--c-primary); outline-offset: 0; border-color: var(--c-primary); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #FBECEB; color: var(--c-err); }
.alert-ok { background: #E7F7F0; color: #137A52; }

/* --- Etapa 2: formuláře, filtry, karta osoby, mapa pokojů --- */
a.strong, .strong { font-weight: 600; text-decoration: none; }
a.strong:hover { text-decoration: underline; }
.right { text-align: right; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; align-items: end; }
.filters label { margin-bottom: 0; }
.filters-actions { display: flex; gap: 10px; align-items: center; padding-bottom: 2px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 400; }
label.inline select { margin: 0; padding: 6px 8px; border: 1px solid #C9D5D2; border-radius: 6px; font: inherit; }
label input[type=search], label input[type=tel], label input[type=number], label textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: inherit; font-weight: 400;
  border: 1px solid #C9D5D2; border-radius: 8px; background: #fff;
}
label textarea { resize: vertical; }
label input[readonly] { background: #F1F4F3; color: var(--c-muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid h2 { margin-top: 6px; }
.form-actions { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
.form-row label { flex: 1; min-width: 200px; margin-bottom: 0; }
.inline-form { display: inline; }
.btn-small { padding: 5px 10px; font-size: 13px; }
.btn-light { background: #E6F1EE; color: var(--c-primary-d); }
.btn-light:hover { background: #D5E8E3; }
.btn-danger { background: var(--c-err); }
.btn-danger:hover { background: #A93530; }
.cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; align-items: start; }
.facts { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
.facts dt { color: var(--c-muted); }
.facts dd { margin: 0; }
.actions { display: flex; flex-direction: column; gap: 10px; }
details > summary { list-style: none; display: inline-block; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 12px; }
details .form-inline { border: 1px solid var(--c-line); border-radius: 8px; padding: 14px; background: #FAFCFB; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 20px; vertical-align: middle; }
.badge-ok { background: #E7F7F0; color: #137A52; }
.badge-info { background: #E7F0FB; color: #1E5BB8; }
.badge-warn { background: #FCEFE2; color: #A85F14; }
.badge-paused { background: #F3EAFB; color: #7A3EB1; }
.agency-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.room li.paused a { color: var(--c-muted); font-style: italic; }
.room li.paused em, .legend-paused { color: #7A3EB1; font-style: normal; font-size: 11px; }
.legend-paused { background: #F3EAFB; padding: 1px 6px; border-radius: 4px; }
@media print { .agency-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
.badge-neutral { background: #EEF1F0; color: var(--c-muted); }
table.compact td { padding: 6px 8px; font-size: 13px; }
tr.row-muted td { color: var(--c-muted); }
tr.row-group td { background: var(--c-bg); color: var(--c-primary); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding-top: 14px; padding-bottom: 6px; }

.legend { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--c-muted); margin-top: 12px; flex-wrap: wrap; }
.legend { gap: 6px 16px; }
.room-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -10px; vertical-align: -1px; }
.legend .room-dot { margin-right: -10px; }
.legend .room-dot + * { margin: 0; }
h3.floor { font-size: 13px; text-transform: uppercase; letter-spacing: .4px; color: var(--c-muted); margin: 16px 0 8px; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.room { border: 1px solid var(--c-line); border-left-width: 4px; border-radius: 8px; padding: 8px 10px; background: #fff; font-size: 13px; }
.room-head { display: flex; justify-content: space-between; margin-bottom: 4px; }
.room-head span { color: var(--c-muted); }
.room ul { list-style: none; margin: 0; padding: 0; }
.room li { padding: 2px 0; line-height: 1.3; }
.room li a { text-decoration: none; color: var(--c-text); font-weight: 600; }
.room li small { display: block; color: var(--c-muted); font-size: 11.5px; }
.room li.free { color: #1A8F62; font-style: italic; }
.room.full, .room-dot.full { border-left-color: var(--c-err); }
.room.part, .room-dot.part { border-left-color: var(--c-warn); }
.room.empty, .room-dot.empty { border-left-color: var(--c-ok); }
.room.off, .room-dot.off { border-left-color: #B8C2BF; background: #F6F8F7; }
.room-dot.full { background: var(--c-err); } .room-dot.part { background: var(--c-warn); }
.room-dot.empty { background: var(--c-ok); } .room-dot.off { background: #B8C2BF; }

@media (max-width: 860px) {
  .cols, .grid-2 { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 120px 1fr; }
}

/* --- Etapa 3: fakturace --- */
tfoot td { border-bottom: 0; padding-top: 6px; }
tfoot tr:first-child td { border-top: 2px solid var(--c-line); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.toolbar h2 { margin: 0; }

/* --- Návod --- */
.manual-toc ol { margin: 8px 0 0; padding-left: 22px; columns: 2; column-gap: 32px; }
.manual-toc li { margin: 3px 0; }
.manual { padding: 8px 28px 24px; line-height: 1.6; }
.manual h2 { font-size: 20px; margin: 28px 0 10px; padding-top: 14px; border-top: 1px solid var(--c-line); scroll-margin-top: 76px; }
.manual h2:first-child { border-top: 0; margin-top: 8px; }
.manual table { margin: 10px 0 16px; }
.manual td, .manual th { white-space: normal; vertical-align: top; }
.manual code { background: #EEF3F1; padding: 1px 6px; border-radius: 4px; }
.manual-shot { margin: 14px 0 20px; }
.manual-shot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--c-line); border-radius: 8px; box-shadow: var(--shadow); }
.manual-shot figcaption { font-size: 13px; color: var(--c-muted); margin-top: 6px; }
.manual-note { background: #FCEFE2; border-left: 4px solid var(--c-warn); padding: 10px 14px; border-radius: 6px; }
.print-only { display: none; }
@media (max-width: 860px) { .manual { padding: 4px 14px 16px; } .manual-toc ol { columns: 1; } }

/* --- Tisk (platí pro celou aplikaci, hlavně návod) --- */
@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body, body.app { background: #fff; font-size: 11pt; }
  .topbar, .no-print, .alert, .nav-toggle { display: none !important; }
  .print-only { display: block; }
  .main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; margin: 0 0 12px; }
  .manual { padding: 0; }
  .manual-toc { page-break-after: always; }
  .manual-toc ol { columns: 1; }
  .manual h2 { page-break-before: always; border-top: 0; padding-top: 0; margin-top: 0; }
  .manual h2:first-child { page-break-before: avoid; }
  .manual-shot, .manual table, .manual-note { page-break-inside: avoid; }
  .manual-shot img { box-shadow: none; max-height: 120mm; width: auto; }
  a { color: #000; text-decoration: none; }
  th, td { border-bottom: 1px solid #ccc; }
}

/* --- Přihlášení --- */
body.bare { background: var(--c-dark); }
.bare { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card h1 { font-size: 20px; margin: 0 0 18px; }
.login-brand { font-weight: 800; font-size: 20px; color: var(--c-primary); margin-bottom: 14px; }
.login-brand span { font-weight: 400; color: var(--c-muted); }
.login-foot { text-align: center; font-size: 13px; margin: 14px 0 0; }

/* --- Mobil --- */
@media (max-width: 860px) {
  .topbar { gap: 12px; padding: 0 16px; flex-wrap: wrap; height: auto; min-height: 56px; }
  .nav-toggle { display: block; margin-left: auto; order: 2; }
  .user { order: 3; }
  .user-name { display: none; }
  .nav { order: 4; flex-basis: 100%; display: none; flex-direction: column; padding-bottom: 10px; }
  body.nav-open .nav { display: flex; }
  .main { padding: 16px; }
}
