/* ------------------------------------------------------------------
   Rezervační systém TZ Studánka - mobile first
   ------------------------------------------------------------------ */

:root {
  --green-900: #12291b;
  --green-800: #1b4429;
  --green-700: #256239;
  --green-600: #2e7d4b;
  --green-500: #3f9a61;
  --green-100: #dfeee6;
  --green-050: #f1f7f3;

  --sand-100: #f6f4ef;
  --sand-200: #eae4d9;

  --ink: #1a201d;
  --ink-soft: #55605a;
  --ink-faint: #8a938d;

  --line: #dfe4e0;
  --line-soft: #ecefeb;
  --white: #ffffff;

  --busy: #c04c38;
  --busy-bg: #fbeae6;
  --busy-line: #f0cfc7;
  --pending: #b57d18;
  --pending-bg: #fdf4e4;
  --pending-line: #eedcb6;
  --ok-bg: #e2f0e8;
  --ok-line: #bfdfcc;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(18, 41, 27, .05);
  --shadow: 0 2px 4px rgba(18, 41, 27, .05), 0 10px 28px rgba(18, 41, 27, .07);
  --header-h: 60px;
}

* { box-sizing: border-box; }

/* Vlastní `display` v pravidlech níže by jinak přebil atribut hidden,
   kterým se v JS skrývají celé sekce. Tohle to jistí na jednom místě. */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 14px);
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--sand-100);
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; margin-top: 1.4em; }
h3:first-child { margin-top: 0; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--green-700); text-underline-offset: 2px; }

/* --- Layout --- */

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }

.site-header {
  background: var(--green-800);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 6px 18px rgba(18, 41, 27, .22);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
}
.site-header .brand {
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
}
.site-header .brand small {
  font-weight: 400;
  opacity: .7;
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.site-header nav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.site-header nav a, .site-header nav button {
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: .82rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.site-header nav a:hover, .site-header nav button:hover { background: rgba(255,255,255,.14); }

/* Musí být specifičtější než .wrap výše - main nese obě třídy najednou. */
main.wrap { padding-top: 22px; padding-bottom: 72px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 18px;
  margin-bottom: 16px;
}
.card > :last-child { margin-bottom: 0; }

.muted { color: var(--ink-soft); }
.small { font-size: .875rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.divider { height: 1px; background: var(--line-soft); margin: 22px 0; border: 0; }

/* --- Hero --- */

.hero {
  background: linear-gradient(155deg, var(--green-800) 5%, var(--green-600) 100%);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.hero h1 { margin-bottom: .3em; }
.hero p { opacity: .92; font-size: .95rem; }
/* Tlačítko na zeleném pozadí - tmavě zelené by v něm zanikalo. */
.hero .btn { background: var(--white); color: var(--green-800); border-color: var(--white); }
.hero .btn:hover { background: var(--green-050); }
.hero .facts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.hero .facts span {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: .78rem;
}
.hero .facts b { font-weight: 650; }

/* --- Postup průvodce --- */

.progress { margin-bottom: 16px; }
.progress-track {
  height: 5px;
  background: var(--sand-200);
  border-radius: 999px;
  overflow: hidden;
}
.progress-track span {
  display: block;
  height: 100%;
  background: var(--green-600);
  border-radius: 999px;
  transition: width .25s ease;
}
.progress-label {
  margin-top: 8px;
  font-size: .82rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.progress-label b { color: var(--green-800); font-weight: 650; }

/* Plný přehled kroků jen tam, kde se vejde bez přetékání. */
.steps { display: none; }
@media (min-width: 720px) {
  .progress-label { display: none; }
  .steps {
    display: flex;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
  }
  .steps li {
    flex: 1 1 0;
    min-width: 0;
    font-size: .78rem;
    color: var(--ink-faint);
    line-height: 1.3;
  }
  .steps li .n {
    display: block;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    opacity: .8;
  }
  .steps li.done { color: var(--green-700); }
  .steps li.active { color: var(--green-800); font-weight: 650; }
}

/* --- Formuláře --- */

label { display: block; font-weight: 600; font-size: .87rem; margin-bottom: 5px; }
.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field .hint { font-size: .8rem; color: var(--ink-soft); margin-top: 5px; font-weight: 400; }

input[type=text], input[type=email], input[type=tel], input[type=password],
input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2355605a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}
textarea { min-height: 108px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--green-500);
  outline-offset: 1px;
  border-color: var(--green-500);
}
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: var(--busy);
  background: #fffbfa;
}
.field-error { color: var(--busy); font-size: .8rem; margin-top: 5px; font-weight: 600; }

.row { display: grid; gap: 0 14px; }
@media (min-width: 600px) {
  .row.cols-2 { grid-template-columns: 1fr 1fr; }
  .row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
  .row.zip { grid-template-columns: 8rem 1fr; }
}

/* Výběr předmětu pronájmu */
.choice-list { display: grid; gap: 9px; }
.choice {
  display: block;
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  cursor: pointer;
  background: var(--white);
  font-weight: 400;
  margin: 0;
  transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--green-500); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .t { font-weight: 650; font-size: .95rem; display: flex; align-items: center; gap: 9px; }
.choice .t::before {
  content: "";
  width: 17px; height: 17px;
  border: 2px solid var(--ink-faint);
  border-radius: 50%;
  flex: 0 0 auto;
}
.choice .d { display: block; font-size: .82rem; color: var(--ink-soft); margin-top: 4px; padding-left: 26px; }
.choice .cap {
  display: inline-block;
  margin-top: 6px;
  margin-left: 26px;
  font-size: .74rem;
  font-weight: 600;
  color: var(--green-800);
  background: var(--green-050);
  border: 1px solid var(--green-100);
  border-radius: 999px;
  padding: 2px 9px;
}
.choice.selected { border-color: var(--green-600); background: var(--green-050); }
.choice.selected .t::before { border-color: var(--green-600); background: var(--green-600); box-shadow: inset 0 0 0 3px var(--white); }
.choice.disabled { opacity: .55; cursor: not-allowed; background: var(--sand-100); }
.choice.disabled:hover { border-color: var(--line); }
.choice .why { display: block; margin-top: 6px; padding-left: 26px; font-size: .76rem; color: var(--busy); font-weight: 600; }

/* Zaškrtávátka */
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--white);
  font-weight: 400;
  margin: 0 0 9px;
}
.check:last-child { margin-bottom: 0; }
.check:hover { border-color: var(--green-500); }
.check.selected { border-color: var(--green-600); background: var(--green-050); }
.check input { width: 19px; height: 19px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--green-700); }
.check .t { font-weight: 650; font-size: .93rem; display: block; }
.check .d { font-size: .82rem; color: var(--ink-soft); display: block; margin-top: 2px; }
.check.terms .t { font-weight: 400; font-size: .88rem; line-height: 1.5; }

