/* CRM kovacmartin.cz: tokeny a písma převzaté z webu V4 (redesign-v4/src/style.css).
   Zásady webu: vlasové linky, žádné stíny ani ikony, jedno plné tlačítko, hodně prázdného místa. */

@font-face { font-family: 'Mona Sans Variable'; font-style: normal; font-display: swap; font-weight: 250 500; font-stretch: 108%;
  src: url(../fonts/mona-sans-latin-standard-normal.woff2) format('woff2-variations'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Mona Sans Variable'; font-style: normal; font-display: swap; font-weight: 250 500; font-stretch: 108%;
  src: url(../fonts/mona-sans-latin-ext-standard-normal.woff2) format('woff2-variations'); unicode-range: U+0100-017F; }
@font-face { font-family: 'Hanken Grotesk Variable'; font-style: normal; font-display: swap; font-weight: 250 700;
  src: url(../fonts/hanken-grotesk-latin-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Hanken Grotesk Variable'; font-style: normal; font-display: swap; font-weight: 250 700;
  src: url(../fonts/hanken-grotesk-latin-ext-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0100-017F; }
@font-face { font-family: 'Mona Fallback'; src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans');
  size-adjust: 105.26%; ascent-override: 103.55%; descent-override: 30.4%; line-gap-override: 0%; }
@font-face { font-family: 'Hanken Fallback'; src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans');
  size-adjust: 100.69%; ascent-override: 99.31%; descent-override: 30.09%; line-gap-override: 0%; }

:root {
  --paper: #f7f8f7;
  --ink: #15181b;
  --ink-2: #4b5157;
  --ink-3: #8a9096;
  --rule: #d5d9dc;
  --blue: #1f45b5;
  --dark: #17191b;
  --call: #e8ecf4;
  --on-dark: #f1f2f2;
  --btn-bg: var(--ink);
  --btn-hover: #31373c;
  --btn-fg: #fff;
  --ok: #1d6b45;
  --warn: #8a5a00;
  --err: #b3261e;

  --display: 'Mona Sans Variable', 'Mona Fallback', 'Segoe UI', sans-serif;
  --text: 'Hanken Grotesk Variable', 'Hanken Fallback', 'Segoe UI', system-ui, sans-serif;
  --wd: 108%;

  --t-meta: 14px;
  --t-body: 16px;
  --t-h3: 20px;
  --t-h: clamp(24px, 2.4vw, 32px);
  --t-h1: clamp(32px, 4vw, 52px);
  --t-kpi: clamp(26px, 2.6vw, 38px);

  --s-1: 4px; --s-2: 8px; --s-3: 16px; --s-4: 24px; --s-5: 40px; --s-6: 64px;
  --pad: clamp(16px, 4vw, 56px);
  --r-btn: 999px;
  --r: 4px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.25s;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: var(--t-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, .brand__name, .kpi__value { font-family: var(--display); font-stretch: var(--wd); letter-spacing: -.02em; }
h1 { font-size: var(--t-h1); font-weight: 280; line-height: 1.04; letter-spacing: -.03em; margin: 0; }
h2 { font-size: var(--t-h); font-weight: 320; line-height: 1.15; margin: 0 0 var(--s-3); }
h3 { font-size: var(--t-h3); font-weight: 380; line-height: 1.25; margin: 0 0 var(--s-2); }
p { margin: 0 0 var(--s-3); }
.meta { font-size: var(--t-meta); color: var(--ink-2); }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* hlavička */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.top__in { display: flex; align-items: center; gap: var(--s-4); height: 64px; }
.brand { display: inline-flex; align-items: baseline; gap: 10px; text-decoration: none; margin-right: auto; }
.brand__name { font-size: 18px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.brand__app { font-size: var(--t-meta); color: var(--ink-2); }
.nav { display: flex; gap: var(--s-4); overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { position: relative; padding: var(--s-2) 0; font-size: 15px; text-decoration: none; white-space: nowrap; }
.nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.nav a[aria-current]::after, .nav a:hover::after { transform: none; }
.top__user { display: flex; align-items: center; gap: var(--s-3); font-size: var(--t-meta); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: .22em; }
.linkbtn:hover { color: var(--ink); }

.menu-btn, .nav__logout { display: none; }
@media (max-width: 1100px) { .top__user .who { display: none; } }
/* mobil: pruh 60 px (jméno + Menu), panel přes celou obrazovku jako na webu V4 */
@media (max-width: 760px) {
  .top__in { height: 60px; gap: var(--s-3); }
  .brand__name { font-size: 17px; font-weight: 430; }
  .top__user { display: none; }
  .menu-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: -10px; padding: 0 10px;
    border: 0; background: none; color: inherit; font: 500 15px/1 var(--text); letter-spacing: .02em; cursor: pointer; }
  .menu-btn__icon { position: relative; width: 20px; height: 7px; }
  .menu-btn__icon::before, .menu-btn__icon::after { content: ''; position: absolute; left: 0; right: 0; height: 1px; background: currentColor; transition: transform .45s var(--ease); }
  .menu-btn__icon::before { top: 0; }
  .menu-btn__icon::after { bottom: 0; }
  .menu-btn[aria-expanded='true'] .menu-btn__icon::before { transform: translateY(3px) rotate(45deg); }
  .menu-btn[aria-expanded='true'] .menu-btn__icon::after { transform: translateY(-3px) rotate(-45deg); }
  .nav { position: fixed; inset: 61px 0 0; z-index: 9; display: flex; flex-direction: column; gap: 0; overflow-y: auto;
    padding: var(--s-4) var(--pad) calc(var(--s-4) + env(safe-area-inset-bottom)); background: var(--paper);
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .3s var(--ease), visibility 0s linear .3s; }
  .menu-open .nav { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .4s var(--ease), visibility 0s; }
  .menu-open body { overflow: hidden; }
  .nav a { padding: 11px 0 12px; border-top: 1px solid var(--rule); white-space: normal;
    font-family: var(--display); font-stretch: var(--wd); font-weight: 300; font-size: clamp(26px, 8vw, 36px); line-height: 1.1; letter-spacing: -.025em; }
  .nav a:last-of-type { border-bottom: 1px solid var(--rule); }
  .nav a::after { content: none; }
  .nav a[aria-current] { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .16em; }
  .nav__logout { display: block; margin-top: auto; padding-top: var(--s-5); }
  .nav__logout .linkbtn { font-size: var(--t-meta); }
}

/* stránka */
main { padding: var(--s-5) 0 var(--s-6); }
.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-5); }
.head__sub { margin: var(--s-2) 0 0; color: var(--ink-2); }
.head__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.section { margin-top: var(--s-6); }
.section:first-child { margin-top: 0; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); border-bottom: 1px solid var(--ink); padding-bottom: var(--s-2); margin-bottom: 0; }
.section__head h2 { margin: 0; font-size: var(--t-h3); font-weight: 400; }
.cols { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5) clamp(16px, 3vw, 48px); }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.cols > * { min-width: 0; }
@media (max-width: 1000px) { .cols > * { grid-column: span 12; } }

/* KPI: řádek čísel oddělený vlasovými linkami, bez karet */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.kpi { padding: var(--s-4) var(--s-4) var(--s-4) 0; }
.kpi + .kpi { padding-left: var(--s-4); border-left: 1px solid var(--rule); }
.kpi__label { font-size: var(--t-meta); color: var(--ink-2); }
.kpi__value { display: block; font-size: var(--t-kpi); font-weight: 300; line-height: 1.1; margin-top: 6px; white-space: nowrap; }
.kpi__note { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr 1fr; border-top: 0; }
  .kpi, .kpi + .kpi { padding: var(--s-3) var(--s-3) var(--s-3) 0; border-left: 0; border-top: 1px solid var(--rule); }
  .kpi:nth-child(2n) { padding-left: var(--s-3); border-left: 1px solid var(--rule); }
}

/* tabulky a řádkové výpisy */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-2); padding: 10px 12px 8px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table a { text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table .num { padding-right: 0; }
.table-wrap { overflow-x: auto; }
@media (max-width: 640px) {
  .hide-m { display: none; }
  .table { font-size: 14px; }
  .table td, .table th { padding-right: 8px; }
  .head h1 { font-size: 34px; }
}
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: var(--s-3); justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.rows li:last-child { border-bottom: 0; }
.rows .meta { white-space: nowrap; }
.rows .prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { padding: var(--s-4) 0; color: var(--ink-3); }

/* štítky stavu: obrys, bez barevných ploch */
.tag { display: inline-block; padding: 1px 9px; border: 1px solid var(--rule); border-radius: var(--r-btn); font-size: 12.5px; line-height: 1.6; white-space: nowrap; color: var(--ink-2); }
.tag--ink { border-color: var(--ink); color: var(--ink); }
.tag--ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.tag--warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); color: var(--warn); }
.tag--err { border-color: color-mix(in srgb, var(--err) 45%, transparent); color: var(--err); }

