:root {
  --primary: #2563eb; --primary-dark: #1d4ed8; --dark: #0f172a; --dark-2: #1e293b; --text: #252a31; --muted: #6b7280;
  --border: #e3e6ea; --bg: #f3f4f6; --panel: #fff; --green: #15803d; --red: #c62828; --radius: 10px; --sidebar: 236px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--dark); line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: .95rem; margin-top: 1.3em; }
p { margin: 0 0 .9em; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .86em; background: #eceef1; padding: .1em .35em; border-radius: 4px; }
img { max-width: 100%; }
.muted { color: var(--muted); } .small { font-size: .84rem; } .danger { color: var(--red); font-weight: 600; }
.right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
.lead { font-size: 1.08rem; color: #414852; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .55em 1.1em; border-radius: 7px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--dark); border-color: #cdd2d9; }
.btn-outline:hover { border-color: var(--dark); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: #fde8e8; color: #9b1c1c; border-color: #f5c2c2; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: .38em .8em; font-size: .82rem; }
.btn-lg { padding: .8em 1.6em; font-size: 1rem; }
.btn-block { display: flex; width: 100%; margin-bottom: 8px; }
.link { background: none; border: 0; padding: 0; color: var(--primary-dark); cursor: pointer; font: inherit; }
.link.danger { color: var(--red); font-size: 1.2rem; }
.inline { display: inline; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: .72rem; opacity: .7; letter-spacing: 0; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; background: var(--primary); color: #fff; border-radius: 8px; font-weight: 800; flex: none; }

/* Public */
body.public { background: #fff; display: flex; flex-direction: column; min-height: 100vh; }
.pub-header { background: var(--dark); padding: 14px 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pub-header nav { display: flex; align-items: center; gap: 18px; }
.pub-header nav a:not(.btn) { color: #d6dae0; }
.pub-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 36px 20px; }
.pub-footer { text-align: center; padding: 18px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); }
.inquiry { display: grid; grid-template-columns: 1fr 1.25fr; gap: 44px; align-items: start; }
.inquiry-embed { display: block; }
.inquiry-info h1 { font-size: 2.1rem; }
.steps { padding-left: 1.3em; margin: 1.4em 0; }
.steps li { margin-bottom: .9em; padding-left: .3em; }
.steps li::marker { color: var(--primary); font-weight: 700; }
@media (max-width: 860px) { .inquiry { grid-template-columns: 1fr; gap: 20px; } }
body.embed { background: transparent; padding: 4px; }
body.embed .card { box-shadow: none; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.auth { max-width: 440px; margin: 20px auto; }
.auth-links { text-align: center; margin: 1em 0 0; }
.sent-icon { width: 64px; height: 64px; border-radius: 50%; background: #dcfce7; color: var(--green); font-size: 2rem; display: grid; place-items: center; margin: 0 auto 14px; }
.error-code { font-size: 4.5rem; font-weight: 800; color: var(--primary); line-height: 1; }

/* App shell */
body.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--dark); color: #c9cfd7; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 30; transition: transform .2s; }
.sidebar .brand { padding: 16px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.side-nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 7px; color: #c9cfd7; font-weight: 500; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--primary); color: #fff; }
.count { background: #fff; color: var(--dark); font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.side-user { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.08); font-size: .88rem; }
.side-user a { color: #fff; display: block; margin-bottom: 6px; }
.side-user small { display: block; color: #9aa3ad; font-weight: 400; }
.side-user .link { color: #9aa3ad; font-size: .84rem; }
.main { margin-left: var(--sidebar); flex: 1; min-width: 0; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 12px 26px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20; }
.topbar h1 { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; background: none; border: 1px solid var(--border); border-radius: 6px; width: 38px; height: 38px; font-size: 1.1rem; cursor: pointer; }
.bell { position: relative; font-size: 1.15rem; text-decoration: none !important; }
.bell .count { position: absolute; top: -6px; right: -12px; background: var(--red); color: #fff; }
.page { padding: 22px 26px 60px; max-width: 1500px; }
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); } .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { margin-left: 0; } .menu-btn { display: block; } .page { padding: 14px 12px 50px; } .topbar { padding: 10px 12px; }
}

/* Cards & layout */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card.narrow { max-width: 720px; }
.card.center { margin-left: auto; margin-right: auto; text-align: center; }
.card-attention { border-color: #f6c56a; background: #fffaf0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; align-items: start; }
.cols > .card, .cols > form.card { margin-bottom: 0; }
.cols { margin-bottom: 18px; }
.cols-wide { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
@media (max-width: 1000px) { .cols, .cols-wide { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; } .row.end { justify-content: flex-end; } .row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 160px; }
.w-sm { width: 74px !important; } .w-md { width: 130px !important; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.crumbs { font-size: .86rem; color: var(--muted); margin-bottom: 12px; }
.section-title { margin-top: 28px; }
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary h2 { display: inline; }
details.card > summary::before { content: '▸ '; color: var(--primary-dark); }
details.card[open] > summary::before { content: '▾ '; }
details.card[open] > summary { margin-bottom: 14px; }
details > summary.btn { display: inline-flex; margin: 10px 0; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--muted); font-size: .85rem; display: flex; flex-direction: column; }
.stat:hover { border-color: var(--primary); text-decoration: none; }
.stat-n { font-size: 1.8rem; font-weight: 700; color: var(--dark); line-height: 1.1; }

/* Tabs */
.tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: .9rem; }
.tabs a:hover { background: #e7e9ed; text-decoration: none; }
.tabs a.active { background: var(--dark); color: #fff; }
.tabs a.active .count { background: var(--primary); color: #fff; }
.tabs .count { background: var(--primary); color: #fff; }
.project-tabs { margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.search { display: flex; gap: 6px; }
.search input { padding: .45em .8em; border: 1px solid #cdd2d9; border-radius: 7px; font: inherit; min-width: 240px; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { font-size: .73rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.table th.right, .table td.right { text-align: right; } .table th.center, .table td.center { text-align: center; }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { border-bottom: 0; font-weight: 500; }
.table tr.total td { font-size: 1.05rem; font-weight: 700; border-top: 2px solid var(--dark); }
.table.compact td, .table.compact th { padding: 6px 6px; }
.table tr.group td { background: #f6f7f9; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.table tr.deleted td { opacity: .5; text-decoration: line-through; }
.table tr.current td { background: #f4fbf6; }
.table select, .table input[type=date], .table input[type=text], .row select, .row input[type=date], .row input[type=text] { padding: .4em .5em; border: 1px solid #cdd2d9; border-radius: 6px; font: inherit; font-size: .86rem; background: #fff; max-width: 100%; }
.card { overflow-x: auto; }

/* Badges */
.badge { display: inline-block; padding: .16em .65em; border-radius: 999px; font-size: .73rem; font-weight: 600; white-space: nowrap; text-decoration: none !important; }
.badge-blue { background: #dbeafe; color: #1e40af; } .badge-orange { background: #ffedd5; color: #9a3412; }
.badge-purple { background: #ede9fe; color: #5b21b6; } .badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; } .badge-gray { background: #eceef1; color: #3f4650; }

/* Forms */
.form label { display: block; margin-bottom: 13px; font-weight: 500; font-size: .89rem; color: var(--dark); }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea, .chat-form textarea, .decide textarea {
  display: block; width: 100%; margin-top: 5px; padding: .58em .75em; border: 1px solid #cdd2d9; border-radius: 7px; font: inherit; font-size: .93rem; background: #fff; color: var(--text); }
.form input:focus, .form select:focus, .form textarea:focus, .chat-form textarea:focus { outline: 2px solid rgba(37,99,235,.3); border-color: var(--primary); }
.form input[disabled] { background: #f3f4f6; color: var(--muted); }
.form input[type=file], input[type=file] { font-size: .85rem; max-width: 100%; }
.form textarea, textarea { resize: vertical; font-family: inherit; }
.form .check, .check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: .89rem; }
.check input { margin: 0; flex: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; }
.span2 { grid-column: span 2; }
@media (max-width: 700px) { .grid2, .grid4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }

/* Flash & notices */
.flash { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 15px; border-radius: 8px; margin-bottom: 12px; border: 1px solid; font-weight: 500; }
.flash button { background: none; border: 0; font-size: 1.2rem; cursor: pointer; color: inherit; line-height: 1; }
.flash-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #7c4a03; padding: 11px 15px; border-radius: 8px; margin: 12px 0; }
.notice-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }

/* Text blocks */
.text { white-space: normal; margin-bottom: 1em; overflow-wrap: anywhere; }
.boxed { background: #f6f7f9; border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 1em; }
.dl dt { color: var(--muted); font-size: .86rem; } .dl dd { margin: 0; }
.plain { list-style: none; padding: 0; margin: 0 0 1em; } .plain li { padding: 5px 0; border-bottom: 1px solid var(--border); } .plain li:last-child { border: 0; }
.impact { display: flex; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.impact div { background: #f6f7f9; border: 1px solid var(--border); border-radius: 8px; padding: 10px 16px; display: flex; flex-direction: column; min-width: 180px; }
.impact strong { font-size: 1.25rem; }

/* Project */
.project-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.phases { display: flex; list-style: none; padding: 0; margin: 0 0 16px; gap: 4px; flex-wrap: wrap; }
.phases li { flex: 1; min-width: 96px; text-align: center; padding: 7px 6px; background: #e4e7eb; color: var(--muted); font-size: .8rem; font-weight: 600; border-radius: 6px; }
.phases li.done { background: #cdebd6; color: #166534; }
.phases li.current { background: var(--primary); color: #fff; }
.milestones { list-style: none; padding: 0; margin: 0; }
.milestones li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0 6px 24px; position: relative; border-bottom: 1px solid var(--border); }
.milestones li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #b6bcc5; background: #fff; }
.milestones li.ms-active::before { border-color: var(--primary); background: var(--primary); }
.milestones li.ms-done::before { border-color: var(--green); background: var(--green); }
.milestones li.ms-done span:first-child { color: var(--muted); text-decoration: line-through; }

/* Chat & messages */
.chat-list { max-height: 62vh; overflow-y: auto; padding: 4px 4px 10px; display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; max-width: 86%; background: #fff; align-self: flex-start; margin-bottom: 8px; }
.chat-list .msg { margin-bottom: 0; }
.msg-staff { background: #fff8ee; border-color: #f9dcae; }
.msg-internal { background: #f1f0ff; border-color: #cfcaf7; border-style: dashed; }
.msg-mine { align-self: flex-end; }
.msg-head { display: flex; align-items: center; gap: 8px; font-size: .84rem; margin-bottom: 4px; flex-wrap: wrap; }
.msg-head time { color: var(--muted); margin-left: auto; font-size: .78rem; }
.msg-body { overflow-wrap: anywhere; }
.tag { background: var(--dark); color: #fff; font-size: .66rem; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.tag-internal { background: #5b21b6; }
.chat-form { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.chat-form textarea { margin: 0 0 8px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumbs img { width: 110px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); display: block; }
.attachments { list-style: none; padding: 0; margin: 8px 0 0; font-size: .88rem; }

/* Approvals */
.decide { border: 2px solid var(--primary); border-radius: var(--radius); padding: 16px; margin: 18px 0; background: #fffaf0; }
.decide h3 { margin-top: 0; }
.decide label { display: block; font-size: .88rem; margin-bottom: 10px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.timeline li { padding: 4px 0 12px 16px; position: relative; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: #b6bcc5; }
.timeline li.tl-approved::before { background: var(--green); } .timeline li.tl-rejected::before { background: var(--red); } .timeline li.tl-pending::before { background: var(--primary); }
.tl-comment { background: #f6f7f9; border-radius: 6px; padding: 6px 10px; margin-top: 4px; font-size: .9rem; }

/* Feedback */
.fb { border-bottom: 1px solid var(--border); padding: 12px 0; }
.fb:last-child { border: 0; }
.fb-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Calendar */
.cal-title { margin: 0; min-width: 170px; text-align: center; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin-bottom: 12px; }
.cal-head { text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 4px; }
.cal-day { background: #fff; border: 1px solid var(--border); border-radius: 6px; min-height: 104px; padding: 4px 5px; overflow: hidden; }
.cal-empty { background: transparent; border-color: transparent; }
.cal-weekend { background: #f8f9fa; }
.cal-today { border: 2px solid var(--primary); }
.cal-num { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.ev { display: block; font-size: .72rem; line-height: 1.25; padding: 2px 5px; border-radius: 4px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none !important; }
.legend .ev { display: inline-block; margin: 0; }
.ev-meeting { background: #dbeafe; color: #1e3a8a; } .ev-work { background: #ede9fe; color: #4c1d95; }
.ev-milestone { background: #ffedd5; color: #7c2d12; } .ev-deadline { background: #fee2e2; color: #7f1d1d; }
.ev-absence { background: #e5e7eb; color: #374151; } .ev-purchase { background: #dcfce7; color: #14532d; }
@media (max-width: 800px) { .cal-day { min-height: 70px; } .ev { font-size: .62rem; } }

/* Misc */
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 8px; border-bottom: 1px solid var(--border); }
.notif-list li.unread { background: #fffaf0; font-weight: 600; }
.notif-list time { color: var(--muted); font-size: .8rem; white-space: nowrap; font-weight: 400; }
.mail summary { cursor: pointer; }
.quote-items input { width: 100%; padding: .45em .5em; border: 1px solid #cdd2d9; border-radius: 6px; font: inherit; font-size: .9rem; margin: 0 !important; }
.w-qty { width: 100px; } .w-unit { width: 80px; } .w-price { width: 140px; }

/* Platforma */
.auth-wide { max-width: 640px; }
.hero { text-align: center; max-width: 820px; margin: 20px auto 40px; }
.hero h1 { font-size: 2.3rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.features .card { margin: 0; }
.feature-icon { font-size: 1.8rem; margin-bottom: 6px; }
.switch-company { display: block; margin: 10px 10px 0; padding: 7px 12px; border-radius: 7px; background: rgba(255,255,255,.06); color: #c9cfd7; font-size: .84rem; }
.switch-company:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.side-soon { margin-top: 14px; padding: 8px 12px; font-size: .74rem; color: #6b7684; line-height: 1.4; }
.company-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.company-pick { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; background: #fff; border: 1px solid var(--border); border-radius: 9px; cursor: pointer; font: inherit; }
.company-pick:hover, .company-pick.current { border-color: var(--primary); }
.company-pick small { display: block; color: var(--muted); font-size: .8rem; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 7px 0 7px 30px; position: relative; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border: 0; }
.checklist li::before { content: ''; position: absolute; left: 2px; top: 9px; width: 16px; height: 16px; border: 2px solid #b6bcc5; border-radius: 50%; }
.checklist li.ok::before { content: '✓'; border-color: var(--green); background: var(--green); color: #fff; font-size: .7rem; text-align: center; line-height: 16px; }
.checklist li.ok a { color: var(--muted); text-decoration: line-through; }
.trade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; }
.stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.stars .muted { color: #d1d5db; }
.toolbar select { padding: .45em .6em; border: 1px solid #cdd2d9; border-radius: 7px; font: inherit; background: #fff; }

/* ===== Navigace ===== */
.nav-group { margin: 14px 12px 4px; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64748b; font-weight: 700; }
.nav-icon { display: inline-block; width: 22px; }
.side-nav a > span:first-child { display: flex; align-items: center; }
.bell + .bell { margin-left: 10px; }
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; font-size: 1.15rem; color: var(--muted); background: none; border: 0; position: relative; font-family: inherit; text-decoration: none !important; }
  .bottom-nav span { font-size: .66rem; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav .count { position: absolute; top: 2px; left: 55%; background: var(--red); color: #fff; font-style: normal; }
  .page { padding-bottom: 90px; }
  .topbar .bell { display: none; }
}
[hidden] { display: none !important; }

/* ===== Projekty ===== */
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.project-card { display: flex; flex-direction: column; gap: 6px; color: inherit; margin: 0; transition: border-color .15s, box-shadow .15s; }
.project-card:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(15,23,42,.06); text-decoration: none; }
.project-card h2 { margin: 2px 0 0; }
.project-card p { margin: 0; }
.project-kpi { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); color: var(--muted); }
.project-tabs { overflow-x: auto; flex-wrap: nowrap; }
.project-tabs a { white-space: nowrap; }
.sub-row { border-bottom: 1px solid var(--border); padding: 10px 0; }
.sub-row:last-of-type { border-bottom: 0; }
.add-box { margin-top: 12px; }
.milestones form { gap: 6px; }
.milestones input[type=date], .milestones select { padding: .25em .4em; border: 1px solid #cdd2d9; border-radius: 6px; font: inherit; font-size: .8rem; }
.crew-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* ===== Komunikace ===== */
.chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; height: calc(100vh - 120px); min-height: 480px; }
.chat-side { overflow-y: auto; margin: 0; padding: 14px; }
.chat-main { display: flex; flex-direction: column; margin: 0; padding: 0; overflow: hidden; }
.chat-filter { width: 100%; margin: 10px 0 4px; padding: .45em .7em; border: 1px solid #cdd2d9; border-radius: 7px; font: inherit; }
.chat-group-title { font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin: 14px 4px 4px; }
.chat-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; color: var(--text); font-size: .9rem; }
.chat-item:hover { background: #f1f5f9; text-decoration: none; }
.chat-item.active { background: #e0e7ff; }
.chat-item.unread .chat-name { font-weight: 700; }
.chat-item .count { background: var(--primary); color: #fff; margin-left: auto; }
.chat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.chat-icon { width: 20px; text-align: center; flex: none; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.chat-back { display: none; font-size: 1.3rem; }
.chat-main .chat-list { flex: 1; max-height: none; padding: 14px 16px; overflow-y: auto; }
.chat-main .chat-form { padding: 10px 16px 14px; margin: 0; position: relative; }
.chat-placeholder { margin: auto; padding: 40px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; }
.thread-list { max-height: 420px; overflow-y: auto; }
.msg { max-width: 80%; margin-bottom: 0; }
.msg-mine { background: #eef2ff; border-color: #c7d2fe; }
.msg-external { border-left: 3px solid #f59e0b; }
.msg-system { align-self: center; font-size: .78rem; color: var(--muted); background: #f1f5f9; border-radius: 999px; padding: 3px 12px; }
.msg-del { margin-left: 4px; opacity: 0; transition: opacity .15s; }
.msg:hover .msg-del { opacity: 1; }
.avatar { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--dark-2); color: #fff; font-size: .62rem; font-weight: 700; }
.tag-ext { background: #f59e0b; }
.mention { background: #dbeafe; color: #1e40af; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention-box { position: absolute; bottom: 100%; left: 16px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; flex-direction: column; min-width: 220px; z-index: 5; }
.mention-box button { text-align: left; background: none; border: 0; padding: 8px 12px; font: inherit; cursor: pointer; }
.mention-box button:hover { background: #eef2ff; }
.file-btn { cursor: pointer; color: var(--primary-dark); font-size: .9rem; }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: 14px; width: 300px; }
.dropdown-menu.right { left: auto; right: 0; }
.dropdown-menu hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100vh - 150px); }
  .chat-layout.has-current .chat-side { display: none; }
  .chat-layout:not(.has-current) .chat-main { display: none; }
  .chat-back { display: inline; }
  .msg { max-width: 92%; }
}
.announcement.pinned { border-color: #93c5fd; }

/* ===== Montáže ===== */
.wo-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.wo-card { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--crew); border-radius: var(--radius); padding: 12px 16px; color: inherit; }
.wo-card:hover { border-color: var(--primary); border-left-color: var(--crew); text-decoration: none; }
.wo-card.wo-done, .wo-card.wo-cancelled { opacity: .65; }
.wo-head .wo-meta { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; font-size: 1.02rem; }
.wo-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.finish-form { display: flex; flex-direction: column; gap: 8px; min-width: min(420px, 100%); }
.finish-form textarea { padding: .5em .7em; border: 1px solid #cdd2d9; border-radius: 7px; font: inherit; }
.checks { list-style: none; padding: 0; margin: 0 0 10px; }
.checks li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.checks li.done .grow > :first-child { color: var(--muted); }
.check-btn { width: 30px; height: 30px; border-radius: 8px; border: 2px solid #b6bcc5; background: #fff; color: #fff; font-size: 1rem; cursor: pointer; flex: none; }
.checks li.done .check-btn { background: var(--green); border-color: var(--green); }
.signature-pad { width: 100%; max-width: 600px; height: auto; aspect-ratio: 600 / 220; border: 2px dashed #cbd5e1; border-radius: 8px; background: #fff; touch-action: none; display: block; margin-bottom: 10px; }
.signature-img { max-width: 280px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.compact-form label { margin-bottom: 8px; }
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-bottom: 18px; }
.crew-card { margin: 0; }
.crew-card.inactive { opacity: .6; }

/* Dispečink */
.dispatch-wrap { padding: 0; overflow-x: auto; }
.dispatch { width: 100%; border-collapse: collapse; min-width: 980px; table-layout: fixed; }
.dispatch th, .dispatch td { border: 1px solid var(--border); padding: 6px; vertical-align: top; font-size: .82rem; }
.dispatch thead th { background: #f8fafc; text-align: center; font-weight: 600; }
.dispatch th.crew-cell { width: 170px; text-align: left; background: #f8fafc; font-weight: 600; }
.dispatch td { height: 86px; background: #fff; }
.dispatch .weekend { background: #f8fafc; }
.dispatch .today { background: #eff6ff; }
.dispatch td.over { background: #dbeafe; outline: 2px dashed var(--primary); }
.chip { display: block; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--crew); border-radius: 6px; padding: 4px 6px; margin-bottom: 4px; color: var(--text); font-size: .76rem; line-height: 1.3; cursor: grab; }
.row > .chip { display: inline-block; margin: 0; }
.chip:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.chip.dragging { opacity: .4; }
.chip.wo-in_progress { background: #f5f3ff; }
.chip.wo-done { opacity: .55; }
.chip.wo-draft { border-style: dashed; }
.chip-time { font-weight: 700; }
.chip-proj { display: block; color: var(--muted); font-size: .7rem; }
.absence-chip { font-size: .7rem; background: #fef3c7; color: #92400e; border-radius: 4px; padding: 2px 5px; margin-bottom: 3px; }
.plain-fieldset { border: 0; padding: 0; margin: 0; }

/* ===== Tendry, porovnání nabídek ===== */
.compare th, .compare td { white-space: nowrap; }
.compare td.best { background: #dcfce7; font-weight: 700; }
.compare td.worst { background: #fee2e2; }
.compare tr.total td { font-size: 1rem; }
.compare .bid-head { text-align: right; }
.bid-items input { width: 120px; padding: .4em .5em; border: 1px solid #cdd2d9; border-radius: 6px; font: inherit; text-align: right; }

/* ===== Vady na výkresu ===== */
.plan-wrap { position: relative; display: inline-block; max-width: 100%; }
.plan-wrap img { display: block; max-width: 100%; cursor: crosshair; border: 1px solid var(--border); border-radius: 6px; }
.pin { position: absolute; transform: translate(-50%, -100%); background: var(--red); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 12px 12px 12px 0; padding: 2px 6px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.3); text-decoration: none !important; }
.pin.closed { background: var(--green); }
.pin.ready { background: #f59e0b; }
.pin-new { background: var(--primary); }

/* ===== Tisk ===== */
body.print { background: #e5e7eb; }
.print-bar { text-align: center; padding: 12px; }
.print-page { background: #fff; max-width: 820px; margin: 0 auto 30px; padding: 40px 48px; box-shadow: 0 4px 24px rgba(0,0,0,.1); }
.print-head { display: flex; justify-content: space-between; border-bottom: 2px solid var(--dark); padding-bottom: 10px; margin-bottom: 20px; }
.print-page h1 { font-size: 1.5rem; }
.print-page h2 { font-size: 1.05rem; margin-top: 22px; }
.print-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.print-photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.sign-row { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 40px; }
@media print {
  body.print { background: #fff; }
  .no-print { display: none !important; }
  .print-page { box-shadow: none; padding: 0; max-width: none; }
}

/* ===== Admin a rozpočet ===== */
.progress { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; background: var(--primary); }
.progress.over > span { background: var(--red); }
.num-pos { color: var(--green); font-weight: 600; } .num-neg { color: var(--red); font-weight: 600; }

/* ===== Zarovnání (sjednocení tabulek, ovládacích prvků a textů) ===== */
.main { overflow-x: clip; }
.card-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tabulky: obsah buněk svisle na střed, záhlaví dole, čísla v jedné linii */
.table th, .table td { vertical-align: middle; }
.table thead th { vertical-align: bottom; padding-top: 6px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.table td.right, .table th.right, .table td.nowrap.right { text-align: right; font-variant-numeric: tabular-nums; }
.table td { line-height: 1.4; }
.table td .small, .table td.small { line-height: 1.35; }
.table td > form.inline + form.inline { margin-left: 6px; }
.table td .badge + .badge { margin-left: 4px; }
.table th:first-child, .table td:first-child { padding-left: 4px; }
.table th:last-child, .table td:last-child { padding-right: 4px; }
.table td select, .table td input[type=text], .table td input[type=date], .table td input:not([type]) { height: 34px; padding: 0 .55em; }
.team-table td { white-space: nowrap; }
.team-table td:nth-child(2) { white-space: normal; }
.team-table select, .team-table input[type=text] { width: 100%; min-width: 130px; }
.compare td, .compare th { vertical-align: middle; }

/* Ovládací prvky v lištách a řádcích – stejná výška */
.toolbar { align-items: center; }
.toolbar .row, .row { align-items: center; }
.toolbar select, .toolbar input[type=search], .toolbar input[type=date], .toolbar input[type=month], .toolbar input[type=text],
.search input, .row > select, .row > input[type=text], .row > input[type=date], .row > input[type=search], .row > input[type=color], .row > input:not([type]) {
  height: 36px; padding: 0 .7em; border: 1px solid #cdd2d9; border-radius: 7px; font: inherit; font-size: .9rem; background: #fff; box-sizing: border-box; }
.row > input[type=color] { width: 44px; padding: 3px; }
.toolbar .btn, .row > .btn, .row > form > .btn { height: 36px; }
.toolbar .btn-sm, .row > .btn-sm, .row > form > .btn-sm, .row > button.btn-sm { height: 32px; }
.search input { min-width: 220px; }
.check { align-items: center; }

/* Hlavičky karet a stránek */
.card-head { align-items: center; }
.card-head h2, .card > h2:first-child, details.card > summary h2 { margin-bottom: 0; }
.card > h2:first-child { margin-bottom: 12px; }
.project-head { align-items: center; flex-wrap: wrap; }
.project-head .row { align-items: center; }
.crumbs { line-height: 1.4; }
.section-title { margin: 22px 0 10px; }

/* Statistiky */
.stat { justify-content: flex-start; gap: 4px; line-height: 1.35; }
.stat-n { margin-bottom: 2px; }
.stat .progress { margin-top: 6px; }

/* Seznamy a popisy */
.dl { align-items: baseline; }
.plain li.row { align-items: center; }
.plain li { line-height: 1.45; }
.timeline li { line-height: 1.4; }
.notice, .flash { line-height: 1.45; }

/* Boční menu bez ikon */
.side-nav a { padding: 9px 14px; }
.side-nav a > span:first-child { display: block; }
.switch-company { text-align: center; }
.nav-group { margin-left: 14px; }

/* Tarify a faktura */
.plan-card ul { padding-left: 1.2em; margin: 10px 0 14px; }
.plan-price { font-size: 1.5rem; font-weight: 700; margin: 6px 0 2px; }
.invoice-number { font-size: 1.2rem; font-weight: 700; }
.invoice-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 10px 0 16px; }
.invoice-parties p { margin: 4px 0 0; }
.invoice-meta th { width: 18%; color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .85rem; }
.invoice-items { margin-top: 16px; }
.qr-pay { display: flex; gap: 24px; align-items: center; margin: 24px 0; padding: 18px; border: 2px solid var(--primary); border-radius: 10px; }
.qr-pay h2 { margin: 0 0 6px; }
.qr-box { width: 180px; height: 180px; flex: none; }
.qr-box img, .qr-box canvas { display: block; }
@media (max-width: 600px) { .qr-pay, .invoice-parties { grid-template-columns: 1fr; flex-direction: column; } }

.stat-n { font-size: clamp(1.15rem, 1.6vw, 1.7rem); white-space: nowrap; }
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.project-tabs { flex-wrap: wrap; overflow-x: visible; }
.project-tabs a { padding: 6px 11px; }

/* QR platba – vlastní SVG */
.qr-box { width: 200px; height: 200px; }
.qr-box svg { width: 100%; height: 100%; display: block; }

/* Plná šířka obrazovky na všech stránkách */
.page { max-width: none; }
.pub-main { max-width: none; padding-left: 32px; padding-right: 32px; }
.cols-wide { grid-template-columns: minmax(0, 3fr) minmax(320px, 1fr); }
@media (min-width: 1600px) { .page { padding-left: 34px; padding-right: 34px; } .cols { grid-template-columns: repeat(auto-fit, minmax(460px, 1fr)); } }

/* Matice rolí */
.roles-matrix th.center { vertical-align: bottom; min-width: 34px; }
.roles-matrix .vertical { display: block; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; margin: 0 auto 4px; text-transform: none; letter-spacing: 0; font-size: .78rem; color: var(--text); }
.roles-matrix td:first-child { white-space: nowrap; }
.roles-matrix .yes { color: var(--green); font-weight: 700; }
.roles-matrix .no { color: #cbd5e1; }
.roles-matrix .custom-col { background: #f5f3ff; }
.role-hint { display: block; margin-top: 4px; font-weight: 400; }

.plain li.row { flex-wrap: wrap; row-gap: 2px; }
.plain li.row > span.nowrap, .plain li.row > .small.nowrap { white-space: normal; }

/* SVG ikony v liště */
.icon { display: block; flex: none; }
.bell { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px; color: var(--muted); }
.bell:hover { background: #f1f5f9; color: var(--dark); }
.bell .count { top: 2px; right: 0; }
.bell + .bell { margin-left: 4px; }
.menu-btn { display: none; align-items: center; justify-content: center; color: var(--dark); background: #fff; }
@media (max-width: 900px) { .menu-btn { display: inline-flex; } }
.bottom-nav .icon { width: 22px; height: 22px; margin: 0 auto; }

/* ===== Harmonogram (Gantt) ===== */
.gantt-card { padding: 0; overflow: hidden; }
.gantt-card > p { padding: 8px 16px; margin: 0; }
.gantt { display: grid; grid-template-columns: 300px minmax(0, 1fr); }
.gantt-left { border-right: 1px solid var(--border); background: #fff; }
.gantt-head-left { height: 44px; display: flex; align-items: flex-end; padding: 0 12px 6px; font-size: .73rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.gantt-name { display: flex; flex-direction: column; justify-content: center; padding: 0 12px; border-bottom: 1px solid #f1f5f9; overflow: hidden; line-height: 1.2; }
.gantt-name a { color: var(--text); font-weight: 500; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-name .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .72rem; }
.gantt-name.crit a { color: var(--red); }
.gantt-right { overflow-x: auto; position: relative; }
.gantt-scale { position: relative; height: 44px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.gantt-month { position: absolute; top: 0; height: 22px; line-height: 22px; font-size: .72rem; font-weight: 600; color: var(--dark); padding-left: 6px; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.gantt-day { position: absolute; top: 22px; height: 22px; line-height: 22px; font-size: .68rem; color: var(--muted); padding-left: 3px; border-left: 1px solid #e5e7eb; white-space: nowrap; overflow: hidden; }
.gantt-day.we { color: #b91c1c; }
.gantt-body { position: relative; background-image: linear-gradient(#f1f5f9 1px, transparent 1px); background-size: 100% 34px; }
.gantt-we { position: absolute; top: 0; bottom: 0; background: rgba(148, 163, 184, .10); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--primary); opacity: .7; z-index: 1; }
.gantt-links { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; }
.gantt-links path { fill: none; stroke: #94a3b8; stroke-width: 1.4; }
.gantt-links path.crit { stroke: var(--red); }
.gantt-bar { position: absolute; height: 20px; border-radius: 5px; background: color-mix(in srgb, var(--bar, #3b82f6) 35%, white); border: 1px solid var(--bar, #3b82f6); z-index: 3; overflow: hidden; }
.gantt-bar.crit { --bar: #dc2626; }
.gantt-bar.editable { cursor: grab; }
.gantt-bar.dragging { cursor: grabbing; opacity: .8; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.gantt-progress { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar, #3b82f6); opacity: .75; }
.gantt-label { position: relative; font-size: .68rem; line-height: 18px; padding-left: 6px; color: var(--dark); font-weight: 600; }
.gantt-resize { position: absolute; right: 0; top: 0; bottom: 0; width: 7px; cursor: ew-resize; background: rgba(0,0,0,.12); }
.gantt-ms { position: absolute; width: 16px; height: 16px; background: #7c3aed; transform: rotate(45deg); z-index: 3; border-radius: 2px; }
.gantt-ms.crit { background: var(--red); }
.legend-crit { display: inline-block; width: 18px; height: 8px; border-radius: 3px; background: var(--red); vertical-align: middle; }
.edit-row td { padding-top: 0; border-bottom: 1px solid var(--border); }
.edit-row details > summary { margin-top: -6px; }
@media (max-width: 900px) { .gantt { grid-template-columns: 160px minmax(0, 1fr); } }

/* ===== Prohlížeč výkresů ===== */
.viewer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.viewer-head h2 { margin: 0 0 2px; }
.viewer { padding: 0; overflow: hidden; }
.viewer-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--border); background: #f8fafc; position: sticky; top: 0; z-index: 4; }
.tool-group { display: inline-flex; align-items: center; border: 1px solid #cdd2d9; border-radius: 7px; overflow: hidden; background: #fff; }
.tool-group button { border: 0; background: #fff; padding: 6px 10px; font: inherit; font-size: .82rem; cursor: pointer; border-right: 1px solid #e5e7eb; }
.tool-group button:last-child { border-right: 0; }
.tool-group button.active { background: var(--primary); color: #fff; }
.tool-group .small { padding: 0 8px; }
.viewer-toolbar input[type=color] { width: 36px; height: 30px; padding: 2px; border: 1px solid #cdd2d9; border-radius: 6px; }
.viewer-stage { overflow: auto; max-height: calc(100vh - 210px); min-height: 400px; background: #e2e8f0; padding: 12px; }
.viewer-sheet { position: relative; margin: 0 auto; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.15); }
.viewer-sheet canvas, .viewer-sheet svg { position: absolute; left: 0; top: 0; }
.viewer-sheet svg { touch-action: none; }
.viewer-sheet .mk { cursor: pointer; }
.cmp { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: middle; }
.cmp-old { background: #dc2626; } .cmp-new { background: #2563eb; } .cmp-same { background: #464646; }

.insp-table input { width: 100%; padding: .35em .5em; border: 1px solid #cdd2d9; border-radius: 6px; font: inherit; font-size: .88rem; }
.insp-table tr.insp-fail td { background: #fef2f2; }
.inline-check { display: inline-flex !important; margin: 0 10px 0 0 !important; }

.attendance-widget { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; border-left: 5px solid var(--green); }
.attendance-widget.is-in { border-left-color: var(--primary); background: #f8fbff; }

/* Stavební deník – záznamy oprávněných osob */
.diary-entry { border-left: 3px solid var(--primary, #2563eb); padding: 6px 10px; margin: 8px 0; background: var(--bg); border-radius: 4px; }
.diary-entry.corrected > div:nth-child(2) { text-decoration: line-through; opacity: .7; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85em; }
table.ident th { width: 34%; white-space: nowrap; font-weight: 600; }
.print-block { break-inside: avoid; }

/* Grafy (App\Core\Chart) */
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--muted); font-size: 11px; font-family: inherit; }
.hbars { display: grid; gap: 6px; margin: 8px 0; }
.hbar { display: grid; grid-template-columns: minmax(120px, 34%) 1fr 70px; gap: 8px; align-items: center; font-size: 13px; }
.hbar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { background: var(--bg); border-radius: 4px; height: 12px; overflow: hidden; }
.hbar-t > span { display: block; height: 100%; background: var(--primary); }
.hbar-v { text-align: right; white-space: nowrap; }

/* ===== Kompaktní vzhled: Arial 13 px, užší menu, menší odsazení ===== */
:root { --sidebar: 184px; --radius: 6px; }
html { font-size: 13px; }
body { font-family: Arial, Helvetica, sans-serif; font-size: 13px; line-height: 1.4; }
h1 { font-size: 1.3rem; } h2 { font-size: 1.08rem; } h3 { font-size: .98rem; }
.sidebar .brand { padding: 10px 12px; }
.side-nav { padding: 6px 6px; gap: 0; }
.side-nav a { padding: 5px 10px; border-radius: 5px; font-size: 13px; }
.nav-group { margin: 10px 10px 2px; font-size: 10px; }
.side-user { padding: 8px 12px; font-size: 12px; }
.topbar { padding: 7px 16px; }
.page { padding: 12px 16px 40px; max-width: none; }
.card { padding: 12px 14px; margin-bottom: 12px; }
.stat { padding: 10px 12px; }
.stat-n { font-size: 1.4rem; }
.btn { padding: .42em .9em; font-size: 13px; border-radius: 5px; }
.btn-sm { padding: .3em .65em; font-size: 12px; }
.btn-lg { padding: .55em 1.2em; font-size: 14px; }
.tabs a { padding: 4px 9px; font-size: 13px; border-radius: 5px; }
.project-tabs { margin-bottom: 10px; padding-bottom: 6px; flex-wrap: wrap; overflow: visible; }
.table { font-size: 13px; }
.table th, .table td { padding: 5px 6px; }
.table th { font-size: 11px; }
.form label { margin-bottom: 8px; font-size: 12px; }
.form input:not([type=checkbox]):not([type=radio]):not([type=file]), .form select, .form textarea, .chat-form textarea { padding: .35em .55em; font-size: 13px; }
/* Komunikace */
.chat-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 10px; height: calc(100vh - 80px); }
.chat-side { padding: 10px; overflow-x: hidden; }
.chat-item { padding: 4px 6px; font-size: 13px; }
.chat-group-title { margin: 10px 4px 2px; font-size: 10px; }
.chat-header { padding: 8px 12px; }
/* Menu „Nová“ v seznamu konverzací se rozbalí uvnitř panelu – nic se nepřekrývá ani neořezává */
.chat-side .dropdown-menu { position: static; width: auto; margin-top: 8px; box-shadow: none; padding: 10px; }
.dropdown-menu { padding: 10px; }
.dropdown-menu select[multiple] { width: 100%; }
.chat-side-head { flex-wrap: wrap; align-items: flex-start; }
.chat-side-head > strong { line-height: 26px; }
.chat-side-head .dropdown { display: contents; }
.chat-side-head .dropdown > summary { margin-left: auto; }
.chat-side-head .dropdown-menu { flex-basis: 100%; }

/* Poptávky z webu */
.inquiry-cols { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.inq-msg { border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; }
.inq-msg.out { border-left: 3px solid var(--primary); background: #f6f8fc; }
.inq-msg.note { background: #fffbea; border-style: dashed; }
tr.unread td { background: #f5f8ff; }
.code-box { width: 100%; font-family: Consolas, monospace; font-size: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); }
.inq-preview { width: 100%; height: 640px; border: 1px dashed var(--border); border-radius: 6px; }

/* Správa platformy */
.settings-help { margin: -4px 0 8px; }
.job-form { width: 320px; }
.job-form .row { gap: 6px; align-items: center; margin-bottom: 8px; }
.w-xs { width: 56px !important; } .w-sm { width: 80px !important; }

/* Průvodce založením projektu */
.wizard-steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0 0 12px; }
.wizard-steps li { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 5px; background: #fff; border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: 13px; }
.wizard-steps li span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--border); color: var(--dark); font-size: 11px; font-weight: bold; }
.wizard-steps li.active { border-color: var(--primary); color: var(--dark); font-weight: bold; }
.wizard-steps li.active span, .wizard-steps li.done span { background: var(--primary); color: #fff; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.form .choice { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--border); border-radius: 6px; padding: 10px; cursor: pointer; margin: 0; }
.choice:has(input:checked) { border-color: var(--primary); background: #eff4ff; }
.choice small { display: block; color: var(--muted); font-weight: normal; margin-top: 2px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.form .chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; cursor: pointer; margin: 0; font-weight: normal; }
.chip:has(input:checked) { border-color: var(--primary); background: #eff4ff; }
.ms-edit { border: 1px solid var(--border); border-radius: 6px; padding: 8px; margin-bottom: 8px; }
.ms-edit .row { gap: 6px; margin-bottom: 6px; align-items: center; }
.form .ms-edit textarea { width: 100%; font-size: 12px; }
.ms-edit:has([name$="[skip]"]:checked) { opacity: .45; }
.wizard-nav { gap: 8px; }
/* Položky milníků v projektu */
.ms-items { list-style: none; margin: 4px 0 6px; padding: 0 0 0 4px; width: 100%; }
.ms-items li { display: flex; gap: 6px; align-items: center; font-size: 12px; padding: 1px 0; }
.ms-items li.done span { text-decoration: line-through; color: var(--muted); }
.ms-progress { font-size: 11px; color: var(--muted); margin-left: 6px; }
.milestones li { flex-wrap: wrap; }
.ms-details { width: 100%; margin-top: 2px; }
.ms-details summary { cursor: pointer; }
.ms-new { border-style: dashed; }

/* Vložení formuláře na web */
.embed-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.embed-option { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; }
.embed-option h3 { margin-top: 0; }
.embed-option ol { padding-left: 18px; }
.embed-option li { margin-bottom: 6px; }
code.copy, .copy { cursor: copy; }
.qr-small svg { width: 96px; height: 96px; }
.copied { outline: 2px solid var(--green); }