/* --- Tlačítka --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  padding: 12px 20px;
  min-height: 46px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  background: var(--green-700);
  color: var(--white);
}
.btn:hover:not(:disabled) { background: var(--green-800); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--green-800); border-color: var(--line); }
.btn.ghost:hover:not(:disabled) { background: var(--green-050); border-color: var(--green-500); }
.btn.danger { background: var(--busy); }
.btn.danger:hover:not(:disabled) { background: #a53f2d; }
.btn.small { padding: 8px 14px; min-height: 38px; font-size: .85rem; }

.actions {
  display: flex;
  gap: 9px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.actions.plain { border-top: 0; padding-top: 0; }
.actions .btn { flex: 1 1 auto; }
@media (min-width: 600px) {
  .actions .btn { flex: 0 0 auto; }
  .actions .right { margin-left: auto; }
}

/* --- Kalendář --- */

.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cal-head .month { font-weight: 700; flex: 1; text-align: center; font-size: 1rem; }
.cal-nav {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  color: var(--green-800);
  flex: 0 0 auto;
}
.cal-nav:hover:not(:disabled) { background: var(--green-050); border-color: var(--green-500); }
.cal-nav:disabled { opacity: .3; cursor: not-allowed; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow {
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding-bottom: 2px;
}
.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: .88rem;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  padding: 0;
}
.cal-day.empty { background: transparent; border-color: transparent; cursor: default; }
.cal-day.past { color: var(--ink-faint); background: transparent; border-color: transparent; cursor: not-allowed; }
.cal-day.free:hover { border-color: var(--green-600); background: var(--green-050); }
.cal-day.busy { background: var(--busy-bg); border-color: var(--busy-line); color: var(--busy); cursor: not-allowed; }
.cal-day.pending { background: var(--pending-bg); border-color: var(--pending-line); color: #8a5c10; cursor: not-allowed; }
.cal-day.today { font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--ink-faint); }
.cal-day.in-range { background: var(--green-100); border-color: var(--green-100); color: var(--green-900); border-radius: 4px; }
.cal-day.sel-start, .cal-day.sel-end {
  background: var(--green-700);
  border-color: var(--green-700);
  color: var(--white);
  font-weight: 700;
}

/* Na širokých displejích by čtvercová políčka byla neúměrně velká. */
@media (min-width: 560px) {
  .cal-day { aspect-ratio: auto; height: 44px; }
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 12px;
  font-size: .76rem;
  color: var(--ink-soft);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }

.cal-hint { margin: 10px 0 0; font-size: .84rem; color: var(--ink-soft); }

/* --- Rekapitulace ceny --- */

.price-box {
  background: var(--green-050);
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
  padding: 16px;
}
.price-head { font-size: .82rem; color: var(--ink-soft); margin-bottom: 10px; line-height: 1.5; }
.price-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(37, 98, 57, .1);
  align-items: baseline;
}
.price-line:last-of-type { border-bottom: 0; }
.price-line .l { flex: 1; font-size: .92rem; font-weight: 600; }
.price-line .l .d,
.price-deposit .l .d { display: block; font-size: .78rem; color: var(--ink-soft); font-weight: 400; margin-top: 1px; }
.price-line .a { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.price-line.discount .a { color: var(--green-600); }
.price-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 12px;
  padding-top: 13px;
  border-top: 2px solid var(--green-600);
  font-size: 1.25rem;
  font-weight: 750;
}
.price-total .a { font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-deposit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--green-100);
  font-size: .85rem;
}
.price-deposit .a { font-weight: 650; white-space: nowrap; }

/* --- Hlášky --- */

.note {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .86rem;
  line-height: 1.5;
  margin-bottom: 12px;
  border: 1px solid;
}
.note:last-child { margin-bottom: 0; }
.note.info { background: var(--green-050); border-color: var(--green-100); color: var(--green-900); }
.note.warn { background: var(--pending-bg); border-color: var(--pending-line); color: #6d4907; }
.note.error { background: var(--busy-bg); border-color: var(--busy-line); color: #8a2b1b; }
.note.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--green-900); }
.note strong { font-weight: 700; }
.note ul { margin: 6px 0 0; padding-left: 20px; }
.note p { margin-bottom: .5em; }

/* --- Souhrn --- */

.summary { margin: 0; display: grid; }
.summary div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: .89rem;
}
.summary div:last-child { border-bottom: 0; }
.summary dt { color: var(--ink-soft); flex: 0 0 auto; }
.summary dd { margin: 0; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }

/* --- O základně --- */

.info-block + .info-block { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.info-block h3 { margin: 0 0 4px; }
.info-block .lead { font-size: .84rem; color: var(--green-800); font-weight: 600; margin-bottom: 9px; }
.bullets { margin: 0; padding: 0; list-style: none; }
.bullets li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 7px;
  font-size: .89rem;
  color: var(--ink-soft);
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 4px; top: .62em;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--green-500);
}
.bullets li:last-child { margin-bottom: 0; }

