/* Wopro Schůzka: společný základ pro přihlášenou část i veřejný web. Světlý, vzdušný, modrofialová jako akcent (barva loga).
   Proměnné jsou pojmenované stejně jako v administraci Wopro (wopro.cz/acc), takže se kostra aplikace (shell.css) dá převzít 1:1. Převzato ze sms/assets/app.css. */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.09);
  --primary-border: rgba(79, 70, 229, 0.28);

  --bg: #f5f7fb;
  --bg-card: #ffffff;
  --bg-hover: #eef1fb;
  --text: #141a2e;
  --text-secondary: #3f4760;
  --text-muted: #6b7389;
  --border: #e2e6f0;
  --border-soft: #eef1f7;

  --success: #10b981;
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.08);
  --warning: #f59e0b;

  --shadow-sm: 0 1px 2px rgba(20, 24, 46, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(20, 24, 46, 0.07), 0 2px 4px -2px rgba(20, 24, 46, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(20, 24, 46, 0.08), 0 4px 6px -4px rgba(20, 24, 46, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(20, 24, 46, 0.1), 0 8px 10px -6px rgba(20, 24, 46, 0.05);
  --shadow-card: 0 25px 50px -12px rgba(20, 24, 46, 0.14);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* vlastní odstíny obsahu */
  --ink: var(--text);
  --ink2: var(--text-secondary);
  --mute: var(--text-muted);
  --paper: var(--bg);
  --card: var(--bg-card);
  --line: var(--border);
  --line2: var(--border-soft);
  --sig: #6366f1;
  --sig-d: #4338ca;
  --sig-bg: #e9eaff;
  --sig-bg2: #f3f4ff;
  --btn: var(--primary);
  --btn-h: var(--primary-hover);
  --blue: #2563eb;
  --blue-bg: #e8f0fe;
  --warn: #a8530a;
  --warn-bg: #fdf3dc;
  --bad: #be123c;
  --bad-bg: #fde8ed;
  --r: 14px;
  --shadow: var(--shadow-sm), 0 6px 20px rgba(20, 24, 46, .04);
  --font: var(--font-sans);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; font: 15px/1.6 var(--font-sans); color: var(--text); background: var(--bg); min-height: 100vh; }
a { color: var(--sig-d); }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(760px, 100% - 32px); margin-inline: auto; padding: 56px 0; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 300; border-radius: 0 0 8px 0; }
.skip:focus { left: 0; }
:focus-visible { outline: 3px solid #b4b8ff; outline-offset: 2px; border-radius: 6px; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Obsah přihlášené části (stejný rámec jako .main-content v administraci Wopro) */
.main-content { max-width: 1200px; margin: 0 auto; padding: 32px 24px; }
.main-content h1 { font-size: 1.7rem; margin-bottom: 6px; }
.main-content > h1 + .lead { margin-bottom: 22px; font-size: 1rem; }
.main-content > h1:not(:has(+ .lead)) { margin-bottom: 20px; }
@media (max-width: 640px) { .main-content { padding: 20px 16px; } }

/* Tlačítka a pole */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; background: var(--btn); color: #fff; border: 0; border-radius: 12px; font: inherit; font-weight: 650; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--btn-h); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: #fff; color: var(--text-secondary); box-shadow: inset 0 0 0 1.5px var(--border); }
.btn.ghost:hover { background: var(--sig-bg2); color: var(--sig-d); box-shadow: inset 0 0 0 1.5px #c7caff; }
.btn.sec { background: var(--sig-bg); color: var(--sig-d); }
.btn.sec:hover { background: #dcdeff; color: var(--sig-d); }
.btn.bad { background: var(--bad); color: #fff; }
.btn.bad:hover { background: #9f0f31; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: .9rem; border-radius: 10px; }
.btn.lg { min-height: 52px; padding: 0 28px; font-size: 1.02rem; border-radius: 14px; }
label { display: block; font-weight: 600; font-size: .9rem; margin: 16px 0 6px; }
/* Atribut hidden schová vždy, i prvek s vlastním display (16. 10.: čas „Naplánovat“ byl vidět i u „Hned“). */
[hidden] { display: none !important; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=url], input[type=password], input[type=datetime-local], input[type=date], input[type=time], select, textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 11px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #dcdeff; border-color: var(--sig); }
.hint { color: var(--text-muted); font-size: .88rem; margin-top: 6px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 220px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 12px 0; }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--btn); flex: none; }

/* Plochy */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card h2 { font-size: 1.1rem; margin-bottom: .8em; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.75rem; letter-spacing: -0.03em; line-height: 1.15; }
.stat span { color: var(--text-muted); font-size: .9rem; }
.stat.sig { background: var(--sig-bg); border-color: #c7caff; box-shadow: none; }
.stat.warn { background: var(--warn-bg); border-color: #f3dca9; box-shadow: none; }
.notice { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; background: var(--blue-bg); color: #1e3a8a; }
.notice.ok { background: var(--sig-bg); color: #064e3b; }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.pill { display: inline-block; padding: 2px 11px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: #eceef5; color: var(--text-secondary); white-space: nowrap; }
.pill.ok { background: var(--sig-bg); color: var(--sig-d); }
.pill.info { background: var(--blue-bg); color: #1d4ed8; }
.pill.wait { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
th { font-size: .8rem; color: var(--text-muted); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.tw { overflow-x: auto; }
.mono { font-family: var(--mono); font-size: .9em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
code, pre { font-family: var(--mono); }
pre { background: #f1f3fb; color: #1e2650; border: 1px solid var(--border); padding: 16px 18px; border-radius: 12px; overflow-x: auto; font-size: .88rem; line-height: 1.6; margin: 0 0 16px; }
pre .c { color: #7a8299; }
pre .k { color: var(--sig-d); font-weight: 600; }
:not(pre) > code { background: #eaecfa; padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.empty { text-align: center; color: var(--text-muted); padding: 28px 12px; }
.toast { position: fixed; right: 16px; bottom: 16px; background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 400; max-width: min(420px, 90vw); box-shadow: 0 10px 30px rgba(0,0,0,.2); }
.toast.bad { background: var(--bad); }
.lead { font-size: 1.15rem; color: var(--text-secondary); }
.counter { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-secondary); font-size: .92rem; margin-top: 8px; }
.counter b { color: var(--ink); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--border); background: #fff; border-radius: 99px; padding: 8px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.chip:hover { border-color: var(--sig); background: var(--sig-bg2); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.timeline time { color: var(--text-muted); min-width: 128px; font-size: .9rem; }
.legal { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: .85rem; color: var(--text-muted); margin-top: 14px; }

/* Přepis a zápis na stránce záznamu (vlna 2, bloky M a N) */
.tr-nadpis { font-size: .95rem; margin: 18px 0 6px; }
.tr-body { margin: 0 0 6px; padding-left: 20px; }
.tr-body li { margin: 0 0 4px; }
.tr-prepis { margin-top: 16px; border-top: 1px solid var(--border-soft); padding-top: 12px; }
.tr-prepis summary { cursor: pointer; font-weight: 650; color: var(--sig-d); }
.tr-seznam { list-style: none; margin: 10px 0 0; padding: 0; max-height: 60vh; overflow-y: auto; }
.tr-seznam li { display: flex; gap: 10px; padding: 6px 8px; border-radius: 8px; line-height: 1.5; }
.tr-seznam li.je-ted { background: var(--sig-bg2); }
.tr-cas { flex: none; min-width: 52px; border: 0; background: none; padding: 0; font: inherit; font-size: .85rem; font-variant-numeric: tabular-nums; color: var(--sig-d); cursor: pointer; text-align: left; }
.tr-cas:hover { text-decoration: underline; }

/* Okno pro potvrzení (místo nativního confirm) */
.dlg-back { position: fixed; inset: 0; background: rgba(20, 24, 46, .38); z-index: 500; display: grid; place-items: center; padding: 16px; }
.dlg { background: #fff; border-radius: 16px; padding: 24px; width: min(420px, 100%); box-shadow: 0 24px 60px rgba(20, 24, 46, .28); }
.dlg p { margin: 0 0 18px; font-size: 1.02rem; }
.dlg .acts { display: flex; gap: 10px; justify-content: flex-end; }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background .15s, color .15s; }
}

/* Stránka hovoru (/m/<kód>): bez lišt, tmavé pozadí, React v assets/app/ si přináší vlastní styly. */
body.hv-bare { background: #0f172a; color: #e2e8f0; min-height: 100dvh; }
body.hv-bare #hv-app { min-height: 100dvh; }
.hv-msg { max-width: 520px; margin: 0 auto; padding: 18vh 24px 40px; text-align: center; }
.hv-msg img { border-radius: 14px; margin-bottom: 18px; }
.hv-msg h1 { color: #fff; font-size: 1.6rem; }
.hv-msg p { color: #cbd5e1; font-size: 1.05rem; }
.hv-msg .btn.ghost { background: transparent; color: #e2e8f0; box-shadow: inset 0 0 0 1.5px #334155; }
/* Klikací dlaždice v přehledu (minuty zdarma, záznamy) */
a.stat { display: block; color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
a.stat:hover { border-color: #c7caff; transform: translateY(-1px); }
a.stat:hover b { color: var(--sig-d); }

/* ===== Přestavba 16. 10.: čistší a bez přetékání ===== */
/* Přehled: rychlé založení schůzky a pozvání */
.rychla h2 { margin-bottom: 12px; }
.rychla-pole { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center; }
.rychla-pole input { margin: 0; }
.pozvat-pole { grid-template-columns: minmax(0, 1fr) auto; }
.rychla .hint, .pozvat-pole + .hint { margin: 10px 0 0; }
@media (max-width: 760px) {
  .rychla-pole, .pozvat-pole { grid-template-columns: 1fr; }
  .rychla-pole .btn { width: 100%; }
}

/* Nová schůzka */
.nova { max-width: 780px; }
.nova > label:first-child { margin-top: 0; }
.nova textarea { min-height: 64px; }
.kdy { border: 0; padding: 0; margin: 18px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.kdy legend { font-weight: 600; font-size: .9rem; margin: 0 0 6px; padding: 0; width: 100%; }
.volba { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 10px 18px; border: 1.5px solid var(--border); border-radius: 12px; font-weight: 600; cursor: pointer; }
.volba:has(input:checked) { border-color: var(--sig); background: var(--sig-bg2); color: var(--sig-d); }
.volba input { accent-color: var(--btn); margin: 0; }
.kdy-plan { margin-top: 2px; }
input[type=datetime-local], input[type=date], input[type=time] { padding-top: 9px; padding-bottom: 9px; }
.dalsi { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.dalsi summary { cursor: pointer; font-weight: 600; color: var(--text-secondary); }
.dalsi[open] summary { margin-bottom: 4px; }
.nova-tlacitka { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 24px; }
.nova-tlacitka .hint { margin: 0; }

/* Tabulky: čísla, kódy a hlavičky se nelámou; dlouhé texty se zalomí místo přetečení */
.tw th, .tw td.num, .tw .mono { white-space: nowrap; }
.tw td { overflow-wrap: break-word; }
/* Dlouhý stav (Selhalo: důvod) se zalomí uvnitř štítku, ať nezúží ostatní sloupce až na jednotlivá písmena (16. 10.). */
.tw .pill.bad { white-space: normal; border-radius: 12px; max-width: 320px; line-height: 1.35; padding-top: 3px; padding-bottom: 3px; }
td .btn + .btn, td .btn + button, td button + .btn { margin-left: 4px; }

/* Telefon: tabulky jako karty (popisky ze záhlaví doplní app.js do data-label) */
@media (max-width: 640px) {
  .tw { overflow: visible; }
  .tw table, .tw tbody, .tw tr, .tw td { display: block; width: 100%; }
  .tw thead { display: none; }
  .tw tr { border: 1px solid var(--border); border-radius: 12px; padding: 4px 14px; margin-bottom: 10px; background: var(--bg-card); }
  .tw td { position: relative; border: 0; padding: 7px 0 7px 40%; text-align: right; min-height: 34px; white-space: normal; }
  .tw td.num { white-space: normal; }
  .tw td::before { content: attr(data-label); position: absolute; left: 0; top: 7px; width: 38%; text-align: left; color: var(--text-muted); font-size: .82rem; font-weight: 600; }
  .tw td:first-child { padding-left: 0; text-align: left; font-size: 1rem; border-bottom: 1px solid var(--border-soft); padding-bottom: 9px; margin-bottom: 2px; }
  .tw td:first-child::before, .tw td[data-label=""]::before { content: none; }
  .tw td[data-label=""] { padding-left: 0; text-align: left; }
  .tw td .btn { margin: 3px 4px 3px 0; }
}
/* Telefon: menší dlaždice s čísly, ať Přehled není jen sloupec čísel */
@media (max-width: 640px) {
  .stats { gap: 10px; }
  .stats .stat { padding: 12px 14px; }
  .stats .stat b { font-size: 1.4rem; }
  .stats .stat span { font-size: .84rem; }
}
.cislo-schuzky { margin: 14px 0 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cislo-schuzky strong { font-size: 1.35rem; letter-spacing: .06em; }
