:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-ink: #ffffff;
  --primary-soft: #dbeafe;
  --accent: #f59e0b;
  --green: #16a34a; --green-soft: #dcfce7;
  --red: #dc2626; --red-soft: #fee2e2;
  --amber: #b45309; --amber-soft: #fef3c7;
  --violet: #7c3aed; --violet-soft: #ede9fe;
  --blue: #1d4ed8; --blue-soft: #dbeafe;
  --gray-soft: #e5e7eb;
  --side: #0f172a; --side-text: #cbd5e1; --side-active: #1e293b;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 4px 16px rgb(15 23 42 / 4%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1120; --surface: #111827; --surface-2: #0f172a; --text: #e5e7eb; --muted: #94a3b8; --line: #1f2937;
    --primary: #3b82f6; --primary-soft: #1e3a8a55;
    --green: #4ade80; --green-soft: #14532d66; --red: #f87171; --red-soft: #7f1d1d66; --amber: #fbbf24; --amber-soft: #78350f66;
    --violet: #a78bfa; --violet-soft: #4c1d9566; --blue: #93c5fd; --blue-soft: #1e3a8a66; --gray-soft: #374151;
    --side: #020617; --side-active: #1e293b;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); -webkit-tap-highlight-color: transparent; }
body.noscroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; margin-top: 1em; }
p { margin: .3em 0 .6em; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small, small { font-size: .82rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.nowrap { white-space: nowrap; }
.text-red { color: var(--red); } .text-green { color: var(--green); } .text-amber { color: var(--amber); }
.ico { width: 20px; height: 20px; flex: none; }

/* ---------- Каркас ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; background: var(--side); color: var(--side-text); display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 40; padding: 14px 10px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #fff; padding: 6px 8px 16px; font-size: .95rem; line-height: 1.2; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #0f172a; display: grid; place-items: center; flex: none; }
.brand-lg { color: var(--text); font-size: 1.15rem; justify-content: center; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-text); font-weight: 500; }
.nav-link:hover { background: var(--side-active); color: #fff; }
.nav-link.active { background: var(--primary); color: #fff; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; color: var(--side-text); margin-top: 10px; border-top: 1px solid #1e293b; }
.me:hover { background: var(--side-active); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text b { color: #fff; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: #94a3b8; }
.content { flex: 1; margin-left: 248px; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 1.2rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; }
.menu-btn { display: none; }
.main { padding: 20px 24px 40px; max-width: 1280px; width: 100%; }
.scrim { display: none; }
.bottombar { display: none; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; width: 280px; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgb(0 0 0 / 45%); z-index: 30; }
  .content { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
  .main { padding: 14px 16px calc(84px + env(safe-area-inset-bottom)); }
  .bottombar {
    display: flex; position: fixed; inset: auto 0 0 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bb-link { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; color: var(--muted); font-size: .68rem; font-weight: 600; text-align: center; line-height: 1.1; }
  .bb-link .ico { width: 22px; height: 22px; }
  .bb-link.active { color: var(--primary); }
}

/* ---------- Элементы ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.form, .card.form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 5px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.inline-label { gap: 4px; }
.input {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-height: 44px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input:disabled { background: var(--surface-2); color: var(--muted); }
textarea.input { resize: vertical; min-height: 64px; }
select.input { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 16px center, right 11px center; background-size: 5px 5px; background-repeat: no-repeat; }
.input-sm { min-height: 38px; padding: 7px 10px; width: auto; font-size: 14px; }
select.input-sm { padding-right: 28px; }
.input-qty { width: 110px; flex: none; text-align: right; }
.input-unit { width: 74px; flex: none; }
.grow { flex: 1; min-width: 140px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .92rem;
  min-height: 42px; padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; white-space: nowrap; transition: filter .15s, background .15s; user-select: none;
}
.btn:hover { filter: brightness(.97); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary.busy::after { border-color: #fff transparent #fff transparent; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger-text { color: var(--red); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
.btn-lg { min-height: 50px; font-size: 1rem; }
.btn-xl { min-height: 58px; font-size: 1.05rem; width: 100%; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }

.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid-2-1 { display: grid; grid-template-columns: 1fr 90px; gap: 8px; }
@media (max-width: 600px) { .grid-3 { grid-template-columns: 1fr; } }

.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-gray { background: var(--gray-soft); color: var(--muted); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 500; }
.alert .ico { margin-top: 1px; }
.alert-red { background: var(--red-soft); color: var(--red); }
.alert-blue { background: var(--blue-soft); color: var(--blue); }
.alert-amber { background: var(--amber-soft); color: var(--amber); }

.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty-ico { font-size: 2rem; margin-bottom: 6px; }
.loading { display: grid; place-items: center; min-height: 40vh; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; flex: none; }
.alert .spinner { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Списки */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.card .list { box-shadow: none; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, .check-item:hover { background: var(--surface-2); }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-main small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.li-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; text-align: right; }
.qty { font-size: 1.1rem; }
.check-item { flex-direction: row; font-weight: 400; color: var(--text); cursor: pointer; }
.check-item input, .check-line input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; }
.check-line { flex-direction: row; align-items: center; gap: 10px; font-weight: 500; color: var(--text); padding: 6px 0; }
.section-title { margin-top: 18px; display: flex; align-items: center; gap: 8px; }
.count { background: var(--gray-soft); color: var(--muted); font-size: .75rem; border-radius: 99px; padding: 1px 8px; }
ul.plain { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 4px; }

/* Таблицы */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; }
.card .table-wrap { border: 0; border-radius: 0; margin: 0 -16px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; background: var(--surface-2); }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.row-warn td { background: var(--amber-soft); }
.row-muted td { opacity: .55; }
.table-edit td { padding: 6px; }
.table-edit .input { min-height: 38px; padding: 7px 9px; font-size: 14px; }
.table-edit td small { display: block; margin-top: 2px; }
.table-edit .input-qty { width: 90px; }