/* --- Stavové odznaky --- */

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge.pending { background: var(--pending-bg); color: #8a5c10; }
.badge.approved { background: var(--ok-bg); color: var(--green-800); }
.badge.rejected { background: var(--busy-bg); color: #8a2b1b; }
.badge.cancelled { background: var(--sand-200); color: var(--ink-soft); }
.badge.completed { background: var(--green-800); color: var(--white); }

/* --- Vyúčtování v administraci --- */

.settle {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green-600);
  border-radius: var(--radius-sm);
  background: var(--sand-100);
}
.settle h3 { margin-top: 0; display: flex; align-items: center; gap: 9px; }
.settle .price-box { margin-top: 6px; }

/* --- Seznam žádostí --- */

.res-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.res-item .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.res-item .when { font-weight: 700; font-size: 1rem; }
.res-item .meta { font-size: .84rem; color: var(--ink-soft); }
.res-detail { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); display: none; }
.res-item.open .res-detail { display: block; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filters button {
  font: inherit; font-size: .84rem; padding: 7px 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: var(--white); cursor: pointer; color: var(--ink);
}
.filters button:hover { border-color: var(--green-500); }
.filters button.active { background: var(--green-800); color: var(--white); border-color: var(--green-800); }

/* --- Modální okno --- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(18, 41, 27, .55);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 20px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow);
  max-height: 88vh;
  overflow-y: auto;
}

/* Fakturační profily v účtu. */
.bp-list { display: grid; gap: 8px; margin: 12px 0; }
.bp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
}
.bp-main { flex: 1 1 220px; min-width: 0; }
.bp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.account-card .check { margin: 10px 0; }

/* Informativní ceník. */
.price-card { margin-bottom: 16px; }
.pc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pc-head h2 { margin: 0; }
.price-card .tariff { margin-top: 14px; }
.price-card .tariff h4 { margin: 0 0 6px; font-size: .9rem; }

/* Úzká stránka (obnova hesla, ceník). */
main.wrap.narrow { max-width: 640px; }

/* Správa uživatelů. */
.users-card { margin-bottom: 18px; }
.user-list { display: grid; gap: 8px; margin-top: 16px; }
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
}
.user-row .ur-main { flex: 1 1 240px; min-width: 0; }
.user-row .ur-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Telefonní hovory v administraci. */
.calls-card { margin-bottom: 18px; }
.call-list { display: grid; gap: 10px; margin-top: 16px; }
.call-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
  display: grid;
  gap: 6px;
}
.call-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.call-main { flex: 1 1 260px; min-width: 0; }
.call-sum { margin-top: 4px; }
.call-row .btn { justify-self: start; }
.call-transcript {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.92rem;
}
.call-transcript p { margin: 0 0 6px; }
.call-transcript span {
  display: inline-block;
  min-width: 74px;
  color: var(--ink-faint);
  font-size: 0.8rem;
}
.call-transcript .tr-bot { color: var(--ink-soft); }
.call-transcript .tr-caller { color: var(--ink); font-weight: 500; }

/* Předvyplněné žádosti v administraci. */
.invite-card { margin-bottom: 18px; }
.invite-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.invite-head h2 { margin: 0 0 2px; }
.invite-card .row, .invite-card .check, .invite-card .field { margin-top: 12px; }
.invite-list { display: grid; gap: 8px; margin-top: 16px; }
.invite-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 13px;
}
.invite-row .ir-main { flex: 1 1 240px; min-width: 0; }
.invite-row .ir-when { font-weight: 650; font-size: .9rem; }
.invite-row .ir-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Podmínky rozdělené po částech - každá se rozbalí zvlášť. */
.terms-list { display: grid; gap: 6px; margin-top: 10px; }
.terms-list .terms-details {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
}
.terms-list .terms-details[open] { border-color: var(--green-200, #cfe0d4); }
.terms-list summary {
  cursor: pointer;
  padding: 9px 13px;
  font-size: .87rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.terms-list summary::-webkit-details-marker { display: none; }
.terms-list summary::before {
  content: "›";
  display: inline-block;
  transition: transform .15s ease;
  color: var(--ink-faint);
  font-size: 1.05rem;
  line-height: 1;
}
.terms-list .terms-details[open] summary::before { transform: rotate(90deg); }

/* Podmínky pronájmu v okně (Moje žádosti). */
.modal.dlg.wide { max-width: 680px; }
.terms-view .terms-body p { margin: 0 0 7px; font-size: .84rem; line-height: 1.55; }
.terms-view .note { margin: 10px 0; }
.terms-view .actions.plain { margin: 10px 0 4px; }

/* Spinner na světlém tlačítku. */
.spinner.dark { border-color: rgba(26, 32, 29, .25); border-top-color: var(--ink); }

/* Pole s heslem a tlačítkem Zobrazit uvnitř. */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap input { width: 100%; padding-right: 88px; }
.pwd-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  font: inherit; font-size: .78rem; font-weight: 600;
  color: var(--green-700); background: var(--green-050);
  border: 1px solid var(--line-soft); border-radius: 999px;
  padding: 5px 11px; cursor: pointer;
}
.pwd-toggle:hover { background: var(--green-100); }

/* Spotřeba elektřiny z Home Assistanta ve vyúčtování. */
.energy-box {
  margin: -4px 0 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--green-050);
  border: 1px solid var(--line-soft);
  line-height: 1.55;
}
.energy-box .energy-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 2px; }

/* Vážení plynových bomb při odjezdu. */
.gas-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px 4px;
  margin: 16px 0;
}
.gas-box h3 { margin: 0 0 10px; font-size: .96rem; }
.gas-box .check { margin-bottom: 10px; }
.gas-box .summary { margin-bottom: 6px; }

