:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --muted2: #94a3b8;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent2: #7c3aed;
  --accent-ink: #ffffff;
  --brand-grad: linear-gradient(135deg, #6366f1, #7c3aed);
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 10px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { display: block; border-radius: 8px; }
.brand-mark { font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -0.01em; }
.brand-dot { color: var(--accent); }
.brand-sub { font-size: 12px; color: var(--muted2); }
.topnav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.topnav a { color: var(--muted); }
.topnav a:hover { color: var(--ink); }
.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { color: var(--err); }

.wrap { max-width: 880px; margin: 28px auto; padding: 0 24px; }
.foot { text-align: center; color: var(--muted2); font-size: 12px; padding: 32px 0; }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px; margin-bottom: 20px;
}
h1 { font-size: 24px; margin: 0 0 6px; }
h2 { font-size: 18px; margin: 24px 0 10px; }
.lead { color: var(--muted); margin: 0 0 20px; }
.hint { color: var(--muted); font-size: 13px; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; font-size: 14px;
  padding: 11px 20px; border-radius: 8px; border: 1px solid transparent;
  background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn-ok { background: var(--ok); }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 4px; }
input[type=text], input[type=email], input[type=date], input[type=number], select, .field {
  width: 100%; font: inherit; font-size: 14px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 640px){ .grid2 { grid-template-columns: 1fr; } }
.errlist { color: var(--err); font-size: 13px; margin: 4px 0 0; }

.messages { margin-bottom: 18px; }
.msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; font-size: 14px; }
.msg-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.msg-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.msg-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 420px; }

