* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: #f4f4f0; color: #222; }
main { padding: 16px 20px 60px; }
h1 { font-size: 22px; margin: 0 0 8px; }
h2 { font-size: 17px; margin: 18px 0 8px; }
h3 { font-size: 14px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em; color: #666; }

.topbar { display: flex; align-items: center; gap: 18px; background: #1d2733; color: #fff; padding: 10px 20px; }
.topbar nav { display: flex; gap: 14px; flex: 1; }
.topbar a { color: #dbe2ea; text-decoration: none; font-size: 14px; }
.topbar a:hover { color: #fff; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: .06em; }
.topbar-user { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #9fb0c3; }
button.link { background: none; border: none; color: #9fb0c3; cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; }

.messages { padding: 10px 20px 0; }
.msg { padding: 8px 12px; border-radius: 6px; margin-bottom: 6px; font-size: 14px; }
.msg-success { background: #e2f2e3; color: #1e5c25; }
.msg-error { background: #fbe3e3; color: #8c1f1f; }

.lane-wrap h2 { margin-top: 22px; }
.lane { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; }
.col { min-width: 185px; width: 185px; flex-shrink: 0; background: #eceae3; border-radius: 8px; padding: 8px; }
.col-konec { background: #e7e2e2; }
.col-head { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 8px; }
.count { float: right; background: #d8d5cb; border-radius: 10px; padding: 0 7px; font-size: 11px; }
.col-empty { color: #b5b2a8; text-align: center; font-size: 13px; padding: 8px 0; }
.card { display: block; background: #fff; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; text-decoration: none; color: inherit; border: 1px solid #e0ded6; }
.card:hover { border-color: #8fa6c0; }
.card-title { font-weight: 600; font-size: 13px; }
.card-sub { font-size: 13px; margin: 2px 0; }
.card-meta { font-size: 11.5px; color: #888; }

.panel { background: #fff; border: 1px solid #e0ded6; border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.panel.narrow { max-width: 560px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }

.detail-head { margin-bottom: 12px; }
.detail-sub { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; color: #666; align-items: center; }
.badge { background: #1d2733; color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12.5px; }

.stav-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.gate { color: #a05a00; font-size: 13px; background: #fdf1dc; padding: 4px 8px; border-radius: 6px; }
.force { font-size: 13px; color: #a05a00; }

.btn { background: #1d2733; color: #fff; border: none; border-radius: 6px; padding: 8px 14px; font-size: 14px; cursor: pointer; }
.btn:hover { background: #32445a; }
.btn-danger { background: #8c2f2f; }
.btn-danger:hover { background: #a84343; }
.btn-secondary { background: #5f6d7d; }
.btn-small { padding: 3px 8px; font-size: 12px; }

.input { border: 1px solid #ccc9bf; border-radius: 6px; padding: 8px 10px; font-size: 14px; width: 100%; background: #fff; }
.input-inline { width: auto; }
.stack label, .stack p { display: block; font-size: 13.5px; margin: 0 0 10px; color: #444; }
.stack input, .stack select, .stack textarea { margin-top: 3px; }
.poznamka-form { display: flex; gap: 8px; margin-bottom: 10px; }

.tab { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tab td, .tab th { padding: 6px 8px; border-bottom: 1px solid #eee9e0; text-align: left; }
.tab tr.overdue td { color: #8c1f1f; font-weight: 600; }

.plain { list-style: none; margin: 0 0 10px; padding: 0; font-size: 13.5px; }
.plain li { padding: 3px 0; }
.pre { white-space: pre-wrap; font-size: 13.5px; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.timeline li { padding: 6px 0; border-bottom: 1px solid #f0ede6; }
.timeline .time { color: #999; margin-right: 8px; }
.timeline .badge { font-size: 11px; }

.list-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.list-head h1 { flex: 1; }
.list-head form { width: 220px; }
.ares-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-size: 13px; color: #666; }
details { margin-top: 8px; font-size: 13.5px; }
details summary { cursor: pointer; color: #4a5c72; }
.login { margin: 60px auto; }
em { color: #999; font-style: normal; font-size: 12px; }

.board-head { display: flex; align-items: baseline; gap: 14px; }
.konce-info { color: #888; font-size: 12.5px; }
.col-phase { border-left: 3px solid #b9b4a6; margin-left: 8px; }
.col.drop, .dz.drop, #pickup.drop { outline: 2px dashed #4a6fa5; outline-offset: -2px; }
.dz { min-height: 26px; border-radius: 6px; }
.dz-label { font-size: 10.5px; color: #a29c8b; text-transform: uppercase; letter-spacing: .05em; border-top: 1px dashed #d5d1c5; margin: 5px 0 3px; padding-top: 3px; }
.del-day { font-size: 10.5px; color: #8c2f2f; background: #f6dede; border-radius: 8px; padding: 1px 6px; cursor: pointer; white-space: nowrap; }
.del-day:hover { background: #efc9c9; }
tr.neaktivni td { color: #a09c92; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.detail-akce { display: flex; gap: 8px; }
.detail-akce .btn { text-decoration: none; }
.servis-karta { border-bottom: 1px solid #f0ede6; padding: 7px 0; font-size: 13.5px; }
.overdue-text { color: #8c1f1f; font-weight: 700; }
.panel.servis-pozde { border-left: 4px solid #a32d2d; border-radius: 0 10px 10px 0; }
.panel.servis-brzy { border-left: 4px solid #e0a252; border-radius: 0 10px 10px 0; }

.avatar { width: 38px; height: 38px; border-radius: 50%; background: #1d2733; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar-lg { width: 52px; height: 52px; font-size: 18px; }
.klienti-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kcard { background: #fff; border: 1px solid #e0ded6; border-radius: 10px; padding: 12px 14px; }
.kcard:hover { border-color: #8fa6c0; }
.kcard-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.kcard-nazev a { font-weight: 600; font-size: 14.5px; color: inherit; text-decoration: none; }
.kcard-nazev a:hover { text-decoration: underline; }
.kcard-kontakty { display: flex; flex-direction: column; gap: 2px; font-size: 13px; margin-bottom: 8px; }
.kcard-kontakty a, .tel { color: #33475e; text-decoration: none; }
.kcard-kontakty a:hover, .tel:hover { text-decoration: underline; }
.kcard-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.kcard-badges .chip { cursor: default; }
.chip-danger { background: #a32d2d; color: #fff; }
.chip-brzy { background: #f5c26b; color: #6b4a08; }
.filtry { display: flex; gap: 6px; margin-bottom: 14px; }
.filtr { padding: 4px 13px; border-radius: 14px; border: 1px solid #ccc9bf; font-size: 13px; text-decoration: none; color: #555; }
.filtr.on { background: #1d2733; color: #fff; border-color: #1d2733; }
.zak-radek { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #f0ede6; font-size: 13.5px; flex-wrap: wrap; }
.zak-radek a { text-decoration: none; color: inherit; }
.detail-head h1 { margin: 0 0 4px; }
.ukol-radek { display: flex; gap: 6px; align-items: baseline; }
.ukol-form { display: inline; }
.ukol-btn { background: none; border: none; cursor: pointer; font-size: 15px; color: #4a6fa5; padding: 0 2px; }
.ukol-btn:hover { color: #1d2733; }
.ukol-fajfka { color: #3b6d11; }
.card.stagnace { background: #fbe3ba; border-color: #dd9a3e; }
.bar-radek { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.bar-popis { width: 175px; flex-shrink: 0; color: #555; }
.bar-drah { flex: 1; background: #efece4; border-radius: 6px; height: 14px; overflow: hidden; }
.bar-vypln { display: block; height: 100%; background: #4a6fa5; border-radius: 6px; }
.bar-cislo { width: 26px; text-align: right; font-weight: 600; }
.board-head .filtry { display: inline-flex; }
.plan-head .filtry { display: inline-flex; margin: 0; }
.kreslici-platno { border: 1px solid #ccc9bf; border-radius: 8px; background: #fff; touch-action: none; max-width: 100%; display: block; margin-bottom: 6px; }
[hidden] { display: none !important; }
.odznak { background: #b3502e; color: #fff; border-radius: 9px; padding: 1px 7px; font-size: 11.5px; font-weight: 700; vertical-align: 1px; }
/* „O" = stará zakázka (před ostrým náběhem 17. 9. 2026) */
.znak-stara { display: inline-block; width: 15px; height: 15px; line-height: 15px; text-align: center;
              border: 1.5px solid #9a938a; color: #7d766d; border-radius: 50%;
              font-size: 10px; font-weight: 700; vertical-align: 1px; }
/* fronta pošty od dodavatelů */
.karta-posta { border: 1px solid #e0ded6; border-radius: 8px; background: #fff; padding: 10px 14px; margin-bottom: 10px; }
.posta-hlava { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.posta-telo { white-space: pre-wrap; font-size: 12.5px; color: #555; background: #faf9f5; border-radius: 6px; padding: 8px 10px; max-height: 220px; overflow: auto; }
.posta-prilohy { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
/* protokol: velké dotykové přepínače a soupis položek z Pohody */
.prepinace { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.stack label.prepinac { display: flex; align-items: center; gap: 8px; margin: 0; border: 1px solid #ccc9bf; border-radius: 8px; padding: 10px 14px; background: #fff; cursor: pointer; font-size: 14px; }
.stack label.prepinac:has(input:checked) { border-color: #4a6fa5; background: #eef2f8; }
.stack label.prepinac input { margin: 0; width: 18px; height: 18px; accent-color: #4a6fa5; }
.stack label.prepinac.zaskrt { margin: 12px 0; }
.soupis-polozky { border: 1px solid #ccc9bf; border-radius: 8px; background: #fff; margin-bottom: 10px; overflow: hidden; }
.stack .soupis-polozky label.soupis-radek { display: flex; align-items: baseline; gap: 10px; margin: 0; padding: 9px 12px; border-bottom: 1px solid #eeece5; cursor: pointer; font-size: 14px; }
.soupis-polozky label.soupis-radek:last-child { border-bottom: none; }
.soupis-polozky input { width: 18px; height: 18px; flex-shrink: 0; accent-color: #4a6fa5; transform: translateY(3px); }
.soupis-polozky label.soupis-radek:has(input:not(:checked)) span { text-decoration: line-through; color: #999; }
.plan-matice td.mcell { vertical-align: top; height: 52px; padding: 4px; }
.mini-mala { padding: 4px 6px; margin-bottom: 4px; font-size: 12px; }
.mini-mala .card-title { font-size: 12px; }
.mini-mala .card-meta { font-size: 10.5px; }
.matice-obal { overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scroll-padding-left: 92px; }
.plan-matice { table-layout: auto; width: max-content; min-width: 100%; }
.plan-matice th, .plan-matice td { width: var(--sirka-dne, 150px); }
.plan-matice .ztab-corner, .plan-matice th.ztab-name { position: sticky; left: 0; z-index: 3; min-width: 92px; width: 92px; box-shadow: 2px 0 0 #d8d4c8; }
.plan-matice th.den-pondeli, .plan-matice td.den-pondeli { border-left: 3px solid #a8a294; }
.plan-matice th.den-snap { scroll-snap-align: start; }
.form-mrizka { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px 16px; margin-bottom: 6px; }
.form-mrizka label { font-size: 13px; color: #444; display: block; }
.form-mrizka .input { margin-top: 3px; }
label.zaskrtavaci { display: flex; align-items: center; gap: 7px; padding-top: 18px; font-size: 13.5px; }
.nakres { max-width: 520px; width: 100%; display: block; margin: 4px 0 12px; border: 1px solid #e0ded6; border-radius: 8px; background: #fff; }
.slot-tag { font-size: 10.5px; color: #6b675c; background: #efece4; border-radius: 8px; padding: 1px 6px; cursor: pointer; white-space: nowrap; }
.slot-tag:hover { background: #e3dfd2; }
.mini-mala .add-day, .mini-mala .del-day { padding: 0 5px; font-weight: 700; }
.mini-mala .warn-text { margin-top: 1px; font-size: 10.5px; }
.hint { color: #999; font-size: 12.5px; }

.plan-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.plan-head h2 { margin: 0; }
.plan-nav { display: flex; gap: 8px; }
.plan-nav .btn { text-decoration: none; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 16px; }
.day { background: #eceae3; border-radius: 8px; padding: 8px; min-height: 130px; }
.day.weekend { background: #e6e2d7; }
.day.today { box-shadow: inset 0 0 0 2px #4a6fa5; }
.day-head { font-size: 12px; font-weight: 600; color: #555; margin-bottom: 6px; }
.mini-card { display: block; background: #fff; border: 1px solid #e0ded6; border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; text-decoration: none; color: inherit; }
.mini-card:hover { border-color: #8fa6c0; }
.mini-card .card-title { font-size: 12.5px; }
.mini-card .card-sub { font-size: 12.5px; }
.mini-card .card-meta { font-size: 11px; }
.pickup { display: flex; gap: 12px; flex-wrap: wrap; }
.bucket { background: #eceae3; border-radius: 8px; padding: 8px; min-width: 210px; max-width: 260px; }
.bucket-neznamo { background: #f5e9d8; }
.stav-forms { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.day-monteri { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.chip { display: inline-block; border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600; cursor: pointer; user-select: none; border: 1px solid transparent; line-height: 1.5; }
.chip-on { background: #1d2733; color: #fff; }
.chip-off { background: transparent; color: #7a7668; border-color: #c9c4b8; }
.chip-absent { background: #dedad0; color: #96917f; text-decoration: line-through; }
.chip-konflikt { background: #a32d2d; color: #fff; }
.chip-warn { background: #f5c26b; color: #6b4a08; cursor: default; }
.mini-card.warn { background: #fbe3ba; border-color: #dd9a3e; }
.mini-card.warn-konflikt { background: #f8d193; border-color: #c97e24; }
.warn-text { font-size: 11px; font-weight: 700; color: #8a5410; margin-top: 3px; }
.mini-head { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.mini-head .card-title { margin-right: auto; }
.add-day { font-size: 10.5px; color: #4a5c72; background: #e3e9f2; border-radius: 8px; padding: 1px 6px; cursor: pointer; white-space: nowrap; }
.add-day:hover { background: #d0dcec; }
.den-tag { font-size: 10.5px; color: #3c3489; background: #e6e3f8; border-radius: 8px; padding: 1px 6px; white-space: nowrap; }
.mini-card .card-title { text-decoration: none; color: inherit; font-weight: 600; }
.mini-card .card-title:hover { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }

.zdroje-toolbar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.zdroje-toolbar form { margin-left: auto; }
.ztab { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ztab th, .ztab td { border: 1px solid #d8d4c8; padding: 4px 5px; vertical-align: top; }
.ztab thead th { background: #eceae3; font-size: 11.5px; font-weight: 600; color: #666; text-align: center; padding: 5px 2px; }
.ztab thead th.ztab-dnes-head { color: #1d4e8f; background: #dfe8f3; }
.ztab .ztab-corner { width: 92px; }
.ztab th.ztab-name { background: #eceae3; font-size: 12.5px; font-weight: 600; color: #444; text-align: left; }
.ztab td.rcell { background: #fff; cursor: pointer; height: 42px; }
.ztab td.ztab-vikend, .ztab thead th.ztab-vikend { background: #f0ede4; }
.ztab td.ztab-dnes { background: #eef3fa; }
.ztab td.rcell-absent { background: #7d1f1f; }
.ztab td.rcell-konflikt { background: #5c1414; }
.ztab td.rcell-konflikt .rcell-abs { color: #ffd7d7; }
.ztab td.rcell:hover { outline: 1.5px solid #8fa6c0; outline-offset: -1.5px; }
.rcell-abs { display: block; font-size: 15px; font-weight: 700; color: #fff; text-align: center; line-height: 1.1; }
.rcell-job { display: block; font-size: 11px; color: #33475e; text-decoration: none; background: #f7f5ef; border: 1px solid #e0ded6; border-radius: 4px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcell-job:hover { border-color: #8fa6c0; }
.mapa-obal { display: none; margin: 4px 0 12px; }
.mapa-obal.zobrazena { display: block; }
.mapa { height: 320px; border: 1px solid #ccc9bf; border-radius: 8px; }
.btn-ok { background: #3b6d11; color: #fff; }
.btn-ok:hover { background: #4d8c19; }
.karta-ovladace { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.parta { display: inline-flex; align-items: center; gap: 2px; background: #eef1f6; border-radius: 8px; padding: 0 3px; }
.parta-pocet { font-size: 10.5px; font-weight: 600; color: #33475e; min-width: 22px; text-align: center; }
.krok { cursor: pointer; font-size: 12px; font-weight: 700; color: #4a6fa5; padding: 0 3px; user-select: none; }
.krok:hover { color: #1d2733; }
.mini-card.vyberova { cursor: pointer; }
.mini-card.vybrano { outline: 2px solid #4a6fa5; outline-offset: 1px; }
.vyber-lista { display: none; align-items: center; gap: 10px; background: #e3e9f2; border: 1px solid #b9c6da;
  border-radius: 8px; padding: 6px 10px; margin: 6px 0; font-size: 13px; color: #2c4a75; }
.vyber-lista.aktivni { display: flex; }
.plan-matice td.mcell { overflow: hidden; }
.mini-mala { max-width: 100%; overflow-wrap: anywhere; word-break: break-word; }
.mini-mala .card-title { overflow-wrap: anywhere; }

.media-mrizka { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 6px; }
.media-pole label { font-size: 13.5px; color: #444; display: block; }
.media-pole .input { margin-top: 3px; }
.media-nahled { display: none; width: 100%; margin-top: 6px; border: 1px solid #e0ded6; border-radius: 8px; background: #fff; }
.media-nahled.videt { display: block; }
.mcell.abs-tah { background: #b45252; outline: 1px solid #7d1f1f; outline-offset: -1px; }
.plan-matice td.mcell { user-select: none; }
.potvrd { font-size: 11px; font-weight: 700; color: #4a6fa5; background: #e3e9f2; border-radius: 8px; padding: 1px 6px; cursor: pointer; }
.potvrd:hover { background: #d0dcec; }
.potvrd.on { background: #1d4e8f; color: #fff; }
.mini-card.potvrzeno { background: #dce8f7; border-color: #1d4e8f; }
.mini-card.potvrzeno .card-title { color: #143a6b; }

/* přepínač poboček v hlavičce — Prachatice / Plzeň / vše */
.pobocka-prepinac { display: inline-flex; gap: 4px; margin-left: auto; align-items: center; }
.pobocka-prepinac a { padding: 3px 11px; border-radius: 12px; border: 1px solid #4a5666;
                      font-size: 12px; text-decoration: none; color: #b9c2cf; }
.pobocka-prepinac a.on { background: #e8ebf0; color: #1d2733; border-color: #e8ebf0; font-weight: 600; }
.pobocka-znak { margin-left: auto; font-size: 12px; color: #b9c2cf; border: 1px solid #4a5666;
                border-radius: 12px; padding: 3px 11px; }