/* Uložené fakturační údaje v průvodci. */
.saved-billing {
  border: 1px solid var(--green-200, #cfe0d4);
  background: var(--green-050, #f2f8f3);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sb-label { font-weight: 600; font-size: .85rem; }
.saved-billing select { margin-top: 8px; }
.sb-body { display: grid; gap: 2px; margin-top: 8px; font-size: .88rem; }
.sb-body span { color: var(--ink-soft); }

/* Potvrzovací okna (náhrada za confirm/alert). */
.modal.dlg { max-width: 440px; }
.modal.dlg h2 { margin: 0 0 10px; font-size: 1.08rem; }
.dlg-text { color: var(--ink-soft); font-size: .9rem; line-height: 1.55; }
.dlg-text p { margin: 0 0 8px; }
.dlg-list {
  margin: 4px 0 10px;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: .87rem;
  line-height: 1.5;
}
.modal.dlg .field { margin-top: 14px; }
.modal.dlg .actions { margin-top: 18px; }

.spinner {
  display: inline-block; width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer.site-footer { padding: 8px 16px 44px; color: var(--ink-faint); font-size: .8rem; text-align: center; }

/* --- Úzké displeje --- */

@media (max-width: 430px) {
  .site-header .brand small { display: none; }
  .site-header nav a, .site-header nav button { padding: 6px 11px; font-size: .78rem; }
  /* Přihlášenému se do řádku nevejdou všechna tlačítka - zalomí se, místo aby utekla z obrazovky. */
  .site-header nav { min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 5px; padding: 8px 0; }
  /* Na telefonu má být kalendář vidět hned - úvod jen stručně. */
  .hero { padding: 14px 15px; margin-bottom: 12px; }
  .hero h1 { font-size: 1.15rem; margin-bottom: .25em; }
  .hero p { font-size: .84rem; line-height: 1.45; }
  .hero .facts { gap: 5px; margin-top: 9px; }
  .hero .facts span { padding: 3px 9px; font-size: .7rem; }
  h1 { font-size: 1.38rem; }
  .card { padding: 18px 15px; }
  .cal-grid { gap: 3px; }
  .cal-day { font-size: .82rem; min-height: 32px; }
  .summary div { flex-direction: column; gap: 1px; }
  .summary dd { text-align: left; }
}

@media print {
  .site-header, .actions, .progress, .steps { display: none; }
  body { background: #fff; }
}

/* Rozbalovací plné znění podmínek */
.terms-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  margin-top: 14px;
}
.terms-details > summary {
  cursor: pointer;
  padding: 12px 15px;
  font-weight: 600;
  font-size: .88rem;
  color: var(--green-800);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.terms-details > summary::-webkit-details-marker { display: none; }
.terms-details > summary::before { content: "▸"; font-size: .8em; transition: transform .15s; }
.terms-details[open] > summary::before { transform: rotate(90deg); }
.terms-details > summary:hover { background: var(--green-050); border-radius: var(--radius-sm); }
.terms-body { padding: 13px 15px 15px; border-top: 1px solid var(--line-soft); }
.terms-body h3 { margin-top: 16px; }
.terms-body p { font-size: .85rem; margin-bottom: .8em; }

/* --- Rozhraní nájemce: dveře, fotky, závady --- */

.door-buttons { display: grid; gap: 10px; margin: 14px 0; }
@media (min-width: 520px) { .door-buttons { grid-template-columns: 1fr 1fr; } }
.door-btn { min-height: 62px; font-size: 1.05rem; }

.log-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .78rem;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
}
.log-row:last-child { border-bottom: 0; }
.log-row .ok { color: var(--green-600); font-weight: 600; }
.log-row .bad { color: var(--busy); font-weight: 600; }

.slot-grid { display: grid; gap: 12px; margin: 14px 0 18px; }
@media (min-width: 620px) { .slot-grid { grid-template-columns: repeat(3, 1fr); } }
.slot {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--white);
  text-align: center;
}
.slot.done { border-style: solid; border-color: var(--green-600); background: var(--green-050); }
.slot.uploading { opacity: .55; }
.slot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: .9rem; }
.slot-state { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.slot.done .slot-state { color: var(--green-700); }
.slot img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; }
.slot-empty {
  height: 110px;
  display: flex; align-items: center; justify-content: center;
  background: var(--sand-100);
  border-radius: 6px;
  color: var(--ink-faint);
  font-size: .8rem;
}
.slot-btn { margin-top: 10px; width: 100%; }

.thumb-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.thumb-row img {
  width: 84px; height: 84px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); display: block;
}

.defect-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 10px;
  background: var(--white);
}
.defect-item .top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.defect-item p { margin-bottom: 6px; }
.tiny { font-size: .74rem; }

input[type=file] {
  width: 100%;
  font: inherit;
  font-size: .9rem;
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}
.slot-btn input[type=file] { display: none; }

/* Fotky předání v administraci */
.shot { margin: 0; width: 110px; }
.shot img { width: 110px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.shot .slot-empty { height: 84px; border: 1px dashed var(--busy-line); color: var(--busy); }
.shot figcaption { font-size: .72rem; color: var(--ink-soft); text-align: center; margin-top: 4px; }

/* --- Trezory a kroky průvodce --- */

.safe-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 9px;
  background: var(--white);
}
.safe-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.safe-contains { font-size: .84rem; color: var(--ink-soft); margin-top: 3px; }
.safe-code {
  margin-top: 9px;
  padding: 10px 12px;
  background: var(--green-050);
  border: 1px solid var(--green-100);
  border-radius: var(--radius-sm);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--green-900);
}
.safe-note { margin-top: 8px; font-size: .8rem; color: var(--ink-faint); }