table.emp { width: 100%; border-collapse: collapse; }
table.emp th, table.emp td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.emp th { color: var(--muted); font-weight: 600; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-koncept { background: #f1f5f9; color: var(--muted); }
.badge-overeno { background: #eff6ff; color: #1e40af; }
.badge-xml { background: #fef9c3; color: #854d0e; }
.badge-odeslano { background: #ecfdf5; color: #065f46; }

.status-ok { color: var(--ok); }
.status-bad { color: var(--err); }
.callout { background: #fffbeb; border: 1px solid #fde68a; color: #854d0e; padding: 14px 16px; border-radius: 8px; font-size: 13px; }
.steps { padding-left: 20px; }
.steps li { margin: 8px 0; }
.ds-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; background:#f1f5f9; padding:2px 8px; border-radius:6px; }
#validate-result .errlist { background:#fef2f2; border:1px solid #fecaca; border-radius:8px; padding:10px 14px; }
.save-flag { font-size: 12px; color: var(--muted2); margin-left: 10px; }

.fld { margin-bottom: 4px; }
.req { color: var(--err); font-weight: 700; }
h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
details.adv { margin-top: 18px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 14px; background: #fafbfc; }
details.adv > summary { cursor: pointer; font-weight: 600; padding: 10px 0; color: var(--muted); }
details.adv[open] > summary { color: var(--ink); margin-bottom: 8px; }
select.field, select { width: 100%; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.fld .hint { margin-bottom: 2px; }

.fld.ac { position: relative; }
.ac-list { display: none; position: absolute; z-index: 30; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; }
.ac-item { padding: 9px 12px; font-size: 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover { background: #eff6ff; }

/* handoff — krokový layout */
.krok { display: flex; gap: 16px; align-items: flex-start; padding: 18px 0; border-top: 1px solid var(--line); }
.krok:first-of-type { border-top: 0; }
.krok-num { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.krok-body { flex: 1; min-width: 0; }
.krok-body h2 { margin: 4px 0 10px; border: 0; padding: 0; font-size: 17px; }
.cesty { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 6px; }
@media (max-width: 640px){ .cesty { grid-template-columns: 1fr; } }
.cesta { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: #fff; display: flex; flex-direction: column; }
.cesta.doporuceno { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #f5f9ff; }
.cesta h3 { margin: 6px 0 6px; font-size: 16px; }
.cesta p { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.cesta .btn { margin-top: auto; text-align: center; }
.cesta-tag { display: inline-block; align-self: flex-start; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.cesta-tip { margin: 10px 0 0 !important; font-size: 12.5px; color: var(--muted2) !important; }
.cesta-tip strong { color: var(--ink); }

.row-actions { display: flex; gap: 14px; align-items: center; white-space: nowrap; }
.linklike.danger { color: var(--err); }
.linklike.danger:hover { text-decoration: underline; }
.manage-row { display: flex; gap: 20px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

/* platby */
.status-ok-box, .status-bad-box { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.status-ok-box { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.status-bad-box { background: #fffbeb; border: 1px solid #fde68a; color: #854d0e; }
.status-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; }
.status-dot.ok { background: var(--ok); }
.status-dot.bad { background: var(--warn); }
.pay-toggle { display: flex; gap: 12px; margin: 8px 0 20px; }
.pay-opt { flex: 1; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; text-align: left; }
.pay-opt.active { border-color: var(--accent); background: #f5f9ff; }
.pay-opt .pay-amt { font-size: 22px; font-weight: 800; color: var(--ink); }
.pay-opt .pay-note { font-size: 12px; color: var(--muted); }
.pay-grid { display: grid; grid-template-columns: 200px 1fr; gap: 24px; align-items: start; }
@media (max-width: 600px){ .pay-grid { grid-template-columns: 1fr; } }
.pay-qr svg { width: 190px; height: 190px; }
.pay-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pay-row span { color: var(--muted); }
.pay-row .vs { font-family: ui-monospace, monospace; font-size: 16px; }
.pay-detail .btn { margin-top: 14px; }
.pay-tip { display: flex; gap: 12px; align-items: flex-start; margin: 14px 0 4px; padding: 13px 15px; background: #f5f9ff; border: 1px solid #bfdbfe; border-radius: 10px; font-size: 13.5px; color: #1e3a8a; }
.pay-tip-ic { flex: 0 0 auto; font-size: 18px; line-height: 1.3; }
.pay-tip strong { color: var(--ink); }
.pay-tip .vs-inline { font-family: ui-monospace, monospace; background: #fff; border: 1px solid #bfdbfe; padding: 0 6px; border-radius: 5px; }

/* zaměstnanec — sbalitelné sekce + živá kontrola povinných polí */
.success-box { display: flex; gap: 12px; align-items: flex-start; padding: 15px 17px; margin-bottom: 16px; background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; color: #065f46; font-size: 14px; }
.success-box .success-ic { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.success-box a { color: #047857; font-weight: 700; }

.fill-status { padding: 11px 15px; border-radius: 9px; font-size: 14px; margin-bottom: 18px; }
.fill-status.todo { background: #fffbeb; border: 1px solid #fde68a; color: #854d0e; }
.fill-status.done { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.hl-red { color: var(--err); font-weight: 700; }

details.sec { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; background: #fff; overflow: visible; }
details.sec > summary { cursor: pointer; font-size: 17px; font-weight: 700; padding: 14px 18px; display: flex; align-items: center; gap: 10px; list-style: none; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "▸"; color: var(--muted2); font-size: 13px; transition: transform .15s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 6px; }
details.sec > .grid2, details.sec > p, details.sec > .hint { padding: 0 18px; }
details.sec[open] { padding-bottom: 14px; }
details.sec.sec-done > summary { color: var(--muted); }
.sec-chip { margin-left: auto; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; }
.sec-chip.chip-done { background: #ecfdf5; color: #065f46; }
.sec-chip.chip-todo { background: #fffbeb; color: #b45309; }
details.sec.sec-jmhz { border-color: #bfdbfe; }
details.sec.sec-jmhz[open] { box-shadow: 0 0 0 2px #bfdbfe; }
details.sec.sec-jmhz > summary { color: #1e40af; }

.fld.fld-missing input, .fld.fld-missing select { border-color: var(--err); background: #fff7f7; }
.fld.fld-missing input:focus, .fld.fld-missing select:focus { outline-color: var(--err); }
.fld.fld-missing > label { color: var(--err); }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--panel); border-radius: 12px; padding: 24px 26px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h3 { margin: 0 0 8px; font-size: 18px; }
.modal p { margin: 0; color: var(--muted); font-size: 14px; }

/* aktivní/neaktivní select v seznamu */
.active-select { width: auto; min-width: 150px; padding: 7px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
tr.row-inactive td:nth-child(-n+3) { opacity: .55; }

/* ===== Branding / tlačítka ===== */
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 10px; }

/* ===== Veřejná landing ===== */
.hero { text-align: center; padding: 56px 20px 36px; }
.hero-badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent); background: #eef2ff; border: 1px solid #e0e7ff;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 22px; }
.hero-title { font-size: 44px; line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 18px; }
.hero-title .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { max-width: 620px; margin: 0 auto 28px; font-size: 17px; color: var(--muted); }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero-note { margin-top: 18px; font-size: 13px; color: var(--muted2); }
@media (max-width: 640px){ .hero-title { font-size: 32px; } }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 28px 0; }
@media (max-width: 760px){ .features { grid-template-columns: 1fr; } }
.feat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.feat-ic { font-size: 26px; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  background: #eef2ff; border-radius: 12px; margin-bottom: 14px; }
.feat h3 { margin: 0 0 8px; font-size: 17px; }
.feat p { margin: 0; color: var(--muted); font-size: 14px; }

.howto { padding: 30px 28px; }
.steps-big { list-style: none; padding: 0; margin: 12px 0 20px; display: grid; gap: 16px; }
.steps-big li { display: flex; gap: 16px; align-items: flex-start; }
.step-n { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: var(--brand-grad);
  color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps-big strong { font-size: 15px; }
.trust { text-align: center; color: var(--muted); font-size: 14px; padding: 8px 0 36px; }

/* ===== Admin CRM ===== */
body.admin { background: #f6f7fb; }
.admin-topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line); }
.admin-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: #fff; background: var(--brand-grad); padding: 2px 8px; border-radius: 6px; margin-left: 8px; vertical-align: middle; }
.admin-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.admin-nav a { color: var(--muted); }
.admin-nav a:hover { color: var(--ink); }
.admin-who { color: var(--muted2); font-size: 13px; }
.admin-wrap { max-width: 1120px; margin: 26px auto; padding: 0 28px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.admin-head h1 { margin: 0; }

.kpi-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
@media (max-width: 760px){ .kpi-band { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.kpi-n { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.kpi-l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.admin-filter { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-filter input[type=search] { flex: 1; min-width: 220px; }
.admin-filter select { width: auto; }

.admin-table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbff; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fafbff; }
.admin-table .num { text-align: right; }
.admin-table .empty { text-align: center; color: var(--muted2); padding: 28px; }
.firma-link { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.small { font-size: 12.5px; color: var(--muted); }

.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pill-ok { background: #ecfdf5; color: #065f46; }
.pill-bad { background: #fef2f2; color: #991b1b; }
.pill-warn { background: #fffbeb; color: #92400e; }
.pill-muted { background: #f1f5f9; color: var(--muted); }
.pill-sub { font-size: 12px; color: var(--muted2); margin-left: 6px; }

.admin-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 760px){ .admin-cards { grid-template-columns: 1fr; } }
.admin-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; margin-bottom: 16px; }
.admin-card h3 { margin: 0 0 12px; font-size: 15px; }
.admin-card .admin-table { margin: 0 -6px; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
