/* ============================================================
   Platební portál – vzhled
   ============================================================ */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/InterVariable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --navy-900: #0c1f3a;
  --navy: #12355e;
  --navy-700: #1d4e86;
  --blue: #2563eb;
  --blue-600: #1d4ed8;
  --blue-soft: #eef4ff;
  --bg: #eff3f9;
  --surface: #ffffff;
  --border: #e2e8f2;
  --border-strong: #cfd9e8;
  --text: #182338;
  --muted: #64748b;
  --green: #0e7a46;
  --green-bg: #e5f6ec;
  --amber: #9a5b00;
  --amber-bg: #fdf3e0;
  --red: #b42318;
  --red-bg: #fdecea;
  --gray-bg: #eef1f6;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 30, 60, .05), 0 6px 20px -8px rgba(15, 30, 60, .10);
  --shadow-lg: 0 4px 12px rgba(10, 25, 50, .08), 0 24px 60px -20px rgba(10, 25, 50, .25);
  --ring: 0 0 0 4px rgba(37, 99, 235, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1000px 400px at 85% -10%, rgba(37, 99, 235, .07), transparent 60%),
    radial-gradient(800px 300px at -10% 0%, rgba(29, 78, 134, .06), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv02', 'cv03', 'cv04';
}
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0; font-weight: 750; letter-spacing: -.02em; }
h2 { font-size: 1.02rem; margin: 0 0 .8rem; color: var(--navy); font-weight: 700; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace; font-size: .93em; }
.strong { font-weight: 650; }
.center { text-align: center; }
.ta-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1.1rem; }
.hidden { display: none !important; }

:focus-visible { outline: 3px solid rgba(37, 99, 235, .4); outline-offset: 2px; border-radius: 6px; }

::selection { background: rgba(37, 99, 235, .18); }

