/* Vzhled podle administrace sznette (LTweb Travel admin) – jen světlý režim, bez levého menu.
   Tokeny a styl komponent převzaty z admin SCSS sznette (_variables/_layout/_buttons/_tables/_forms/_flash). */
:root {
  --bg: #ebeef1;          /* pozadí stránky (adm-bg) */
  --surface: #ffffff;     /* karty, panely, lišta (adm-surface) */
  --surface-2: #f6f7f9;   /* jemné odlišení (hlavičky, code) */
  --hover: #f1f3f5;       /* jemné zvýraznění na hover (adm-hover) */
  --line: #dde1e7;        /* rámečky (adm-border) */
  --faint: #c2c6cc;       /* slabší linka (adm-faint) */
  --text: #1a1d21;        /* hlavní text (adm-text) */
  --text-2: #6b7280;      /* tlumený (adm-muted) */
  --text-3: #9096a0;      /* nápovědy (adm-hint) */
  --accent: #1d70b8;      /* LTweb modrá (adm-blue) */
  --accent-hover: #185c95;
  --accent-strong: #155a94;
  --link-hover: #14507f;
  --accent-text: #ffffff;
  --accent-soft: rgba(29, 112, 184, .12);
  --accent-soft-bd: rgba(29, 112, 184, .35);
  --accent-row: rgba(29, 112, 184, .10);  /* hover řádku tabulky (světlé téma) */
  --danger: #dc2626;      /* text chyby / povinné */
  --danger-soft: rgba(248, 113, 113, .12);
  --danger-soft-bd: rgba(248, 113, 113, .35);
  --ok: #15803d;
  --warn: #b45309;
  --amber: #fbbf24;
  --radius: 3px;
  --radius-lg: 6px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .18);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; scrollbar-color: var(--faint) transparent; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 13px/1.6 var(--font);
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
code { font: 12px var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1px 5px; word-break: break-all; }

