/* ACR Czech – kartotéka zákazníků. Paleta a písma převzaté z acrczech.cz:
   ink #14161a / #1d2024, gold #fcc500 / #e0ac00, mist #d9d9d9 / #e8e8e8, red #ed1c24, blue #01579c */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/Inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/Inter-latin.woff2) format("woff2");
  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: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/SpaceGrotesk-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/SpaceGrotesk-latin.woff2) format("woff2");
  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; }
:root {
  --navy: #14161a;          /* ink – velmi tmavě šedá */
  --navy-2: #1d2024;        /* ink-2 */
  --navy-3: #2b2f35;
  --navy-line: rgba(255,255,255,.08);
  --yellow: #fcc500;        /* gold */
  --yellow-2: #e0ac00;      /* gold-dark */
  --yellow-soft: #fff8db;
  --yellow-line: #f3dc80;
  --bg: #f1f1f1;
  --card: #ffffff;
  --line: #dddddd;
  --line-2: #ececec;
  --mist: #d9d9d9;
  --mist-2: #e8e8e8;
  --text: #14161a;
  --text-2: #3b4047;
  --muted: #6e737a;
  --blue: #01579c;
  --blue-soft: #e8f1f9;
  --red: #ed1c24;
  --red-soft: #fdeceb;
  --green: #17895c;
  --green-soft: #e5f6ee;
  --radius: 12px;
  --radius-s: 8px;
  --shadow: 0 1px 2px rgba(20,22,26,.06), 0 3px 12px rgba(20,22,26,.05);
  --shadow-l: 0 10px 40px rgba(20,22,26,.2);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --head: "Space Grotesk", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --side: 248px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- boot / login ---------- */
.boot { height: 100vh; display: grid; place-items: center; background: var(--navy); }
.boot-logo { color: #fff; font-weight: 800; font-size: 28px; letter-spacing: .08em; }
.boot-logo span { color: var(--yellow); margin-left: 6px; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--navy); }
.login-brand { position: relative; overflow: hidden; color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-brand::before { content: ""; position: absolute; inset: -20% -40% auto auto; width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,204,0,.22), rgba(255,204,0,0) 60%); }
.login-brand .cards { position: absolute; right: 8%; bottom: 14%; width: 340px; height: 230px; }
.login-brand .cards div { position: absolute; inset: 0; border-radius: 14px; background: #fffdf5; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.login-brand .cards div:nth-child(1) { transform: rotate(-8deg) translate(-30px, 10px); background: #f5efd9; }
.login-brand .cards div:nth-child(2) { transform: rotate(-3deg) translate(-12px, 4px); background: #faf5e3; }
.login-brand .cards div:nth-child(3) { padding: 22px; }
.login-brand .cards div:nth-child(3)::before { content: ""; display: block; height: 14px; width: 60%; background: var(--navy); border-radius: 4px; margin-bottom: 18px; }
.login-brand .cards div:nth-child(3)::after { content: ""; display: block; height: 120px; background:
  repeating-linear-gradient(#0000 0 22px, #d9d2b8 22px 23px); }
.logo { font-weight: 800; letter-spacing: .1em; font-size: 22px; display: flex; align-items: center; gap: 10px; }
.logo b { color: var(--yellow); }
.logo-mark { width: 38px; height: 34px; border-radius: 9px; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-weight: 900; font-size: 12px; letter-spacing: .02em; flex: none; text-decoration: none !important; }
.login-brand h1 { font-size: 44px; line-height: 1.08; margin: 0 0 16px; max-width: 12ch; letter-spacing: -.02em; }
.login-brand p { color: #b9c6d6; max-width: 40ch; margin: 0; }
.login-brand .foot { color: #7f91a8; font-size: 13px; position: relative; }
.login-panel { background: var(--bg); display: grid; place-items: center; padding: 32px; }
.login-box { width: 100%; max-width: 400px; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-l); padding: 36px; }
.login-box h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.01em; }
.login-box .sub { color: var(--muted); margin: 0 0 26px; }
.qr { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0 12px; }
.qr svg { width: 200px; height: 200px; }
.secret { font-family: var(--mono); font-size: 13px; background: var(--line-2); padding: 8px 10px; border-radius: 8px; word-break: break-all; text-align: center; }
.steps { padding-left: 20px; color: var(--text-2); margin: 0 0 8px; font-size: 14px; }
.code-input { font-family: var(--mono); font-size: 30px !important; letter-spacing: .4em; text-align: center; padding: 12px !important; }

/* ---------- formuláře ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span, .lbl { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; letter-spacing: .01em; }
.input, .field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); background: #fff; border-radius: var(--radius-s); padding: 10px 12px; outline: none;
  transition: border-color .15s, box-shadow .15s; }
.field textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--navy-3); box-shadow: 0 0 0 4px rgba(28,54,83,.12); }
.field.ocr input, .field.ocr textarea { border-color: var(--yellow-2); background: var(--yellow-soft); }
.field.low input, .field.low textarea { border-color: #e39a3b; background: #fff3e4; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.err { color: var(--red); font-size: 13.5px; margin: -4px 0 12px; min-height: 0; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }

/* ---------- tlačítka ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 10px 16px;
  font-weight: 650; cursor: pointer; background: var(--line-2); color: var(--text); white-space: nowrap; transition: background .15s, transform .05s, box-shadow .15s; text-decoration: none !important; }
.btn:hover { background: #e3e8ee; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-3); }
.btn.accent { background: var(--yellow); color: var(--navy); }
.btn.accent:hover { background: var(--yellow-2); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { background: var(--red-soft); color: var(--red); }
.btn.danger:hover { background: #f8d9d9; }
.btn.block { width: 100%; padding: 13px; font-size: 16px; }
.btn.sm { padding: 6px 10px; font-size: 13.5px; border-radius: 8px; }
.btn.icon { padding: 8px; }
.spin { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #c9d4e2; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 20px 14px; }
.side .logo { color: #fff; padding: 4px 8px 22px; font-size: 17px; }
.side .logo small { display: block; font-size: 11px; letter-spacing: .14em; color: #7f91a8; font-weight: 600; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9d4e2; font-weight: 550; text-decoration: none; position: relative; }
.nav a:hover { background: var(--navy-2); color: #fff; }
.nav a.on { background: var(--navy-3); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.nav .count { margin-left: auto; font-size: 12px; background: rgba(255,255,255,.1); padding: 1px 8px; border-radius: 20px; }
.nav .count.warn { background: var(--yellow); color: var(--navy); font-weight: 700; }
.nav-sep { height: 1px; background: var(--navy-line); margin: 12px 8px; }
.side .cta { margin: 6px 0 14px; }
.side .me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--navy-line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-weight: 800; flex: none; }
.me .who { line-height: 1.2; min-width: 0; }
.me .who b { color: #fff; display: block; font-size: 14px; }
.me .who small { color: #7f91a8; font-size: 12px; }
.me .btn { margin-left: auto; color: #9fb0c4; background: transparent; }
.me .btn:hover { background: var(--navy-2); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; background: rgba(242,244,247,.9); backdrop-filter: blur(10px); padding: 14px 28px; display: flex; gap: 14px; align-items: center; border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.search { position: relative; flex: 1; max-width: 720px; }
.search svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 46px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; padding: 0 90px 0 44px; outline: none; font-size: 15.5px; box-shadow: var(--shadow); }
.search input:focus { border-color: var(--navy-3); box-shadow: 0 0 0 4px rgba(28,54,83,.12); }
.search kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
kbd { font: 600 11.5px var(--mono); color: var(--muted); background: var(--line-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
.suggest { position: absolute; left: 0; right: 0; top: 52px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-l); border: 1px solid var(--line); overflow: hidden; max-height: 70vh; overflow-y: auto; }
.suggest a { display: flex; gap: 12px; align-items: center; padding: 10px 14px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.suggest a.on, .suggest a:hover { background: var(--yellow-soft); }
.suggest .more { justify-content: center; color: var(--blue); font-weight: 600; }
.content { padding: 8px 28px 60px; max-width: 1400px; width: 100%; }

/* ---------- typografie stránek ---------- */
.page-h { display: flex; align-items: flex-end; gap: 16px; margin: 14px 0 20px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; line-height: 1.15; }
.page-h .sub { color: var(--muted); margin-top: 4px; }
.page-h .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .93em; }

/* ---------- dashboard ---------- */
.hero { background: var(--navy); color: #fff; border-radius: 20px; padding: 28px 30px; display: flex; gap: 24px; align-items: center; position: relative; overflow: hidden; margin-bottom: 20px; }
.hero::after { content: ""; position: absolute; right: -80px; top: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(255,204,0,.25), rgba(255,204,0,0) 65%); }
.hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.02em; }
.hero p { margin: 0; color: #b9c6d6; }
.hero .actions { margin-left: auto; display: flex; gap: 10px; position: relative; z-index: 1; flex-wrap: wrap; }
.hero .btn:not(.accent) { background: rgba(255,255,255,.1); color: #fff; }
.hero .btn:not(.accent):hover { background: rgba(255,255,255,.18); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); text-decoration: none !important; color: var(--text); display: block; border: 1.5px solid transparent; transition: border-color .15s, transform .15s; }
a.stat:hover { border-color: var(--yellow); transform: translateY(-1px); }
.stat .n { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat .t { color: var(--muted); font-size: 13.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.stat.warn .n { color: #b07b00; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.panel > h2, .panel-h h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 14px; font-weight: 700; }
.panel-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-h h2 { margin: 0; }
.panel-h .btn { margin-left: auto; }
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.letters-big { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.letters-big a { aspect-ratio: 1; border-radius: 12px; background: var(--line-2); display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--text); font-weight: 800; font-size: 20px; transition: background .15s, transform .1s; border: 1.5px solid transparent; }
.letters-big a small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.letters-big a:hover { background: var(--yellow-soft); border-color: var(--yellow); transform: translateY(-1px); }
.letters-big a.empty { opacity: .35; pointer-events: none; }
.feed a { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none; }
.feed a:last-child { border-bottom: 0; }
.feed a:hover .nm { color: var(--blue); }
.feed .nm { font-weight: 600; }
.feed small { color: var(--muted); display: block; font-size: 12.5px; }

/* ---------- kartotéka ---------- */
.tabs-az { position: sticky; top: 74px; z-index: 10; display: flex; gap: 4px; overflow-x: auto; padding: 8px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 14px; scrollbar-width: thin; }
.tabs-az a { min-width: 38px; height: 38px; padding: 0 8px; border-radius: 9px; display: grid; place-items: center; font-weight: 750; color: var(--text-2); text-decoration: none; flex: none; position: relative; }
.tabs-az a:hover { background: var(--line-2); }
.tabs-az a.on { background: var(--navy); color: #fff; }
.tabs-az a.on::after { content: ""; position: absolute; bottom: -8px; left: 30%; right: 30%; height: 3px; background: var(--yellow); border-radius: 3px; }
.tabs-az a.empty { color: #c3ccd6; pointer-events: none; }
.tabs-az a.all { padding: 0 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1.5px solid var(--line); background: #fff; border-radius: 30px; padding: 6px 14px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; text-decoration: none !important; }
.chip:hover { border-color: var(--navy-3); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip .c { font-size: 12px; opacity: .7; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-head, .item { display: grid; grid-template-columns: 44px minmax(220px, 2.2fr) 110px minmax(120px, 1fr) minmax(170px, 1.3fr) 150px; gap: 14px; align-items: center; padding: 0 18px; }
.list-head { height: 40px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); background: #fafbfc; }
.item { min-height: 64px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-2); color: var(--text); text-decoration: none !important; cursor: pointer; transition: background .1s; }
.item:last-child { border-bottom: 0; }
.item:hover, .item.kb { background: #f8fafc; }
.item.kb { box-shadow: inset 4px 0 0 var(--yellow); }
.item .nm { font-weight: 650; line-height: 1.3; }
.item .nm small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .cell { color: var(--text-2); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .cell small { display: block; color: var(--muted); font-size: 12.5px; }
.tile { width: 40px; height: 40px; border-radius: 10px; background: var(--line-2); display: grid; place-items: center; font-weight: 800; color: var(--navy-3); font-size: 15px; }
.item.has-alert .tile { background: var(--yellow); color: var(--navy); }
.badges { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--line-2); color: var(--text-2); white-space: nowrap; }
.badge.y { background: var(--yellow-soft); color: #8a6400; }
.badge.r { background: var(--red-soft); color: var(--red); }
.badge.g { background: var(--green-soft); color: var(--green); }
.badge.n { background: var(--navy); color: #fff; }
.badge svg.i { width: 13px; height: 13px; }
mark { background: #ffe680; color: inherit; border-radius: 3px; padding: 0 1px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .big { font-size: 46px; margin-bottom: 4px; }
.empty-state h3 { color: var(--text); margin: 0 0 6px; }
.letter-sep { padding: 8px 18px; background: #fafbfc; font-weight: 800; color: var(--navy-3); border-bottom: 1px solid var(--line-2); font-size: 13px; letter-spacing: .06em; }

/* ---------- detail karty ---------- */
.card-head { display: flex; gap: 18px; align-items: flex-start; margin: 14px 0 18px; flex-wrap: wrap; }
.card-head .tile { width: 58px; height: 58px; font-size: 22px; border-radius: 14px; background: var(--navy); color: var(--yellow); }
.card-head h1 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.02em; line-height: 1.15; }
.ids { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.idchip { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; background: #fff; border: 1.5px solid var(--line); border-radius: 8px; padding: 3px 10px; cursor: pointer; color: var(--text-2); }
.idchip b { font-family: var(--mono); color: var(--text); font-weight: 600; }
.idchip:hover { border-color: var(--navy-3); }
.idchip svg.i { width: 14px; height: 14px; color: var(--muted); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.alert { display: flex; gap: 14px; background: var(--yellow-soft); border: 1.5px solid var(--yellow-line); border-left: 6px solid var(--yellow); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.alert svg.i { color: #b07b00; width: 22px; height: 22px; margin-top: 1px; }
.alert b { display: block; margin-bottom: 2px; }
.alert .txt { white-space: pre-line; }
.alert.r { background: var(--red-soft); border-color: #f2c4c4; border-left-color: var(--red); }
.alert.r svg.i { color: var(--red); }
.kgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.sect { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sect-h { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--navy); color: #fff; font-weight: 700; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; }
.sect-h svg.i { color: var(--yellow); width: 16px; height: 16px; }
.sect-h .btn { margin-left: auto; background: rgba(255,255,255,.12); color: #fff; letter-spacing: 0; text-transform: none; }
.sect-b { padding: 16px 18px; }
.sect.full { grid-column: 1 / -1; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; }
.kv dt { color: var(--muted); font-size: 13.5px; font-weight: 550; }
.kv dd { margin: 0; font-weight: 550; white-space: pre-line; min-width: 0; overflow-wrap: anywhere; }
.addr { white-space: pre-line; font-weight: 550; line-height: 1.55; }
.none { color: #a5b1bf; font-style: italic; font-weight: 400; }
.people { width: 100%; border-collapse: collapse; }
.people td, .people th { padding: 9px 8px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
.people th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.people tr:last-child td { border-bottom: 0; }
.people td:first-child, .people th:first-child { padding-left: 0; }
.tel { font-family: var(--mono); white-space: nowrap; font-weight: 600; }
.emails { display: flex; flex-direction: column; gap: 6px; }
.emails a { display: inline-flex; gap: 8px; align-items: center; font-weight: 550; overflow-wrap: anywhere; }
.pl { width: 100%; border-collapse: collapse; font-size: 14px; }
.pl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); font-weight: 700; }
.pl td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.pl tr.note td { color: var(--muted); font-style: italic; }
.pl-wrap { overflow-x: auto; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photos .ph { aspect-ratio: 4/3; border-radius: 10px; overflow: hidden; background: var(--line-2); position: relative; cursor: zoom-in; border: 0; padding: 0; }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.history { font-size: 13.5px; }
.history li { padding: 8px 0; border-bottom: 1px solid var(--line-2); list-style: none; }
.history ul { padding: 0; margin: 0; }
.history .ch { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.history .ch del { color: var(--red); text-decoration: line-through; }
.history .ch ins { color: var(--green); text-decoration: none; }
.meta-line { color: var(--muted); font-size: 13px; margin-top: 18px; }

/* ---------- editace ---------- */
.edit-bar { position: sticky; bottom: 0; z-index: 15; margin: 18px -28px -60px; padding: 14px 28px; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.edit-bar .st { color: var(--muted); font-size: 13.5px; }
.edit-bar .st.dirty { color: #b07b00; font-weight: 600; }
.edit-bar .btn.primary { margin-left: auto; }
.edit-bar.inline { margin: 18px 0 0; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.crow { display: grid; grid-template-columns: 1fr 1.3fr 1fr 1.3fr 36px; gap: 8px; margin-bottom: 8px; align-items: center; }
.crow input { width: 100%; border: 1.5px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; min-width: 0; }
.crow input:focus { border-color: var(--navy-3); }
.crow.head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.plrow { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(90px, 1fr)) 36px; gap: 6px; margin-bottom: 6px; }
.plrow input { width: 100%; border: 1.5px solid var(--line); border-radius: 7px; padding: 6px 8px; outline: none; font-size: 13.5px; min-width: 0; }
.plrow input:focus { border-color: var(--navy-3); }
.dup { background: var(--yellow-soft); border: 1.5px solid var(--yellow-line); border-radius: 10px; padding: 10px 14px; margin: -4px 0 14px; font-size: 14px; }
.dup a { font-weight: 650; }
.ares-box { background: #eef5ff; border: 1.5px solid #cfe0f8; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; font-size: 14px; }
.ares-box b { display: block; }
.ares-box .addr { font-weight: 450; }
.ico-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.ico-row .btn { height: 44px; margin-bottom: 14px; }

/* ---------- OCR ---------- */
.drop { border: 2.5px dashed #c5cfdb; border-radius: 20px; background: #fff; padding: 56px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--yellow-2); background: var(--yellow-soft); }
.drop .ic { width: 74px; height: 74px; border-radius: 20px; background: var(--navy); color: var(--yellow); display: grid; place-items: center; margin: 0 auto 16px; }
.drop .ic svg.i { width: 36px; height: 36px; }
.drop h3 { margin: 0 0 6px; font-size: 20px; }
.drop p { margin: 0 0 18px; color: var(--muted); }
.tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.tips div { background: #fff; border-radius: 14px; padding: 16px; box-shadow: var(--shadow); font-size: 14px; color: var(--text-2); }
.tips b { display: block; color: var(--text); margin-bottom: 2px; }
.ocr-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
.ocr-photo { position: sticky; top: 84px; }
.viewer { background: #1a2a3c; border-radius: 16px; overflow: hidden; position: relative; height: calc(100vh - 290px); min-height: 320px; cursor: grab; touch-action: none; }
.viewer img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; max-width: none; }
.viewer .zoom { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.viewer .zoom .btn { background: rgba(255,255,255,.92); }
.lines { margin-top: 12px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); max-height: 230px; overflow-y: auto; }
.lines button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-2); padding: 8px 14px; cursor: pointer; font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.lines button:hover { background: var(--yellow-soft); color: var(--text); }
.lines .h { position: sticky; top: 0; background: #fafbfc; padding: 8px 14px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; border-bottom: 1px solid var(--line); }
.queue { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.queue .q { width: 46px; height: 46px; border-radius: 9px; overflow: hidden; border: 2.5px solid transparent; opacity: .55; flex: none; }
.queue .q.on { border-color: var(--yellow); opacity: 1; }
.queue .q.done { opacity: 1; position: relative; }
.queue .q.done::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(23,137,92,.7); color: #fff; font-weight: 800; }
.queue .q img { width: 100%; height: 100%; object-fit: cover; }
.processing { display: grid; place-items: center; text-align: center; padding: 80px 20px; }
.processing .spin { width: 42px; height: 42px; border-width: 4px; color: var(--navy); margin-bottom: 16px; }
.pop { position: fixed; z-index: 60; background: #fff; border-radius: 12px; box-shadow: var(--shadow-l); border: 1px solid var(--line); padding: 8px; display: grid; gap: 2px; min-width: 220px; }
.pop .t { font-size: 12px; color: var(--muted); padding: 4px 8px 6px; font-weight: 650; }
.pop button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 550; }
.pop button:hover { background: var(--yellow-soft); }

/* ---------- správa ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 12px; border-bottom: 2px solid var(--line); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.flagline { display: flex; gap: 8px; align-items: flex-start; color: #8a4b00; font-size: 14px; margin-top: 4px; }

/* ---------- toasty, modály ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-l); display: flex; gap: 10px; align-items: center; max-width: 420px; animation: tin .2s ease-out; font-weight: 550; }
.toast.err { background: var(--red); }
.toast.ok svg.i { color: var(--yellow); }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
.modal-bg { position: fixed; inset: 0; background: rgba(11,26,43,.55); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fin .15s; }
@keyframes fin { from { opacity: 0; } }
.modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-l); width: 100%; max-width: 460px; padding: 26px; max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 8px; font-size: 20px; }
.modal p { color: var(--text-2); margin: 0 0 20px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5,12,20,.92); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.skel { background: linear-gradient(90deg, #eef1f5 25%, #f6f8fa 50%, #eef1f5 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- mobil ---------- */
.mnav { display: none; }
.m-only { display: none !important; }
@media (max-width: 1180px) {
  .list-head, .item { grid-template-columns: 44px minmax(180px, 2fr) 100px minmax(160px, 1.3fr) 130px; }
  .list-head > :nth-child(4), .item > :nth-child(4) { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .dash-grid, .kgrid, .ocr-layout { grid-template-columns: 1fr; }
  .ocr-photo { position: static; }
  .viewer { height: 52vh; }
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}
@media (max-width: 760px) {
  :root { --side: 0px; }
  body { font-size: 15.5px; }
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 10px 14px; }
  .m-only { display: grid !important; }
  .hide-m { display: none; }
  .search kbd { display: none; }
  .content { padding: 4px 14px 96px; }
  .mnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--navy); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .mnav a { color: #9fb0c4; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 10px; text-decoration: none; position: relative; }
  .mnav a.on { color: #fff; }
  .mnav a.on svg.i { color: var(--yellow); }
  .mnav a.cam { background: var(--yellow); color: var(--navy); padding: 8px 16px; margin-top: -18px; border-radius: 16px; box-shadow: 0 6px 16px rgba(0,0,0,.3); }
  .mnav svg.i { width: 22px; height: 22px; }
  .tabs-az { top: 66px; }
  .list-head { display: none; }
  .item { grid-template-columns: 40px 1fr auto; gap: 12px; padding: 10px 14px; }
  .item > :nth-child(3), .item > :nth-child(4), .item > :nth-child(5) { display: none; }
  .item .badges { max-width: 110px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero .actions { margin-left: 0; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat .n { font-size: 26px; }
  .page-h h1, .card-head h1 { font-size: 23px; }
  .card-head .actions { margin-left: 0; width: 100%; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .grid2, .ico-row { grid-template-columns: 1fr; }
  .crow { grid-template-columns: 1fr 1fr; }
  .crow.head { display: none; }
  .crow .btn { grid-column: 2; justify-self: end; }
  .edit-bar.inline { margin: 14px 0 0; padding: 12px 14px; bottom: 70px; }
  .edit-bar { margin: 18px -14px -96px; padding: 12px 14px calc(70px + env(safe-area-inset-bottom)); }
  .tips { grid-template-columns: 1fr; }
  #toasts { left: 14px; right: 14px; bottom: 84px; align-items: stretch; }
}
@media print {
  .side, .top, .mnav, .actions, .edit-bar, .sect-h .btn { display: none !important; }
  .shell { display: block; }
  .sect { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .sect-h { background: #eee !important; color: #000 !important; }
}


/* ================= ACR brand v2 (logo, písma, šedé pásy jako na papírové kartě) ================= */
h1, h2, h3, .stat .n, .letters-big a, .tabs-az a, .tile, .logo, .hero h1, .login-box h2, .page-h h1, .card-head h1, .modal h3, .drop h3 { font-family: var(--head); }
h1, .page-h h1, .card-head h1 { letter-spacing: -.015em; font-weight: 700; }
.boot { background: var(--navy); }
.boot-logo img { height: 64px; }
/* boční panel */
.side { background: var(--navy); border-right: 1px solid #000; }
.side .logo { flex-direction: column; align-items: flex-start; gap: 6px; padding: 6px 8px 22px; text-decoration: none; }
.side .logo img { height: 60px; width: auto; display: block; margin-left: -2px; }
.side .logo small { font-family: var(--font); font-size: 10.5px; letter-spacing: .2em; color: #8b9098; font-weight: 600; }
.side .cta { box-shadow: 0 4px 14px rgba(252,197,0,.18); }
.nav a { color: #c7cad0; }
.nav a:hover { background: var(--navy-2); }
.nav a.on { background: var(--navy-3); }
.nav .count { background: rgba(255,255,255,.08); }
.nav .count.warn { background: var(--red); color: #fff; }
.me .who small, .side .logo small { color: #8b9098; }
/* horní lišta – logo jen na mobilu */
.top { background: rgba(241,241,241,.9); }
.top-logo img { height: 30px; display: block; }
.search input:focus, .input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(252,197,0,.28); }
/* hero na přehledu: tmavá + jemná žlutá + červené "buňky" z loga */
.hero { background: var(--navy); background-image: linear-gradient(115deg, var(--navy) 55%, var(--navy-2)); }
.hero::after { background: radial-gradient(circle, rgba(252,197,0,.18), rgba(252,197,0,0) 65%); }
.hero::before { content: ""; position: absolute; right: 26px; top: 18px; width: 64px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--red) 0 30%, transparent 30% 38%, var(--red) 38% 62%, transparent 62% 70%, var(--yellow) 70%); opacity: .9; }
.hero .btn:not(.accent) { background: rgba(255,255,255,.08); }
/* sekce karty – šedý pás jako na papírové kartě, žlutý akcent */
.sect { border: 1px solid var(--line); box-shadow: none; }
.sect-h { background: var(--mist-2); color: var(--text); border-bottom: 1px solid var(--line); box-shadow: inset 4px 0 0 var(--yellow); font-family: var(--head); letter-spacing: .08em; font-size: 12.5px; }
.sect-h svg.i { color: var(--text-2); }
.sect-h .btn { background: #fff; color: var(--text); border: 1px solid var(--line); }
.sect-h .btn:hover { background: var(--yellow-soft); }
.panel, .stat, .list, .tabs-az { border: 1px solid var(--line); box-shadow: none; }
.panel > h2, .panel-h h2 { font-family: var(--head); color: var(--text-2); }
.stat .n { font-weight: 700; }
a.stat:hover { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(252,197,0,.18); }
.stat.warn .n { color: var(--red); }
.list-head { background: var(--mist-2); color: var(--text-2); }
.letter-sep { background: #f7f7f7; color: var(--text); border-left: 4px solid var(--yellow); }
.tile { background: var(--mist-2); color: var(--text); }
.item.has-alert .tile { background: var(--yellow); color: var(--navy); }
.item.kb { box-shadow: inset 4px 0 0 var(--yellow); }
.letters-big a { background: var(--mist-2); }
.letters-big a:hover { background: var(--yellow); border-color: var(--yellow); }
.tabs-az a.on { background: var(--navy); color: var(--yellow); }
.tabs-az a.on::after { background: var(--yellow); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.card-head .tile { background: var(--navy); color: var(--yellow); }
/* detaily: modrá = odkazy/telefon/ARES, červená = upozornění a kontrola */
a, .tel, .emails a { color: var(--blue); }
.idchip:hover { border-color: var(--blue); }
.ares-box { background: var(--blue-soft); border-color: #c4dbef; }
.alert { background: var(--yellow-soft); border-color: var(--yellow-line); border-left-color: var(--yellow); }
.alert svg.i { color: #9a7400; }
.alert.r { background: var(--red-soft); border-color: #f6c3c1; border-left-color: var(--red); }
.alert.r svg.i { color: var(--red); }
.badge.r { background: var(--red-soft); color: #c4161d; }
.badge.y { background: var(--yellow-soft); color: #8a6a00; }
.badge.n { background: var(--navy); color: var(--yellow); }
.badge.g { background: var(--blue-soft); color: var(--blue); }
.flagline { color: #c4161d; }
mark { background: #ffe066; }
.btn.danger { color: #c4161d; }
.history .ch del { color: #c4161d; }
.drop .ic { background: var(--navy); color: var(--yellow); }
.drop:hover, .drop.over { border-color: var(--yellow); }
.viewer { background: var(--navy-2); }
/* přihlášení */
.login { background: var(--navy); }
.login-brand::before { background: radial-gradient(circle at 30% 30%, rgba(252,197,0,.18), rgba(252,197,0,0) 60%); }
.login-brand .brand-logo img { height: 70px; display: block; }
.login-brand h1 { font-family: var(--head); }
.login-brand p, .login-brand .foot { color: #a3a8b0; }
.login-brand .cards div:nth-child(3)::before { background: var(--navy); box-shadow: 0 22px 0 -2px var(--mist), 0 26px 0 -2px var(--mist); }
.login-logo { display: none; height: 44px; margin-bottom: 18px; }
.mnav { background: var(--navy); }
.mnav a.cam { background: var(--yellow); color: var(--navy); }
.print-logo { display: none; }
@media (max-width: 960px) { .login-logo { display: block; } }
@media print {
  .print-logo { display: block; height: 42px; margin-bottom: 10px; }
  .sect-h { background: #eee !important; color: #000 !important; box-shadow: inset 4px 0 0 #fcc500 !important; }
}

.login-brand .cards { top: 16%; bottom: auto; right: 9%; width: 300px; height: 200px; }
.login-brand > div:nth-child(2) { position: relative; z-index: 1; }
.pl th.num, .pl td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-head { display: grid; grid-template-columns: repeat(var(--cols, 7), minmax(90px, 1fr)) 36px; gap: 6px; margin-bottom: 4px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ================= v3: ACR modrá → černá + patička MalbarDesign ================= */
.side { background: linear-gradient(180deg, #01579c 0%, #023f72 16%, #0f1f33 42%, #14161a 66%, #050506 100%); border-right: 0; }
.nav a { color: #d3dbe5; }
.nav a:hover { background: rgba(255,255,255,.08); }
.nav a.on { background: rgba(255,255,255,.13); }
.nav .count { background: rgba(255,255,255,.12); }
.nav-sep, .side .me { border-color: rgba(255,255,255,.1); }
.nav-sep { background: rgba(255,255,255,.1); }
.side .logo small { color: #b9c9dc; }
.credit { display: flex; flex-direction: column; gap: 7px; padding: 12px 8px 2px; margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; line-height: 1.35; color: #8b9098; }
.credit .heart { color: var(--red); font-size: 13px; }
.credit a { display: inline-block; line-height: 0; opacity: .9; transition: opacity .15s; }
.credit a:hover { opacity: 1; }
.credit img { height: 17px; width: auto; display: block; }
.login-brand { background: linear-gradient(160deg, #01579c 0%, #0a2d52 30%, #14161a 62%, #050506 100%); }
.login-brand::before { background: radial-gradient(circle at 30% 30%, rgba(252,197,0,.14), rgba(252,197,0,0) 60%); }
.login-brand .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.login-brand .foot .credit { border: 0; padding: 0; margin: 0; align-items: flex-start; }
.login-brand .foot .credit img { height: 20px; }
.m-credit { display: none; }
@media (max-width: 960px) {
  .login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: linear-gradient(180deg, var(--bg) 60%, #e3e3e3); }
  .login-panel .m-credit { display: block; }
  .login-panel .m-credit .credit { background: var(--navy); border-radius: 12px; padding: 12px 16px; align-items: center; text-align: center; border: 0; margin: 0; }
}
@media (max-width: 760px) {
  .content .m-credit { display: block; margin: 26px 0 8px; }
  .content .m-credit .credit { background: linear-gradient(135deg, #01579c, #14161a 70%); border-radius: 14px; padding: 14px 16px; align-items: center; text-align: center; border: 0; margin: 0; color: #c9d4e2; }
}
@media print { .credit, .m-credit { display: none !important; } }