/* ---- Topbar ---- */
.topbar {
  background: linear-gradient(100deg, var(--navy-900) 0%, var(--navy) 55%, #16406e 100%);
  color: #fff;
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 2px 14px rgba(8, 20, 45, .28);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 22px;
  height: 62px; display: flex; align-items: center; gap: 26px;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-mark {
  background: var(--blue); color: #fff; font-weight: 800; letter-spacing: .5px;
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: .85rem;
}
.brand-mark-lg { width: 60px; height: 60px; font-size: 1.2rem; border-radius: 15px; }
/* Znak obce místo textového loga */
.brand-znak {
  background: rgba(255, 255, 255, .10);
  border-radius: 10px; object-fit: contain; padding: 4px; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text strong { font-weight: 700; letter-spacing: -.01em; }
.brand-text small { color: #9fb4d2; font-size: .74rem; font-weight: 500; }
.nav { display: flex; gap: 5px; margin-left: 10px; }
.nav a {
  color: #c3d2e8; padding: 8px 15px; border-radius: 9px; font-weight: 550; font-size: .92rem;
  transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; text-decoration: none; }
.nav a.active {
  background: rgba(255, 255, 255, .14); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 1px 2px rgba(0, 0, 0, .15);
}
.user { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.user-name { color: #e6ecf5; font-weight: 550; font-size: .92rem; padding: 6px 10px; border-radius: 8px; }
.user-name:hover { background: rgba(255, 255, 255, .09); text-decoration: none; color: #fff; }
.inline { display: inline; }

/* ---- Layout ---- */
.container { max-width: 1120px; margin: 0 auto; padding: 30px 22px 64px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.back-link { font-size: .85rem; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; color: var(--muted); font-weight: 550; }
.back-link:hover { color: var(--blue-600); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 17px;
  font-size: .92rem; font-weight: 620; cursor: pointer; background: none;
  font-family: inherit; text-decoration: none; letter-spacing: .005em;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s, filter .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, #3674f0, var(--blue-600));
  color: #fff;
  box-shadow: 0 1px 2px rgba(29, 78, 216, .4), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { color: #fff; filter: brightness(1.07); box-shadow: 0 3px 10px rgba(29, 78, 216, .35), inset 0 1px 0 rgba(255, 255, 255, .18); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); box-shadow: 0 1px 2px rgba(15, 30, 60, .05); }
.btn-ghost:hover { background: #f6f9fd; border-color: #b9c7dc; }
.btn-ghost.active { border-color: var(--blue); color: var(--blue-600); background: var(--blue-soft); }
.btn-warn { background: var(--amber-bg); color: var(--amber); border-color: #ecd3a2; }
.btn-warn:hover { background: #fbe9c8; }
.btn-danger { background: #fff; color: var(--red); border-color: #efc4bf; }
.btn-danger:hover { background: var(--red-bg); border-color: #e5a9a2; }
.btn-sm { padding: 7px 13px; font-size: .85rem; }
.btn-xs { padding: 4px 10px; font-size: .78rem; border-radius: 8px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn:disabled { opacity: .55; cursor: default; }

/* ---- Cards ---- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; box-shadow: var(--shadow);
}
.card.narrow { max-width: 540px; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::before {
  content: ""; position: absolute; inset: 0 auto auto 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, #f0b429, #f7d070);
}
.stat-ok::before { background: linear-gradient(90deg, #12925a, #34c98e); }
.stat-muted::before { background: linear-gradient(90deg, #94a3b8, #cbd5e1); }
.stat-label { display: block; color: var(--muted); font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.stat-value { display: block; font-size: 2.05rem; font-weight: 780; line-height: 1.25; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { display: block; color: var(--muted); font-size: .9rem; }
.overdue-text { color: var(--red); font-weight: 620; }

/* ---- Toolbar / filtry ---- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 15px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--muted); font-size: .87rem; font-weight: 570; box-shadow: 0 1px 2px rgba(15, 30, 60, .04);
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { text-decoration: none; background: #f4f8fd; color: var(--text); }
.chip-active { background: linear-gradient(180deg, #1a3f6d, var(--navy)); color: #fff; border-color: var(--navy); box-shadow: 0 2px 6px rgba(18, 53, 94, .35); }
.chip-active:hover { background: var(--navy); color: #fff; }
.search { display: flex; gap: 7px; margin-left: auto; }
.search input { min-width: 230px; }
.toolbar-right { display: flex; gap: 8px; margin-left: auto; }

/* Lišta filtrů přehledu (období, účel, hledání) */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.filter-bar select { width: auto; max-width: 250px; padding: 8px 10px; font-size: .87rem; }
.filter-bar input[type=search] { flex: 1 1 190px; width: auto; min-width: 160px; padding: 8px 12px; font-size: .9rem; }

/* ---- Tabulka ---- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 680; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #f8fafd;
}
.table td { padding: 13px 16px; border-bottom: 1px solid #edf1f7; font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: none; }
.row-link { cursor: pointer; transition: background .12s; }
.row-link:hover { background: #f4f8ff; }
.table.compact th, .table.compact td { padding: 9px 12px; }
.table .row-title { color: inherit; font-weight: 640; }
.table .badge + .badge { margin-left: 6px; }
.table-scroll { overflow-x: auto; }
.table-scroll .table td, .table-scroll .table th { white-space: nowrap; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 20px;
  font-size: .77rem; font-weight: 650; white-space: nowrap; letter-spacing: .01em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-lg { font-size: .9rem; padding: 7px 16px; }
.badge-pending { background: var(--amber-bg); color: var(--amber); }
.badge-paid { background: var(--green-bg); color: var(--green); }
.badge-canceled { background: var(--gray-bg); color: var(--muted); }
.badge-expired { background: var(--red-bg); color: var(--red); }
.badge-ok { background: var(--green-bg); color: var(--green); }
.badge-warn { background: var(--amber-bg); color: var(--amber); }

/* ---- Alerts ---- */
.alert { padding: 13px 17px; border-radius: 12px; margin-bottom: 18px; border: 1px solid transparent; border-left-width: 4px; }
.alert ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.alert-error { background: var(--red-bg); color: var(--red); border-color: #f2cac5; border-left-color: var(--red); }
.alert-success { background: var(--green-bg); color: var(--green); border-color: #c4e8d2; border-left-color: #16a34a; }
.alert-warn { background: var(--amber-bg); color: var(--amber); border-color: #eeda9d; border-left-color: #d97706; }
.alert-muted { background: var(--gray-bg); color: var(--muted); border-left-color: #94a3b8; }
.big-success { display: flex; align-items: center; gap: 16px; padding: 18px 20px; }
.success-icon {
  background: linear-gradient(180deg, #22b573, #16a34a); color: #fff; width: 44px; height: 44px;
  border-radius: 50%; display: grid; place-items: center; font-size: 1.35rem; flex: none;
  box-shadow: 0 3px 10px rgba(22, 163, 74, .35);
}

/* ---- Forms ---- */
.form label, .stack label { display: block; }
label > span { display: block; font-weight: 620; font-size: .86rem; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=search], input[type=date], input[type=number], input[type=email], textarea, select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: .95rem; font-family: inherit; background: #fff; color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 30, 60, .04) inset;
  transition: border-color .15s, box-shadow .15s;
}
input:hover, textarea:hover, select:hover { border-color: #b6c4d9; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.search input { padding: 8px 13px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row .col-2 { grid-column: span 2; }
.form .form-row:has(.col-2) { grid-template-columns: 2fr 1fr; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack .form-row { margin-bottom: 0; }
.hint { display: block; color: var(--muted); font-size: .8rem; margin-top: 5px; font-weight: 450; }
.req { color: var(--red); }
.form-actions { display: flex; gap: 10px; margin-top: 10px; }
.form-row .form-actions { align-self: end; margin-top: 0; }
.form-section {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 14px;
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}
.form-section::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.info-panel {
  background: linear-gradient(180deg, #eef4ff, #e9f0fe); border: 1px solid #d3e0fb; border-radius: 12px;
  padding: 13px 17px; margin: 6px 0 18px; font-size: .9rem; border-left: 4px solid var(--blue);
}
.info-panel .mono { background: #fff; padding: 1px 7px; border-radius: 6px; border: 1px solid #d3e0fb; }
/* Vyšší specificita než ".form label" (ta nastavuje display:block) */
.form label.check, .stack label.check, label.check {
  display: flex; align-items: center; gap: 10px; font-weight: 550; cursor: pointer;
}
.check input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blue); flex: none; margin: 0; }
.check > span { display: inline; margin-bottom: 0; font-weight: 550; font-size: .92rem; }
.receipt-row {
  background: #f8fafd; border: 1px solid var(--border); border-radius: 12px;
  padding: 15px 17px; margin-bottom: 16px; display: grid; gap: 12px;
}

/* ---- Detail ---- */
.detail-grid { display: grid; grid-template-columns: 360px 1fr; gap: 20px; align-items: start; }
.qr-card { text-align: center; position: sticky; top: 82px; }
.qr-card.is-dim .qr-box { opacity: .45; }
.qr-amount { font-size: 1.85rem; font-weight: 780; color: var(--navy); margin-bottom: 12px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.qr-box {
  display: grid; place-items: center; padding: 14px; background: #fff;
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 2px 8px rgba(15, 30, 60, .06);
}
.qr-box svg { width: 236px; height: 236px; }
.qr-hint { color: var(--muted); font-size: .85rem; margin: 14px 0 10px; }
.qr-actions { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.pulse-wait { display: inline-flex; align-items: center; gap: 8px; color: var(--amber); font-weight: 620; font-size: .88rem; margin-top: 6px; }
.pulse-wait .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); animation: pulse 1.3s infinite; }
@keyframes pulse { 0%, 100% { opacity: .3; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

.kv { display: grid; grid-template-columns: 175px 1fr; gap: 9px 16px; margin: 0 0 18px; }
.kv dt { color: var(--muted); font-size: .87rem; padding-top: 1px; }
.kv dd { margin: 0; }
.copyable { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-btn {
  border: 1px solid var(--border-strong); background: #fff; border-radius: 7px; width: 27px; height: 27px;
  cursor: pointer; color: var(--muted); font-size: .9rem; line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}
.copy-btn:hover { background: var(--blue-soft); color: var(--blue-600); border-color: #b9cdf5; }
.copy-btn.copied { color: var(--green); border-color: var(--green); background: var(--green-bg); }
/* Kopírovací tlačítko s textem (např. „⧉ odkaz") – nesmí zdědit pevné 27×27 px */
.btn.copy-btn { width: auto; height: auto; }
.vs-big { font-size: 1.18rem; }
.vs-explain { flex-basis: 100%; color: var(--muted); font-size: .8rem; }
.desc { white-space: pre-wrap; margin: 0 0 14px; }
.events { white-space: pre-line; background: var(--gray-bg); border: 1px solid var(--border); border-radius: 12px; padding: 13px 17px; font-size: .9rem; margin: 0 0 18px; }
.meta-line { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; color: var(--muted); font-size: .88rem; }

/* ---- Empty ---- */
.empty { text-align: center; padding: 64px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty p { color: var(--muted); margin-bottom: 16px; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: transparent; padding: 18px 0; margin-top: 44px; }
.site-footer .container { padding: 0 22px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .85rem; }
.footer-badge { padding: 4px 11px; border-radius: 20px; font-size: .75rem; font-weight: 650; }

/* ---- Administrace ---- */
.admin-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 20px; align-items: start; }

/* ---- Banka ---- */
.balance-chip {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 18px; box-shadow: var(--shadow);
}
.balance-label { font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.balance-value { font-size: 1.25rem; font-weight: 760; color: var(--navy); font-variant-numeric: tabular-nums; }
.match-form { display: flex; gap: 6px; align-items: center; }
.match-form select { width: auto; max-width: 320px; padding: 6px 9px; font-size: .84rem; }

/* ---- Login ---- */
.login-body {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(59, 130, 246, .25), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(29, 78, 134, .5), transparent 60%),
    linear-gradient(150deg, var(--navy-900), var(--navy) 55%, var(--navy-700));
}
.login-card {
  background: #fff; width: 400px; max-width: calc(100vw - 32px); padding: 38px 34px;
  border-radius: 20px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .35);
}
.login-head { text-align: center; margin-bottom: 24px; }
.login-head .brand-mark { margin: 0 auto 14px; }
.login-head .brand-znak { background: var(--blue-soft); box-shadow: inset 0 0 0 1px #dbe6fb; padding: 6px; }
.login-head h1 { font-size: 1.35rem; }
.btn-block { width: 100%; }
.btn-sso { margin-bottom: 6px; padding: 12px 17px; font-size: .96rem; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .8rem; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* ---- Veřejná stránka platby (/pay) ---- */
.pay-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(59, 130, 246, .18), transparent 60%),
    radial-gradient(700px 500px at 5% 110%, rgba(29, 78, 134, .35), transparent 60%),
    linear-gradient(150deg, var(--navy-900), var(--navy) 55%, var(--navy-700));
}
.pay-card {
  background: var(--surface); width: 460px; max-width: calc(100vw - 24px); padding: 30px 32px;
  border-radius: 20px; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .35); text-align: center;
}
.pay-head { display: flex; align-items: center; gap: 12px; text-align: left; margin-bottom: 20px; }
.pay-head .brand-znak { background: var(--blue-soft); box-shadow: inset 0 0 0 1px #dbe6fb; }
.pay-title { font-size: 1.3rem; margin-bottom: 4px; letter-spacing: -.015em; }
.pay-kv { text-align: left; margin-top: 20px; grid-template-columns: 155px 1fr; }
.pay-foot { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 13px; }

/* ---- Error / profile ---- */
.error-page { text-align: center; padding: 64px 20px; }
.error-page h1 { margin-bottom: 8px; }
.error-page p { margin-bottom: 20px; }

/* ---- Trvalé platební místo / šablony / hromadný import ---- */
.amount-suggest { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tpl-row { background: var(--blue-soft); border: 1px solid #d3e0fb; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.tpl-row select { margin-top: 2px; }
.inline-file { font-weight: 450; color: var(--muted); margin-top: 6px; }
.inline-file input[type=file] { width: auto; }
.mt-sm { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hint-inline { color: var(--muted); font-size: .85rem; }
.open-form { text-align: left; }

/* ---- Plakát ---- */
.poster { max-width: 560px; margin: 30px auto; padding: 40px 30px; text-align: center; }
.poster-znak { width: 84px; height: 84px; object-fit: contain; }
.poster-office { font-weight: 700; color: var(--navy); margin-top: 8px; }
.poster-title { font-size: 2rem; margin: 14px 0 6px; letter-spacing: -.02em; }
.poster-desc { color: #444; margin: 0 0 10px; }
.poster-qr { display: grid; place-items: center; margin: 18px 0 10px; }
.poster-qr svg { width: 300px; height: 300px; }
.poster-note { font-size: 1.05rem; line-height: 1.6; }
.poster-url { color: #666; font-size: .85rem; word-break: break-all; }

/* ---- Print doklad ---- */
.print-body { background: #fff; color: #000; }
.doklad { max-width: 660px; margin: 30px auto; padding: 30px; }
.doklad-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid #000; padding-bottom: 14px; }
.doklad-head h1 { font-size: 1.3rem; }
.doklad-brand { display: flex; align-items: center; gap: 14px; }
.doklad-znak { width: 54px; height: 54px; object-fit: contain; }
.doklad-title { font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.doklad-subject { margin: 18px 0 4px; }
.doklad-body { display: flex; gap: 26px; align-items: center; margin: 20px 0; }
.doklad-qr svg { width: 200px; height: 200px; }
.doklad-table { border-collapse: collapse; }
.doklad-table th { text-align: left; color: #444; font-weight: 550; padding: 5px 16px 5px 0; vertical-align: top; }
.doklad-table td { padding: 5px 0; }
.doklad-note { border-top: 1px solid #ccc; padding-top: 12px; }
.print-toolbar { text-align: center; padding: 20px; }

@media print {
  .no-print { display: none !important; }
  .doklad { margin: 0; }
  body { font-size: 13px; background: #fff; }
}

/* ---- Responsive ---- */
@media (max-width: 1000px) {
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .detail-grid { grid-template-columns: 1fr; }
  .qr-card { position: static; }
  .stats { grid-template-columns: 1fr; }
  .form-row, .form .form-row:has(.col-2) { grid-template-columns: 1fr; }
  .topbar-inner { gap: 12px; }
  .nav { display: none; }
  .search { margin-left: 0; width: 100%; }
  .search input { min-width: 0; flex: 1; }
}

/* ---- DPH nápověda ---- */
.dph-hint { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dph-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 8px;
  font-size: .8rem; font-weight: 650; white-space: nowrap; border: 1px solid transparent;
}
.dph-base { background: var(--amber-bg); color: var(--amber); border-color: #ecd3a2; }
.dph-reduced { background: var(--green-bg); color: var(--green); border-color: #c4e8d2; }
.dph-muted { background: var(--gray-bg); color: var(--muted); border-color: var(--border-strong); }
.dph-note { color: var(--muted); font-size: .8rem; flex: 1 1 180px; min-width: 160px; }
.dph-disclaimer { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #cdd9ef; font-size: .82rem; color: #45557a; }

/* ---- Modal (<dialog>) ---- */
dialog.modal {
  border: none; border-radius: 16px; padding: 0; width: 460px; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg); color: var(--text); background: var(--surface);
}
dialog.modal::backdrop { background: rgba(12, 25, 50, .5); backdrop-filter: blur(2px); }
.modal-card { padding: 24px 26px; display: flex; flex-direction: column; gap: 12px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; }
.modal-x { border: none; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; border-radius: 6px; }
.modal-x:hover { color: var(--text); background: var(--gray-bg); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.link-actions { flex-basis: 100%; margin-top: 4px; }

/* ---- Audit ---- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager-links { display: flex; gap: 8px; }
.filter-bar .filter-narrow { width: auto; max-width: 190px; }