.guide-step { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.guide-step:first-child { padding-top: 0; }
.guide-step:last-child { border-bottom: 0; padding-bottom: 0; }
.guide-step h3 { display: flex; align-items: center; gap: 9px; margin: 0 0 6px; font-size: .96rem; }
.guide-step h3 .n {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--green-700);
  color: var(--white);
  font-size: .74rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.guide-step p:last-child { margin-bottom: 0; }

/* --- Ověření telefonu SMS kódem --- */

.verify-box {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  background: var(--sand-100);
  margin: 12px 0 15px;
}
.verify-box.done { border-color: var(--green-600); background: var(--green-050); }
.verify-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.verify-title { font-weight: 650; font-size: .92rem; }
.verify-actions { margin-top: 10px; }
.verify-code { display: flex; gap: 9px; margin-top: 10px; }
.verify-code input {
  flex: 0 1 9rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.verify-box .note { margin-top: 10px; }

/* Výběr účtu, když k jednomu ověřenému číslu patří víc účtů. */
.account-choice { display: grid; gap: 8px; margin-top: 12px; }
.account-choice button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  width: 100%;
  padding: 10px 13px;
}
.account-choice button span { font-size: .82rem; opacity: .75; font-weight: 500; }

/* Uzavřené vyúčtování: formulář se rozbalí až na vyžádání. */
.settle-edit { margin-top: 12px; }

.verified {
  display: inline-block;
  background: var(--ok-bg);
  color: var(--green-800);
  border: 1px solid var(--ok-line);
  border-radius: 999px;
  padding: 1px 9px;
  font-size: .72rem;
  font-weight: 700;
}

/* --- Rozhraní nájemce: shrnutí, záložky, kontakty --- */

.stay-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--green-800);
  color: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 13px 16px;
}
.stay-bar-main { min-width: 0; }
.stay-bar-main strong { display: block; font-size: 1rem; }
.stay-bar-sub { display: block; font-size: .8rem; opacity: .82; }
.stay-bar .badge { flex: 0 0 auto; margin-left: auto; background: rgba(255,255,255,.16); color: var(--white); }

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  position: sticky;
  top: var(--header-h);
  z-index: 10;
}
.tabs button {
  position: relative;
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  padding: 11px 4px;
  border: 0;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
}
.tabs button:hover { background: var(--green-050); }
.tabs button.active { background: var(--green-050); color: var(--green-800); box-shadow: inset 0 -3px 0 var(--green-600); }

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--pending-bg);
  color: #8a5c10;
  border: 1px solid var(--pending-line);
  font-size: .68rem;
  font-weight: 700;
}
.tab-badge.done { background: var(--ok-bg); color: var(--green-800); border-color: var(--ok-line); }

.contact-strip {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}
.contact-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: .85rem;
}
.contact-item .role { color: var(--ink-faint); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; flex: 1 0 100%; }
.contact-item .who { font-weight: 600; }
.contact-item .tel { font-weight: 700; }

@media (max-width: 380px) {
  .tabs button { font-size: .76rem; padding: 10px 2px; }
}

/* Přepínač způsobu přihlášení */
.switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.switcher button {
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  padding: 9px 6px;
  border: 0;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 40px;
}
.switcher button.active { background: var(--green-800); color: var(--white); }

/* --- Moje žádosti --- */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.page-head h1 { margin-bottom: .15em; }
.page-head .btn { flex: 0 0 auto; }

.summary-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 22px;
}
.summary-bar div {
  background: var(--white);
  padding: 12px 10px;
  text-align: center;
}
.summary-bar strong { display: block; font-size: 1.5rem; line-height: 1.1; color: var(--green-800); }
.summary-bar span { font-size: .74rem; color: var(--ink-soft); }

.res-group { margin-bottom: 26px; }
.res-group h2 { display: flex; align-items: center; gap: 9px; margin-bottom: .2em; }
.res-group h2 .count {
  font-size: .72rem;
  font-weight: 700;
  background: var(--sand-200);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 2px 9px;
}
.res-group > .muted { margin-bottom: 14px; }

