/* Rozpočet ČBA – vzhled sladěný s IS Baseball (Rozpis soutěží).
   Barvy a písmo jsou v proměnných níže. */
:root {
  --brand: #0a3d75;          /* tmavě modrá (konec přechodu) */
  --brand-2: #0b5cab;        /* modrá tlačítek a odkazů */
  --brand-light: #0a85e0;    /* světlá modrá (začátek přechodu) */
  --grad: linear-gradient(90deg, #0a85e0 0%, #0b5cab 55%, #0a3d75 100%);
  --accent: #d6203a;         /* červená z loga */
  --green: #1fb53b;          /* zelená tlačítka „+ Nový…“ */
  --bg: #edf1f7;
  --card: #fff;
  --text: #2b2f36;
  --muted: #747b88;
  --line: #dde2ea;
  --head: #d3d8e0;           /* šedý pruh nadpisu sekce */
  --thead: #f6f8fb;
  --ok: #1b8f3f;
  --warn: #c77800;
  --err: #d32f2f;
  --info: #0b5cab;
  --radius: 2px;
  --shadow: none;
  --font: "Roboto", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --topbar-h: 66px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.2rem; margin: .2rem 0 .3rem; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; border-left: 4px solid var(--brand-2); padding-left: .7rem; line-height: 1.25; }
h2 { font-size: .95rem; margin: 0 0 .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
h3 { font-size: .9rem; margin: 1rem 0 .5rem; text-transform: uppercase; letter-spacing: .03em; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.strong { font-weight: 700; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--err); } .pos { color: var(--ok); }
.up { color: var(--err); } .down { color: var(--ok); }
.center { text-align: center; }
code { background: #eef1f6; padding: 0 .3em; border-radius: 3px; font-size: .9em; }

/* ---------- hlavička ---------- */
.topbar { background: #fff; color: var(--text); position: relative; z-index: 50; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 1rem; padding: .5rem 2rem; min-height: var(--topbar-h); }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--brand-2); font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 48px; height: 48px; object-fit: contain; }
.topbar-right { display: flex; align-items: center; gap: 1rem; margin-left: auto; }
.yearpick { display: flex; align-items: center; gap: .4rem; color: var(--muted); }
.yearpick label { flex-direction: row; font-weight: 400; color: var(--muted); }
.yearpick select { width: auto; padding: .3rem .5rem; border-radius: 2px; }
.usermenu, .navmore { position: relative; }
.usermenu > summary, .navmore > summary { list-style: none; cursor: pointer; }
.usermenu > summary::-webkit-details-marker, .navmore > summary::-webkit-details-marker { display: none; }
.usermenu > summary { display: flex; align-items: center; gap: .5rem; color: var(--text); }
.avatar { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid #b9c2d0; background: #eef2f8; color: var(--text); font-size: .95rem; }
.caret { font-size: .7rem; color: var(--muted); }
.navmore > div, .usermenu > div { position: absolute; top: calc(100% + 6px); background: #fff; color: var(--text); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.12); min-width: 220px; padding: .3rem 0; display: flex; flex-direction: column; z-index: 60; }
.usermenu > div, .mobmenu > div { right: 0; }
.navmore > div a, .usermenu > div a, .usermenu .linkbtn { padding: .55rem 1rem; color: var(--text); text-align: left; }
.navmore > div a:hover, .usermenu > div a:hover, .usermenu .linkbtn:hover { background: var(--bg); text-decoration: none; }
.usermenu > div .muted { padding: .4rem 1rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.menu-sep { padding: .5rem 1rem .2rem; border-top: 1px solid var(--line); margin-top: .3rem; font-size: .8rem; }
.mobmenu .linkbtn { padding: .55rem 1rem; text-align: left; color: var(--text); }
.linkbtn { background: none; border: 0; font: inherit; cursor: pointer; width: 100%; }

.navbar { background: #fff; border-top: 1px solid var(--line); }
.mainnav { max-width: 1400px; margin: 0 auto; padding: .9rem 2rem; display: flex; }
.mainnav > a, .mainnav > .navmore > summary {
  flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: .55rem; min-height: 46px; padding: .5rem .8rem;
  border: 1px solid var(--line); margin-left: -1px; background: #fff; color: #4b5260;
  font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}
.mainnav > .navmore { flex: 1 1 0; display: flex; margin-left: -1px; }
.mainnav > .navmore > summary { width: 100%; margin-left: 0; }
.mainnav > .navmore > div { right: 0; }
.mainnav > a:hover, .mainnav > .navmore > summary:hover { text-decoration: none; color: var(--brand-2); background: #f7f9fc; }
.mainnav > a.active, .mainnav > .navmore > summary.active { background: var(--grad); color: #fff; border-color: transparent; position: relative; z-index: 1; }
.mainnav > a.active .ni, .mainnav summary.active .ni { stroke: #fff; }
.ni { width: 20px; height: 20px; fill: none; stroke: var(--brand-2); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.container { max-width: 1400px; margin: 0 auto; padding: 1.6rem 2rem 6rem; }
.foot { text-align: center; color: var(--muted); font-size: .8rem; padding: 1rem 1rem 5.5rem; }

/* ---------- komponenty ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.15rem; margin-bottom: 1rem; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pagehead p { margin: 0; }
.actions, .row-gap { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .25rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid2 > .card { margin-bottom: 0; }
.grid2 + * { margin-top: 1rem; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: .5rem .95rem; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: #f7f8fb; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-warn { background: #fff4e0; border-color: #f0c47a; color: #7a4a00; }
.btn-danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn-danger-text { color: var(--err); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.2rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: .8rem; border-left: 4px solid; background: #fff; box-shadow: var(--shadow); }
.flash-ok { border-color: var(--ok); background: #eef8f2; }
.flash-err { border-color: var(--err); background: #fdeeee; }
.flash-warn { border-color: var(--warn); background: #fff6e8; }
.flash-info { border-color: var(--info); background: #eef4fc; }

.badge { display: inline-block; padding: .12rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eceff4; color: #46506a; white-space: nowrap; }
.badge-priprava, .badge-koncept, .badge-navrh { background: #eceff4; color: #46506a; }
.badge-cteni, .badge-ke_schvaleni, .badge-podano { background: #fff1d6; color: #8a5300; }
.badge-schvaleny, .badge-schvaleno, .badge-vote-pro { background: #def5e6; color: #126b3a; }
.badge-zaplaceno, .badge-proplaceno, .badge-uzavreny { background: #dfeafc; color: #0d4ea6; }
.badge-zamitnuto, .badge-vote-proti { background: #fde3e3; color: #a31c1c; }
.badge-vote-zdrzel { background: #eceff4; }
.tag { display: inline-block; padding: 0 .4rem; border-radius: 4px; font-size: .75rem; background: #e8edf6; color: #2c3e66; margin-left: .2rem; vertical-align: 1px; }
.tag-b { background: #f2e9fb; color: #5b2c8a; }
.tag-m { background: #e7f6f1; color: #17664b; }
.tag-n { background: #fff1d6; color: #8a5300; cursor: help; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpi { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .25rem; border-top: 3px solid var(--brand); }
.kpi-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.kpi-value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .82rem; color: var(--muted); }
.kpis-sm .kpi-value { font-size: 1.2rem; }
.bar { display: block; height: 8px; background: #e7eaf1; border-radius: 99px; overflow: hidden; min-width: 50px; }
.bar > span { display: block; height: 100%; background: var(--brand-2); border-radius: 99px; }
.bar-ok > span { background: var(--ok); }
.bar-over > span { background: var(--err); }

.todo { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.todo-item { background: #fff; border-left: 4px solid var(--accent); padding: .55rem .9rem; border-radius: 8px; box-shadow: var(--shadow); color: var(--text); }
.todo-item b { color: var(--accent); font-size: 1.1rem; }

.steps { display: flex; list-style: none; padding: 0; margin: 0 0 1rem; gap: .4rem; flex-wrap: wrap; counter-reset: s; }
.steps li { flex: 1; min-width: 150px; }
.steps a { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; background: #fff; border-radius: 8px; color: var(--muted); box-shadow: var(--shadow); font-size: .9rem; }
.steps a:hover { text-decoration: none; }
.steps b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e7eaf1; font-size: .8rem; }
.steps .cur a { color: var(--brand); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent), var(--shadow); }
.steps .cur b { background: var(--accent); color: #fff; }
.steps .cur-soft a { color: var(--brand); }
.steps .done b { background: var(--ok); color: #fff; }

/* tabulky */
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: .45rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #f7f9fc; }
.tbl tfoot td { font-weight: 700; border-bottom: 0; }
.tbl-compact th, .tbl-compact td { padding: .3rem .4rem; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: .5rem; align-items: center; padding: .45rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list li .num { margin-left: auto; }
.comments { list-style: none; padding: 0; margin: 0 0 .75rem; }
.comments li { padding: .5rem .7rem; background: #f6f8fb; border-radius: 8px; margin-bottom: .4rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.pager { display: flex; gap: .25rem; flex-wrap: wrap; margin-top: .75rem; }
.pager a { padding: .25rem .6rem; border-radius: 6px; background: #f1f3f7; }
.pager a.active { background: var(--brand); color: #fff; }

/* strom rozpočtu */
.ttable { --cols: 4; font-size: .92rem; }
.ttable.cols1 { --cols: 1; } .ttable.cols2 { --cols: 2; } .ttable.cols3 { --cols: 3; } .ttable.cols4 { --cols: 4; } .ttable.cols5 { --cols: 5; } .ttable.cols6 { --cols: 6; }
.trow { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(var(--cols), minmax(92px, 130px)); gap: .5rem; align-items: center; padding: .38rem .5rem; border-bottom: 1px solid var(--line); }
.overview .trow, .ttable:not(.prep) .trow { grid-template-columns: minmax(220px, 1fr) repeat(calc(var(--cols) - 1), minmax(92px, 130px)) 120px; }
.thead { font-size: .75rem; text-transform: uppercase; position: sticky; top: 0; z-index: 2; }
.tnode > summary { list-style: none; cursor: pointer; }
.tnode > summary::-webkit-details-marker { display: none; }
.tnode > summary .name::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
.tnode[open] > summary .name::before { transform: rotate(90deg); }
.tnode.lvl1 > summary { background: #eef2f8; font-weight: 700; }
.tnode.lvl2 > summary { background: #f7f9fc; font-weight: 600; }
.tnode.lvl2 > summary .name { padding-left: 1rem; }
.tnode.lvl3 > summary .name { padding-left: 2rem; }
.tline .name { padding-left: 3rem; }
.tnode.lvl1 > .tline .name { padding-left: 1.6rem; }
.tnode.lvl2 > .tline .name { padding-left: 2.4rem; }
.tline:hover { background: #fafbfd; }
.c.name { min-width: 0; overflow-wrap: anywhere; }
.chg { color: var(--warn); font-weight: 700; }
input.amt { width: 100%; text-align: right; padding: .25rem .4rem; border: 1px solid transparent; background: #f6f8fc; border-radius: 6px; font: inherit; font-variant-numeric: tabular-nums; }
input.amt:hover { border-color: var(--line); }
input.amt:focus { border-color: var(--brand-2); background: #fff; outline: none; }
input.amt.saving { background: #fff8e6; }
input.amt.saved { background: #eaf7ef; }
input.amt.error { background: #fdeaea; border-color: var(--err); }

/* formuláře */
label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; color: #3a4459; font-weight: 600; }
input, select, textarea { font: inherit; font-weight: 400; color: var(--text); padding: .5rem .6rem; border: 1px solid #cfd5e1; border-radius: 8px; background: #fff; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(19, 61, 128, .25); border-color: var(--brand-2); }
input[type=checkbox], input[type=radio] { width: auto; }
label.check { flex-direction: row; align-items: center; gap: .4rem; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .75rem; }
legend { font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem 1rem; }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.span2 { grid-column: span 2; }
.form-grid-4 .span2 { grid-column: span 2; }
.inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form textarea { width: auto; flex: 1; min-width: 160px; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; align-items: center; }
.filters select, .filters input { width: auto; min-width: 150px; }
.filters input[type=checkbox] { min-width: 0; }
.input-btn, .input-pair { display: flex; gap: .3rem; }
.input-pair select { max-width: 90px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .3rem; }
.segmented { display: flex; gap: .4rem; margin-bottom: .6rem; }
.segmented label { flex: 1; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; text-align: center; padding: .6rem; border: 1px solid #cfd5e1; border-radius: 8px; cursor: pointer; font-weight: 600; }
.segmented input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.pop { position: relative; }
.pop-body { position: absolute; right: 0; top: calc(100% + 6px); width: 320px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); padding: 1rem; display: flex; flex-direction: column; gap: .6rem; z-index: 20; }
.addline > summary { cursor: pointer; }
.addline form { margin-top: .8rem; }
.alloc-row, .item-row, .exp-row { display: flex; gap: .4rem; align-items: center; margin-bottom: .4rem; }
.alloc-row select, .item-row select { flex: 3; }
.alloc-row input, .item-row input { flex: 1; min-width: 100px; }
.exp-row select { flex: 0 0 170px; } .exp-row input { flex: 1; } .exp-row input[inputmode=decimal] { flex: 0 0 110px; }
.item-new { flex-wrap: wrap; background: #f6f8fc; padding: .4rem; border-radius: 8px; }
.sticky-actions { display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.docform .sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 1rem 0; }
.scan { border: 2px dashed #c9d2e3; box-shadow: none; text-align: center; }
.scan.dragover { border-color: var(--brand-2); background: #f2f6fd; }
.scan-buttons { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.filelist { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.file { display: inline-block; padding: .2rem .6rem; background: #eef2f8; border-radius: 99px; font-size: .85rem; margin: .2rem .2rem 0 0; }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.attachments figure { margin: 0; }
.attachments img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.filebox { display: grid; place-items: center; height: 150px; background: #f1f4f9; border-radius: 8px; font-size: 2.4rem; }
.attachments figcaption { font-size: .8rem; overflow-wrap: anywhere; }
.calc-panel { position: sticky; top: 140px; }
.calc-panel .dl { margin-top: .6rem; }
.calc-panel .tbl { font-size: .8rem; }
.calc-panel .tbl th { font-size: .66rem; }
.meal-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem; margin-bottom: .6rem; }
.meal-days label { flex-direction: row; align-items: center; justify-content: space-between; background: #f6f8fc; padding: .35rem .6rem; border-radius: 8px; font-weight: 400; }
.meal-days select { width: 70px; }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: #e6e9f0; }
.chart .axis { font-size: 11px; fill: var(--muted); }
.chart .b-plan { fill: #c3cfe4; } .chart .b-act { fill: var(--brand-2); }
.legend { font-size: .85rem; color: var(--muted); display: flex; gap: .4rem; align-items: center; }
.legend span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.lg-plan { background: #c3cfe4; } .lg-act { background: var(--brand-2); margin-left: .6rem; }

/* přihlášení */
.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, var(--brand), #071b3c); padding: 1rem; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: .9rem; padding: 1.6rem; }
.login-head { text-align: center; }
.login-head h1 { margin: .4rem 0 0; }
.login-head p { margin: 0; }

/* spodní navigace (mobil) */
.bottomnav { display: none; }
.mobmenu { display: none; }
.mobmenu > summary { font-size: 1.5rem; color: var(--brand-2); padding: .2rem .4rem; }
.mobmenu > div { right: 0; }


/* ---------- vzhled IS Baseball: komponenty ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 1.1rem 1.25rem; }
.card > h2:first-child, .card > .row-between:first-child, .card > summary:first-child {
  margin: -1.1rem -1.25rem 1rem; padding: .8rem 1.25rem; background: var(--head); min-height: 46px; display: flex; align-items: center;
}
.card > .row-between:first-child h2 { margin: 0; }
.card.tree > .row-between:first-child, .card > summary:first-child { margin-bottom: 0; }
details.card[open] > summary:first-child { margin-bottom: 1rem; }
.pagehead { align-items: center; margin-bottom: 1.2rem; }
.pagehead h1 { margin: 0 0 .35rem; }
.pagehead p { margin: 0 0 0 calc(4px + .7rem); }
.crumbs { font-size: .85rem; text-align: right; margin-bottom: -.4rem; }
.btn { border-radius: 2px; font-weight: 500; padding: .45rem .9rem; border-color: #c9d0db; }
.btn-primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-primary:hover { background: var(--brand); border-color: var(--brand); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #179a31; }
.btn-lg { padding: .75rem 1.2rem; }
.btn-login, .sticky-actions .btn-primary, .login .btn-primary { background: var(--grad); border: 0; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: .82rem; padding: .8rem 1.2rem; }
.btn-danger { background: var(--err); border-color: var(--err); }
.flash { border-radius: 2px; box-shadow: none; border: 1px solid var(--line); border-left-width: 4px; }
.kpi { border: 1px solid var(--line); border-radius: 2px; box-shadow: none; border-top: 3px solid var(--brand-2); }
.kpi-label { font-weight: 700; color: #4b5260; }
.badge { border-radius: 2px; }
.todo-item { border-radius: 2px; box-shadow: none; border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.steps a { border-radius: 0; box-shadow: none; border: 1px solid var(--line); text-transform: uppercase; font-size: .78rem; font-weight: 700; letter-spacing: .05em; }
.steps .cur a { background: var(--grad); color: #fff; box-shadow: none; border-color: transparent; }
.steps .cur b { background: #fff; color: var(--brand-2); }
.tbl th { color: #2b2f36; font-weight: 700; background: var(--thead); font-size: .76rem; padding: .7rem .5rem; }
.tbl td { padding: .55rem .5rem; }
.tbl tbody tr:hover td { background: #f9fbfd; }
.thead { color: #2b2f36; font-weight: 700; background: var(--thead); }
.trow { padding: .45rem .6rem; }
.tnode.lvl1 > summary { background: #e9edf3; }
.tnode.lvl2 > summary { background: #f6f8fb; }
input, select, textarea { border-radius: 2px; border-color: #c9d0db; }
.pop-body { border-radius: 2px; border: 1px solid var(--line); }
.scan { border-radius: 2px; }
.segmented span { border-radius: 2px; }
.segmented input:checked + span { background: var(--grad); border-color: transparent; }
.pager a { border-radius: 2px; }
.pager a.active { background: var(--brand-2); }

/* přihlášení */
.login-body { display: grid; place-items: center; min-height: 100vh; background: var(--bg); padding: 1rem; }
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 1rem; padding: 2.4rem 2.5rem 2rem; background: #fff; border: 1px solid #cfd5df; }
.login-head { text-align: center; margin-bottom: 1.6rem; }
.login-head img { width: 120px; height: auto; }
.login-title { color: var(--brand-2); font-size: 2.1rem; font-weight: 700; letter-spacing: -.03em; margin-top: .4rem; }
.login h1 { border: 0; padding: 0; text-transform: none; font-weight: 300; font-size: 1.75rem; letter-spacing: 0; margin: 0 0 .4rem; }
.login input { padding: .75rem .9rem; }
.login-foot { margin: 1.2rem 0 0; font-size: .9rem; color: var(--brand-2); }

@media (max-width: 1000px) {
  .grid-main { grid-template-columns: 1fr; }
  .calc-panel { position: static; }
  .navbar { display: none; }
  .topbar { position: sticky; top: 0; }
  .mobmenu { display: block; }
  .topbar-inner { padding: .4rem 1rem; }
  .usermenu { display: none; }
  .topbar-right { gap: .4rem; }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  .container { padding: .75rem .6rem 6rem; }
  .grid2 { grid-template-columns: 1fr; }
  .form-grid, .form-grid-4 { grid-template-columns: 1fr; }
  .span2, .form-grid-4 .span2 { grid-column: auto; }
  .brand { font-size: 1.15rem; gap: .4rem; }
  .brand img { width: 40px; height: 40px; }
  .yearpick label { display: none; }
  .yearpick select { max-width: 120px; padding: .3rem .3rem; font-size: .85rem; }
  .avatar { width: 38px; height: 38px; font-size: .85rem; }
  :root { --topbar-h: 56px; }
  h1 { font-size: 1.05rem; }
  .crumbs { text-align: left; margin-bottom: .2rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .kpi-value { font-size: 1.1rem; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); z-index: 40; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.06); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); padding: .45rem 0 .5rem; }
  .bottomnav a:hover { text-decoration: none; }
  .bottomnav a.active { color: var(--brand); }
  .bottomnav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .bottomnav .fab svg { background: var(--accent); color: #fff; border-radius: 50%; width: 40px; height: 40px; padding: 8px; margin-top: -18px; box-shadow: 0 4px 10px rgba(208,32,46,.4); }
  .bottomnav .fab { color: var(--accent); }
  /* strom: na mobilu jen název + 2 hlavní sloupce */
  .trow { grid-template-columns: 1fr 96px 96px !important; font-size: .86rem; }
  .ttable .trow > .c:not(.name):not(.strong):not([data-label="Čerpáno"]):not([data-label="Návrh"]):not([data-label="Rozdíl"]):not([data-label="Rozpočet"]) { display: none; }
  .ttable.prep .trow > .c[data-label="Rozdíl"] { display: block; }
  .thead { top: var(--topbar-h); }
  .tline .name, .tnode .name { padding-left: .3rem !important; }
  /* tabulky jako karty */
  .tbl-cards thead { display: none; }
  .tbl-cards tr { display: block; border-bottom: 1px solid var(--line); padding: .4rem 0; }
  .tbl-cards td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .15rem .2rem; text-align: right; }
  .tbl-cards td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; }
  .tbl:not(.tbl-cards) { display: block; overflow-x: auto; }
  .alloc-row, .item-row { flex-wrap: wrap; }
  .alloc-row select, .item-row select { flex: 1 1 100%; }
  .exp-row { flex-wrap: wrap; } .exp-row select { flex: 1 1 100%; }
  .docform .sticky-actions { bottom: calc(58px + env(safe-area-inset-bottom)); }
  .docform .sticky-actions .btn { flex: 1; }
  .pop-body { position: fixed; left: .6rem; right: .6rem; width: auto; top: 30%; }
  .foot { display: none; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters select, .filters input { min-width: 0; width: 100%; }
}
@media print {
  .topbar, .bottomnav, .actions, .filters, .foot, .steps { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  details { display: block; } details > * { display: block; }
}

/* jízdy v cestovním příkazu */
.legs td { padding: .3rem .25rem; vertical-align: middle; }
.legs input, .legs select { padding: .35rem .4rem; font-size: .9rem; }
.legs input[type=time] { width: 108px; } .legs input[type=date] { width: 140px; }
.legs .leg-from, .legs .leg-to { min-width: 120px; }
.legs .leg-km, .legs .leg-fare { width: 80px; text-align: right; }
.legs select { width: 74px; }
input.filled { background: #f1f8ee; }
@media (max-width: 760px) {
  .legs tr { border: 1px solid var(--line); margin-bottom: .5rem; padding: .3rem; background: #fafbfd; }
  .legs td { align-items: center; }
  .legs input[type=date], .legs input[type=time], .legs .leg-km, .legs .leg-fare, .legs select { width: 60%; }
  .legs input:not([type]), .legs .leg-from, .legs .leg-to { width: 70%; }
}

/* kilometrovník */
.km-wrap { overflow: auto; max-height: 75vh; border: 1px solid var(--line); }
.km-matrix { font-size: .8rem; }
.km-matrix th, .km-matrix td { padding: .25rem .35rem; border: 1px solid var(--line); }
.km-matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--thead); }
.km-matrix .vert { height: 130px; vertical-align: bottom; }
.km-matrix .vert span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 600; }
.km-matrix .sticky-col { position: sticky; left: 0; background: var(--thead); z-index: 1; white-space: nowrap; text-align: left; text-transform: none; font-size: .8rem; }
.km-matrix thead .sticky-col { z-index: 3; }
.km-matrix td.self { background: #e9edf3; }
.km-matrix tbody tr:hover td, .km-matrix tbody tr:hover th { background: #eef4fc; }