/* ---------- tlačítka ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: .4rem .7rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); white-space: nowrap; color: var(--text-2); text-decoration: none; line-height: 1.3; font-size: 12px; transition: background-color .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--hover); border-color: var(--line); color: var(--text); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn .i { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 500; }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.danger { background: var(--danger-soft); border-color: var(--danger-soft-bd); color: var(--danger); font-weight: 500; }
.btn.danger:hover { background: rgba(248, 113, 113, .2); border-color: rgba(248, 113, 113, .5); color: var(--danger); }
.btn.small { padding: .25rem .55rem; font-size: 11.5px; gap: 5px; }
.btn.small .i { width: 13px; height: 13px; }
.btn.ghost-danger { background: var(--surface); color: var(--text-3); }
.btn.ghost-danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn.wide { width: 100%; justify-content: center; padding: .6rem; margin-top: 1.5rem; font-weight: 500; font-size: 13px; }

/* ---------- přihlášení ---------- */
.login { display: flex; flex-direction: column; align-items: center; min-height: 100vh; background: var(--bg); padding: 16px; }
.login::before { content: ''; flex: 2 0 0; }
.login::after { content: ''; flex: 3 0 0; }
.login form { width: 100%; max-width: 340px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem 1.75rem; }
.login-head { margin-bottom: 1.75rem; }
.login-logo { display: block; width: 70%; max-width: 224px; height: auto; margin: -6px 0 0 -3px; }
.login-head p { margin: .5rem 0 0; color: var(--text-2); font-size: 13px; }
.login label { display: block; font-size: 13px; color: var(--text-2); margin: 1rem 0 .35rem; }
.login input { width: 100%; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.login input:focus { outline: none; border-color: var(--text-2); }
.login .err:not(:empty) { color: #b91c1c; margin-top: 1rem; font-size: 12px; padding: 8px 12px; border: 1px solid #fca5a5; border-radius: var(--radius); background: #fee2e2; }
.login .note { font-size: 13px; padding: 8px 12px; border-radius: var(--radius); background: var(--accent-soft); color: var(--text); margin-bottom: 4px; }
.pwwrap { position: relative; display: block; }
.pwwrap input { padding-right: 38px !important; }
.pweye { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-3); }
.pweye:hover { color: var(--text); background: var(--hover); }
.pweye.on { color: var(--accent); }

/* ---------- horní lišta ---------- */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 1.25rem; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; flex: none; line-height: 0; }
.brand-logo { display: block; height: 30px; width: auto; margin-left: -2px; }
.adminbadge { display: inline-block; font-size: 10px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: #a06a00; border: 1px solid rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .12); border-radius: var(--radius); padding: 1px 6px; }
.appname { font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.top .spacer { flex: 1; }
.who { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); min-width: 0; }
.who .i { color: var(--text-3); }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top form { margin: 0; }

/* ---------- obsah ---------- */
.wrap { max-width: 1280px; margin: 0 auto; padding: 18px 2rem 2.5rem; }
.pagehead { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 1.25rem; }
h1 { font-size: 18px; font-weight: 600; margin: 0; line-height: 1.3; word-break: break-word; }
.sub { margin: 3px 0 0; color: var(--text-2); font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.1rem; }
.card.strip { display: flex; align-items: center; gap: 12px; padding: .7rem 1rem; color: var(--text-2); }
.card.strip > .i { color: var(--accent); }
.card.strip b { color: var(--text); font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.cardhead { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.cardhead h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; }
.cardhead h2 .i { color: var(--accent); }
.count { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; }
.meta { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.meta.full { color: var(--danger); font-weight: 600; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-3); }
.sectitle { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; margin: 1.75rem 0 .75rem; }
.sectitle .i { color: var(--accent); }

/* hledání v seznamu */
.psearch { position: relative; flex: 0 1 240px; }
.psearch input { width: 100%; height: 32px; padding: 0 12px 0 32px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.psearch input:focus { outline: none; border-color: var(--text-2); }
.psearch .i { position: absolute; left: 9px; top: 8px; width: 16px; height: 16px; color: var(--text-3); }

/* ---------- tabulka účtů ---------- */
table.acc { width: 100%; border-collapse: collapse; font-size: 13px; }
.acc th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.acc th:first-child, .acc td:first-child { padding-left: 16px; }
.acc td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.acc tbody tr:last-child td { border-bottom: 0; }
.acc tbody tr { transition: background-color .12s ease; }
.acc tbody tr:hover { background: var(--accent-row); }
.sortlink { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.sortlink:hover { color: var(--text); text-decoration: none; }
.sortlink .s { width: 12px; height: 12px; opacity: .35; }
.sortlink.on { color: var(--text); }
.sortlink.on .s { opacity: 1; color: var(--accent); }
.em { min-width: 200px; }
.em .addr { word-break: break-all; }
.em .dom { color: var(--text-3); }
.em .flags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 0 16px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--ok); }
.dot.off { background: var(--danger); }
.dot.ro { background: var(--text-3); }
.info { color: var(--text-2); max-width: 260px; overflow-wrap: anywhere; }
.fw .fwd { display: block; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.fw .muted { font-size: 13px; }
td.act { text-align: right; white-space: nowrap; }
td.act .btn { margin: 2px 0 2px 4px; }

/* štítky */
.chip { display: inline-block; font-size: 11px; line-height: 18px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text-2); white-space: nowrap; font-weight: 500; }
.chip.on { color: #15803d; border-color: #86efac; background: #dcfce7; }
.chip.off { color: var(--text-3); }
.chip.warn { color: #b45309; border-color: #fcd34d; background: #fef3c7; }
.chip.bad { color: #b91c1c; border-color: #fca5a5; background: #fee2e2; }
.chip.info { color: var(--accent); border-color: var(--accent-soft-bd); background: var(--accent-soft); }

/* ---------- moduly filtrování ---------- */
.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.module { display: flex; flex-direction: column; padding: .9rem 1rem; margin: 0; }
.mhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mhead h3 { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; }
.module .hint { flex: 1; }
.mfoot { margin-top: 10px; }
.rules { list-style: none; margin: 10px 0 0; padding: 0; flex: 1; font-size: 13px; }
.rules li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.rules .op { color: var(--danger); }

/* ---------- účet uživatele ---------- */
.account { padding: 6px 18px 16px; }
.props { display: grid; grid-template-columns: 200px 1fr; margin: 0; }
.props dt, .props dd { padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.props dt { color: var(--text-2); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.actions form { margin: 0; }

/* ---------- formuláře ---------- */
.panel { max-width: 640px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem 1.75rem 1.75rem; }
.panel.narrow { max-width: 480px; }
.panel.wide { max-width: 1000px; }
.panel > h1 { margin-top: 2px; }
.panel > .sub { margin-bottom: 1rem; }
.panel > p { color: var(--text-2); }
.backlink { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; color: var(--text-2); text-decoration: none; margin: 0 0 .7rem -4px; }
.backlink:hover { color: var(--accent); text-decoration: none; }
.backlink .i { width: 16px; height: 16px; }
.lead { font-size: 14px; margin: 14px 0; overflow-wrap: anywhere; }
.form label { display: block; font-size: 13px; color: var(--text-2); margin: 1rem 0 .35rem; }
.form input:not([type=checkbox]):not([type=radio]), .form textarea, .form select {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); font-size: 13px; }
.form input:not([type=checkbox]):not([type=radio]):focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--text-2); box-shadow: none; }
.form textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.form .narrowin { max-width: 220px; }
.form h4.sub { margin: 1.5rem 0 .2rem; font-size: 13px; font-weight: 600; color: var(--text); padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
.opt { color: var(--text-3); font-weight: 400; }
.form label.chk { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; margin: 1rem 0 4px; cursor: pointer; }
.form label.chk input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.hint { font-size: 12px; color: var(--text-3); margin: 6px 0 0; line-height: 1.5; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid2 .span2 { grid-column: 1 / -1; }
.addrin, .unitin { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; }
.addrin:focus-within, .unitin:focus-within { border-color: var(--text-2); }
.form .addrin input, .form .unitin input { border: 0 !important; box-shadow: none !important; border-radius: 0; min-width: 0; background: transparent; }
.addrin span, .unitin span { padding: 0 10px; color: var(--text-2); background: var(--surface); align-self: stretch; display: flex; align-items: center; border-left: 1px solid var(--line); white-space: nowrap; }
.fwlist { display: flex; flex-direction: column; gap: 6px; }
.propline { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.propline > span:first-child { width: 110px; flex: none; color: var(--text-2); }
.row2 { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }
.switchrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 4px; }
.switchrow > span { color: var(--text-2); font-size: 13px; }
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; gap: 2px; }
.form .seg label { margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 5px 14px; border-radius: 2px; font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--accent); color: var(--accent-text); font-weight: 500; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.dangerzone { display: flex; align-items: center; gap: 14px; margin-top: 1.75rem; padding: .9rem 1rem; border: 1px solid var(--danger-soft-bd); border-radius: var(--radius); background: var(--danger-soft); }
.dangerzone > div { flex: 1; }
.dangerzone .hint { margin-top: 2px; }

/* pravidla filtru */
.rulegrid { margin-top: 12px; }
.rhead, .rrow { display: grid; grid-template-columns: 120px minmax(160px, 1.4fr) 150px minmax(140px, 1fr) 96px; gap: 8px; align-items: center; }
.rhead { font-size: 12px; color: var(--text-2); font-weight: 500; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.rrow { padding: 6px 0; border-bottom: 1px solid var(--line); }
.form .rrow select, .form .rrow input:not([type=checkbox]) { padding: .35rem .5rem; }
.exprin { display: flex; align-items: center; gap: 6px; min-width: 0; }
.exprin input { min-width: 0; }
.form label.mini { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; color: var(--text-2); white-space: nowrap; cursor: pointer; }
.form label.mini input { margin: 0; accent-color: var(--accent); }
.form label.rm { color: var(--danger); }
.rnew { margin: 16px 0 2px; font-size: 13px; font-weight: 600; }

/* ---------- hlášky ---------- */
.banner { display: flex; gap: 10px; align-items: flex-start; padding: .7rem 1rem; margin: 0 0 1.1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); font-size: 13px; }
.banner > .i { margin-top: 1px; }
.banner .btext { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.banner strong { font-weight: 600; }
.banner ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.banner li.bad { color: var(--danger); }
.banner .dmsg { color: var(--text-3); }
.banner.ok { border-color: #86efac; background: #dcfce7; color: #15803d; }
.banner.ok > .i { color: #15803d; }
.banner.err { border-color: #fca5a5; background: #fee2e2; color: #b91c1c; }
.banner.err > .i { color: #b91c1c; }
.banner.warn { border-color: #fcd34d; background: #fef3c7; color: #b45309; }
.banner.warn > .i { color: #b45309; }
.banner.info { background: var(--accent-soft); border-color: var(--accent-soft-bd); color: var(--link-hover); }
.banner.info > .i { color: var(--accent); }

/* ---------- potvrzovací dialog ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); display: grid; place-items: center; z-index: 80; padding: 16px; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; max-width: 440px; padding: 1.4rem 1.5rem; }
.modal h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; line-height: 1.4; }
.modal .row2 { margin-top: 1.25rem; }

/* ---------- menší obrazovky ---------- */
@media (max-width: 900px) {
  .acc thead { display: none; }
  .acc, .acc tbody, .acc tr, .acc td { display: block; width: 100%; }
  .acc tr { padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .acc tbody tr:last-child { border-bottom: 0; }
  .acc td, .acc th:first-child, .acc td:first-child { padding: 3px 0; border: 0; }
  .acc td[data-l]:not(.em)::before { content: attr(data-l) ": "; color: var(--text-3); font-size: 12px; }
  .acc td.fw .fwd { display: inline; }
  .acc td.fw .fwd + .fwd::before { content: ", "; }
  .info { max-width: none; }
  td.act { text-align: left; white-space: normal; padding-top: 8px !important; }
  td.act .btn { margin: 4px 4px 0 0; }
}
@media (max-width: 600px) {
  .top { padding: 0 .75rem; gap: 8px; }
  .brand-logo { height: 26px; }
  .appname, .d-only, .who { display: none; }
  .wrap { padding: 16px .75rem 3rem; }
  .panel { padding: 1.1rem; }
  .grid2 { grid-template-columns: 1fr; }
  .props { grid-template-columns: 1fr; }
  .props dt { border: 0; padding-bottom: 0; }
  .cardhead .psearch { flex-basis: 100%; order: 5; }
  .modules { grid-template-columns: 1fr; }
  .rhead { display: none; }
  .rrow { grid-template-columns: 1fr 1fr; }
  .rrow .exprin, .rrow > input[type=text] { grid-column: 1 / -1; }
  .dangerzone { flex-direction: column; align-items: stretch; }
  .switchrow { flex-wrap: wrap; }
}
