/* NTS Mini App — NXA Design System v2 */
:root {
  --primary: #111827;
  --secondary: #6b7280;
  --muted: #9ca3af;
  --border: #e5e7eb;
  --bg: #f6f7fb;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* ── Topbar ─────────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

/* логотип NEWTECH — векторное воссоздание фирменного wordmark */
.logo {
  position: relative;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: .015em;
  color: #1c2340;
  line-height: 1;
  padding-top: 8px;
  user-select: none;
}
.logo-bar {
  /* как в оригинале: штрих вровень с левым краем «N», длина ~30% wordmark */
  position: absolute;
  top: 0; left: 1px;
  width: 40%; height: 3.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ef6a45, #f9b195);
}

/* переключатель языка — segmented pill */
.lang-switch {
  display: inline-flex; flex-shrink: 0;
  background: #f3f4f6; border: 1px solid var(--border);
  border-radius: 999px; padding: 3px; gap: 2px;
}
.lang-switch button {
  border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--secondary);
  padding: 6px 12px; border-radius: 999px;
  transition: 150ms ease;
}
.lang-switch button.is-active { background: var(--primary); color: #fff; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px; letter-spacing: .02em;
}
.brand-name { font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 12px; color: var(--secondary); margin-top: 1px; }

/* ── Tabs ───────────────────────────────── */
.tabs {
  display: flex; gap: 4px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
}
.tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 8px 10px;
  border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 500; font-size: 13px; color: var(--secondary);
  border-bottom: 3px solid transparent;
  transition: 150ms ease;
}
.tab svg { width: 20px; height: 20px; }
.tab:hover { background: #f3f4f6; }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); background: none; }

/* ── Page ───────────────────────────────── */
.page { flex: 1; overflow-y: auto; padding: 20px 16px 0; max-width: 720px; width: 100%; margin: 0 auto; }

.section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 12px;
}

