/* CRM jádro: vzhled „liquid glass“. Bez externích zdrojů a bez inline stylů (CSP). Světlý a tmavý režim: prefers-color-scheme + ruční volba (atribut data-theme na <html>). */
:root {
  color-scheme: light;
  --fg: #14203a; --muted: #4b5a76; --line: rgba(60, 80, 130, .16); --bg: #f4f6fd; --soft: rgba(255, 255, 255, .55);
  --accent: #1f56c8; --bad: #b3261e; --ok: #14703f; --warn: #8a5300;
  --page: radial-gradient(900px 600px at 8% 0%, rgba(120, 160, 255, .45), transparent 60%), radial-gradient(800px 600px at 100% 10%, rgba(190, 150, 255, .40), transparent 60%), radial-gradient(900px 700px at 60% 100%, rgba(120, 210, 255, .35), transparent 60%), linear-gradient(135deg, #eaf0ff 0%, #f1ecff 50%, #e7f2ff 100%);
  --glass: rgba(255, 255, 255, .58); --glass-strong: rgba(255, 255, 255, .78); --glass-edge: rgba(255, 255, 255, .85);
  --shadow: 0 10px 34px rgba(40, 60, 130, .13), 0 1px 0 rgba(255, 255, 255, .9) inset;
  --shadow-sm: 0 4px 16px rgba(40, 60, 130, .10);
  --input-bg: rgba(255, 255, 255, .85); --input-line: #8a98b6;
  --btn-grad: linear-gradient(180deg, #3a78f5 0%, #2457d6 100%); --btn-text: #fff; --btn-shadow: 0 6px 16px rgba(36, 87, 214, .35);
  --on-bg: #1f56c8; --on-text: #fff;
  --tone-blue-bg: rgba(46, 112, 240, .14); --tone-blue-fg: #1747a8;
  --tone-amber-bg: rgba(245, 158, 11, .20); --tone-amber-fg: #7a4800;
  --tone-green-bg: rgba(34, 160, 90, .17); --tone-green-fg: #0e6236;
  --tone-violet-bg: rgba(130, 90, 240, .16); --tone-violet-fg: #4a2bb0;
  --tone-red-bg: rgba(220, 60, 50, .14); --tone-red-fg: #9c1c14;
  --tone-gray-bg: rgba(90, 105, 140, .14); --tone-gray-fg: #3a4863;
  --radius-sm: 12px;
}
/* tmavé hodnoty jsou zapsány dvakrát: podle systému (bez ruční volby) a podle ruční volby */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fg: #e9eefb; --muted: #aab6d2; --line: rgba(160, 180, 230, .20); --bg: #0d1226; --soft: rgba(255, 255, 255, .06);
    --accent: #8fb4ff; --bad: #ff8c84; --ok: #6fdc9d; --warn: #f5c066;
    --page: radial-gradient(900px 600px at 8% 0%, rgba(70, 100, 220, .38), transparent 60%), radial-gradient(800px 600px at 100% 10%, rgba(130, 80, 230, .32), transparent 60%), radial-gradient(900px 700px at 60% 100%, rgba(40, 120, 200, .25), transparent 60%), linear-gradient(135deg, #0c1126 0%, #17123a 50%, #0b1a33 100%);
    --glass: rgba(28, 36, 66, .60); --glass-strong: rgba(36, 46, 82, .78); --glass-edge: rgba(255, 255, 255, .10);
    --shadow: 0 12px 38px rgba(0, 0, 0, .40), 0 1px 0 rgba(255, 255, 255, .06) inset; --shadow-sm: 0 4px 16px rgba(0, 0, 0, .32);
    --input-bg: rgba(14, 20, 42, .70); --input-line: #7684a8;
    --btn-grad: linear-gradient(180deg, #3d6ee6 0%, #2848b8 100%); --btn-shadow: 0 6px 18px rgba(20, 40, 140, .55);
    --on-bg: #8fb4ff; --on-text: #0d1226;
    --tone-blue-bg: rgba(110, 160, 255, .20); --tone-blue-fg: #b4ccff;
    --tone-amber-bg: rgba(245, 170, 40, .20); --tone-amber-fg: #fcd68a;
    --tone-green-bg: rgba(70, 200, 130, .20); --tone-green-fg: #9ae8be;
    --tone-violet-bg: rgba(160, 120, 255, .22); --tone-violet-fg: #cdb9ff;
    --tone-red-bg: rgba(255, 110, 100, .20); --tone-red-fg: #ffb5af;
    --tone-gray-bg: rgba(170, 185, 220, .16); --tone-gray-fg: #c9d3ea;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fg: #e9eefb; --muted: #aab6d2; --line: rgba(160, 180, 230, .20); --bg: #0d1226; --soft: rgba(255, 255, 255, .06);
  --accent: #8fb4ff; --bad: #ff8c84; --ok: #6fdc9d; --warn: #f5c066;
  --page: radial-gradient(900px 600px at 8% 0%, rgba(70, 100, 220, .38), transparent 60%), radial-gradient(800px 600px at 100% 10%, rgba(130, 80, 230, .32), transparent 60%), radial-gradient(900px 700px at 60% 100%, rgba(40, 120, 200, .25), transparent 60%), linear-gradient(135deg, #0c1126 0%, #17123a 50%, #0b1a33 100%);
  --glass: rgba(28, 36, 66, .60); --glass-strong: rgba(36, 46, 82, .78); --glass-edge: rgba(255, 255, 255, .10);
  --shadow: 0 12px 38px rgba(0, 0, 0, .40), 0 1px 0 rgba(255, 255, 255, .06) inset; --shadow-sm: 0 4px 16px rgba(0, 0, 0, .32);
  --input-bg: rgba(14, 20, 42, .70); --input-line: #7684a8;
  --btn-grad: linear-gradient(180deg, #3d6ee6 0%, #2848b8 100%); --btn-shadow: 0 6px 18px rgba(20, 40, 140, .55);
  --on-bg: #8fb4ff; --on-text: #0d1226;
  --tone-blue-bg: rgba(110, 160, 255, .20); --tone-blue-fg: #b4ccff;
  --tone-amber-bg: rgba(245, 170, 40, .20); --tone-amber-fg: #fcd68a;
  --tone-green-bg: rgba(70, 200, 130, .20); --tone-green-fg: #9ae8be;
  --tone-violet-bg: rgba(160, 120, 255, .22); --tone-violet-fg: #cdb9ff;
  --tone-red-bg: rgba(255, 110, 100, .20); --tone-red-fg: #ffb5af;
  --tone-gray-bg: rgba(170, 185, 220, .16); --tone-gray-fg: #c9d3ea;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--page); background-attachment: fixed; color: var(--fg); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
button.primary:focus-visible, #side a.on:focus-visible, .chip.on:focus-visible { outline-color: var(--fg); }

/* ---------- sklo ---------- */
main, #top, nav#nav, #side, #bar, .col, details.help, .notice, .tablewrap, .card, .gcard, .stat { background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: #f7f8fe; --glass-strong: #ffffff; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --glass: #1b2342; --glass-strong: #222c52; } }
  :root[data-theme="dark"] { --glass: #1b2342; --glass-strong: #222c52; }
}

/* ---------- rozvržení ---------- */
#shell { display: flex; min-height: 100vh; }
#content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#side, #bar { display: none; }
main { width: calc(100% - 24px); max-width: none; margin: 12px 12px 100px; padding: 18px 16px 24px; border-radius: 26px; }
main:not(.wide) > * { max-width: 720px; }

/* spodní navigace (mobil) */
nav#nav { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; padding: 4px; border-radius: 24px; z-index: 5; }
nav#nav a { flex: 1; text-align: center; padding: 11px 2px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .85rem; border-radius: 18px; }
nav#nav a.on { color: var(--on-text); background: var(--on-bg); box-shadow: var(--shadow-sm); }
@media (max-width: 420px) { nav#nav a { flex: 1 1 auto; font-size: .68rem; padding: 12px 3px; } }          /* až 7 odkazů (vlastník a správce mají i Webhooky) se vejde na 375 px */

/* záhlaví (mobil) */
header#top { position: sticky; top: 8px; z-index: 4; margin: 8px 10px 0; padding: 8px 10px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; border-radius: 22px; }
header#top strong { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header .grow { flex: 1; }
header select { max-width: 40vw; }
.hl { color: var(--accent); text-decoration: none; font-size: .9rem; padding: 8px 4px; font-weight: 600; }
@media (max-width: 420px) { header#top { gap: 2px; padding: 6px 8px; } header .hl { font-size: .8rem; padding: 8px 3px; } header button.link { padding: 4px 3px; font-size: .8rem; } header#top strong { max-width: 4.2em; } .ghead a.all { font-size: .78rem; padding: 6px 9px; } .gcard { padding: 14px 12px; } }

/* ---------- desktop: postranní panel + horní lišta ---------- */
@media (min-width: 900px) {
  header#top, nav#nav { display: none; }
  #side:not([hidden]) { display: flex; flex-direction: column; position: sticky; top: 12px; height: calc(100vh - 24px); width: 256px; flex: none; margin: 12px 0 12px 12px; padding: 16px 14px 14px; border-radius: 30px; overflow-y: auto; }
  #bar:not([hidden]) { display: flex; align-items: center; gap: 12px; margin: 12px 12px 0 12px; padding: 8px 10px 8px 14px; border-radius: 22px; }
  main { margin: 12px; width: calc(100% - 24px); padding: 24px 28px 30px; flex: 1; }
  main:not(.wide) > * { max-width: 760px; }
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 14px; }
.brand-name { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; }
.logo { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(145deg, #5aa0ff, #5a3fe0); box-shadow: 0 6px 16px rgba(60, 80, 220, .4); position: relative; flex: none; }
.logo::before, .logo::after { content: ""; position: absolute; background: rgba(255, 255, 255, .92); border-radius: 4px; width: 14px; height: 14px; }
.logo::before { left: 9px; top: 9px; }
.logo::after { right: 9px; bottom: 9px; opacity: .7; }
.orgpick { display: block; margin: 0 0 14px; }
.orgpick select { background: var(--glass-strong); border-radius: 16px; font-weight: 500; }
.side-main, .side-sub { display: flex; flex-direction: column; gap: 4px; }
.side-sub { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
#side a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; color: var(--fg); text-decoration: none; font-weight: 500; }
#side a:hover { background: var(--soft); }
#side a.on { background: var(--btn-grad); color: #fff; font-weight: 600; box-shadow: var(--btn-shadow); }
svg.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.userbox { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px; border-radius: 18px; background: var(--soft); }
.uname { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox .logout { min-height: 36px; padding: 2px 6px; font-size: .85rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; color: var(--tone-violet-fg); background: var(--tone-violet-bg); border: 1px solid var(--glass-edge); }
.searchbox { position: relative; flex: 0 1 560px; display: flex; align-items: center; margin: 0; }
.searchbox input { padding-left: 44px; padding-right: 84px; border-radius: 16px; }
.sicon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: inline-flex; pointer-events: none; }
kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: inherit; font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; background: var(--soft); pointer-events: none; }
.iconbtn { width: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--glass-strong); color: var(--fg); border: 1px solid var(--glass-edge); border-radius: 14px; box-shadow: var(--shadow-sm); }
header#top .iconbtn { width: 38px; min-height: 38px; }

/* ---------- typografie ---------- */
h1 { font-size: 1.6rem; margin: 2px 0 12px; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 1.1rem; margin: 22px 0 8px; letter-spacing: -.01em; }
@media (min-width: 900px) { h1 { font-size: 2.2rem; } }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.err { color: var(--bad); margin: 8px 0; }
.ok { color: var(--ok); }
.pagehead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.pagehead h1 { margin: 2px 0 8px; }

/* ---------- prvky ---------- */
.notice { border-radius: var(--radius-sm); padding: 10px 14px; margin: 10px 0; background: var(--soft); box-shadow: none; }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list li > a, .list li > div { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.list li > a:hover { background: var(--soft); }
.list .t { font-weight: 600; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.row > .grow { flex: 1; min-width: 0; }
.row > .grow.pick { flex: 1 1 10em; }
.row input[type=number], .row input[type=date] { width: auto; flex: 1 1 8em; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.chip { border: 1px solid var(--line); background: var(--glass-strong); border-radius: 999px; padding: 6px 14px; font: inherit; color: var(--fg); min-height: 40px; box-shadow: none; }
.chip.on { background: var(--btn-grad); border-color: transparent; color: #fff; box-shadow: var(--btn-shadow); }
.tag { display: inline-block; white-space: nowrap; font-size: .75rem; font-weight: 600; border-radius: 999px; padding: 1px 10px; margin-right: 4px; color: var(--tone-gray-fg); background: var(--tone-gray-bg); }
.tag.bad { color: var(--tone-red-fg); background: var(--tone-red-bg); }
.tag.t-blue { color: var(--tone-blue-fg); background: var(--tone-blue-bg); }
.tag.t-amber { color: var(--tone-amber-fg); background: var(--tone-amber-bg); }
.tag.t-green { color: var(--tone-green-fg); background: var(--tone-green-bg); }
.tag.t-violet { color: var(--tone-violet-fg); background: var(--tone-violet-bg); }
label { display: block; font-size: .875rem; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--fg); background: var(--input-bg); border: 1px solid var(--input-line); border-radius: 14px; padding: 10px 14px; min-height: 44px; }
textarea { min-height: 88px; }
input::placeholder { color: var(--muted); opacity: 1; }
button { font: inherit; font-weight: 600; min-height: 44px; border-radius: 14px; padding: 8px 18px; border: 1px solid transparent; background: var(--btn-grad); color: var(--btn-text); cursor: pointer; box-shadow: var(--btn-shadow); transition: transform .12s ease, filter .12s ease; }
button:hover:not(:disabled) { filter: brightness(1.06); }
button:active:not(:disabled) { transform: translateY(1px); }
button.sec { background: var(--glass-strong); color: var(--accent); border-color: var(--line); box-shadow: none; }
button.danger { background: var(--glass-strong); color: var(--bad); border-color: var(--bad); box-shadow: none; }
button.link { background: none; border: none; color: var(--accent); min-height: 40px; padding: 4px 8px; box-shadow: none; font-weight: 500; }
button.primary { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
button:disabled { opacity: .5; cursor: default; }
.iconbtn { box-shadow: var(--shadow-sm); }
a.button, .list li > div a.button { display: inline-block; padding: 10px 18px; min-height: 44px; border-radius: 14px; background: var(--btn-grad); color: #fff; text-decoration: none; font-weight: 600; box-shadow: var(--btn-shadow); }
.list li > div > a:not(.button) { display: block; color: inherit; text-decoration: none; }
.kv { display: grid; grid-template-columns: 9em 1fr; gap: 4px 12px; margin: 8px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; color: var(--fg); font-size: 1rem; }
input[type=checkbox] { width: auto; min-height: 0; flex: none; accent-color: var(--accent); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border: 1px solid var(--line); border-radius: 14px; padding: 10px; font-size: .8rem; }
code { background: var(--soft); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
details.help { border-radius: var(--radius-sm); padding: 4px 14px; margin: 10px 0; background: var(--soft); box-shadow: none; }
details.help summary { cursor: pointer; padding: 8px 0; color: var(--accent); font-weight: 600; min-height: 24px; }
details.help ol, details.help ul { margin: 6px 0 10px; padding-left: 1.3em; }
details.help li { margin: 4px 0; }
.ai-text { white-space: pre-wrap; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 12px; margin-top: .4rem; }

/* nástěnka případů */
.board { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; }
.col { flex: 0 0 82%; max-width: 300px; scroll-snap-align: start; border-radius: 18px; padding: 4px 10px 10px; box-shadow: none; background: var(--soft); }
.col h2 { margin: 10px 0 8px; font-size: 1rem; }
.card { border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; background: var(--glass-strong); box-shadow: var(--shadow-sm); }
.card a { font-weight: 600; overflow-wrap: anywhere; }
.card .row { margin: 6px 0 0; }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .45; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--tone-blue-bg); }
.col.over.deny { outline-color: var(--bad); background: var(--tone-red-bg); }      /* sloupec ztráty: přetažením se ztráta nezapisuje */

/* tabulky (Přehledy) */
.tablewrap { overflow-x: auto; margin: 8px 0; border-radius: 16px; box-shadow: none; background: var(--soft); }
.tablewrap table { border-collapse: collapse; width: 100%; font-size: .875rem; }
.tablewrap th, .tablewrap td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tablewrap th:first-child, .tablewrap td:first-child { text-align: left; position: sticky; left: 0; background: var(--glass-strong); }
.tablewrap thead th { background: var(--soft); color: var(--muted); font-weight: 600; white-space: normal; vertical-align: bottom; }
.tablewrap tr.total th, .tablewrap tr.total td { font-weight: 700; background: var(--soft); }
.tablewrap tr:last-child th, .tablewrap tr:last-child td { border-bottom: none; }
.bar { display: inline-block; width: 64px; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-left: 6px; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.rep-card { margin: 18px 0; }
.rep-card h3 { font-size: .95rem; margin: 14px 0 2px; }
.rep-big { display: flex; gap: 20px; flex-wrap: wrap; margin: 8px 0; }
.rep-big div { min-width: 7em; } .rep-big .n { font-size: 1.5rem; font-weight: 700; } .rep-big .l { color: var(--muted); font-size: .8rem; }

/* ---------- Dnes ---------- */
.gcard { border-radius: 22px; padding: 16px; margin: 0; background: var(--glass-strong); min-width: 0; }
.ghead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ghead h2 { margin: 0; font-size: 1.1rem; flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.ghead a.all { font-size: .85rem; text-decoration: none; padding: 7px 12px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); color: var(--muted); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 8px 0 14px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.stat { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 22px; text-decoration: none; color: var(--fg); background: var(--glass-strong); min-width: 0; }
.stat:hover { filter: brightness(1.03); }
.tile { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--tone-blue-bg); color: var(--tone-blue-fg); }
.stat .tile { width: 52px; height: 52px; border-radius: 16px; }
.stat .tile svg { width: 28px; height: 28px; }
.stat.amber .tile, .arow.amber .tile { background: var(--tone-amber-bg); color: var(--tone-amber-fg); }
.stat.violet .tile, .arow.violet .tile { background: var(--tone-violet-bg); color: var(--tone-violet-fg); }
.arow.red .tile { background: var(--tone-red-bg); color: var(--tone-red-fg); }
.stat .txt { flex: 1; min-width: 0; }
.stat .lbl { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; line-height: 1.2; }
.stat .num { font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.stat.bad .num { color: var(--bad); }
.chev { display: inline-flex; width: 32px; height: 32px; flex: none; align-items: center; justify-content: center; border-radius: 50%; background: var(--soft); border: 1px solid var(--line); color: var(--muted); text-decoration: none; }
.chev svg { width: 16px; height: 16px; }
.stat .chev { display: none; }
@media (min-width: 900px) { .stat .chev { display: inline-flex; } }
@media (max-width: 420px) { .stat { padding: 10px; gap: 8px; } .stat .tile { width: 40px; height: 40px; border-radius: 13px; } .stat .tile svg { width: 22px; height: 22px; } .stat .num { font-size: 1.5rem; } }
.dgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
@media (min-width: 900px) { .dgrid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.tblscroll { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: .92rem; }
.dtable th { text-align: left; font-weight: 600; font-size: .8rem; color: var(--muted); padding: 8px 10px; background: var(--soft); }
.dtable th:first-child { border-radius: 12px 0 0 12px; } .dtable th:last-child { border-radius: 0 12px 12px 0; }
.dtable td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.dtable tr:last-child td { border-bottom: none; }
.dtable td a { color: var(--fg); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.dtable td a:hover { text-decoration: underline; }
.dtable .late { color: var(--bad); font-weight: 600; }
@media (max-width: 560px) { .dtable .opt { display: none; } .dtable th, .dtable td { padding-left: 6px; padding-right: 6px; } }
.agroup { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; font-weight: 600; font-size: .92rem; }
.agroup svg { width: 18px; height: 18px; }
.agroup.red { color: var(--bad); } .agroup.violet { color: var(--tone-violet-fg); } .agroup.blue { color: var(--tone-blue-fg); } .agroup.amber { color: var(--tone-amber-fg); }
.arow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: none; }
.arow .tile svg { width: 21px; height: 21px; }
.arow .body { flex: 1; min-width: 0; }
.arow .body > a { display: block; color: inherit; text-decoration: none; }
.arow .ti { font-weight: 600; overflow-wrap: anywhere; }
.pipe .board { gap: 14px; }
@media (min-width: 900px) { .pipe .col { flex: 1 1 0; max-width: none; min-width: 200px; } }
.col .stagehead { display: flex; align-items: center; gap: 8px; margin: 10px 0 8px; font-weight: 700; }
.col .dot { width: 10px; height: 10px; border-radius: 50%; background: #2f7bf0; flex: none; }
.col .dot.s1 { background: #7a52e8; } .col .dot.s2 { background: #1fa86a; } .col .dot.s3 { background: #e09a14; }
.col .deal { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin-bottom: 8px; border-radius: 14px; background: var(--glass-strong); box-shadow: var(--shadow-sm); text-decoration: none; color: var(--fg); }
.col .deal .tile { width: 34px; height: 34px; background: var(--tone-gray-bg); color: var(--tone-gray-fg); }
.col .deal .tile svg { width: 18px; height: 18px; }
.col .deal .body { flex: 1; min-width: 0; }
.col .deal .nm { font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.fold { margin-top: 16px; }
.fold > summary { cursor: pointer; font-weight: 600; font-size: 1.05rem; min-height: 28px; padding: 4px 0; }
.sel-inline { width: auto; min-height: 36px; padding: 4px 10px; font-size: .85rem; border-radius: 12px; }

/* ---------- hromadné akce a rychlý zápis ---------- */
.list li.sel { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.list li.sel > a { flex: 1; min-width: 0; border-bottom: none; }
.list li.sel > input[type=checkbox] { width: 22px; height: 22px; margin: 0 4px 0 6px; }
.bulkbar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 8px 0; padding: 4px 4px; }
.bulkbar .check { margin: 0; }
.bulkbar button { min-height: 40px; }
.fab { position: fixed; right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); z-index: 6; min-height: 52px; padding: 8px 20px 8px 16px; border-radius: 26px; display: inline-flex; align-items: center; gap: 8px; box-shadow: var(--btn-shadow), var(--shadow-sm); }
@media (min-width: 900px) { .fab { right: 28px; bottom: 28px; } }
#quick { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 16, 40, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#quick .sheet { width: 100%; max-width: 560px; max-height: 94vh; overflow-y: auto; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); }
@media (min-width: 900px) { #quick { align-items: center; } #quick .sheet { border-radius: 26px; } }
#quick .ghead h2 { font-size: 1.2rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pickrow { width: 100%; text-align: left; background: var(--glass-strong); color: var(--fg); border: 1px solid var(--line); box-shadow: none; margin-top: 6px; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(142px + env(safe-area-inset-bottom)); z-index: 30; max-width: 90vw; padding: 10px 18px; border-radius: 18px; background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--shadow); font-weight: 600; }

/* ---------- Čas (časovač) ---------- */
.timebox { margin-top: 6px; }
.timerline { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.timerline .grow { flex: 1 1 8em; min-width: 0; }
.timerline svg.ic { color: var(--accent); }
.timer-big { font-size: 1.8rem; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.timercard { margin: 0 0 16px; }
.inprog { margin: 0 0 16px; }
.timercard a { font-weight: 600; overflow-wrap: anywhere; }
.timelist li.voided .t { text-decoration: line-through; color: var(--muted); }
@media (max-width: 420px) { .timer-big { font-size: 1.5rem; } }

/* ---------- Dokumenty ---------- */
.docbox { margin-top: 6px; }
.docbox .t, .docbox .small { overflow-wrap: anywhere; }
.docbox input[type=file] { padding: 8px 10px; }
.doclist li.voided .t { text-decoration: line-through; color: var(--muted); }

/* ---------- pohyb ---------- */
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } button:active:not(:disabled) { transform: none; } }
.list li > label.check { margin: 0; padding: 10px 4px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.list li > label.check input[type=checkbox] { width: 22px; height: 22px; margin: 1px 0 0; }
/* Pošta: text zprávy se zobrazuje jako prostý text (zachová zalomení, dlouhé řádky se lámou), blok Komunikace v detailu kontaktu a úkolu */
.mailmsg { border-bottom: 1px solid var(--line); }
.mailmsg > div { padding: 12px 4px; }
pre.mailbody { font: inherit; font-size: .92rem; margin: 8px 0; max-height: 28em; overflow: auto; }
.mailblock { margin-top: 6px; }
.demo-bar { margin: 0; border-radius: 0; text-align: center; }      /* pruh veřejného dema (ADR 0021) */