/* Сегменты-фильтры */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--gray-soft); border-radius: 10px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; }
.seg a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-wide { display: flex; margin-bottom: 14px; }
.seg-wide a { flex: 1; text-align: center; }

/* Модалки и тосты */
.modal-wrap { position: fixed; inset: 0; background: rgb(15 23 42 / 55%); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgb(0 0 0 / 30%); }
.modal-wide { max-width: 860px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-x { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; background: transparent; font-size: 26px; color: var(--muted); cursor: pointer; border-radius: 8px; z-index: 1; }
.modal-body h3 { padding-right: 36px; }
.confirm-text { font-size: 1rem; }
@media (max-width: 600px) {
  .modal-wrap { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .modal-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(90px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / 25%); font-weight: 500; transition: opacity .4s, transform .4s; }
.toast-err { background: var(--red); }
.toast.hide { opacity: 0; transform: translateY(10px); }
.photo-full { width: 100%; border-radius: 10px; }
.scanner { width: 100%; border-radius: 12px; background: #000; aspect-ratio: 1; object-fit: cover; }

/* ---------- Вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 30% 20%, #1e293b, #0f172a 60%); }
.login-card { width: min(380px, 100%); background: var(--surface); border-radius: 20px; padding: 26px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 30px 80px rgb(0 0 0 / 40%); }

/* ---------- Монтажник ---------- */
.greet { margin-bottom: 12px; }
.greet h2 { margin: 0; }
.greet p { margin: 2px 0 0; text-transform: capitalize; }
.shift-card { display: flex; flex-direction: column; gap: 14px; }
.shift-card.is-open { border-color: color-mix(in srgb, var(--green) 40%, var(--line)); }
.shift-head { display: flex; gap: 14px; align-items: center; }
.selfie { width: 76px; height: 76px; border-radius: 16px; object-fit: cover; background: var(--gray-soft); cursor: zoom-in; flex: none; }
.shift-time { font-size: 1.6rem; font-weight: 800; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); min-height: 104px; }
.tile .ico { width: 26px; height: 26px; color: var(--primary); margin-bottom: 6px; }
.tile small { color: var(--muted); }
.tile-accent { background: var(--primary); border-color: var(--primary); color: #fff; }
.tile-accent .ico, .tile-accent small { color: #fff; opacity: .95; }
.tile-done .ico { color: var(--green); }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }

.report-form { max-width: 760px; }
.work-row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.work-row:first-child { padding-top: 0; }
.work-num { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; margin-top: 9px; }
.work-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.work-fields .input-qty { width: 100%; text-align: left; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-soft); color: var(--primary); border-radius: 99px; padding: 5px 4px 5px 12px; font-weight: 600; font-size: .88rem; }
.chip button { border: 0; background: transparent; color: inherit; font-size: 18px; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; line-height: 1; }
.mat-list { display: flex; flex-direction: column; margin-bottom: 8px; }
.mat-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mat-row:last-child { border-bottom: 0; }
.mat-row .input-qty { width: 96px; }
.unit { color: var(--muted); font-size: .85rem; min-width: 22px; }
.manual-row, .line { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.manual-row .input:first-child { flex: 1; min-width: 160px; }
.lines { display: flex; flex-direction: column; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.thumbs img, .thumb-new img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: var(--gray-soft); }
.thumb-new { position: relative; }
.thumb-new button { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--red); color: #fff; cursor: pointer; }
.thumb-add { width: 84px; height: 84px; border-radius: 10px; border: 2px dashed var(--line); background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; font: inherit; font-size: .75rem; }
.thumb-add:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Склад ---------- */
.user-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.user-head h2 { margin: 0; }
.tool-card { display: flex; gap: 16px; align-items: center; }
.qr { width: 110px; height: 110px; background: #fff; border-radius: 8px; padding: 4px; flex: none; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.tl-item { display: grid; grid-template-columns: 112px 1fr; gap: 10px; font-size: .9rem; }
.tl-item > small { color: var(--muted); }
.inv-layout { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 14px; }
.inv-layout .card { margin-bottom: 14px; }
@media (max-width: 800px) { .inv-layout { grid-template-columns: 1fr; gap: 0; } }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; margin: 0; z-index: 5; }
@media (max-width: 900px) { .sticky-actions { bottom: calc(60px + env(safe-area-inset-bottom)); } }
.rec .line { margin: 0; }

/* ---------- Руководитель ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; color: var(--text); box-shadow: var(--shadow); }
.kpi span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.kpi b { font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi small { color: var(--muted); }
.kpi-accent { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.kpi-warn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.dash-grid .card { margin: 0; }
.dash-grid + .card, .dash-grid + section { margin-top: 14px; }
.span-2 { grid-column: span 2; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } .span-2 { grid-column: auto; } }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-bottom: 10px; }
.face { display: flex; flex-direction: column; gap: 1px; font-size: .85rem; }
.face img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; cursor: zoom-in; background: var(--gray-soft); margin-bottom: 4px; border: 3px solid var(--green); }
.face-ended img { border-color: var(--line); filter: grayscale(.4); }
.face b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.bar { width: 100%; background: var(--primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar-col small { color: var(--muted); font-size: .65rem; }
.obj-progress { display: block; color: var(--text); padding: 10px 0; border-bottom: 1px solid var(--line); }
.obj-progress:last-child { border-bottom: 0; }
.progress { height: 8px; background: var(--gray-soft); border-radius: 99px; overflow: hidden; margin: 6px 0 4px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), #22c55e); border-radius: 99px; }
.progress-sm { height: 6px; width: 70px; margin: 0; }
.timesheet { font-size: .78rem; }
.timesheet th, .timesheet td { padding: 6px 5px; text-align: center; border-left: 1px solid var(--line); }
.timesheet .sticky-col { position: sticky; left: 0; background: var(--surface); text-align: left; z-index: 1; min-width: 170px; }
.timesheet th.sticky-col { background: var(--surface-2); }
.timesheet .weekend { background: var(--gray-soft); }
.timesheet td.late { background: var(--amber-soft); color: var(--amber); font-weight: 700; }
.timesheet td.open { color: var(--green); font-weight: 800; }
.shift-feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.shift-item { display: flex; gap: 12px; margin: 0; }
.shift-photos { display: flex; gap: 6px; flex: none; }
.shift-photos figure { margin: 0; text-align: center; }
.shift-photos img { width: 76px; height: 96px; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: var(--gray-soft); }
.shift-photos figcaption { font-size: .72rem; color: var(--muted); }
.shift-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.shift-info a { display: inline-flex; align-items: center; gap: 3px; }
.shift-info .ico { width: 14px; height: 14px; }
.shift-info .link { text-align: left; margin-top: 4px; }

@media print {
  .sidebar, .topbar, .bottombar, .toolbar, .btn { display: none !important; }
  .content { margin: 0; }
}

/* Мобильные поправки */
.seg-wide a { white-space: normal; line-height: 1.2; }
@media (max-width: 600px) {
  .seg-wide a { font-size: .78rem; padding: 7px 6px; }
  .sticky-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .sticky-actions .btn-primary { grid-column: 1 / -1; order: -1; }
  .line .input.grow { min-width: 100%; }
}

/* ---------- Worketra: бренд, подписка, кабинет компании ---------- */
.brand-mark.w { background: none; padding: 0; }
.brand-mark.w img { width: 34px; height: 34px; display: block; }
.brand small { display: block; color: #64748b; font-weight: 600; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
.brand-lg small { color: var(--muted); }
.login-foot { text-align: center; color: var(--muted); font-size: .8rem; margin: 4px 0 0; }
.login-card.blocked { text-align: center; }
.login-card.blocked .brand { justify-content: center; }
.sub-banner { display: block; padding: 9px 24px; background: var(--primary); color: #fff; font-weight: 600; font-size: .88rem; text-align: center; }
.sub-banner.warn { background: #b45309; }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--gray-soft); border-radius: 99px; transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 3px rgb(0 0 0 / 30%); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:disabled + span { opacity: .45; cursor: not-allowed; }
.mod-toggle { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); font-weight: 400; font-size: .95rem; }
.mod-toggle:last-child { border-bottom: 0; }
.mod-toggle .li-main small { -webkit-line-clamp: 2; }
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 14px; }
.plan-card { position: relative; flex-direction: column; gap: 2px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; color: var(--text); font-weight: 400; transition: border-color .15s; }
.plan-card input { position: absolute; opacity: 0; }
.plan-card b { font-size: 1.05rem; }
.plan-card .pc-price { font-size: 1.4rem; font-weight: 800; }
.plan-card .pc-price small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.plan-card small { color: var(--muted); }
.plan-card .badge { position: absolute; top: 10px; right: 10px; }
.plan-card.on { border-color: var(--primary); background: var(--primary-soft); }
.pay-total { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; margin-bottom: 12px; border-top: 1px dashed var(--line); }
.pay-total b { font-size: 1.5rem; }
.chat { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); white-space: pre-wrap; }
.msg small { display: block; color: var(--muted); margin-bottom: 4px; }
.msg.support { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }

/* Материалы внутри работы в отчёте */
.work-mats { background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.wm-title { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wm-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.wm-row .grow { min-width: 160px; }
.wm-row .input-qty { width: 90px; }
@media (max-width: 600px) { .wm-row .grow { min-width: 100%; } }
.work-mat-list { margin: 2px 0 0; padding-left: 16px; color: var(--muted); font-size: .85rem; }

.sub-banner.demo { background: #7c3aed; }
.demo-role { text-align: left; background: var(--surface); font: inherit; }
.demo-role .link { margin-top: 6px; font-weight: 700; }

.pay-methods-app { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.pay-m { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s; }
.pay-m:hover { border-color: var(--primary); }
.pay-m small { color: var(--muted); }
.pay-m.busy { opacity: .6; }

details.history summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
details.history summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.history[open] summary::before { transform: rotate(90deg); }
details.history .hist-body { margin-top: 12px; }
.li-side .btn-sm { margin-top: 4px; }

.pay-m:disabled { opacity: .5; cursor: not-allowed; border-style: dashed; }
.pay-m:disabled:hover { border-color: var(--line); }

.has-err .input { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field-err { color: var(--red); font-weight: 600; }
