/* Kancelář – vzhled ladí s novým webem (tmavě modrá + firemní světle modrá), větší čitelné písmo */
:root {
  --paper: #f6f5f1; --white: #fff; --ink: #0d2238; --ink-2: #4a5a6e; --line: #dcd7cc;
  --blue: #0093dd; --blue-ink: #0071ab; --blue-soft: #e6f4fc; --ok: #2f7d4f; --warn: #a15c00; --danger: #b3261e;
  --r: 6px; --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Iowan Old Style", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--blue-ink); }
h1, h2 { font-family: var(--serif); font-weight: 600; margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.8rem; } h2 { font-size: 1.2rem; }
h1 small, h2 small { font: 400 1rem var(--sans); color: var(--ink-2); }
.wrap { max-width: 1500px; margin: 0 auto; padding: 24px; }
.muted { color: var(--ink-2); } .small { font-size: .88rem; } .mt { margin-top: 32px; }

/* hlavička */
.top { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top__in { max-width: 1500px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand span { font: 600 1.1rem var(--serif); border-left: 1px solid var(--line); padding-left: 12px; }
.menu { display: flex; flex-wrap: wrap; gap: 2px; }
.menu a { padding: 8px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink); font-weight: 500; }
.menu a:hover { background: var(--paper); }
.menu a[aria-current] { background: var(--ink); color: #fff; }
.user { margin-left: auto; font-size: .9rem; color: var(--ink-2); }
.mode { background: #fff6d6; color: #6b5200; text-align: center; font-size: .85rem; padding: 4px; border-top: 1px solid #ecd98a; }

/* tlačítka */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: var(--r); border: 1px solid var(--line); background: var(--white); color: var(--ink); font: 600 .95rem var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn--blue { background: var(--blue-ink); border-color: var(--blue-ink); color: #fff; }
.btn--blue:hover { background: var(--ink); border-color: var(--ink); }
.btn--sm { padding: 5px 10px; font-size: .85rem; }
.btn--danger { color: var(--danger); }
.link { background: none; border: 0; color: var(--blue-ink); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; padding: 0; }

.head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { margin: 0; }
.head__act { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { margin-bottom: 8px; font-size: .9rem; }
.flash { background: #e7f5ec; border: 1px solid #b6dcc3; color: #1d5a35; padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; }
.flash--info { background: var(--blue-soft); border-color: #b5dcf2; color: var(--ink); }
.error { background: #fdecea; border: 1px solid #f3b8b1; color: #8a1c10; padding: 10px 14px; border-radius: var(--r); margin-bottom: 12px; }
.new { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .08em; background: var(--blue-soft); color: var(--blue-ink); padding: 3px 7px; border-radius: 99px; vertical-align: middle; }

/* filtry */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.filters input[type=search] { flex: 1 1 360px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; align-items: flex-end; }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--ink); border-bottom: 3px solid transparent; }
.tabs a[aria-current] { border-color: var(--blue); font-weight: 600; }
.tabs__search { margin-left: auto; padding-bottom: 6px; }

/* hromadné akce */
.bulk { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--white); border: 1px solid var(--line); border-bottom: 0; border-radius: var(--r) var(--r) 0 0; }
.bulk [data-count] { font-size: .9rem; color: var(--ink-2); margin-right: 8px; }

/* tabulky */
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
.bulk + .table-wrap { border-radius: 0 0 var(--r) var(--r); }
table.list { border-collapse: collapse; width: 100%; font-size: .93rem; }
.list th, .list td { padding: 9px 10px; border-bottom: 1px solid #ece8df; text-align: left; vertical-align: top; }
.list thead th { background: #f0eee8; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); white-space: nowrap; position: sticky; top: 0; }
.list thead a { color: inherit; text-decoration: none; }
.list tbody tr:hover { background: #fafcfe; }
.list td small { display: block; color: var(--ink-2); font-size: .8rem; }
.list .name a { font-weight: 600; text-decoration: none; }
.list .name a:hover { text-decoration: underline; }
.list .num { text-align: right; white-space: nowrap; }
.list .name { min-width: 190px; }
.list .mail { min-width: 170px; max-width: 240px; overflow-wrap: anywhere; }
.list .note { max-width: 260px; color: var(--ink-2); font-size: .85rem; }
.list .nowrap { white-space: nowrap; }
.list .empty { text-align: center; padding: 40px; color: var(--ink-2); }
.list tfoot td { background: #f0eee8; }
.plan--odhad { font-style: italic; color: var(--ink-2); }
.warn { color: var(--warn) !important; }
.items div { margin-bottom: 4px; }
.tag { display: inline-block; font-size: .8rem; padding: 2px 8px; border-radius: 99px; background: #eeeae1; white-space: nowrap; }
.tag--com { background: #eef3f8; } .tag--exc { background: var(--blue-soft); color: var(--blue-ink); } .tag--vip { background: #0d2238; color: #fff; }
.tag--st1 { background: #e7f5ec; color: var(--ok); } .tag--st2 { background: #fff3d6; color: var(--warn); } .tag--st3 { background: #eeeae1; }
.tag--new { background: var(--blue); color: #fff; }

/* karty a formuláře */
.grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }
.side { display: grid; gap: 20px; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 16px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; }
.form label small { font-weight: 400; color: var(--ink-2); }
.form .wide { grid-column: 1 / -1; }
.form .check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; font-size: .95rem; }
@media (max-width: 600px) { .form { grid-template-columns: 1fr; } }
.actions { display: flex; gap: 8px; }
.hint { background: #fff8e6; border: 1px solid #efd9a0; padding: 8px 12px; border-radius: var(--r); font-size: .88rem; }
.mini { width: 100%; border-collapse: collapse; font-size: .9rem; margin-bottom: 10px; }
.mini td { padding: 7px 4px; border-bottom: 1px solid #ece8df; vertical-align: top; }
.mini small { display: block; color: var(--ink-2); font-size: .8rem; }
.mini .num { text-align: right; white-space: nowrap; }
.mini .off { opacity: .5; }
.add summary { cursor: pointer; color: var(--blue-ink); font-weight: 600; margin: 6px 0 12px; }
.log { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.log li { padding: 6px 0; border-bottom: 1px solid #ece8df; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; }
.facts dt { color: var(--ink-2); } .facts dd { margin: 0; font-weight: 600; }
.login { max-width: 420px; margin: 60px auto; display: grid; gap: 14px; }
.login label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.steps div { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; font-size: .9rem; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr; } }
.names { columns: 2; column-gap: 40px; padding-left: 1.6em; }
.names li { break-inside: avoid; padding: 4px 0; }
.print-sheet { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }

@media print {
  .top, .noprint, .flash { display: none !important; }
  body { background: #fff; } .wrap { padding: 0; } .print-sheet { border: 0; padding: 0; }
}

/* historie klienta (Poznámka 2 ze Synetixu) */
.history { display: grid; gap: 8px; }
.history .lbl { font-size: .85rem; font-weight: 600; }
.history .lbl small, .history label small { font-weight: 400; color: var(--ink-2); }
.history__box { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; background: #fcfbf8; font-size: .9rem; }
.history__box p { margin: 0 0 8px; }
.history label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 600; }
.raw summary { font-size: .82rem; color: var(--ink-2); cursor: pointer; }
.raw textarea { width: 100%; margin-top: 6px; font: .82rem/1.4 ui-monospace, Menlo, monospace; }

/* seznam klientů: méně sloupců, vejde se i na menší obrazovku */
.wrap { max-width: none; padding: 20px clamp(12px, 2vw, 28px); }
.list--klienti { table-layout: fixed; font-size: .9rem; min-width: 980px; }
.list--klienti th, .list--klienti td { padding: 8px 10px; }
.list--klienti .c-chk { width: 34px; }
.list--klienti .c-klient { width: 21%; }
.list--klienti .c-kontakt { width: 21%; }
.list--klienti .c-smlouva { width: 13%; }
.list--klienti .c-cena { width: 9%; }
.list--klienti .c-fakt { width: 10%; }
.list--klienti .c-pozn { width: auto; }
.list--klienti .c-posta { width: 96px; }
.list--klienti .name a { display: block; }
.list--klienti .ic { color: #8391a2; }
.list--klienti .contact .who { font-weight: 500; }
.list--klienti .contact .mail { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); text-decoration: none; font-size: .85rem; }
.list--klienti .contact .mail:hover { color: var(--blue-ink); text-decoration: underline; }
.list--klienti .note { max-width: none; }
.list--klienti .note span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.list--klienti .post .btn { padding: 4px 8px; }
.list--klienti .post small { margin-top: 4px; }
.list--klienti .badge { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 99px; background: #fff3d6; color: var(--warn); font-size: .75rem; }
.list thead .sub { font-weight: 400; }
@media (max-width: 1150px) { .list--klienti .c-pozn { width: 15%; } }
.list--klienti .plan small, .list--klienti .num small { white-space: nowrap; }

/* zkušební režim (e-maily neodcházejí, fakturace jen náhled) */
.flash--warn { background: #fff6dc; border-color: #ecd28a; color: #5c4400; }
.btn--test { border-style: dashed; color: var(--ink-2); background: #fffaf0; }
.test-note { font-size: .85rem; color: #6b5200; background: #fff6dc; border: 1px solid #ecd28a; border-radius: 99px; padding: 3px 10px; }

/* jednotné kompaktní tabulky (všechny seznamy) */
.list--compact { table-layout: fixed; font-size: .9rem; }
.list--compact th, .list--compact td { padding: 8px 10px; }
.list--compact td.date, .list--compact td.num, .list--compact .nowrap { white-space: nowrap; }
.list--compact .name a { display: block; }
.list--compact .ic { color: #8391a2; }
.list--compact .contact .who { font-weight: 500; }
.list--compact .contact .mail { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); text-decoration: none; font-size: .85rem; }
.list--compact .contact .mail:hover { color: var(--blue-ink); text-decoration: underline; }
.list--compact .tag + small { margin-top: 4px; }
.list--rm { min-width: 820px; }
.list--fakt { min-width: 900px; }
.list--fakt .items div { line-height: 1.35; }
.login .remember { display: flex; align-items: center; gap: 8px; font-weight: 400; }