/* ── KPI ────────────────────────────────── */
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.kpi-row--wide { grid-template-columns: repeat(2, 1fr); }
.kpi {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,.05);
  text-align: left; font: inherit; color: inherit;
}
button.kpi { cursor: pointer; transition: 150ms ease; }
button.kpi:hover { border-color: #d1d5db; }
button.kpi:active { transform: scale(.98); }
button.kpi:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kpi--accent { background: var(--accent-soft); border-color: #e0e7ff; }
.kpi--warn { background: #fffbeb; border-color: #fde68a; }
.kpi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi-value { font-size: 22px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 12px; font-weight: 400; color: var(--secondary); }

/* ── Сегментированный переключатель статуса (крупные тап-цели) ── */
.seg {
  display: flex; gap: 4px;
  background: #eceef3; border-radius: 13px; padding: 4px;
  margin-bottom: 10px;
}
.seg-btn {
  flex: 1; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--secondary);
  padding: 10px 8px; border-radius: 10px; white-space: nowrap;
  transition: 150ms ease;
}
.seg-btn:active { transform: scale(.97); }
.seg-btn.is-active {
  background: #fff; color: var(--primary);
  box-shadow: 0 1px 4px rgba(17,24,39,.1);
}

/* ── Кнопка выбора категории → открывает шторку ── */
.cat-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid var(--border); background: #fff; border-radius: 13px;
  padding: 12px 14px; margin-bottom: 14px; cursor: pointer;
  font: inherit; font-size: 14px; color: var(--primary);
  transition: 150ms ease;
}
.cat-btn:active { transform: scale(.99); background: #fbfbfc; }
.cat-btn .filter-ic { width: 18px; height: 18px; color: var(--secondary); flex-shrink: 0; }
.cat-btn-label { flex: 1; text-align: left; font-weight: 500; }
.cat-btn-label.is-set { color: var(--accent); font-weight: 600; }
.cat-btn-chev { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }

/* ── Нижняя шторка (bottom sheet) ── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(17,24,39,.4); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 180ms ease;
}
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  background: #fff; border-radius: 22px 22px 0 0;
  padding: 8px 12px calc(18px + env(safe-area-inset-bottom, 0px));
  max-height: 72vh; overflow-y: auto;
  transform: translateY(101%);
  transition: transform 260ms cubic-bezier(.22, 1, .36, 1);
  box-shadow: 0 -8px 40px rgba(15,23,42,.16);
}
.sheet.is-open { transform: translateY(0); }
.sheet-handle {
  width: 38px; height: 4px; border-radius: 999px;
  background: #d1d5db; margin: 6px auto 12px;
}
.sheet-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); padding: 0 8px 6px;
}
.sheet-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 12px; border-radius: 12px; cursor: pointer;
  font-size: 15px; color: var(--primary); transition: 120ms ease;
}
.sheet-item:active { background: #f3f4f6; }
.sheet-item.is-active { color: var(--accent); font-weight: 600; }
.sheet-item .check { width: 20px; height: 20px; opacity: 0; flex-shrink: 0; }
.sheet-item.is-active .check { opacity: 1; }

/* ── Filter chips (legacy, не используются) ── */
.filter-chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 2px; margin: 0 -2px 10px;
  /* скроллбар скрыт, прокручиваемость показывает фейд справа */
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; white-space: nowrap;
  border: 1px solid var(--border); background: #fff; color: #4b5563;
  font: inherit; font-size: 12.5px; font-weight: 500; line-height: 1;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  transition: 150ms ease;
}
.chip:hover { background: #f9fafb; }
.chip:active { transform: scale(.96); }
.chip.is-active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 1px 3px rgba(17,24,39,.18);
}
/* категории — вторичный ряд: легче, мельче, без жёсткой рамки */
.filter-chips--cat { gap: 6px; margin: -2px 0 14px; }
.chip--cat {
  border-color: transparent; background: #f1f2f5; color: var(--secondary);
  padding: 5px 11px; font-size: 12px;
}
.chip--cat:hover { background: #e9ebf0; }
.chip--cat.is-active {
  background: var(--accent-soft); color: #4338ca; box-shadow: none;
}

/* видимый фокус с клавиатуры (a11y) */
.chip:focus-visible, .tab:focus-visible, .card--tappable:focus-visible,
.lang-switch button:focus-visible, .btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* скелетоны загрузки */
.skel {
  border-radius: 14px;
  background: linear-gradient(100deg, #eceef3 40%, #f5f6fa 50%, #eceef3 60%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
}
@keyframes skel-shimmer { to { background-position: -200% 0; } }
.skel-kpi { height: 78px; }
.skel-card { height: 96px; }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .skel { animation: none; background: #eceef3; }
}

/* ── Cards list ─────────────────────────── */
.cards { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,.05);
  cursor: pointer;
  transition: 150ms ease;
}
.card:hover { border-color: #d1d5db; }
.card--tappable { position: relative; padding-right: 38px; }
.card--tappable:active { transform: scale(.995); background: #fcfcfe; }
.card--tappable .chev {
  position: absolute; right: 14px; top: 50%; margin-top: -9px;
  width: 18px; height: 18px; color: #c8ccd4;
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-id { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-title { font-weight: 600; font-size: 15px; margin-top: 3px; letter-spacing: -.01em; }
.card-meta {
  display: flex; align-items: center; gap: 6px; margin-top: 9px;
  font-size: 12.5px; color: var(--secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta .arr { color: #c8ccd4; flex-shrink: 0; }
.card-meta--sub { margin-top: 4px; color: var(--muted); font-size: 12px; }
.card-meta--sub b { font-weight: 500; color: var(--secondary); }

/* status chips (семантические, pill) */
.st { border-radius: 999px; font-size: 11px; font-weight: 600; padding: 4px 10px; white-space: nowrap; }
.st-ASSIGNED { background: var(--accent-soft); color: #4338ca; }
.st-UNASSIGNED { background: #fffbeb; color: #92400e; }
.st-IN_WORK { background: #eff6ff; color: #1d4ed8; }
.st-WAIT_CONFIRM { background: #fdf4ff; color: #86198f; }
.st-DONE, .st-DONE_AUTO { background: #ecfdf5; color: #065f46; }
.st-REJECTED { background: #fef2f2; color: #991b1b; }
.st-CANCELLED { background: #f3f4f6; color: #6b7280; }

/* ── Люди ───────────────────────────────── */
.user-row { display: flex; align-items: center; gap: 12px; padding-right: 38px; }
.user-row.card--tappable { cursor: pointer; }
.avatar {
  width: 40px; height: 40px; border-radius: 999px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 600; font-size: 13.5px;
}
.avatar--off { background: #f1f2f5; color: var(--muted); }
.user-info { flex: 1; min-width: 0; }
.user-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.user-sub { font-size: 12.5px; color: var(--secondary); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-off {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: #fffbeb; color: #92400e; padding: 2px 7px; border-radius: 999px;
}

/* карточка управления участником (внутри member sheet) */
.member-head { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; }
.member-name { font-weight: 600; font-size: 17px; }
.member-sub { font-size: 13px; color: var(--secondary); margin-top: 2px; }
.member-stat {
  background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 10px;
  padding: 10px 12px; font-size: 13px; color: #4b5563; margin: 0 4px 4px;
}
.member-stat b { color: var(--primary); }
.member-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 12px; border-radius: 12px; cursor: pointer;
  font-size: 15px; color: var(--primary); transition: 120ms ease;
}
.member-toggle:active { background: #f3f4f6; }
.switch {
  width: 46px; height: 28px; border-radius: 999px; background: #d1d5db;
  position: relative; flex-shrink: 0; transition: 180ms ease;
}
.switch.on { background: var(--accent); }
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: 180ms cubic-bezier(.22,1,.36,1);
}
.switch.on .knob { transform: translateX(18px); }
.member-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 8px 4px; }
.mini-chip {
  background: #f1f2f5; color: var(--secondary);
  font-size: 12px; padding: 5px 11px; border-radius: 999px;
}

/* ── Сводка: пульс-карточка + секции ── */
.hero {
  border-radius: 16px; padding: 18px 20px 16px; margin-bottom: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 25px rgba(0,0,0,.05);
}
.hero--ok { background: #fff; }
.hero--warn { background: #fffdf7; border-color: #fde68a; }
.hero-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.hero-value {
  font-size: 44px; font-weight: 700; line-height: 1.05; margin: 4px 0 10px;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.hero-subs { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--secondary); }
.hero-sub b { color: var(--primary); font-weight: 600; }
.hero-sub.is-warn b { color: #b45309; }
.hero-sub.is-warn { color: #92400e; }
.hero-dot { width: 3px; height: 3px; border-radius: 999px; background: #d1d5db; }

.stat-wide {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 10px 25px rgba(0,0,0,.05);
}
.stat-wide.kpi--accent { background: var(--accent-soft); border-color: #e0e7ff; }
.stat-hint { font-size: 12px; color: var(--secondary); margin-top: 3px; }
.stat-big { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat-big small { font-size: 13px; font-weight: 400; color: var(--secondary); }
#summary .section-label { margin-top: 4px; }

/* ── Footer: [NXA] Platform — один знак, без дублей ── */
.foot {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 18px 0 24px; margin-top: 8px;
  border-top: 1px solid #f3f4f6;
}
.nxa-logo { height: 15px; width: auto; opacity: .38; }
.foot-name {
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  color: var(--muted);
}

/* группировка открытых заявок по «что требует действия» */
.group-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
  margin: 8px 2px 0;
}
.group-label:first-child { margin-top: 0; }
.group-count {
  background: #eceef3; color: var(--secondary);
  border-radius: 999px; padding: 1px 7px; font-size: 10.5px;
}

/* ── Drawer (§17) ───────────────────────── */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(17,24,39,.4); backdrop-filter: blur(4px);
  opacity: 0; pointer-events: none; transition: opacity 180ms ease;
}
.drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; z-index: 50;
  top: 12px; right: 12px; bottom: 12px;
  width: min(480px, calc(100vw - 24px));
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  box-shadow: -8px 0 40px rgba(15,23,42,.14), 0 10px 25px rgba(0,0,0,.05);
  display: flex; flex-direction: column;
  transform: translateX(calc(100% + 24px));
  transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}
.drawer.is-open { transform: translateX(0); }
@media (max-width: 768px) {
  .drawer { top: 0; right: 0; bottom: 0; width: 100vw; border-radius: 0; border: 0; }
}
.drawer-head {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 24px 16px; border-bottom: 1px solid #f3f4f6;
}
.drawer-ic {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.drawer-ic svg { width: 22px; height: 22px; }
.drawer-title-wrap { flex: 1; min-width: 0; }
.drawer-title { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-sub { font-size: 13px; color: var(--secondary); margin-top: 2px; }
.drawer-close {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--border); background: #fff; color: var(--secondary);
  display: grid; place-items: center; cursor: pointer; transition: 150ms ease;
}
.drawer-close:hover { background: #f3f4f6; }
.drawer-close svg { width: 18px; height: 18px; }
.drawer-body { flex: 1; overflow-y: auto; background: var(--bg); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
/* футер внутри прокручиваемого тела drawer — как на странице, не отдельной планкой */
.drawer-foot {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 0 6px; margin-top: 2px;
}

/* блоки внутри drawer */
.dcard {
  background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.dcard .section-label { margin-bottom: 10px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13.5px; }
.kv + .kv { border-top: 1px solid #f8f9fb; }
.kv b { font-weight: 500; color: var(--secondary); }
.raw { font-size: 13px; color: #4b5563; background: #f9fafb; border: 1px solid #f3f4f6; border-radius: 10px; padding: 10px 12px; }

.assign-row { display: flex; gap: 8px; }
.assign-row select {
  flex: 1; height: 44px; border-radius: 10px; border: 1px solid var(--border);
  font: inherit; font-size: 13.5px; padding: 0 10px; background: #fff; color: var(--primary);
}
.assign-row select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(17,24,39,.05); }
.btn-primary {
  height: 44px; padding: 0 18px; border-radius: 10px; border: 0;
  background: var(--primary); color: #fff;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  transition: 150ms ease;
}
.btn-primary:hover { background: #1f2937; }
.btn-primary:disabled { opacity: .5; cursor: default; }

.result { border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.result:empty { display: none; }
.result--success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.result--error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* timeline журнала */
.tl { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 10px; padding: 7px 0; font-size: 13px; }
.tl-item + .tl-item { border-top: 1px solid #f8f9fb; }
.tl-dot { width: 8px; height: 8px; border-radius: 999px; background: #d1d5db; margin-top: 5px; flex-shrink: 0; }
.tl-dot--accent { background: var(--accent); }
.tl-when { color: var(--muted); font-size: 12px; margin-top: 1px; }

.empty { text-align: center; color: var(--muted); padding: 36px 0 20px; font-size: 13.5px; }
.empty--rich { padding: 44px 24px 28px; }
.empty--rich svg { width: 36px; height: 36px; color: #d1d5db; margin-bottom: 10px; }
.empty-title { font-weight: 600; font-size: 14px; color: var(--secondary); }
.empty-hint { margin-top: 4px; font-size: 12.5px; color: var(--muted); max-width: 260px; margin-inline: auto; }

/* ── nxa-scroll (§15) ───────────────────── */
.nxa-scroll { scrollbar-width: thin; scrollbar-color: rgba(156,163,175,.55) transparent; }
.nxa-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.nxa-scroll::-webkit-scrollbar-track { background: transparent; }
.nxa-scroll::-webkit-scrollbar-thumb { background: rgba(156,163,175,.45); border-radius: 999px; }
.nxa-scroll::-webkit-scrollbar-thumb:hover { background: rgba(107,114,128,.75); }

body.drawer-open { overflow: hidden; }

/* ─────────────── Настройки (шестерёнка) ─────────────── */
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid var(--border); background: #fff; border-radius: 11px;
  color: var(--secondary); cursor: pointer; transition: 150ms ease;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:hover { color: var(--primary); border-color: #d1d5db; }
.icon-btn:active { transform: scale(.94); }

.settings-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.settings-head .icon-btn { width: 34px; height: 34px; }
.settings-title { font-size: 19px; font-weight: 700; color: var(--primary); }

.set-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.set-card + .set-card { margin-top: 0; }
.set-card-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 3px; }
.set-card-hint { font-size: 12.5px; color: var(--secondary); margin-bottom: 14px; line-height: 1.4; }

.field { margin-bottom: 13px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--secondary); margin-bottom: 6px; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; margin-bottom: 0; }

.inp {
  width: 100%; box-sizing: border-box;
  font: inherit; font-size: 14px; color: var(--primary);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; background: #fff; transition: 150ms ease;
}
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.inp { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 34px; }

.cat-list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px; border-top: 1px solid #f1f2f4; cursor: pointer;
}
.cat-list-item:first-child { border-top: 0; }
.cat-list-item:active { background: #f8f9fb; }
.cat-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.cat-meta { flex: 1; min-width: 0; }
.cat-meta-name { font-size: 14px; font-weight: 600; color: var(--primary); }
.cat-meta-sub { font-size: 12px; color: var(--secondary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-list-item .chev { width: 18px; height: 18px; color: #c8ccd4; flex-shrink: 0; }
.btn-ghost {
  width: 100%; margin-top: 12px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border: 0; border-radius: 10px;
  padding: 11px; cursor: pointer; transition: 150ms ease;
}
.btn-ghost:active { transform: scale(.98); }
.btn-danger { color: #991b1b; background: #fef2f2; }

.chips-input { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 10px; }
.chips-input .mini-chip { cursor: default; }
.chips-input .mini-chip b { cursor: pointer; margin-left: 4px; opacity: .6; font-weight: 700; }
.chips-input input { border: 0; outline: none; font: inherit; font-size: 13px; flex: 1; min-width: 80px; padding: 4px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet-actions .btn-primary { flex: 1; }
.field-hint { font-size: 11.5px; line-height: 1.4; color: var(--muted); margin-top: 5px; }
.pos-list { display: flex; flex-direction: column; }
.pos-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #f1f2f4; }
.pos-item:first-child { border-top: 0; }
.pos-name { font-size: 14.5px; font-weight: 600; color: var(--primary); }
.pos-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pos-qty { font-size: 13.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 3px 9px; white-space: nowrap; }
.pos-urgent { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #b91c1c; background: #fef2f2; border-radius: 7px; padding: 3px 8px; }
.user-stat { margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 4px 9px; display: inline-block; }
.obj-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px; }
.obj-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.obj-name { font-size: 15px; font-weight: 700; color: var(--primary); }
.obj-meta { font-size: 12px; color: var(--secondary); white-space: nowrap; }
.obj-mats { margin-top: 10px; border-top: 1px solid #f1f2f4; padding-top: 8px; }
.obj-mat { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13.5px; }
.obj-mat span { color: var(--secondary); }
.obj-mat b { color: var(--accent); font-weight: 700; }

/* ── Смета: прогресс в карточке объекта ── */
.sm-block { margin-top: 10px; border-top: 1px solid #f1f2f4; padding-top: 8px; }
.sm-title { font-size: 12px; font-weight: 700; color: var(--secondary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.sm-row { margin-bottom: 8px; }
.sm-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 3px; }
.sm-head span { color: var(--text); }
.sm-num { font-weight: 700; }
.sm-num--ok { color: #059669; }
.sm-num--warn { color: #d97706; }
.sm-num--over { color: #dc2626; }
.sm-bar { position: relative; height: 7px; border-radius: 4px; background: #eef0f3; overflow: hidden; display: flex; }
.sm-fill { height: 100%; border-radius: 4px; transition: width .3s; }
.sm-fill--ok { background: #10b981; }
.sm-fill--warn { background: #f59e0b; }
.sm-fill--over { background: #dc2626; }
.sm-fill--spill { background: repeating-linear-gradient(45deg, #dc2626, #dc2626 3px, #fca5a5 3px, #fca5a5 6px); border-radius: 0 4px 4px 0; }
.sm-sub { font-size: 11.5px; color: var(--secondary); margin-top: 2px; }
.sm-over-txt { color: #dc2626; }
.sm-edit-btn { margin-top: 8px; width: 100%; padding: 7px 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--accent); background: #eef2ff; border: none; border-radius: 10px; cursor: pointer; }
.sm-edit-btn:hover { background: #e0e7ff; }

/* ── Смета: редактор норм ── */
.sm-hint { font-size: 12.5px; color: var(--secondary); margin: 4px 2px 10px; line-height: 1.45; }
.sm-edit-row { display: grid; grid-template-columns: 1fr 74px 58px 44px; gap: 6px; align-items: center; padding: 5px 0; }
.sm-edit-name { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-in { font: inherit; font-size: 13.5px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 9px; width: 100%; min-width: 0; }
.sm-in:focus { outline: none; border-color: var(--accent); }
#smetaSheetBody .btn-primary { width: 100%; margin-top: 12px; }

/* ── График по неделям (Сводка) ── */
.chart-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px 8px; }
.ch-svg { width: 100%; height: auto; display: block; }
.ch-created { fill: var(--accent); }
.ch-done { fill: #10b981; }
.ch-num { font-size: 8.5px; fill: var(--secondary); text-anchor: middle; font-weight: 600; }
.ch-lbl { font-size: 8px; fill: var(--secondary); text-anchor: middle; }
.ch-legend { display: flex; gap: 14px; justify-content: center; padding: 6px 0 4px; font-size: 12px; color: var(--secondary); }
.ch-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ch-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ch-dot--created { background: var(--accent); }
.ch-dot--done { background: #10b981; }

/* ── Объекты v2: карточка с кольцом + деталка ── */
.obj-card--tappable { cursor: pointer; transition: transform .12s, box-shadow .12s; }
.obj-card--tappable:active { transform: scale(.985); }
.ring { position: relative; width: 56px; height: 56px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #eef0f3; stroke-width: 6; }
.ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .4s; }
.ring--ok .ring-fill { stroke: #10b981; }
.ring--warn .ring-fill { stroke: #f59e0b; }
.ring--over .ring-fill { stroke: #dc2626; }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.ring--ok .ring-num { color: #059669; }
.ring--warn .ring-num { color: #d97706; }
.ring--over .ring-num { color: #dc2626; }
.obj-card .obj-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.obj-minibars { display: flex; gap: 5px; margin-top: 10px; }
.mini-track { flex: 1; height: 5px; border-radius: 3px; background: #eef0f3; overflow: hidden; display: flex; }
.obj-detail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 2px 2px; }
.obj-detail-name { font-size: 17px; font-weight: 800; }

/* ── Прорабы в Хисоботе ── */
.prorab-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 11px 14px; margin-bottom: 8px; }
.prorab-info { flex: 1; min-width: 0; }
.prorab-name { font-weight: 700; font-size: 14.5px; }
.prorab-stat { font-size: 12.5px; color: var(--secondary); margin-top: 2px; }
.prorab-objs { font-size: 12px; color: var(--secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prorab-count { font-size: 20px; font-weight: 800; color: var(--accent); }

/* ── До/после (Хисобот) ── */
.ba-card { background: linear-gradient(135deg, #f0fdf4, #fff); border: 1px solid #bbf7d0; border-radius: 16px; padding: 12px 16px; }
.ba-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.ba-label { font-size: 13.5px; color: var(--secondary); }
.ba-vals { display: inline-flex; align-items: center; gap: 8px; }
.ba-before { color: #9ca3af; font-size: 14px; }
.ba-arrow { color: #10b981; font-weight: 700; }
.ba-after { color: #059669; font-size: 17px; font-weight: 800; }
.ba-src { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }

/* ── Действия в деталке объекта ── */
.obj-actions { display: flex; gap: 8px; margin-top: 14px; }
.obj-act-btn { flex: 1; text-align: center; padding: 10px 0; font: inherit; font-size: 13.5px; font-weight: 600; border-radius: 12px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; text-decoration: none; }
.obj-act-btn:hover { background: #f8f9fb; }
.obj-act-btn--danger { color: #dc2626; border-color: #fecaca; background: #fff5f5; }
.obj-act-btn--danger:hover { background: #fee2e2; }

/* ── Нарушители сметы (Хисобот) ── */
.viol-row { border-color: #fecaca; background: #fffafa; }
.viol-count { color: #dc2626; }