/* Kompaktní výpis žádostí - jeden řádek na žádost, detail se rozbalí. */
.res-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
  overflow: hidden;
}
.res-item.status-pending { border-left-color: var(--pending); }
.res-item.status-approved { border-left-color: var(--green-600); }
.res-item.status-settled { border-left-color: #7c5cbf; }
.res-item.status-completed { border-left-color: var(--green-800); }
.res-item.status-rejected { border-left-color: var(--busy); }
.res-item.status-cancelled { border-left-color: var(--ink-faint); }

.res-main {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) minmax(0, 1.6fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.res-main:hover { background: var(--sand-050, #faf8f4); }
.ri-when { font-weight: 650; font-size: .93rem; }
.ri-id { color: var(--ink-faint); font-weight: 500; font-size: .78rem; margin-left: 7px; white-space: nowrap; }
.ri-facts {
  color: var(--ink-soft);
  font-size: .82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ri-price {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
.ri-price-note { display: block; font-weight: 500; font-size: .72rem; color: var(--ink-faint); }

.res-item .res-detail {
  display: none;
  padding: 4px 16px 16px;
  border-top: 1px solid var(--line-soft);
}
.res-item.open .res-detail { display: block; }
.res-item.open .res-main { background: var(--sand-050, #faf8f4); }
.res-item .res-detail h3 { margin-top: 1.2em; }
.ri-notes { display: grid; gap: 8px; margin: 12px 0; }
.res-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

@media (max-width: 720px) {
  .res-main { grid-template-columns: 1fr auto; row-gap: 5px; }
  .ri-when { grid-area: 1 / 1; }
  .res-main .badge { grid-area: 1 / 2; justify-self: end; }
  .ri-facts { grid-area: 2 / 1 / auto / -1; white-space: normal; }
  .ri-price { grid-area: 3 / 1 / auto / -1; display: flex; gap: 7px; align-items: baseline; text-align: left; }
  .ri-price-note { display: inline; }
}
.res-item .res-detail h3:first-child { margin-top: 0; }

.empty-state { text-align: center; padding: 40px 22px; }
.empty-state .empty-icon { font-size: 2.4rem; line-height: 1; margin-bottom: 10px; }
.empty-state h2 { margin-bottom: .3em; }
.empty-state .btn { margin-top: 8px; }

.account-card { padding: 0; }
.account-card > summary {
  cursor: pointer;
  padding: 16px 18px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .95rem;
}
.account-card > summary::-webkit-details-marker { display: none; }
.account-card > summary::before { content: "▸"; font-size: .8em; color: var(--green-700); transition: transform .15s; }
.account-card[open] > summary::before { transform: rotate(90deg); }
.account-body { padding: 0 18px 18px; border-top: 1px solid var(--line-soft); padding-top: 16px; }

@media (max-width: 430px) {
  .page-head { flex-direction: column; align-items: stretch; }
  .summary-bar strong { font-size: 1.25rem; }
}

/* --- Administrace: fronty, seznam, detail se záložkami --- */

.queues { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.queue {
  font: inherit;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 15px;
  cursor: pointer;
  display: block;
}
.queue:hover { border-color: var(--green-500); border-left-color: var(--green-500); }
.queue.has { border-left-color: var(--pending); }
.queue strong { display: block; font-size: 1.7rem; line-height: 1.1; color: var(--green-800); }
.queue.has strong { color: var(--pending); }
.queue span { display: block; font-size: .8rem; font-weight: 600; color: var(--ink); }
.queue em { display: block; font-size: .7rem; color: var(--ink-faint); font-style: normal; }

.adm-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 9px;
}
.adm-row.status-pending { border-left-color: var(--pending); }
.adm-row.status-approved { border-left-color: var(--green-600); }
.adm-row.status-settled { border-left-color: #7a6bbd; }
.adm-row.status-completed { border-left-color: var(--green-800); }
.adm-row.status-rejected { border-left-color: var(--busy); }
.adm-row.status-cancelled { border-left-color: var(--ink-faint); }

.adm-main {
  font: inherit;
  text-align: left;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  min-width: 0;
}
.adm-when { display: block; font-weight: 700; font-size: .98rem; color: var(--ink); }
.adm-meta { display: block; font-size: .79rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.adm-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.adm-amount { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .92rem; }

.adm-detail { display: none; grid-column: 1 / -1; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.adm-row.open .adm-detail { display: block; }

.adm-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.adm-tabs button {
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.adm-tabs button.active { background: var(--green-800); color: var(--white); border-color: var(--green-800); }
.adm-tabs button.active .tab-badge { background: rgba(255,255,255,.2); color: #fff; border-color: transparent; }
.adm-pane h3:first-child { margin-top: 0; }

.badge.settled { background: #ece9f8; color: #4a3f86; }
.adm-row.status-settled .badge.settled { background: #ece9f8; }

.invoice-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 3px solid #7a6bbd;
  border-radius: var(--radius-sm);
  background: var(--sand-100);
}
.invoice-box h3 { margin-top: 0; display: flex; align-items: center; gap: 9px; }

@media (max-width: 560px) {
  /* Tři fronty i na telefonu vedle sebe, jen menší - pod sebou zabíraly celou obrazovku. */
  .queues { gap: 6px; }
  .queue { padding: 9px 9px; border-radius: var(--radius-sm); }
  .queue strong { font-size: 1.3rem; }
  .queue span { font-size: .72rem; line-height: 1.25; }
  .queue em { display: none; }
  .adm-row { grid-template-columns: 1fr; }
  .adm-side { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* --- Administrace: rozvržení s postranní nabídkou --- */

body.wide .wrap { max-width: 1140px; }
.adm-layout { display: grid; gap: 16px; }
.adm-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 8px 16px;
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: var(--sand-100);
}
.adm-nav::-webkit-scrollbar { display: none; }
.adm-nav button {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: inherit;
  font-size: .88rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.adm-nav button:hover { border-color: var(--green-500); }
.adm-nav button.active { background: var(--green-800); border-color: var(--green-800); color: var(--white); }
.adm-nav .count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pending-bg);
  color: #8a5c10;
  font-size: .72rem;
  line-height: 20px;
  text-align: center;
}
.adm-nav button.active .count { background: rgba(255,255,255,.2); color: var(--white); }
.adm-view > h2.view-title { margin: 0 0 12px; }

@media (min-width: 900px) {
  .adm-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 26px; align-items: start; }
  .adm-nav {
    flex-direction: column;
    overflow: visible;
    margin: 0;
    padding: 0;
    top: calc(var(--header-h) + 18px);
    background: none;
  }
  .adm-nav button {
    border-radius: var(--radius-sm);
    border-color: transparent;
    background: transparent;
    padding: 10px 14px;
    text-align: left;
  }
  .adm-nav button:hover { background: var(--white); border-color: var(--line); }
  .adm-nav button.active { background: var(--green-800); border-color: var(--green-800); }
}

/* --- Rychlé rezervace --- */

.qb-list { display: grid; gap: 10px; }
.qb-row {
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 10px;
  padding: 11px 13px;
  background: var(--white);
  display: grid;
  gap: 8px;
}
.qb-row.phase-active { border-left-color: var(--green-600); }
.qb-row.phase-upcoming { border-left-color: var(--pending); }
.qb-row.phase-ended { border-left-color: var(--green-800); opacity: .85; }
.qb-row.phase-cancelled { border-left-color: var(--ink-faint); opacity: .7; }
.qb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.qb-main { min-width: 0; }
.qb-main strong { display: block; }
.qb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qb-link { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.qb-link input { flex: 1 1 260px; min-width: 0; font-size: .85rem; }

.qb-safes { display: grid; gap: 8px; }
@media (min-width: 640px) { .qb-safes { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.qb-safes .check { margin: 0; }

/* --- Stránka pobytu --- */

.pobyt-bar { border-radius: var(--radius) var(--radius) 0 0; }
.pobyt-card { border-top-left-radius: 0; border-top-right-radius: 0; border-top: 0; }
.pobyt-intro { margin-bottom: 12px; }
.pobyt-card .safe-item { margin: 8px 0 0; }
.pobyt-card .terms-details { margin-top: 18px; }
.pobyt-farewell { margin: 18px 0 0; font-weight: 600; color: var(--green-800); text-align: center; }

/* --- Ověření na stránce pobytu --- */

.gate { display: grid; place-items: center; min-height: calc(100vh - 220px); padding: 12px 0 28px; }
.gate-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 30px 26px 28px;
  border-radius: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  text-align: center;
  overflow: hidden;
}
.gate-card::before {
  content: '';
  position: absolute;
  inset: -40% -30% auto;
  height: 220px;
  background: radial-gradient(closest-side, rgba(63, 154, 97, .16), transparent);
  pointer-events: none;
}
.gate-card h1 { margin: 6px 0 8px; font-size: 1.55rem; color: var(--green-900); }
.gate-lead { margin: 0 0 6px; color: var(--ink); }
.gate-sub { margin: 10px 0 0; font-size: .88rem; color: var(--ink-soft); }
.gate-btn { margin-top: 18px; min-width: 190px; }
.gate-error { margin: 12px 0 0; font-size: .88rem; color: var(--busy); font-weight: 600; }

.gate-progress { display: flex; justify-content: center; gap: 7px; margin: 0 0 14px; padding: 0; list-style: none; }
.gate-progress li {
  width: 8px; height: 8px; border-radius: 999px; background: var(--line);
  transition: width .35s cubic-bezier(.3, 1.4, .5, 1), background .3s;
}
.gate-progress li.done { background: var(--green-500); }
.gate-progress li.active { width: 26px; background: var(--green-700); }

.gate-step { animation: gate-in .45s cubic-bezier(.2, .9, .3, 1.15) both; }
.gate-step.leaving { animation: gate-out .22s ease-in both; }
@keyframes gate-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes gate-out { to { opacity: 0; transform: translateY(-12px) scale(.98); } }

.gate-emoji { font-size: 3.2rem; line-height: 1; display: inline-block; }
.gate-emoji.wave { transform-origin: 70% 80%; animation: wave 1.8s ease-in-out .3s 2; }
.gate-emoji.buzz { animation: buzz .9s ease-in-out .2s 2; }
.gate-emoji.bounce { animation: bounce 1s cubic-bezier(.3, 1.6, .5, 1) both; }
.gate-emoji.pop { animation: pop .6s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes wave {
  0%, 60%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(16deg); }
  20%, 40% { transform: rotate(-8deg); }
}
@keyframes buzz {
  0%, 100% { transform: translateX(0) rotate(0); }
  15%, 45%, 75% { transform: translateX(-3px) rotate(-6deg); }
  30%, 60%, 90% { transform: translateX(3px) rotate(6deg); }
}
@keyframes bounce { 0% { transform: translateY(-24px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes pop { 0% { transform: scale(0) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }

.gate-check { width: 64px; height: 64px; margin: 0 auto; }
.gate-check svg { width: 100%; height: 100%; fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.gate-check circle { stroke: var(--green-500); stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s ease-out forwards; }
.gate-check path { stroke: var(--green-700); stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .35s ease-out .5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.digits { display: flex; justify-content: center; gap: 8px; margin: 20px 0 4px; }
.digits input {
  width: 46px;
  height: 56px;
  padding: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--green-900);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--sand-100);
  caret-color: var(--green-600);
  transition: border-color .15s, background .15s, transform .15s;
}
.digits input:focus { outline: none; border-color: var(--green-600); background: var(--white); box-shadow: 0 0 0 4px rgba(63, 154, 97, .18); }
.digits input.filled { border-color: var(--green-500); background: var(--white); animation: tick .18s ease-out; }
.digits.masked input { -webkit-text-security: disc; }
.digits.wrong { animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
.digits.wrong input { border-color: var(--busy); }
.digits.ok input { border-color: var(--green-600); background: var(--green-050); }
.digits.busy { opacity: .6; pointer-events: none; }
@keyframes tick { 50% { transform: scale(1.08); } }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
@media (max-width: 380px) {
  .digits { gap: 6px; }
  .digits input { width: 40px; height: 50px; font-size: 1.3rem; }
}

.link-btn {
  border: 0; background: none; padding: 4px; font: inherit; font-size: .88rem;
  color: var(--green-700); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-btn:disabled { color: var(--ink-faint); text-decoration: none; cursor: default; }

.pobyt-reveal { animation: gate-in .5s cubic-bezier(.2, .9, .3, 1.1) both; }

@media (prefers-reduced-motion: reduce) {
  .gate-step, .gate-step.leaving, .gate-emoji, .gate-check circle, .gate-check path,
  .digits input.filled, .digits.wrong, .pobyt-reveal { animation: none !important; }
  .gate-check circle, .gate-check path { stroke-dashoffset: 0; }
}

/* Stažení instrukcí jako PDF */
.pdf-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}
.pdf-download > div { display: grid; gap: 2px; min-width: 0; }
.pdf-download .btn { flex: 0 0 auto; }
@media (max-width: 480px) {
  .pdf-download { flex-wrap: wrap; }
}

/* --- Vyúčtování --- */

.queue.active { border-color: var(--green-800); box-shadow: inset 0 0 0 1px var(--green-800); }
.bill-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.bill-toolbar .filters { margin-bottom: 12px; }
.bill-tools { display: flex; gap: 8px; flex-wrap: wrap; }
#bill-pending .note.bill-pending-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 12px 10px 14px;
}
.bill-pending-line span { flex: 1 1 auto; min-width: 0; }
.bill-pending-line .btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  #bill-pending .note.bill-pending-line { flex-wrap: wrap; }
}

/* Vyhledávání v seznamech - lupa vlevo, výška jako malá tlačítka vedle. */
input[type=search] {
  padding: 8px 12px 8px 34px;
  font-size: .9rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2355605a' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
}
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }
.bill-quick { margin-bottom: 16px; }
.bill-quick h3 { margin: 0 0 8px; }
.bill-quick-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.bill-row.state-toInvoice { border-left-color: #7a6bbd; }
.bill-row.state-invoiced { border-left-color: var(--pending); }
.bill-row.state-paid { border-left-color: var(--green-600); }
.bill-row.open .adm-detail { display: block; }
.bill-detail h3 { margin: 16px 0 6px; }
.bill-actions { margin-top: 14px; }

#bill-form h3 { margin: 18px 0 6px; }
#bill-form .row, #bill-form .field { margin-top: 10px; }
.bl-head, .bl-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1.2fr) 32px;
  gap: 6px;
  align-items: center;
}
.bl-head { font-size: .72rem; font-weight: 600; color: var(--ink-faint); margin: 6px 0 4px; }
.bl-row { margin-bottom: 6px; }
.bl-row input { min-width: 0; width: 100%; }
.bl-amount { text-align: right; font-variant-numeric: tabular-nums; font-size: .88rem; font-weight: 600; }
.bl-remove {
  border: 1px solid var(--line); background: var(--white); border-radius: 8px;
  width: 32px; height: 32px; cursor: pointer; font-size: 1.1rem; line-height: 1; color: var(--ink-soft);
}
.bl-remove:hover { border-color: var(--busy); color: var(--busy); }
.bf-total { display: flex; justify-content: flex-end; gap: 14px; align-items: baseline; margin: 12px 0 4px; font-size: 1.05rem; }
.bf-total strong { font-variant-numeric: tabular-nums; color: var(--green-800); }

@media (max-width: 640px) {
  .bl-head { display: none; }
  .bl-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) minmax(0, 1.2fr) 32px;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
  }
  .bl-row [data-l="label"] { grid-column: 1 / 4; grid-row: 1; }
  .bl-row .bl-remove { grid-column: 4; grid-row: 1; }
  .bl-row [data-l="quantity"] { grid-column: 1; grid-row: 2; }
  .bl-row [data-l="unit"] { grid-column: 2; grid-row: 2; }
  .bl-row [data-l="unitPrice"] { grid-column: 3 / 5; grid-row: 2; }
  .bl-row .bl-amount { grid-column: 1 / -1; grid-row: 3; }
  .bl-row .bl-amount:empty { display: none; }
}

/* --- Hovory: kompaktní seznam --- */

.calls-toolbar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.calls-toolbar .filters { margin-bottom: 0; }
.calls-toolbar .filters .muted { font-weight: 400; }
.calls-toolbar .filters button.active .muted { color: rgba(255,255,255,.75); }
.calls-tools { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; justify-content: flex-end; }
.calls-tools input { flex: 1 1 200px; width: auto; min-width: 0; max-width: 320px; }
.calls-selbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 8px 12px; border-radius: 10px; background: var(--sand-100);
}
.calls-selbar span { font-weight: 600; font-size: .88rem; margin-right: auto; }
.calls-card .call-list { gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.calls-card .call-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
}
.calls-card .call-row:first-child { border-top: 0; }
.calls-card .call-row.outcome-message { border-left-color: #7a6bbd; }
.calls-card .call-row.outcome-transfer { border-left-color: var(--pending); }
.calls-card .call-row.outcome-failed { border-left-color: var(--busy); }
.calls-card .call-row.open { background: var(--sand-100); }
.call-check { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.call-line {
  display: grid;
  grid-template-columns: 92px minmax(0, 1.1fr) minmax(0, 2fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 9px 12px 9px 0;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}
.call-when { font-size: .8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.call-who { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-sum-line { font-size: .85rem; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-detail { grid-column: 2; padding: 0 12px 12px 0; }
.call-detail .summary { margin: 6px 0 10px; }
#calls-more { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }

@media (max-width: 640px) {
  .call-line { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .call-when { grid-column: 1; }
  .call-line .badge { grid-column: 2; grid-row: 1; }
  .call-who, .call-sum-line { grid-column: 1 / -1; }
  .calls-tools { justify-content: stretch; }
  .calls-tools input { max-width: none; }
}

.users-search { margin: 14px 0 0; }
.users-search input { max-width: 360px; }

/* --- Znalosti asistentky --- */

.gap-list { display: grid; gap: 8px; margin-top: 12px; }
.gap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--pending);
  border-radius: 10px;
}
.gap-row.done { border-left-color: var(--green-600); opacity: .7; }
.gap-main { flex: 1 1 260px; min-width: 0; }
.gap-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.kn-list { display: grid; gap: 10px; margin-top: 4px; }
.kn-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green-600);
  border-radius: 10px;
  background: var(--white);
}
.kn-row.off { border-left-color: var(--ink-faint); opacity: .68; }
.kn-main { flex: 1 1 300px; min-width: 0; }
.kn-main p { margin: 4px 0 6px; color: var(--ink-soft); }
.kn-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.kn-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 560px) {
  .kn-side { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
}

.contact-item .note-line { display: block; width: 100%; margin-top: 2px; }

/* Plovoucí bublina pro hovor s asistentkou (viz js/hovor.js). */
.webhovor {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.webhovor-bublina {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: 28px;
  background: var(--green-700);
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(18, 41, 27, .28);
  transition: gap .18s ease, padding .18s ease, background .18s ease;
}
.webhovor-bublina svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.webhovor-bublina:hover:not(:disabled) { background: var(--green-600); }
.webhovor-bublina:disabled { opacity: .6; cursor: default; }
.webhovor-bublina:focus-visible { outline: 3px solid var(--green-500); outline-offset: 3px; }

/* Popisek se rozbalí až při najetí, jinak je to jen kolečko s ikonou. */
.webhovor-stitek {
  max-width: 0;
  /* Pružné prvky mají výchozí minimální šířku podle obsahu a ta by strop
     přebila, takže by se štítek nikdy nesbalil. */
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  font-weight: 600;
  font-size: .95rem;
  transition: max-width .18s ease;
}
.webhovor-bublina:hover .webhovor-stitek,
.webhovor-bublina:focus-visible .webhovor-stitek { max-width: 12rem; }
.webhovor-bublina:hover, .webhovor-bublina:focus-visible { gap: 10px; }

.webhovor-panel {
  width: min(19rem, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(18, 41, 27, .18);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.webhovor-panel.chyba { border-color: var(--busy-line); background: var(--busy-bg); }
.webhovor-panel p { margin: 0; font-size: .9rem; line-height: 1.45; }

.webhovor-radek { display: flex; align-items: center; gap: 9px; }
.webhovor-popis { font-weight: 600; font-size: .95rem; }
.webhovor-cas {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  font-size: .9rem;
}

/* Tečka tepe, dokud hovor běží - je hned vidět, že linka žije. */
.webhovor-tecka {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green-500);
  animation: webhovor-tep 1.4s ease-in-out infinite;
}
@keyframes webhovor-tep {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.75); }
}
@media (prefers-reduced-motion: reduce) {
  .webhovor-tecka { animation: none; }
  .webhovor-bublina, .webhovor-stitek { transition: none; }
}

.webhovor-konec, .webhovor-zavrit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--busy);
  color: var(--white);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}
.webhovor-konec svg { width: 18px; height: 18px; fill: currentColor; }
.webhovor-konec:hover, .webhovor-zavrit:hover { filter: brightness(.94); }
.webhovor-zavrit { background: transparent; color: var(--busy); border: 1px solid var(--busy-line); }

@media (max-width: 560px) {
  .webhovor { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .webhovor-stitek { display: none; }
  .webhovor-bublina { width: 56px; padding: 0; justify-content: center; }
}