/* pipeline: sloupce oddělené linkami */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--ink); }
.board__col { padding: var(--s-3) var(--s-3) var(--s-3) 0; min-width: 0; }
.board__col + .board__col { padding-left: var(--s-3); border-left: 1px solid var(--rule); }
.board__head { display: flex; justify-content: space-between; font-size: var(--t-meta); color: var(--ink-2); margin-bottom: var(--s-2); }
.deal { display: block; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.deal:last-child { border-bottom: 0; }
.deal__title { display: block; font-weight: 500; }
.deal:hover .deal__title { text-decoration: underline; }
@media (max-width: 760px) {
  .board { grid-template-columns: 1fr; }
  .board__col, .board__col + .board__col { padding: var(--s-3) 0; border-left: 0; }
  .board__col + .board__col { border-top: 1px solid var(--rule); }
}

/* tlačítka */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 42px; padding: 0 20px; border: 0; border-radius: var(--r-btn); background: var(--btn-bg); color: var(--btn-fg); font: 500 15px/1 var(--text); text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color var(--t-fast) var(--ease); }
.btn:hover { background: var(--btn-hover); }
.btn:active { background: #000; }
.btn--line { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn--line:hover { background: var(--ink); color: #fff; }
.btn--quiet { background: transparent; color: var(--ink-2); border: 1px solid var(--rule); }
.btn--quiet:hover { background: transparent; border-color: var(--ink-3); color: var(--ink); }
.btn--danger { background: transparent; color: var(--err); border: 1px solid color-mix(in srgb, var(--err) 40%, transparent); }
.btn--danger:hover { background: var(--err); color: #fff; }
.btn--sm { min-height: 34px; padding: 0 14px; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border: 1px solid var(--rule); border-radius: var(--r-btn); font: 500 14px/1 var(--text); text-decoration: none; color: var(--ink); background: transparent; }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-current], .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .count { margin-left: 6px; opacity: .65; }

/* formuláře */
.form { display: grid; gap: var(--s-3) var(--s-4); grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 880px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }
.field label, .label { display: block; margin-bottom: 6px; font-size: var(--t-meta); font-weight: 500; color: var(--ink-2); }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=url], .field input[type=number], .field input[type=date], .field input[type=search], .field input[type=file], .field select, .field textarea, .input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--ink-3); border-radius: var(--r); background: #fff; color: var(--ink); font: 16px/1.4 var(--text); transition: border-color var(--t-fast) var(--ease); }
.field textarea { min-height: 110px; resize: vertical; }
.field textarea.code { min-height: 60vh; font: 14px/1.55 ui-monospace, 'Cascadia Mono', Consolas, monospace; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--ink); outline: none; }
.field .hint { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.field .error { font-size: 13px; color: var(--err); margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.form__actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; padding-top: var(--s-2); }
.inline-form { display: inline; }
.search { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s-4); }
.search .input { max-width: 320px; }

