/* Klíče: vizuál převzatý z CRM crm.kovacmartin.cz (public/css/app.css).
   Vlasové linky, žádné stíny ani ikony, pilulková tlačítka, jedno plné tlačítko na obrazovce. */

@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;
  --call: #e8ecf4;
  --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;
  --mono: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --wd: 108%;

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

  --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; }
[hidden] { display: none !important; }
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 { 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; overflow-wrap: anywhere; }
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; }
p { margin: 0 0 var(--s-3); }
.meta { font-size: var(--t-meta); color: var(--ink-2); }
.muted { color: var(--ink-3); }
.code { font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 var(--pad); }

/* hlavička */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); }
.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); }
.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; min-height: 44px; }
.linkbtn:hover { color: var(--ink); }

.menu-btn, .nav__logout { display: none; }
/* mobil: pruh 60 px (jméno + Menu), panel přes celou obrazovku jako v CRM */
@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: calc(61px + env(safe-area-inset-top)) 0 0; z-index: 9; 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); font-size: var(--t-meta); }
  .nav__logout .who { display: block; color: var(--ink-3); }
}

/* stránka */
main { padding: var(--s-5) 0 var(--s-6); }
.head { margin-bottom: var(--s-5); }
.head__sub { margin: var(--s-2) 0 0; color: var(--ink-2); }
.head__tags { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: var(--s-3); }
.back { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: var(--s-2); font-size: var(--t-meta); color: var(--ink-2); }
.section { margin-top: var(--s-5); }
.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; }
@media (max-width: 640px) { .head h1 { font-size: 34px; } main { padding-top: var(--s-4); } }

/* řádkové výpisy */
.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 { overflow-wrap: anywhere; }
.row-link { display: flex; flex-wrap: wrap; gap: 4px var(--s-3); justify-content: space-between; align-items: baseline; width: 100%; min-height: 44px; text-decoration: none; }
.row-link:hover .row-link__title { text-decoration: underline; }
.row-link__title { font-weight: 500; display: block; }
.row-link__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { padding: var(--s-4) 0; color: var(--ink-3); }

/* položka klíče v detailu */
.rows > li.entry { display: block; padding: var(--s-3) 0; }
.entry__head { display: flex; flex-wrap: wrap; gap: 4px var(--s-2); align-items: baseline; justify-content: space-between; }
.entry__label { font-weight: 500; }
.entry__desc { margin: 4px 0 0; font-size: var(--t-meta); color: var(--ink-2); }
.members { list-style: none; margin: var(--s-3) 0 0; padding: 0; border-top: 1px solid var(--rule); }
.member { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.state { display: flex; flex-wrap: wrap; gap: 4px var(--s-2); align-items: baseline; margin-top: var(--s-2); font-size: 15px; }
.state__value { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; margin-top: var(--s-2); }
.editor { margin-top: var(--s-3); padding: var(--s-3); border: 1px solid var(--rule); border-radius: var(--r); background: #fff; display: grid; gap: var(--s-3); }
.pw { display: flex; gap: var(--s-2); }
.pw .input { flex: 1; min-width: 0; }
.names { display: flex; flex-wrap: wrap; gap: 6px; padding: var(--s-3) 0; }
.names code { font-family: var(--mono); font-size: 12.5px; background: var(--call); padding: 2px 6px; border-radius: 3px; }

/* š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); }

/* tlačítka */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6em; min-height: 44px; 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:disabled { opacity: .45; cursor: not-allowed; }
.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 { padding: 0 14px; font-size: 14px; }
.btn--line:disabled:hover, .btn--quiet:disabled:hover, .btn--danger:disabled:hover { background: transparent; color: inherit; }

/* formuláře */
.field label, .label { display: block; margin-bottom: 6px; font-size: var(--t-meta); font-weight: 500; color: var(--ink-2); }
.input { width: 100%; min-height: 44px; 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); }
.input--mono { font-family: var(--mono); font-size: 15px; }
.input:focus { border-color: var(--ink); outline: none; }
.input[aria-invalid='true'] { border-color: var(--err); }
.field .hint { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.field .error { font-size: 13px; color: var(--err); margin-top: 4px; }
.form__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }

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

/* průběh nasazení */
.log { margin: var(--s-3) 0 0; padding: var(--s-3); max-height: 50vh; overflow: auto; background: #fff; border: 1px solid var(--rule); border-radius: var(--r);
  font: 12.5px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }

/* spodní lišta rozpracovaných změn */
.bar { position: sticky; bottom: 0; z-index: 8; border-top: 1px solid var(--ink); background: var(--paper); padding-bottom: env(safe-area-inset-bottom); }
.bar__in { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding-top: 10px; padding-bottom: 10px; }
.bar__count { margin-right: auto; font-weight: 500; }

/* potvrzovací dialog */
.dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: var(--s-4); border: 1px solid var(--ink); border-radius: var(--r); background: var(--paper); color: var(--ink); }
.dialog::backdrop { background: rgba(21, 24, 27, .45); }
.dialog h2 { font-size: var(--t-h3); font-weight: 400; }
.dialog .rows { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: var(--s-3); }
.dialog .rows > li { padding: 8px 0; }
.dialog .form__actions { justify-content: flex-end; }

/* 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); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