/* hlášky */
.flash { padding: 12px 14px; border-left: 2px solid var(--blue); background: #fff; font-size: 15px; margin-bottom: var(--s-4); }
.flash--err { border-left-color: var(--err); }

/* detail: definiční seznam */
.dl { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; margin: 0; border-top: 1px solid var(--rule); }
.dl dt, .dl dd { padding: 10px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.dl dt { color: var(--ink-2); font-size: var(--t-meta); padding-right: var(--s-3); }
.prose { max-width: 70ch; white-space: pre-wrap; }
@media (max-width: 640px) { .dl { grid-template-columns: 96px 1fr; } }

/* graf návštěvnosti (sloupce z CSS, bez knihovny) */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; border-bottom: 1px solid var(--rule); padding-top: var(--s-2); }
.bars span { flex: 1; background: var(--ink); min-height: 1px; position: relative; }
.bars span:hover { background: var(--blue); }
.bars__axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
/* finanční sloupce: výška = vyfakturováno, tmavá část = zaplaceno */
.fbars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: var(--s-3); border-bottom: 1px solid var(--rule); }
.fbars--thin { height: 120px; }
.fbars__col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.fbars__bar { position: relative; background: var(--call); display: flex; align-items: flex-end; min-height: 1px; }
.fbars__bar > span { display: block; width: 100%; background: var(--ink); }
.fbars__bar--solid { background: var(--ink); }
.fbars__col:hover .fbars__bar > span, .fbars__col:hover .fbars__bar--solid { background: var(--blue); }
.fbars__label { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 4px; transform: translateY(100%); height: 0; }
.fbars { margin-bottom: 18px; }
.meter { height: 4px; background: var(--rule); margin-top: 4px; }
.meter > span { display: block; height: 100%; background: var(--ink); }

/* náhled dokumentu */
.doc { overflow-wrap: anywhere; overflow-x: auto; background: #fff; border: 1px solid var(--rule); padding: clamp(20px, 4vw, 56px); max-width: 860px; }
.doc h1 { font-size: 30px; margin-bottom: var(--s-3); }
.doc h2 { font-size: 22px; margin-top: var(--s-4); }
.doc h3 { font-size: 18px; margin-top: var(--s-3); }
.doc table { border-collapse: collapse; width: 100%; }
.doc td, .doc th { border-bottom: 1px solid var(--rule); padding: 6px 8px 6px 0; text-align: left; vertical-align: top; }
.doc code { background: var(--call); padding: 0 4px; border-radius: 3px; font-size: .92em; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.vars code { font-size: 12.5px; background: var(--call); padding: 2px 6px; border-radius: 3px; }

/* přihlášení */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--pad); }
.login__box { width: 100%; max-width: 420px; }
.login__box h1 { margin-bottom: var(--s-3); }
.login__box .btn { width: 100%; min-height: 52px; margin-top: var(--s-4); }

.foot { padding: var(--s-5) 0; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-3); }

@media print {
  .top, .foot, .head__actions, .no-print { display: none !important; }
  body { background: #fff; }
  .doc { border: 0; padding: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
