/* ERP · УКРБУДПРОЄКТ — спокійний інтерфейс */

@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@400;500;600;700;800&family=Jura:wght@400;500;600;700&display=swap');

/* ============ TOKENS ============ */

:root {
  /* Палітра УКРБУДПРОЄКТ */
  --c-blue:         #015B76;   /* інфо / оплати → петроль (вторинний) */
  --c-mint:         #98DAB4;   /* м'ятний акцент темної теми (як у 1-му бандлі) */
  --c-green:        #068B49;   /* статус у роботі → той самий емеральд (єдиний зелений) */
  --c-green-deep:   #068B49;   /* primary action → емеральд (з бандла) */
  --c-grass:        #068B49;   /* акцент бренду */
  --c-lime-bright:  #D6F58E;   /* яскравий лайм — запасний хайлайт */
  --c-red:          #ED413E;   /* прострочено → кіновар */
  --c-pine:         #186447;   /* хвоя — success */
  --c-lime:         #A8C33B;   /* лайм — вторинний акцент */
  --c-amber:        #F0BF30;   /* бурштин — warning */

  /* Шрифти */
  --font-sans: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Jura", "SF Mono", Menlo, monospace;

  /* Радіуси */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Простір */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  --dens: 1;
}

/* ---- Світла тема (білий фон) ---- */
.theme-light {
  --bg:           #ffffff;
  --bg-elev:      #ffffff;
  --bg-sunken:    #eef4f0;
  --bg-hover:     #edf3ef;
  --bg-active:    rgba(6, 139, 73, 0.09);   /* напівпрозорий основний зелений */
  --bg-tint:      #f1f6f3;
  --bg-nav-active:#e6f0f3;        /* петроль натяк (нав) */

  --ink:          #1b211a;
  --ink-2:        #454a3d;
  --ink-3:        #73796a;
  --ink-4:        #a8ac9d;

  --line:         #e3e8e2;
  --line-strong:  #d2dace;

  --accent:       var(--c-green-deep);
  --accent-soft:  rgba(6, 139, 73, 0.15);   /* напівпрозорий основний зелений */
  --accent-ink:   #064d2a;

  --nav-accent:   var(--c-blue);
  --nav-active-ink: #014c61;

  --live:         var(--c-pine);
  --live-bg:      #e5f0ea;

  --late:         var(--c-red);
  --late-bg:      #fdeae9;

  --done-ink:     #98a1ad;

  --shadow-sm:    0 1px 2px rgba(31, 35, 26, 0.05);
  --shadow-md:    0 8px 24px -10px rgba(31, 35, 26, 0.12);
  --focus-ring:   0 0 0 3px rgba(6, 139, 73, 0.22);

  color-scheme: light;
}

/* ---- Темна тема (повністю темна, #010e1f) ---- */
.theme-dark {
  --bg:           #042230;        /* петроль-навій */
  --bg-elev:      #073241;        /* картки, kpi, поверхні */
  --bg-sunken:    #03202c;        /* найглибше */
  --bg-hover:     #0d3a4a;
  --bg-active:    #0a3a2a;        /* хвоя натяк */
  --bg-tint:      #08312a;
  --bg-nav-active:#0e4357;        /* петроль натяк (нав) */

  --ink:          #e9eff0;
  --ink-2:        #9db0b5;
  --ink-3:        #6b8088;
  --ink-4:        #456069;

  --line:         #114050;
  --line-strong:  #1c5063;

  --accent:       var(--c-mint);
  --accent-soft:  #143a2a;
  --accent-ink:   var(--c-mint);

  --nav-accent:   #5fb3ca;
  --nav-active-ink: #bfe3ec;

  --live:         #2c8460;
  --live-bg:      #0a3a2a;

  --late:         var(--c-red);
  --late-bg:      #3a1414;

  --done-ink:     #4d5d74;

  --shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md:    0 8px 24px -10px rgba(0, 0, 0, 0.6);
  --focus-ring:   0 0 0 3px rgba(152, 218, 180, 0.28);

  color-scheme: dark;
}

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ LAYOUT ============ */
.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.app.app-with-header {
  display: block;
}

/* Drive cross-cutting elements */
.drive-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-md);
  margin-bottom: 16px;
}
.theme-dark .drive-banner { background: var(--bg-active); }
.drive-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-elev);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.drive-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  white-space: nowrap;
}
.drive-link-icon { font-size: 13px; }

.pb-row.pb-base {
  background: var(--bg-active);
  font-weight: 600;
}
.theme-dark .pb-row.pb-base { background: var(--bg-tint); }

/* ============ GANTT ============ */
.gantt-container {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.gantt-head {
  display: grid;
  grid-template-columns: 240px 1fr;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
}
.gantt-head-obj {
  padding: 10px 14px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
  border-right: 1px solid var(--line);
}
.gantt-timeline {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}
.gantt-month {
  padding: 10px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  text-align: center;
  border-right: 1px solid var(--line);
  text-transform: uppercase;
}
.gantt-month:last-child { border-right: 0; }
.gantt-month.is-current {
  background: var(--bg-tint);
  color: var(--accent);
}
.gantt-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  border-bottom: 1px solid var(--line);
}
.gantt-row:last-child { border-bottom: 0; }
.gantt-obj {
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}
.gantt-bars {
  position: relative;
  background-image: repeating-linear-gradient(to right, transparent, transparent calc(12.5% - 1px), var(--line) calc(12.5% - 1px), var(--line) 12.5%);
  min-height: 50px;
  padding: 8px 0;
}
.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 24px;
  background: var(--accent);
  border-radius: 4px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  white-space: nowrap;
}
.theme-dark .gantt-bar { color: #010e1f; }
.gantt-bar.is-completed { background: var(--ink-3); opacity: 0.65; }
.gantt-bar.is-active { background: var(--c-green-deep); box-shadow: 0 0 0 2px var(--bg-tint); }
.theme-dark .gantt-bar.is-active { background: var(--c-mint); }

/* ============ PHASE 5: ONBOARDING ============ */
.onb-stack, .onb-template { display: flex; flex-direction: column; gap: 10px; }
.onb-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.onb-card:hover { border-color: var(--line-strong); }
.onb-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}
.onb-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
}
.theme-dark .onb-avatar { color: var(--c-mint); }
.onb-progress { text-align: right; }
.onb-prog-num {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.onb-prog-num span { color: var(--ink-3); font-weight: 500; font-size: 14px; }
.onb-prog-label { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.onb-bar {
  height: 4px;
  background: var(--bg-sunken);
  position: relative;
}
.onb-bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.onb-detail {
  padding: 14px 18px;
  background: var(--bg-sunken);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.onb-template { padding: 0; }
.onb-template .onb-cat { padding: 14px 18px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); }

.onb-cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.onb-cat-icon { font-size: 16px; }
.onb-cat-name { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }
.onb-cat-stat { margin-left: auto; font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.onb-steps { display: flex; flex-direction: column; gap: 4px; }
.onb-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  border-radius: 4px;
}
.onb-step.is-done { color: var(--ink-3); }
.onb-step.is-done .onb-step-label { text-decoration: line-through; }
.onb-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.onb-check.is-on {
  background: var(--c-green-deep);
  border-color: var(--c-green-deep);
  color: #fff;
}
.onb-check svg { width: 11px; height: 11px; }
.onb-step-label { flex: 1; }

/* ============ PHASE 5: AUDIT ============ */
.audit-stream { display: flex; flex-direction: column; gap: 24px; }
.audit-day-head {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 600;
  padding: 8px 0;
  position: sticky;
  top: 100px;
  background: var(--bg);
  z-index: 5;
}
.audit-day-list {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.audit-row {
  display: grid;
  grid-template-columns: 50px 110px 130px 1fr 1.2fr;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  font-size: 13px;
}
.audit-row:last-child { border-bottom: 0; }
.audit-time { font-size: 11.5px; color: var(--ink-3); }
.audit-actor { display: flex; align-items: center; gap: 8px; }
.audit-action { display: flex; align-items: center; gap: 8px; }
.audit-action-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.audit-action-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.audit-entity { min-width: 0; }
.audit-entity-type {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.audit-entity-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.audit-details {
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1100px) {
  .audit-row { grid-template-columns: 1fr; gap: 4px; padding: 14px 18px; }
  .audit-entity-name { white-space: normal; }
}

/* ============ PHASE 5: NOTIFICATIONS ============ */
.notif-settings {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.notif-setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
}
.notif-setting-row:last-child { border-bottom: 0; }
.notif-channel {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
  min-width: 80px;
}
.notif-channel input { cursor: pointer; }

.notif-list { display: flex; flex-direction: column; gap: 4px; }
.notif-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  position: relative;
  transition: background 0.12s;
  cursor: pointer;
}
.notif-row:hover { background: var(--bg-hover); }
.notif-row.is-unread { background: var(--bg-tint); border-color: var(--accent-soft); }
.theme-dark .notif-row.is-unread { background: var(--bg-active); }
.notif-row.is-important { border-left: 3px solid var(--late); }
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.notif-row.is-unread .notif-icon { background: var(--bg-elev); }
.notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.notif-row.is-unread .notif-title { font-weight: 700; }
.notif-text {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.4;
}
.notif-unread-dot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============ PHASE 5: TRAINING (table reuses existing) ============ */

/* ============ KANBAN ============ */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  min-height: 60vh;
}
.kanban-col {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
}
.kanban-col-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.005em;
  text-transform: uppercase;
}
.kanban-col-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  background: var(--bg-elev);
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.kanban-col-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 100px;
}
.kanban-empty {
  text-align: center;
  padding: 40px 0;
  color: var(--ink-4);
  font-size: 13px;
}
.kanban-card {
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  position: relative;
}
.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.kanban-card.is-live { border-left: 3px solid var(--c-green-deep); }
.kanban-card.is-late { border-left: 3px solid var(--late); background: rgba(251, 74, 71, 0.04); }
.theme-dark .kanban-card.is-late { background: rgba(251, 74, 71, 0.08); }
.kanban-card.is-done { opacity: 0.7; }
.kanban-card.is-done .kanban-card-title { text-decoration: line-through; color: var(--ink-3); }

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.35;
  letter-spacing: -0.003em;
  margin-bottom: 8px;
}
.kanban-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.kanban-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.kanban-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.12s;
}
.kanban-card:hover .kanban-card-actions { opacity: 1; }
.kanban-card-actions button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  color: var(--ink-3);
  transition: all 0.1s;
}
.kanban-card-actions button:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.theme-dark .kanban-card-actions button:hover { color: #010e1f; }
.kanban-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  transition: border-color 0.12s, color 0.12s;
}
.kanban-add:hover { border-color: var(--accent); color: var(--accent); }

.select-pill {
  padding: 7px 12px;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
}

@media (max-width: 1100px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .kanban-board { grid-template-columns: 1fr; }
}

/* ============ KPI ============ */
.kpi-stack { display: flex; flex-direction: column; gap: 10px; }
.kpi-person-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.kpi-person-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background 0.1s;
}
.kpi-person-head:hover { background: var(--bg-hover); }
.kpi-person-summary { text-align: right; flex-shrink: 0; }
.kpi-person-num {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.kpi-person-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 3px;
}
.kpi-goals-list {
  border-top: 1px solid var(--line);
  padding: 14px 18px;
  background: var(--bg-sunken);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.kpi-goal-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-elev);
  border-radius: 8px;
}
.kpi-goal-title { font-size: 13px; font-weight: 500; color: var(--ink); }
.kpi-goal-vals { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 6px; }
.kpi-goal-current { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi-actions { display: flex; gap: 8px; margin-top: 6px; }

.oneonone-list { display: flex; flex-direction: column; gap: 8px; }
.oneonone-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.oneonone-row.is-upcoming { border-left: 3px solid var(--accent); }

/* ============ SUPPLIERS ============ */
.supplier-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-item {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-2);
}

/* ============ TASK TEMPLATES ============ */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.template-card {
  padding: 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.template-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.template-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.template-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.template-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.template-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
  margin-top: -6px;
}
.template-stats {
  display: flex;
  gap: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.template-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--ink-3);
}
.template-stats b {
  font-size: 18px;
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
}
.template-foot { display: flex; gap: 6px; }
.template-add {
  padding: 20px;
  background: transparent;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 500;
  min-height: 200px;
  transition: border-color 0.12s, color 0.12s;
}
.template-add:hover { border-color: var(--accent); color: var(--accent); }
.template-add svg { width: 20px; height: 20px; }

/* ============ DASHBOARD ============ */
.dash-hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 32px;
  padding: 28px 32px;
  background: var(--bg-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-xl);
  margin-bottom: 28px;
}
.theme-dark .dash-hero {
  background: var(--bg-elev);
}
.dash-hero-label {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 6px;
}
.dash-hero-val {
  font-size: 42px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dash-hero-val span {
  font-size: 20px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 4px;
}
.dash-hero-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 8px;
}
.dash-hero-divider {
  width: 1px;
  background: var(--line);
  align-self: stretch;
}
.dash-hero-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.dash-hs-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-size: 13.5px;
  padding: 4px 0;
}
.dash-hs-label { color: var(--ink-2); }
.dash-hs-val { font-variant-numeric: tabular-nums; font-weight: 500; }
.dash-hs-val.good { color: var(--c-green-deep); }
.dash-hs-val.bad { color: var(--ink-2); }
.dash-hs-val.big { font-size: 18px; font-weight: 700; }
.dash-hs-total {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.theme-dark .dash-hs-val.good { color: var(--c-green); }

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.dash-card {
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
}
.dash-card-wide {
  grid-column: span 2;
}
.dash-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dash-card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-card-title .ic { color: var(--ink-3); width: 16px; height: 16px; }
.quick-action .qa-ic { color: var(--accent); }
.theme-dark .quick-action .qa-ic { color: var(--accent); }

/* ============ ЛІНІЙНІ ІКОНКИ В ПЛИТКАХ ============ */
.ic { vertical-align: -0.15em; }
/* нейтральні плитки — акцентний колір іконки */
.template-icon .ic,
.subfolder-icon .ic,
.cat-icon .ic,
.cat-mini-icon .ic,
.notif-icon .ic,
.onb-cat-icon .ic,
.irc-icon .ic,
.ke-icon .ic,
.drive-folder-icon .ic,
.drive-status-icon .ic,
.report-icon .ic,
.supplier-avatar .ic,
.lead-stage-icon .ic,
.drive-banner-icon .ic { color: var(--accent); }
/* плитки з власним інлайн-кольором (role/legal/audit) — іконка успадковує його */
.audit-action-icon .ic { width: 1em; height: 1em; }
.dash-card-link {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
}
.dash-card-link:hover { color: var(--ink); }
.dash-big-num {
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.dash-big-num span {
  font-size: 16px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 3px;
}
.dash-card-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 4px;
}
.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.dash-stat {
  padding: 10px 12px;
  background: var(--bg-active);
  border-radius: 8px;
}
.dash-stat-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.dash-stat-label {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 2px;
}
.dash-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--late-bg);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.dash-alert.is-warn { color: var(--late); }
.dash-alert > span { flex: 1; }
.dash-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.dash-row > *:first-child { min-width: 0; flex: 1; overflow: hidden; }
.dash-row .cell-name,
.dash-row .cell-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-row:last-child { border-bottom: 0; }
.dash-team-row {
  display: flex;
  gap: 14px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.dash-team-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}
.dash-team-load {
  height: 3px;
  background: var(--c-green);
  border-radius: 2px;
  max-width: 100%;
}
.dash-team-load.is-high { background: var(--late); }

.dash-mini-chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  height: 100px;
  align-items: flex-end;
  margin-top: 14px;
}
.dash-mini-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.dash-mini-bar {
  width: 70%;
  background: var(--c-green-deep);
  border-radius: 3px 3px 0 0;
  min-height: 12px;
}
.dash-mini-label {
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 500;
}

.dash-funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.dash-funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-sunken);
  border-radius: 6px;
}

.dash-team-stats {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.dash-team-stats > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  color: var(--ink-3);
}
.dash-team-stats b {
  font-size: 17px;
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.quick-action:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  color: var(--ink);
}

@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-card-wide { grid-column: span 2; }
  .quick-actions { grid-template-columns: repeat(3, 1fr); }
  .dash-hero { grid-template-columns: 1fr; }
  .dash-hero-divider { display: none; }
}
@media (max-width: 720px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-card-wide { grid-column: span 1; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

/* ============ LEADS ============ */
.lead-stack {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 12px;
}
.lead-card {
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.lead-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.lead-card.lead-hot { border-left: 3px solid var(--c-green-deep); }
.lead-card.lead-warm { border-left: 3px solid var(--c-blue); }
.lead-card.lead-cold { border-left: 3px solid var(--ink-4); opacity: 0.85; }
.lead-card.lead-lost { opacity: 0.55; background: var(--bg-sunken); }
.lead-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.lead-card-stage { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lead-card-prob {
  text-align: right;
}
.lead-prob-num {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.lead-prob-num span {
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 1px;
}
.lead-prob-label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.lead-card-name {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.lead-card-client {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: -4px;
}
.lead-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.lead-card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.lead-card-foot {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.lead-value-label, .lead-action-label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lead-value-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  white-space: nowrap;
}
.lead-value-num span { font-size: 11px; color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.lead-action-text {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-stage-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-tint);
  border: 1px solid var(--accent-soft);
  border-radius: 8px;
}
.theme-dark .lead-stage-block { background: var(--bg-active); }
.lead-stage-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elev);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ============ BUDGETS ============ */
.budget-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.budget-row {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.budget-row.is-open { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.budget-row.is-over { border-left: 3px solid var(--late); }

.budget-head {
  display: grid;
  grid-template-columns: 1.2fr 1.4fr 1fr 32px;
  gap: 24px;
  padding: 18px 22px;
  cursor: pointer;
  align-items: center;
  transition: background 0.1s;
}
.budget-head:hover { background: var(--bg-hover); }

.budget-id { min-width: 0; }
.budget-plan-fact { min-width: 0; }
.bpf-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12.5px;
}
.bpf-label { color: var(--ink-3); }
.bpf-val { color: var(--ink); font-variant-numeric: tabular-nums; }
.bpf-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.bpf-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-sunken);
  border-radius: 4px;
  display: flex;
  overflow: visible;
  position: relative;
}
.bpf-bar-fill {
  height: 100%;
  background: var(--c-green-deep);
  border-radius: 4px;
  transition: width 0.3s;
}
.bpf-bar-fill.is-warn { background: var(--c-green); }
.bpf-bar-fill.is-over { background: var(--late); border-radius: 4px 0 0 4px; }
.bpf-bar-over {
  height: 100%;
  background: repeating-linear-gradient(45deg, var(--late) 0px, var(--late) 4px, #d03835 4px, #d03835 8px);
  border-radius: 0 4px 4px 0;
}
.bpf-bar-pct {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-width: 42px;
  text-align: right;
}

.budget-margin {
  text-align: right;
}
.budget-margin-val {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  line-height: 1.1;
}
.budget-margin-val span {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 3px;
}

.budget-detail {
  border-top: 1px solid var(--line);
  padding: 18px 22px;
  background: var(--bg-sunken);
}
.budget-total-row td {
  background: var(--bg-elev);
  border-top: 2px solid var(--line-strong);
}
.budget-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

@media (max-width: 1100px) {
  .budget-head { grid-template-columns: 1fr; gap: 14px; }
  .budget-margin { text-align: left; padding-top: 8px; border-top: 1px solid var(--line); }
}

/* ============ ROLES ============ */
.roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.role-card {
  padding: 20px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.role-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.role-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.role-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}
.role-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.role-desc {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.4;
}

.role-permissions-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg-sunken);
  border-radius: 8px;
}
.role-perm-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  gap: 12px;
}
.role-perm-label { color: var(--ink-3); flex-shrink: 0; }
.role-perm-val { color: var(--ink); font-weight: 500; text-align: right; white-space: nowrap; }

.role-members {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.role-members-label {
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.perm-matrix {
  background: var(--bg-sunken);
  border-radius: 8px;
  padding: 4px 0;
}
.perm-matrix-head {
  display: grid;
  grid-template-columns: 1.5fr 70px 70px 70px 70px;
  gap: 16px;
  padding: 8px 18px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 500;
}
.perm-matrix-head span:not(:first-child) { text-align: center; }
.perm-matrix-group {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 18px 4px;
}
.perm-matrix-row {
  display: grid;
  grid-template-columns: 1.5fr 70px 70px 70px 70px;
  gap: 16px;
  padding: 6px 18px;
  align-items: center;
  font-size: 13px;
}
.perm-item-name { color: var(--ink-2); }
.perm-dot {
  text-align: center;
  font-size: 14px;
  color: var(--ink-4);
}
.perm-dot.is-on { color: var(--c-green-deep); font-weight: 700; }
.theme-dark .perm-dot.is-on { color: var(--c-green); }

/* ============ COMPANY ============ */
.ke-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.ke-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.ke-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-active);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

/* ============ GOOGLE DRIVE ============ */
.drive-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-lg);
  margin-bottom: 24px;
}
.theme-dark .drive-status { background: var(--bg-active); }
.drive-status-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-elev);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
}

.drive-folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.drive-folder-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.drive-folder-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.drive-folder-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-sunken);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.subfolder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.subfolder-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.12s;
}
.subfolder-card:hover { border-color: var(--accent); }
.subfolder-icon {
  width: 32px;
  height: 32px;
  background: var(--bg-sunken);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 1px 6px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
}

/* ============ REPORTS ============ */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.report-card {
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.report-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.report-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.report-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.report-card-client {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: -4px;
}
.report-card-foot { margin-top: auto; padding-top: 4px; }

/* Modal preview */
.report-modal {
  position: fixed;
  inset: 24px;
  background: var(--bg);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  z-index: 101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.report-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}
.report-page {
  flex: 1;
  overflow-y: auto;
  padding: 40px;
  max-width: 850px;
  margin: 0 auto;
  width: 100%;
  background: var(--bg);
}
.report-doc-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 28px;
}
.report-section { margin-bottom: 28px; }
.report-section-h {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.report-info-table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
}
.report-info-table thead th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 500;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
}
.report-info-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.report-info-table tbody td:first-child {
  color: var(--ink-3);
  width: 200px;
}
.report-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding-left: 16px;
}
.report-list li {
  list-style: disc;
  font-size: 13px;
  color: var(--ink-2);
}
.photo-placeholder {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-ph {
  aspect-ratio: 4/3;
  background: var(--bg-sunken);
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
}
.report-signature {
  display: flex;
  justify-content: space-between;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

/* Internal reports */
.internal-report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.internal-report-card {
  padding: 18px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.irc-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.irc-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-sunken);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.irc-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.irc-subtitle {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.irc-kpis {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.irc-kpi {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  padding: 6px 10px;
  background: var(--bg-sunken);
  border-radius: 6px;
}
.irc-kpi-label { color: var(--ink-3); font-size: 12px; }
.irc-kpi-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.irc-foot {
  display: flex;
  gap: 6px;
}

/* ============ CASH FLOW ============ */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.account-card {
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 0.12s;
}
.account-card.is-primary {
  border-color: var(--accent);
  background: var(--bg-tint);
}
.theme-dark .account-card.is-primary { background: var(--bg-elev); }
.account-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 8px;
}
.account-head > div:first-child { min-width: 0; flex: 1; }
.account-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-bank {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.account-head .empl-chip { flex-shrink: 0; }
.account-balance {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1.1;
}
.account-balance span {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 3px;
}
.account-uah {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.account-iban {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  letter-spacing: 0;
}

/* Графік прогнозу */
.cashflow-graph {
  position: relative;
  padding: 24px 0 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.cf-bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: 140px;
  align-items: center;
  padding: 0 8px;
  position: relative;
}
.cf-zero-line {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 50%;
  height: 1px;
  background: var(--line-strong);
  z-index: 1;
}
.cf-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  z-index: 2;
}
.cf-bar {
  width: 12px;
  border-radius: 2px;
  transition: opacity 0.12s;
}
.cf-bar:hover { opacity: 0.85; }
.cf-bar-in {
  background: var(--c-green);
  margin-bottom: 1px;
  align-self: flex-end;
  margin-bottom: calc(50% + 1px);
}
.cf-bar-out {
  background: var(--late);
  align-self: flex-start;
  margin-top: calc(50% + 1px);
}

.cf-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  height: 140px;
  width: 100%;
  pointer-events: none;
  z-index: 3;
}

.cf-labels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  padding: 8px;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
}
.cf-label {
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-3);
  padding: 4px 2px;
}
.cf-label-week {
  font-weight: 500;
  margin-bottom: 2px;
}
.cf-label-bal {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 11px;
}
.cf-label.is-gap .cf-label-bal { color: var(--late); font-weight: 700; }

/* Операції */
.op-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.op-icon.op-in {
  background: var(--live-bg);
  color: var(--c-green-deep);
}
.theme-dark .op-icon.op-in { color: var(--c-green); }
.op-icon.op-out {
  background: var(--late-bg);
  color: var(--late);
}

/* ============ EXPENSES (категорії, кошториси) ============ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}
.cat-card {
  text-align: left;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.12s, background 0.12s;
  cursor: pointer;
}
.cat-card:hover { border-color: var(--line-strong); }
.cat-card.is-active {
  border-color: var(--accent);
  background: var(--bg-tint);
}
.theme-dark .cat-card.is-active { background: var(--bg-active); }
.cat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cat-icon {
  font-size: 18px;
  line-height: 1;
}
.cat-name {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 4px;
  font-weight: 500;
}
.cat-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}
.cat-amount span {
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 3px;
}
.cat-count {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 3px;
}

.cat-mini-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.break-bar-seg.is-focus {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
  z-index: 2;
}
.break-bar-seg { cursor: pointer; }

/* ============ ESTIMATES (Кошториси) ============ */
.rates-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.rate-card {
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.rate-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 4px;
}
.rate-val {
  font-size: 32px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1;
}
.rate-val span {
  font-size: 18px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 2px;
}
.rate-method {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-top: 2px;
}
.rate-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 4px;
}
.rate-sub.is-good { color: var(--c-green-deep); font-weight: 500; }
.rate-sub.is-neutral { color: var(--ink-2); }
.rate-sub.is-bad { color: var(--late); font-weight: 600; }
.rate-amount {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  margin-top: 6px;
}

.hint-box {
  padding: 14px 18px;
  background: var(--bg-tint);
  border: 1px solid var(--accent-soft);
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  margin-top: 12px;
}
.hint-box b { color: var(--accent); font-weight: 600; }
.theme-light .hint-box b { color: var(--accent-ink); }
.theme-dark .hint-box {
  background: var(--bg-active);
  border-color: var(--accent-soft);
}

/* Estimate rows */
.estimate-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.estimate-row {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.estimate-row.is-open { border-color: var(--line-strong); box-shadow: var(--shadow-md); }

.estimate-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 1fr) minmax(0, 1.2fr) 32px;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  align-items: center;
  transition: background 0.1s;
}
.estimate-head:hover { background: var(--bg-hover); }

.estimate-id { min-width: 0; }
.estimate-share { min-width: 0; text-align: left; }
.estimate-share-val {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-top: 2px;
}
.estimate-share-val span {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 2px;
}

.estimate-overhead {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.overhead-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.overhead-line .empl-chip { flex-shrink: 0; }
.overhead-pct {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-left: auto;
}

.estimate-total {
  text-align: right;
  min-width: 0;
}
.estimate-total-val {
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  margin-top: 2px;
  line-height: 1.1;
  white-space: nowrap;
}
.estimate-total-val span {
  font-size: 13px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 3px;
}

/* Formula */
.estimate-detail {
  border-top: 1px solid var(--line);
  padding: 22px;
  background: var(--bg-sunken);
}
.estimate-formula {
  background: var(--bg-elev);
  border-radius: var(--r-md);
  overflow: hidden;
}
.formula-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.formula-row:last-child { border-bottom: 0; }
.formula-label {
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.formula-note {
  font-size: 11.5px;
  color: var(--ink-3);
}
.formula-val {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 500;
}
.formula-row.formula-base { background: var(--bg-active); }
.formula-row.formula-base .formula-label { color: var(--accent-ink); font-weight: 600; }
.theme-dark .formula-row.formula-base { background: var(--bg-tint); }
.theme-dark .formula-row.formula-base .formula-label { color: var(--c-mint); }

.formula-row.formula-sub {
  background: var(--bg);
  font-weight: 600;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.formula-row.formula-final {
  background: var(--bg-active);
  font-size: 15px;
  font-weight: 700;
  padding: 14px 18px;
}
.formula-row.formula-final .formula-label { color: var(--accent-ink); }
.formula-row.formula-final .formula-val { color: var(--accent-ink); font-size: 17px; }
.theme-dark .formula-row.formula-final { background: var(--bg-tint); }
.theme-dark .formula-row.formula-final .formula-label,
.theme-dark .formula-row.formula-final .formula-val { color: var(--c-mint); }

.formula-row.formula-comparison {
  background: transparent;
  font-style: normal;
}
.formula-row.formula-comparison .formula-label { color: var(--ink-3); }

.formula-row.formula-margin {
  font-weight: 600;
  font-size: 14px;
  padding: 14px 18px;
}
.formula-row.formula-margin.is-good { background: var(--live-bg); }
.formula-row.formula-margin.is-good .formula-label,
.formula-row.formula-margin.is-good .formula-val { color: var(--c-green-deep); }
.theme-dark .formula-row.formula-margin.is-good .formula-label,
.theme-dark .formula-row.formula-margin.is-good .formula-val { color: var(--c-green); }
.formula-row.formula-margin.is-bad { background: var(--late-bg); }
.formula-row.formula-margin.is-bad .formula-label,
.formula-row.formula-margin.is-bad .formula-val { color: var(--late); }
.formula-row.formula-margin.is-neutral .formula-val { color: var(--ink-2); }

.estimate-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

@media (max-width: 1100px) {
  .estimate-head {
    grid-template-columns: 1fr auto;
    gap: 14px;
    grid-template-areas:
      "id toggle"
      "share share"
      "overhead overhead"
      "total total";
  }
  .estimate-id { grid-area: id; }
  .estimate-share { grid-area: share; display: flex; align-items: center; gap: 12px; padding-top: 4px; border-top: 1px solid var(--line); }
  .estimate-share .rate-label { margin-bottom: 0; }
  .estimate-share .estimate-share-val { font-size: 16px; margin-top: 0; }
  .estimate-share .rate-sub { display: none; }
  .estimate-overhead { grid-area: overhead; flex-direction: row; flex-wrap: wrap; gap: 12px 20px; }
  .estimate-overhead .overhead-line { font-size: 13px; }
  .estimate-overhead .overhead-pct { margin-left: 4px; }
  .estimate-total {
    grid-area: total;
    text-align: left;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
  }
  .estimate-total .estimate-total-val { font-size: 22px; }
  .obj-card-toggle { grid-area: toggle; }
}

@media (max-width: 700px) {
  .rates-row { grid-template-columns: 1fr; }
  .formula-row { grid-template-columns: 1fr auto; }
  .formula-row .formula-note { grid-column: 1 / -1; order: 3; }
}

/* ============ FINANCE ============ */
.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}

.rating-star {
  font-size: 14px;
  color: var(--ink-4);
}
.rating-star.is-on { color: var(--c-green); }

.contact-block {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-sunken);
  border-radius: 8px;
}
.contact-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.theme-dark .contact-avatar { color: var(--c-mint); }

/* CONTRACT CARDS */
.contract-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contract-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.contract-card.is-open { border-color: var(--line-strong); box-shadow: var(--shadow-md); }

.contract-card-head {
  display: grid;
  grid-template-columns: 130px 1fr auto auto auto;
  gap: 20px;
  padding: 18px 22px;
  cursor: pointer;
  align-items: center;
  transition: background 0.1s;
}
.contract-card-head:hover { background: var(--bg-hover); }

.contract-num-val {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.contract-num-date {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

.contract-main { min-width: 0; }
.contract-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.contract-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.contract-meta .dot {
  width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4);
}

.contract-amount {
  text-align: right;
  min-width: 140px;
}
.contract-amount-val {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.contract-amount-paid {
  font-size: 11.5px;
  color: var(--c-green-deep);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.theme-dark .contract-amount-paid { color: var(--c-green); }

/* SCHEDULE */
.contract-schedule {
  border-top: 1px solid var(--line);
  padding: 18px 22px 22px;
  background: var(--bg-sunken);
}
.schedule-head {
  margin-bottom: 12px;
}
.schedule-table tbody tr.is-overdue td { background: var(--late-bg); }
.schedule-table tbody tr.is-overdue td:first-child { box-shadow: inset 3px 0 0 var(--late); }
.theme-dark .schedule-table tbody tr.is-overdue td { background: #2c1413; }
.schedule-table thead th { padding: 8px 12px; }
.schedule-table tbody td { padding: 10px 12px; }

.contract-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  align-items: center;
}

/* ROW OVERDUE highlight */
.data-table tbody tr.row-overdue { background: rgba(251, 74, 71, 0.04); }
.theme-dark .data-table tbody tr.row-overdue { background: rgba(251, 74, 71, 0.07); }
.data-table tbody tr.row-overdue:hover { background: rgba(251, 74, 71, 0.10); }

/* ============ CASHFLOW CHART ============ */
.cashflow-chart {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  padding: 20px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  height: 200px;
}
.cashflow-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.cashflow-val {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  height: 14px;
}
.cashflow-track {
  flex: 1;
  width: 70%;
  max-width: 32px;
  display: flex;
  align-items: flex-end;
}
.cashflow-fill {
  width: 100%;
  background: var(--c-green-deep);
  border-radius: 3px 3px 0 0;
  min-height: 0;
  transition: height 0.3s;
}
.cashflow-col.is-overdue .cashflow-fill { background: var(--late); }
.cashflow-col.is-overdue .cashflow-val { color: var(--late); }
.cashflow-label {
  font-size: 10px;
  color: var(--ink-3);
  text-align: center;
  white-space: nowrap;
}

/* ============ APP HEADER (ERP-режим) ============ */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.appbar-row {
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.appbar-row-primary {
  height: 56px;
  border-bottom: 1px solid var(--line);
}

.appbar-row-secondary {
  height: 44px;
  background: var(--bg-sunken);
}

/* Бренд */
.appbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 12px;
  border-right: 1px solid var(--line);
  margin-right: 4px;
  flex-shrink: 0;
}
.appbar-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.appbar-brand-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.appbar-brand-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  margin-top: 1px;
}

/* Primary nav (top tabs) */
.appbar-nav {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
}

.appbar-nav-item {
  position: relative;
  padding: 0 14px;
  height: 100%;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  transition: color 0.15s;
}
.appbar-nav-item::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: transparent;
  border-radius: 2px;
  transition: background 0.15s;
}
.appbar-nav-item:hover { color: var(--ink); }
.appbar-nav-item.is-active {
  color: var(--accent);
}
.appbar-nav-item.is-active::after {
  background: var(--accent);
}
.theme-light .appbar-nav-item.is-active { color: var(--accent-ink); }
.theme-light .appbar-nav-item.is-active::after { background: var(--accent); }

/* Tools */
.appbar-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.appbar-search {
  width: 220px;
  margin-left: 0;
}

.theme-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink-2);
  transition: background 0.12s, color 0.12s;
}
.theme-btn:hover { background: var(--bg-hover); color: var(--ink); }

.appbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 10px 3px 3px;
  border-radius: var(--r-md);
  transition: background 0.12s;
  background: transparent;
}
.appbar-user:hover { background: var(--bg-hover); }
.appbar-user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}
.appbar-user-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.appbar-user-role {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

/* Sub-nav (secondary row) */
.subnav {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  min-width: 0;
  flex: 1 1 auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.subnav::-webkit-scrollbar { height: 4px; }
.subnav::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.subnav::-webkit-scrollbar-track { background: transparent; }
.subnav-item {
  height: 100%;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  position: relative;
  transition: color 0.12s;
  white-space: nowrap;
  flex-shrink: 0;
}
.subnav-item:hover { color: var(--ink); }
.subnav-item.is-active {
  color: var(--ink);
}
.subnav-item.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: var(--nav-accent);
  border-radius: 2px 2px 0 0;
}
.subnav-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-3);
  min-width: 20px;
  text-align: center;
}
.subnav-item.is-active .subnav-count {
  background: var(--bg-nav-active);
  border-color: transparent;
  color: var(--nav-active-ink);
}

.subnav-trail {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-4);
  flex-shrink: 0;
  padding-left: 16px;
}
.subnav-trail .trail-sep {
  color: var(--ink-4);
  font-size: 12px;
}
.subnav-trail .trail-current {
  color: var(--ink-3);
  font-weight: 500;
}

.hide-sm { display: inline; }
@media (max-width: 1100px) {
  .appbar-search { width: 160px; }
  .appbar-user-meta { display: none; }
  .hide-sm { display: none; }
}
@media (max-width: 820px) {
  .appbar-search { display: none; }
  .appbar-brand-text { display: none; }
}

/* ---- Sidebar (legacy, used elsewhere) ---- */
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg);
  padding: var(--s-6) 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sb-brand {
  padding: 0 var(--s-6) var(--s-6);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}

.sb-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
}
.theme-dark .sb-mark { color: #010e1f; }

/* Марка «Укрбудпроєкт» в appbar */
.sb-mark-ubp {
  background: #068B49;
  color: #fff !important;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.sb-mark-logo {
  width: 64%;
  height: 64%;
  object-fit: contain;
  display: block;
}
.appbar-brand-name .ubp-erp { color: var(--accent-ink); font-weight: 800; letter-spacing: 0.02em; }
.appbar-brand-name .ubp-name { color: var(--ink-2); font-weight: 600; }

/* Бренд: логотип-напис + зелений бейдж ERP */
.appbar-erp { color: var(--accent-ink); font-weight: 800; font-size: 16px; letter-spacing: 0.02em; }
.appbar-wordmark { height: 17px; width: auto; display: block; }
.appbar-wordmark-white { display: none; }
.appbar-erp-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #068B49; color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 0.04em;
  padding: 3px 7px; border-radius: 7px; line-height: 1;
}
.theme-dark .appbar-wordmark-black { display: none; }
.theme-dark .appbar-wordmark-white { display: block; }
.theme-dark .appbar-brand-name .ubp-erp { color: var(--accent); }
.theme-dark .appbar-brand-name .ubp-name { color: var(--ink); }
.appbar-brand-sub { text-transform: none !important; letter-spacing: 0 !important; }

.sb-brand-name {
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.005em;
}
.sb-brand-sub {
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 1px;
}

.sb-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: var(--s-3) var(--s-3);
}

.sb-section-title {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  font-weight: 500;
  padding: var(--s-4) var(--s-3) var(--s-2);
}

.sb-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 8px 12px;
  border-radius: var(--r-md);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  width: 100%;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
}
.sb-item:hover { background: var(--bg-hover); color: var(--ink); }
.sb-item.is-active {
  background: var(--bg-nav-active);
  color: var(--nav-active-ink);
}

.sb-item-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.sb-item.is-active .sb-item-count { color: var(--nav-active-ink); opacity: 0.85; }

.sb-footer {
  margin-top: auto;
  padding: var(--s-3) var(--s-3) var(--s-2);
  border-top: 1px solid var(--line);
}

.sb-user {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
}
.sb-user-name { font-weight: 600; font-size: 13px; }
.sb-user-role { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

.theme-switch {
  display: flex;
  background: var(--bg-sunken);
  border-radius: var(--r-md);
  padding: 3px;
  margin: var(--s-2) var(--s-3) 0;
}
.theme-switch button {
  flex: 1;
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-3);
  border-radius: 5px;
  transition: background 0.12s, color 0.12s;
}
.theme-switch button.is-active {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ---- Main ---- */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 60px;
  padding: 0 var(--s-8);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  gap: var(--s-5);
  position: sticky;
  top: 0;
  z-index: 10;
  white-space: nowrap;
}

.topbar-title {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.topbar-date {
  color: var(--ink-3);
  font-size: 13px;
  white-space: nowrap;
}

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  width: 240px;
  flex-shrink: 1;
  min-width: 120px;
  font-size: 13px;
  color: var(--ink-3);
  transition: border-color 0.12s;
}
.search:hover { border-color: var(--line-strong); }
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  min-width: 0;
}
.search input::placeholder { color: var(--ink-3); }
.search-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-4);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 7px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s, border-color 0.12s, transform 0.06s;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink);
  white-space: nowrap;
  flex-shrink: 0;
}
.btn:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.theme-dark .btn-primary { color: #010e1f; }
.btn-primary:hover { background: var(--c-green-deep); filter: brightness(0.95); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--ink); }

/* ============ PAGE CONTAINER ============ */
.page {
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: var(--s-10) var(--s-8) var(--s-16);
}

.page-head {
  margin-bottom: var(--s-8);
}
.page-greeting {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: var(--s-2);
}
.page-h1 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}
.page-h1 b { color: var(--accent); font-weight: 600; }

.page-sub {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--ink-3);
}
.page-sub .dot {
  width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4);
}

/* ============ KPI ============ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-10);
}
.kpi {
  padding: var(--s-5) var(--s-5);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-label {
  font-size: 11.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.kpi-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.kpi-sub {
  font-size: 12px;
  color: var(--ink-3);
}
.kpi.is-warn .kpi-value { color: var(--late); }

/* ============ SECTION ============ */
.section {
  margin-bottom: var(--s-12);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-4);
  padding-bottom: var(--s-3);
  border-bottom: 1px solid var(--line);
}
.section-h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
}
.section-sub {
  color: var(--ink-3);
  font-size: 13px;
}
.section-action {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 500;
}
.section-action:hover { color: var(--ink); }

/* ============ TASK LIST ============ */
.task-list {
  display: flex;
  flex-direction: column;
}
.task-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: var(--s-4);
  padding: 14px 8px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.1s;
  position: relative;
}
.task-row:hover { background: var(--bg-hover); }
.task-row:last-child { border-bottom: 0; }
.task-row.is-live { background: rgba(142, 201, 117, 0.07); }
.task-row.is-late { background: rgba(251, 74, 71, 0.07); }
.task-row.is-live:hover { background: rgba(142, 201, 117, 0.12); }
.task-row.is-late:hover { background: rgba(251, 74, 71, 0.12); }
.theme-dark .task-row.is-live { background: rgba(152, 218, 180, 0.06); }
.theme-dark .task-row.is-late { background: rgba(251, 74, 71, 0.10); }
.theme-dark .task-row.is-live:hover { background: rgba(152, 218, 180, 0.10); }
.theme-dark .task-row.is-late:hover { background: rgba(251, 74, 71, 0.16); }

.task-row::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  border-radius: 1px;
  background: transparent;
}
.task-row.is-live::before { background: var(--live); }
.task-row.is-late::before { background: var(--late); }

.task-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-elev);
  display: grid;
  place-items: center;
  transition: background 0.12s, border-color 0.12s;
  justify-self: start;
}
.task-check:hover { border-color: var(--accent); }
.task-row.is-done .task-check {
  background: var(--accent);
  border-color: var(--accent);
}
.task-check svg { width: 11px; height: 11px; color: #fff; opacity: 0; }
.theme-dark .task-row.is-done .task-check svg { color: #14181a; }
.task-row.is-done .task-check svg { opacity: 1; }

.task-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.task-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.003em;
}
.task-row.is-done .task-title {
  color: var(--done-ink);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.task-meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 12px;
  color: var(--ink-3);
}
.task-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-4);
  display: inline-block;
}
.task-obj {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}

.task-right {
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.task-time {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.task-row.is-late .task-time { color: var(--late); font-weight: 600; }
.task-row.is-live .task-time { color: var(--c-green-deep); }
.theme-dark .task-row.is-live .task-time { color: var(--c-green); }

.task-date {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
  min-width: 110px;
  text-align: right;
}
.task-date.is-late { color: var(--late); font-weight: 600; }

.task-assignee {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.theme-dark .task-assignee { color: var(--accent); }

.task-status {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--bg-sunken);
  color: var(--ink-3);
}
.task-status.is-live {
  background: var(--live-bg);
  color: var(--c-green-deep);
}
.theme-dark .task-status.is-live { color: var(--c-green); }
.task-status.is-late {
  background: var(--late-bg);
  color: var(--late);
}

/* ============ WEEK STRIP ============ */
.week-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--s-3);
}
.day-col {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s-4);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.day-col.is-today {
  border-color: var(--accent);
  background: var(--bg-tint);
}
.day-col.is-past { opacity: 0.65; }

.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.day-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 500;
}
.day-col.is-today .day-name { color: var(--accent); }
.day-num {
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.day-count {
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.day-task {
  font-size: 12.5px;
  padding: 6px 8px;
  background: var(--bg);
  border-radius: var(--r-sm);
  border-left: 2px solid var(--line-strong);
  color: var(--ink-2);
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.1s;
}
.day-task:hover { background: var(--bg-hover); }
.day-col.is-today .day-task { background: var(--bg-elev); }
.day-task.is-live { border-left-color: var(--live); }
.day-task.is-late { border-left-color: var(--late); color: var(--late); }
.day-task.is-done {
  color: var(--done-ink);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  border-left-color: var(--line);
}
.day-task-obj {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-4);
  display: block;
  margin-top: 2px;
}
.day-empty {
  font-size: 12px;
  color: var(--ink-4);
  font-style: italic;
  margin-top: auto;
  margin-bottom: auto;
  text-align: center;
}

/* ============ OBJECT ROW (для головної) ============ */
.obj-list { display: flex; flex-direction: column; }
.obj-row {
  display: grid;
  grid-template-columns: 110px 1fr 160px 180px;
  align-items: center;
  gap: var(--s-5);
  padding: var(--s-4) var(--s-2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.1s;
}
.obj-row:hover { background: var(--bg-hover); }
.obj-row:last-child { border-bottom: 0; }
.obj-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.obj-name { font-weight: 500; font-size: 13.5px; color: var(--ink); }
.obj-client { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.obj-stage {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}
.obj-stage-val { color: var(--ink-2); }

.progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progress-bar {
  height: 4px;
  background: var(--bg-sunken);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ============ OBJECT CARDS (Об'єкти) ============ */
.obj-stack {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.obj-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.obj-card.is-open { border-color: var(--line-strong); box-shadow: var(--shadow-md); }

.obj-card-head {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: var(--s-6);
  padding: var(--s-5) var(--s-6);
  cursor: pointer;
  align-items: center;
  transition: background 0.1s;
}
.obj-card-head:hover { background: var(--bg-hover); }

.obj-card-id {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 110px;
}
.obj-card-id .obj-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: -0.01em;
}
.obj-grade {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  background: var(--bg-active);
  color: var(--accent);
  border-radius: 4px;
  font-weight: 600;
  align-self: flex-start;
}
.theme-dark .obj-grade { background: var(--accent-soft); }

.obj-card-main { min-width: 0; }
.obj-card-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 4px;
}
.obj-card-meta {
  display: flex;
  align-items: center;
  gap: 4px 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.obj-card-meta > span:not(.dot) { white-space: nowrap; }
.obj-card-meta .dot {
  width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4);
}

.obj-card-now {
  text-align: right;
  min-width: 160px;
}
.obj-card-now-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  font-weight: 500;
  margin-bottom: 2px;
}
.obj-card-now-stage {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}
.obj-card-deadline {
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.obj-card-toggle {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--ink-3);
}
.obj-card-toggle:hover { background: var(--bg-hover); color: var(--ink); }

/* Загальний прогрес */
.obj-overall {
  padding: 0 var(--s-6) var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.obj-overall-bar {
  height: 4px;
  background: var(--bg-sunken);
  border-radius: 2px;
  overflow: hidden;
}
.obj-overall-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s;
}
.obj-overall-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* Стрічка етапів */
.stage-strip-wrap {
  padding: var(--s-3) var(--s-6) 0;
}
.stage-strip-wrap:last-child { padding-bottom: var(--s-5); }
.stage-strip-wrap.is-correction {
  padding-top: var(--s-2);
}

.stage-strip-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-4);
  font-weight: 500;
  margin-bottom: 6px;
}

.stage-strip {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.stage-strip-sep {
  flex: 0 0 12px;
  align-self: center;
  height: 1px;
  background: var(--line);
}

.stage-chip {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-sunken);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s, border-color 0.12s;
}
.stage-chip.is-active {
  background: var(--bg-tint);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--bg-tint);
}
.stage-chip.is-completed {
  border-style: dashed;
  background: transparent;
  color: var(--ink-3);
}
.stage-chip.is-completed .stage-chip-name { color: var(--ink-3); }
.stage-chip.is-skipped {
  border-style: dashed;
  background: transparent;
  opacity: 0.5;
}
/* Прострочене — червоний акцент перекриває зелений активний */
.stage-chip.has-late {
  background: rgba(251, 74, 71, 0.07);
  border-color: var(--late);
  box-shadow: 0 0 0 2px rgba(251, 74, 71, 0.07);
}
.theme-dark .stage-chip.has-late {
  background: rgba(251, 74, 71, 0.10);
  box-shadow: 0 0 0 2px rgba(251, 74, 71, 0.10);
}
.stage-chip.has-late .stage-chip-name { color: var(--late); }
.stage-chip.has-late .stage-chip-dot { background: var(--late); }

.stage-chip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.stage-chip-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-chip.is-active .stage-chip-name { color: var(--accent); }
.theme-light .stage-chip.is-active .stage-chip-name { color: var(--accent-ink); }

.stage-chip-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.65; }
}

.stage-chip-progress {
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.stage-chip-of {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 13px;
}
.stage-chip-empty {
  color: var(--ink-4);
  font-size: 16px;
}
.stage-chip.is-completed .stage-chip-progress { color: var(--ink-3); }

.stage-chip-note {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-chip-note.is-late { color: var(--late); font-weight: 600; }
.stage-chip-note.is-live { color: var(--c-green-deep); font-weight: 600; }
.theme-dark .stage-chip-note.is-live { color: var(--accent); }

.stage-chip svg { color: var(--accent); }
.stage-chip.is-completed svg { color: var(--ink-3); }

/* Розгорнутий блок */
.obj-expand {
  border-top: 1px solid var(--line);
  padding: var(--s-5) var(--s-6) var(--s-5);
  background: var(--bg-sunken);
}
.obj-expand-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}

@media (max-width: 900px) {
  .obj-card-head { grid-template-columns: 1fr auto; gap: var(--s-3); padding: var(--s-4); }
  .obj-card-id { flex-direction: row; align-items: center; min-width: 0; }
  .obj-card-now { display: none; }
  .stage-strip-wrap { padding-left: var(--s-4); padding-right: var(--s-4); }
  .stage-strip { overflow-x: auto; }
  .stage-chip { min-width: 100px; flex: 0 0 auto; }
}

/* ============ TEAM ============ */
.team-controls {
  display: flex;
  align-items: center;
  margin-bottom: var(--s-4);
}
.team-sort {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.team-sort-btn {
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
}
.team-sort-btn:hover { color: var(--ink); background: var(--bg-hover); }
.team-sort-btn.is-active {
  background: var(--bg-nav-active);
  color: var(--nav-active-ink);
}

.team-table {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.team-table-head,
.team-row {
  display: grid;
  grid-template-columns: 48px 1.5fr 1fr 1.4fr 1.2fr 1.5fr;
  align-items: center;
  gap: var(--s-4);
  padding: 12px var(--s-5);
}
.team-table-head {
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
  padding-top: 10px;
  padding-bottom: 10px;
}
.team-row {
  border-bottom: 1px solid var(--line);
  transition: background 0.1s;
}
.team-row:hover { background: var(--bg-hover); }
.team-row:last-child { border-bottom: 0; }

.team-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.theme-dark .team-avatar { background: var(--accent-soft); color: var(--accent); }

.team-name { font-weight: 600; font-size: 14px; color: var(--ink); letter-spacing: -0.005em; }
.team-role { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.team-col-tasks {
  font-size: 13px;
  color: var(--ink-2);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.team-task-count {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.team-late { color: var(--late); font-size: 11.5px; font-weight: 500; }

.team-col-load {
  display: flex;
  align-items: center;
  gap: 10px;
}
.team-col-load .load-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-sunken);
  border-radius: 3px;
  overflow: hidden;
  max-width: 100px;
}
.theme-dark .team-col-load .load-bar { background: var(--bg-hover); }
.load-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.load-fill.is-high { background: var(--late); }
.load-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
}
.load-val.is-high { color: var(--late); }

.team-col-phone {
  font-size: 12.5px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.team-col-email {
  font-size: 12.5px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.team-email-link {
  color: var(--ink-2);
  transition: color 0.12s;
  border-bottom: 1px dotted transparent;
}
.team-email-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

@media (max-width: 1000px) {
  .team-table-head,
  .team-row { grid-template-columns: 40px 1.5fr 0.8fr 1.2fr; }
  .team-col-phone, .team-col-email { display: none; }
}
@media (max-width: 720px) {
  .team-table-head,
  .team-row { grid-template-columns: 40px 1fr 1fr; gap: var(--s-3); padding-left: var(--s-4); padding-right: var(--s-4); }
  .team-col-tasks { display: none; }
}

/* ============ DATA TABLE (загальна) ============ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table thead th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 500;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.data-table tbody tr.is-clickable { cursor: pointer; transition: background 0.1s; }
.data-table tbody tr.is-clickable:hover { background: var(--bg-hover); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tfoot td {
  padding: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
}
.data-table.compact-table tbody td { padding: 8px 12px; }

.data-table .num-col { text-align: right; font-variant-numeric: tabular-nums; }
.data-table thead th.num-col { text-align: right; }
.data-table .num-bold { font-weight: 600; }

.data-table .cell-name {
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink);
  letter-spacing: -0.003em;
}
.data-table .cell-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.data-table .td-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
}
.data-table .td-link {
  color: var(--accent);
  font-size: 12.5px;
  text-decoration: none;
  transition: color 0.1s;
}
.data-table .td-link:hover { text-decoration: underline; }
.theme-light .data-table .td-link { color: var(--accent-ink); }

/* ============ TOOLBAR ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ============ EMPLOYMENT CHIP ============ */
.empl-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.empl-staff      { background: var(--bg-nav-active); color: var(--nav-active-ink); }
.empl-part       { background: var(--bg-active);     color: var(--accent); }
.empl-contractor { background: var(--bg-sunken);     color: var(--ink-2);  border: 1px solid var(--line); }
.theme-dark .empl-part { color: var(--c-mint); }
.theme-dark .empl-staff { background: #14304d; color: #c5d8ee; }

/* ============ STATUS TAG ============ */
.status-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.status-tag.tone-live    { background: var(--live-bg); color: var(--live); }
.status-tag.tone-warn    { background: var(--late-bg); color: var(--late); }
.status-tag.tone-neutral { background: var(--bg-sunken); color: var(--ink-3); border: 1px solid var(--line); }

/* ============ LOAD BAR ============ */
.load-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  width: 100%;
}
.load-bar-val {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  font-weight: 500;
  flex: 0 0 38px;
  text-align: right;
  white-space: nowrap;
  order: 1; /* val першим */
}
.load-bar-track {
  flex: 1 1 auto;
  height: 6px;
  background: var(--bg-sunken);
  border-radius: 3px;
  overflow: hidden;
  min-width: 60px;
  order: 2; /* track другим */
}
.load-bar-fill {
  height: 100%;
  background: var(--c-green);
  border-radius: 3px;
  transition: width 0.3s;
}
.load-bar-fill.is-high { background: var(--late); }

/* ============ PROFILE CARDS ============ */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.profile-card {
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.profile-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.profile-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.profile-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.profile-card-role {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 3px;
  margin-bottom: 12px;
}
.profile-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.profile-card-meta span { color: var(--ink-3); }
.profile-card-meta b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.profile-card-meta b.high { color: var(--late); }
.profile-card-foot {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  padding-top: 8px;
}

.info-grid.info-grid-salary dd.num {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ============ TIMESHEET ============ */
.timesheet-table th.ts-day {
  text-align: center;
  padding: 8px 4px;
  min-width: 70px;
}
.timesheet-table th.ts-day.is-today {
  background: var(--bg-active);
  color: var(--accent);
}
.theme-light .timesheet-table th.ts-day.is-today { color: var(--accent-ink); }
.ts-day-name { font-size: 10px; }
.ts-day-num {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0;
}
.timesheet-table th.ts-day.is-today .ts-day-num { color: var(--accent); }
.theme-light .timesheet-table th.ts-day.is-today .ts-day-num { color: var(--accent-ink); }

.ts-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  min-width: 60px;
}
.ts-cell.is-today { background: var(--bg-tint); }
.ts-cell .ts-empty { color: var(--ink-4); font-weight: 400; }
.ts-total {
  text-align: right;
  font-variant-numeric: tabular-nums;
  background: var(--bg-sunken);
}
.timesheet-table th.ts-total { text-align: right; }

/* ============ VACATION LIST ============ */
.vacation-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vacation-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color 0.12s;
}
.vacation-row.is-pending {
  border-left: 3px solid var(--late);
  padding-left: 16px;
  background: var(--late-bg);
}
.theme-dark .vacation-row.is-pending { background: rgba(251, 74, 71,0.06); }
.vacation-main { flex: 1; min-width: 0; }
.vacation-dates {
  text-align: right;
  min-width: 200px;
}
.vacation-period {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.vacation-actions {
  display: flex;
  gap: 6px;
}

/* ============ DOCUMENTS ============ */
.doc-type {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--bg-sunken);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* ============ PAYROLL BREAKDOWN ============ */
.payroll-breakdown {
  display: flex;
  flex-direction: column;
  background: var(--bg-sunken);
  border-radius: var(--r-md);
  padding: 4px 0;
}
.pb-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.pb-row:last-child { border-bottom: 0; }
.pb-label { color: var(--ink-2); }
.pb-val { color: var(--ink); font-variant-numeric: tabular-nums; }
.pb-row.pb-note { padding: 4px 18px 8px; border-bottom: 0; }
.pb-row.pb-sub { background: transparent; }
.pb-row.pb-sum {
  background: var(--bg);
  font-weight: 600;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}
.pb-row.pb-deduct .pb-label { color: var(--ink-3); font-size: 12.5px; }
.pb-row.pb-final {
  background: var(--bg-active);
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pb-row.pb-final .pb-label { color: var(--accent-ink); }
.pb-row.pb-final .pb-val { color: var(--accent-ink); font-size: 18px; }
.theme-dark .pb-row.pb-final .pb-label,
.theme-dark .pb-row.pb-final .pb-val { color: var(--c-mint); }

/* ============ REGISTRY ============ */
.registry-summary {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 24px;
}

/* ============ BAR CHART (аналітика) ============ */
.bar-chart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  padding: 24px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  height: 280px;
}
.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bar-val {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}
.bar-val span { color: var(--ink-3); font-weight: 500; }
.bar-track {
  flex: 1;
  width: 60%;
  max-width: 64px;
  display: flex;
  align-items: flex-end;
  position: relative;
}
.bar-fill {
  width: 100%;
  background: var(--c-green-deep);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.3s;
}
.bar-col.is-projected .bar-fill {
  background: var(--bg-active);
  border: 1px dashed var(--accent);
  border-bottom: 0;
}
.bar-col.is-projected .bar-val { color: var(--ink-3); }
.bar-label {
  font-size: 11px;
  color: var(--ink-3);
  text-align: center;
  white-space: nowrap;
}

/* ============ BREAK DOWN ============ */
.break-stack { display: flex; flex-direction: column; gap: 18px; }
.break-bar {
  display: flex;
  height: 28px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-sunken);
}
.break-bar-seg { transition: opacity 0.12s; }
.break-bar-seg:hover { opacity: 0.85; }
.break-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}
.break-legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
}
.break-dot { width: 12px; height: 12px; border-radius: 3px; }
.break-label { color: var(--ink-2); }
.break-val { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
.break-pct { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* ============ MINI LIST (in drawer) ============ */
.mini-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mini-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--bg-sunken);
  border-radius: 6px;
  font-size: 12.5px;
}
.mini-list-item > span:first-child { flex: 1; color: var(--ink-2); }

/* ============ EMPTY ============ */
.empty {
  padding: var(--s-12) var(--s-6);
  text-align: center;
  color: var(--ink-3);
  font-size: 14px;
}

/* ============ FILTER PILL (Тиждень) ============ */
.filter-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-bottom: var(--s-8);
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-sunken);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  border: 1px solid var(--line);
}
.filter-pill-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  opacity: 0.85;
}
.filter-pill-item:hover { color: var(--ink); opacity: 1; }
.filter-pill-item.is-active {
  background: var(--bg-elev);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  opacity: 1;
}
.theme-dark .filter-pill-item.is-active {
  background: #14304d;
  box-shadow: 0 0 0 1px rgba(152, 218, 180, 0.15), 0 4px 12px -6px rgba(0,0,0,0.6);
}
/* Якщо є аватар попереду — менший лівий відступ */
.filter-pill-item:has(.av) { padding-left: 6px; }

.filter-pill-label { letter-spacing: -0.005em; white-space: nowrap; }
.filter-pill-count {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 1px 7px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
  white-space: nowrap;
}
.filter-pill-item.is-active .filter-pill-count {
  background: var(--bg-active);
  color: var(--accent);
  border-color: transparent;
}
.theme-dark .filter-pill-item.is-active .filter-pill-count {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Avatar stack */
.avatar-stack {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.avatar-stack .av {
  margin-right: -8px;
}
.avatar-stack .av:last-child { margin-right: 0; }
.av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  border: 2px solid var(--bg-sunken);
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1;
}
.filter-pill-item.is-active .av { border-color: var(--bg-elev); }
.av.av-more {
  background: var(--bg-elev);
  color: var(--ink-3);
  font-size: 10px;
}
.av.av-me {
  background: var(--accent);
  color: #fff;
}
.theme-dark .av.av-me {
  background: var(--accent);
  color: #010e1f;
}

/* ============ DAY SECTION (Тиждень) ============ */
.day-section {
  margin-bottom: var(--s-8);
  transition: opacity 0.2s;
}
.day-section.is-past { opacity: 0.7; }
.day-section.is-empty { margin-bottom: var(--s-3); opacity: 0.5; }
.day-section.is-empty .day-section-head { padding-bottom: var(--s-2); border-bottom-style: dashed; }

.day-section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-4);
  padding: var(--s-3) 0 var(--s-3);
  margin-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
  position: relative;
}
.day-section.is-today .day-section-head { border-bottom-color: var(--accent); }
.day-section.is-today .day-section-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

.day-section-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.day-section-num {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.day-section.is-today .day-section-num { color: var(--accent); }
.day-section-month {
  font-size: 13px;
  color: var(--ink-3);
  text-transform: lowercase;
}
.day-section-name {
  font-size: 13px;
  color: var(--ink-2);
  text-transform: lowercase;
  font-weight: 500;
}
.day-section-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ============ DRAWER ============ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 100;
  opacity: 0;
  animation: fadeIn 0.15s ease forwards;
}
.theme-dark .drawer-overlay { background: rgba(0,0,0,0.55); }
@keyframes fadeIn { to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 92vw);
  background: var(--bg-elev);
  z-index: 101;
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.drawer-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  color: var(--ink-3);
}
.drawer-close:hover { background: var(--bg-hover); color: var(--ink); }
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--s-6);
}
.drawer-h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 var(--s-2);
  line-height: 1.25;
}
.drawer-meta {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  font-size: 12px;
  color: var(--ink-3);
  margin-bottom: var(--s-6);
}
.drawer-section { margin-bottom: var(--s-6); }
.drawer-section-h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: var(--s-3);
}

.subtask {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.subtask:last-child { border-bottom: 0; }
.subtask-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.subtask.is-done .subtask-check { background: var(--accent); border-color: var(--accent); }
.subtask.is-done span { color: var(--done-ink); text-decoration: line-through; }
.subtask-time { margin-left: auto; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ===== Підзадачі (повноцінні міні-задачі) ===== */
.st-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.st-empty {
  font-size: 12.5px; color: var(--ink-3); padding: 10px 12px;
  background: var(--bg-sunken); border-radius: var(--r-md); line-height: 1.5;
}
.st-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-elev);
}
.st-row.is-done { background: var(--bg-sunken); }
.st-check {
  width: 18px; height: 18px; margin-top: 1px; flex-shrink: 0;
  border-radius: 5px; border: 1.5px solid var(--line-strong);
  display: grid; place-items: center; cursor: pointer; color: #fff; background: transparent;
}
.st-row.is-done .st-check { background: var(--accent); border-color: var(--accent); }
.st-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.st-title { font-size: 13px; color: var(--ink); cursor: text; line-height: 1.4; }
.st-row.is-done .st-title { color: var(--done-ink); text-decoration: line-through; }
.st-edit { padding: 4px 8px !important; font-size: 13px !important; width: 100%; }
.st-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.st-status-pill {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em;
}
.st-status-pill.st-todo { background: var(--bg-sunken); color: var(--ink-3); }
.st-status-pill.st-live { background: var(--live-bg); color: var(--live); }
.st-status-pill.st-late { background: var(--late-bg); color: var(--late); }
.st-status-pill.st-done { background: var(--accent-soft, var(--bg-active)); color: var(--accent-ink, var(--accent)); }
.st-sel {
  font-size: 11.5px; padding: 3px 6px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg-elev); color: var(--ink-2); max-width: 150px;
}
.st-av { width: 22px !important; height: 22px !important; font-size: 9px !important; flex-shrink: 0; }
.st-due {
  font-size: 11.5px; padding: 3px 8px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg-elev); color: var(--ink-2); width: 92px;
}
.st-del {
  flex-shrink: 0; width: 24px; height: 24px; border: 0; background: transparent;
  color: var(--ink-4); border-radius: 6px; display: grid; place-items: center; cursor: pointer;
}
.st-del:hover { background: var(--late-bg); color: var(--late); }
.st-add { display: flex; gap: 8px; align-items: center; }
.st-add-input { flex: 1; padding: 7px 10px !important; font-size: 12.5px !important; }

/* ===== Чеклісти (групи галочок) ===== */
.cl-group {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px; margin-bottom: 10px; background: var(--bg-elev);
}
.cl-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cl-group-title { font-size: 13px; font-weight: 600; color: var(--ink); cursor: text; }
.cl-title-edit { padding: 3px 8px !important; font-size: 13px !important; font-weight: 600; flex: 1; }
.cl-group-count {
  font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink-3);
  margin-left: auto; font-weight: 600;
}
.cl-progress { height: 4px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; margin-bottom: 6px; }
.cl-progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .25s; }
.cl-items { display: flex; flex-direction: column; }
.cl-items .subtask { gap: 10px; }
.cl-items .subtask .st-del { margin-left: 4px; }

.subtask-check { cursor: pointer; }

/* ===== Кар'єра та розвиток ===== */
.career-track-chip {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: var(--bg-active); color: var(--c-blue); white-space: nowrap;
}
.theme-dark .career-track-chip { color: var(--c-mint); }

.career-banner {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 13px; margin-bottom: 18px; border-radius: var(--r-md);
  background: var(--bg-tint, var(--live-bg)); border: 1px solid var(--accent-soft, var(--line));
}
.career-banner-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.career-banner-txt { font-size: 13px; font-weight: 600; color: var(--accent-ink, var(--accent)); }
.theme-dark .career-banner-txt { color: var(--accent); }
.career-banner-go { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

.career-card {
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; background: var(--bg-elev);
}
.career-card.is-promo { border-color: var(--accent-soft, var(--line-strong)); border-left: 3px solid var(--accent); background: var(--bg-tint, var(--bg-sunken)); }
.theme-dark .career-card.is-promo { background: rgba(45,160,90,0.06); }
.career-card.is-applied { border-left: 3px solid var(--live); background: var(--live-bg); }
.theme-dark .career-card.is-applied { background: rgba(45,160,90,0.08); }
.career-card-top { margin-bottom: 10px; }
.career-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: 3px 9px; border-radius: 999px; background: var(--accent); color: #fff;
}
.career-badge.is-done { background: var(--live); }

.career-transition { display: flex; align-items: stretch; gap: 12px; margin-bottom: 10px; }
.career-pos {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: var(--r-md);
  background: var(--bg-elev); border: 1px solid var(--line);
}
.career-pos.is-target { border-color: var(--accent); }
.career-pos-k { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 3px; }
.career-pos-v { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.career-arrow { align-self: center; color: var(--ink-3); font-size: 18px; flex-shrink: 0; }
.career-arrow.sm { font-size: 13px; }
.career-reason { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 10px; }
.career-salary {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 11px; border-radius: var(--r-md); background: var(--bg-elev); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums; margin-bottom: 10px;
}
.career-salary-k { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.career-salary-old { font-size: 13px; color: var(--ink-3); text-decoration: line-through; }
.career-salary-new { font-size: 14px; font-weight: 700; color: var(--ink); }
.career-salary-delta { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--live); }
.career-tpl { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.career-tpl b { color: var(--ink-2); font-weight: 600; }

.career-next {
  padding: 11px 13px; border-radius: var(--r-md); background: var(--bg-sunken); border: 1px dashed var(--line-strong);
}
.career-next-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); }
.career-next-txt { font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 3px 0 2px; }
.career-next-req { font-size: 12px; color: var(--ink-2); }
.career-note { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; padding: 10px 12px; background: var(--bg-sunken); border-radius: var(--r-md); }

.career-ladder { display: flex; flex-direction: column; gap: 0; margin-top: 12px; }
.career-rung { display: flex; gap: 11px; padding: 7px 0; position: relative; }
.career-rung:not(:last-child)::before {
  content: ""; position: absolute; left: 9px; top: 26px; bottom: -7px; width: 2px; background: var(--line);
}
.career-rung.is-passed:not(:last-child)::before { background: var(--accent); }
.career-rung-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; z-index: 1;
  border: 1.5px solid var(--line-strong); background: var(--bg-elev);
  display: grid; place-items: center; color: #fff;
}
.career-rung.is-passed .career-rung-dot, .career-rung.is-current .career-rung-dot { background: var(--accent); border-color: var(--accent); }
.career-rung.is-current .career-rung-dot { box-shadow: 0 0 0 4px var(--accent-soft, rgba(45,160,90,0.18)); }
.career-rung-body { padding-top: 1px; }
.career-rung-label { font-size: 13px; color: var(--ink-2); }
.career-rung.is-current .career-rung-label { font-weight: 700; color: var(--ink); }
.career-rung-need { font-size: 11px; color: var(--ink-3); margin-top: 1px; }

.career-log { margin-top: 14px; }
.career-log-h { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 6px; }
.career-log-row { display: flex; gap: 10px; font-size: 12.5px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.career-log-row:last-child { border-bottom: 0; }
.career-log-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); flex-shrink: 0; }
.career-log-txt { color: var(--ink-2); }

/* ===== HR-шаблони ===== */
.hr-tpl-effect {
  display: flex; align-items: center; gap: 6px; margin: 8px 0 4px;
  font-size: 12px; font-weight: 600; color: var(--accent);
}
.hr-tpl-effect.is-deadline { color: var(--ink-3); font-weight: 500; }
.hr-tpl-meta {
  display: flex; flex-direction: column; gap: 0; margin-bottom: 20px;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.hr-tpl-meta-row { display: flex; gap: 14px; padding: 11px 14px; }
.hr-tpl-meta-row:not(:last-child) { border-bottom: 1px solid var(--line); }
.hr-tpl-meta-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); width: 70px; flex-shrink: 0; padding-top: 2px; }
.hr-tpl-meta-v { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.hr-task-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; background: var(--bg-elev); }
.hr-task-head { display: flex; align-items: flex-start; gap: 10px; }

/* ===== Каса (готівковий контур) ===== */
.cash-privacy {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; margin-bottom: 20px; border-radius: var(--r-md);
  background: var(--late-bg); border: 1px solid rgba(251, 74, 71, 0.25);
  font-size: 12.5px; line-height: 1.5; color: var(--ink-2);
}
.cash-privacy > svg { color: var(--late); flex-shrink: 0; margin-top: 1px; }
.cash-privacy > div { flex: 1; }
.cash-privacy .cash-toggle { flex-shrink: 0; align-self: center; }
.theme-dark .cash-privacy { background: rgba(251,74,71,0.08); }

.cash-locked, .cash-privacy-gate {
  max-width: 460px; margin: 60px auto; text-align: center;
  padding: 36px 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-elev);
}
.cash-locked-ic {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
  display: grid; place-items: center; background: var(--late-bg); color: var(--late);
}
.cash-privacy-gate h2, .cash-locked h2 { font-size: 18px; margin: 0 0 8px; }
.cash-privacy-gate p, .cash-locked p { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; margin: 0 0 18px; }
.cash-privacy-gate .cash-toggle { margin: 0 auto; }

.cash-kpi-balance { border-color: var(--accent-soft, var(--line-strong)); background: var(--bg-tint, var(--bg-sunken)); }
.theme-dark .cash-kpi-balance { background: rgba(45,160,90,0.06); }

.cash-kind-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500; padding: 3px 9px; border-radius: 999px;
  background: var(--bg-sunken); color: var(--ink-2); white-space: nowrap;
}
.cash-kind-chip.dir-in  { background: var(--live-bg); color: var(--c-green-deep); }
.cash-kind-chip.dir-out { background: var(--late-bg); color: var(--late); }
.theme-dark .cash-kind-chip.dir-in { color: var(--c-green); }

.cash-break { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cash-break-item {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-elev);
}
.cash-break-item.dir-in  { border-left: 3px solid var(--c-green-deep); }
.cash-break-item.dir-out { border-left: 3px solid var(--late); }
.cash-break-ic {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--bg-sunken); color: var(--ink-2);
}
.cash-break-label { font-size: 12.5px; color: var(--ink-3); }
.cash-break-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; }
.cash-break-val.is-in { color: var(--c-green-deep); }
.cash-break-val.is-out { color: var(--late); }
.theme-dark .cash-break-val.is-in { color: var(--c-green); }

.cash-table .cash-in  { color: var(--c-green-deep); }
.cash-table .cash-out { color: var(--late); }
.theme-dark .cash-table .cash-in { color: var(--c-green); }
.cash-table tfoot td { border-top: 2px solid var(--line-strong); background: var(--bg-sunken); }

.cash-addform {
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 16px; margin-bottom: 16px; background: var(--bg-sunken);
}
.cash-addform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.cash-addform-grid .cp-row-full { grid-column: 1 / -1; }
.cash-addform-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ===== ПДВ у витратах ===== */
.vat-summary {
  display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap;
  margin: 16px 0 8px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-sunken);
}
.vat-summary-item { flex: 1; min-width: 130px; }
.vat-summary-sep { align-self: center; color: var(--ink-4); font-size: 18px; }
.vat-summary-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.vat-summary-val { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); margin-top: 3px; }
.vat-summary-sub { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.vat-summary-item.is-credit { padding-left: 12px; border-left: 2px solid var(--c-green-deep); }
.vat-summary-item.is-credit .vat-summary-val { color: var(--c-green-deep); }
.theme-dark .vat-summary-item.is-credit .vat-summary-val { color: var(--c-green); }
.vat-summary-item.is-warn { padding-left: 12px; border-left: 2px solid var(--late); }
.vat-summary-item.is-warn .vat-summary-val { color: var(--late); }

.vat-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.vat-chip {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  background: var(--bg-sunken); color: var(--ink-3);
}
.vat-chip.is-ok   { background: var(--live-bg); color: var(--c-green-deep); }
.vat-chip.is-warn { background: var(--late-bg); color: var(--late); }
.vat-chip.is-none { color: var(--ink-4); }
.theme-dark .vat-chip.is-ok { color: var(--c-green); }

.vat-invoice-toggle {
  display: flex; align-items: center; gap: 11px; margin-top: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-elev); cursor: pointer; transition: border-color .15s, background .15s;
}
.vat-invoice-toggle:hover { border-color: var(--line-strong); }
.vat-invoice-toggle.is-on { border-color: var(--c-green-deep); background: var(--live-bg); }
.theme-dark .vat-invoice-toggle.is-on { background: rgba(45,160,90,0.08); }
.vat-invoice-check {
  width: 20px; height: 20px; border-radius: 5px; flex-shrink: 0;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: #fff;
}
.vat-invoice-toggle.is-on .vat-invoice-check { background: var(--c-green-deep); border-color: var(--c-green-deep); }
.vat-invoice-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.vat-invoice-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

/* ===== Контакти — чипи типу та кольорові аватари ===== */
.contact-type-chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap; background: var(--bg-sunken); color: var(--ink-2);
}
.contact-type-chip.av-client   { background: rgba(6,139,73,0.10);  color: var(--c-green-deep); }
.contact-type-chip.av-supplier { background: rgba(1,91,118,0.10);  color: var(--c-blue); }
.contact-type-chip.av-lead     { background: rgba(240,191,48,0.18); color: #876a02; }
.contact-type-chip.av-team     { background: var(--bg-active);      color: var(--ink-2); }
.theme-dark .contact-type-chip.av-client   { background: rgba(45,160,90,0.14);  color: var(--c-green); }
.theme-dark .contact-type-chip.av-supplier { color: var(--c-mint); }
.theme-dark .contact-type-chip.av-lead     { background: rgba(240,191,48,0.14); color: var(--c-amber); }

.contact-av.av-client   { background: rgba(6,139,73,0.12);  color: var(--c-green-deep); }
.contact-av.av-supplier { background: rgba(1,91,118,0.12);  color: var(--c-blue); }
.contact-av.av-lead     { background: rgba(240,191,48,0.20); color: #876a02; }
.contact-av.av-team     { background: var(--bg-active);      color: var(--ink-2); }
.theme-dark .contact-av.av-client   { color: var(--c-green); }
.theme-dark .contact-av.av-supplier { color: var(--c-mint); }
.theme-dark .contact-av.av-lead     { color: var(--c-amber); }

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3) var(--s-5);
  padding: var(--s-4);
  background: var(--bg-sunken);
  border-radius: var(--r-md);
  font-size: 13px;
}
.info-grid dt { color: var(--ink-3); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; }
.info-grid dd { margin: 0; color: var(--ink); }

.drawer-foot {
  padding: var(--s-4) var(--s-6);
  border-top: 1px solid var(--line);
  display: flex;
  gap: var(--s-3);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .app { grid-template-columns: 64px 1fr; }
  .sb-brand-text, .sb-item-label, .sb-user-meta, .sb-section-title, .theme-switch { display: none; }
  .sb-item { justify-content: center; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .obj-row { grid-template-columns: 80px 1fr 140px; }
  .obj-row > :last-child { display: none; }
  .topbar-date { display: none; }
  .search { width: 180px; }
}
@media (max-width: 720px) {
  .week-grid { grid-template-columns: 1fr; }
  .topbar { padding: 0 var(--s-4); }
  .page { padding: var(--s-5) var(--s-4) var(--s-10); }
  .search { width: 140px; }
}


/* ============ TEMPLATES — TABS ============ */
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}
.tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab:hover { color: var(--ink); }
.tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.tab-count {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  background: var(--bg-sunken);
  border-radius: 999px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.tab.is-active .tab-count {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* ============ CREATE PROJECT MODAL FORM ============ */
.cp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.cp-row { display: flex; flex-direction: column; gap: 6px; }
.cp-row-full { grid-column: 1 / -1; }
.cp-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}
.cp-required { color: var(--late); margin-left: 2px; }
.cp-input {
  padding: 9px 12px;
  font-size: 13.5px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}
.cp-input:focus {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.cp-input::placeholder { color: var(--ink-4); }
select.cp-input { cursor: pointer; padding-right: 28px; }
.cp-hint {
  font-size: 11px;
  color: var(--ink-3);
}

.cp-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.cp-team-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  transition: border-color 0.12s, background 0.12s;
}
.cp-team-chip:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.cp-team-chip.is-selected {
  border-color: var(--accent);
  background: var(--bg-tint);
}
.theme-dark .cp-team-chip.is-selected { background: var(--bg-active); }
.cp-team-chip input { display: none; }

.cp-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cp-summary-stage {
  padding: 12px 14px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.cp-summary-stage-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 720px) {
  .cp-grid { grid-template-columns: 1fr; }
}

/* ============ NEW TASK MODAL ============ */
.nt-modal { display: flex; flex-direction: column; }
.nt-head-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: var(--bg-active);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 17px;
  flex-shrink: 0;
}
.theme-dark .nt-head-icon { color: var(--accent); }
.nt-textarea { resize: vertical; min-height: 64px; line-height: 1.45; font-family: inherit; }
.nt-seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 3px;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.nt-seg-item {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  border-radius: 6px;
  transition: background 0.12s, color 0.12s;
}
.nt-seg-item:hover { color: var(--ink); }
.nt-seg-item.is-active {
  background: var(--bg-elev);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
}
.theme-dark .nt-seg-item.is-active { color: var(--accent); }
.nt-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
  flex-shrink: 0;
}
.nt-kind {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.nt-kind-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  color: var(--ink-3);
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.nt-kind-card:hover { border-color: var(--line-strong); }
.nt-kind-card.is-active {
  border-color: var(--accent);
  background: var(--bg-active);
  color: var(--accent);
}
.nt-kind-card .ic { flex-shrink: 0; }
.nt-kind-txt { display: flex; flex-direction: column; gap: 1px; }
.nt-kind-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.nt-kind-card.is-active .nt-kind-name { color: var(--accent-ink); }
.theme-dark .nt-kind-card.is-active .nt-kind-name { color: var(--accent); }
.nt-kind-sub { font-size: 11px; color: var(--ink-3); }

.nt-count {
  display: inline-grid;
  place-items: center;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  margin-left: 6px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  vertical-align: 1px;
}
.nt-people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.nt-person {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 7px 7px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
  position: relative;
  overflow: hidden;
}
.nt-person:hover { border-color: var(--line-strong); }
.nt-person.is-on { border-color: var(--accent); background: var(--bg-active); }
.nt-person-av {
  width: 28px !important; height: 28px !important;
  font-size: 10px !important;
  flex-shrink: 0;
}
.nt-person-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nt-person-role {
  font-size: 11px;
  color: var(--ink-3);
  margin-left: auto;
  white-space: nowrap;
  flex-shrink: 0;
}
.nt-person.is-on .nt-person-role { display: none; }
.nt-person-check {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  flex-shrink: 0;
}
.nt-hint {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 6px;
}


/* ============ PROJECT TEMPLATE PICKER ============ */
.picker-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
  width: 100%;
  font-family: inherit;
  color: inherit;
}
.picker-row:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
}


/* ============ LEGAL CHANGES ============ */
.legal-company-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px 26px;
}
.legal-company-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.legal-company-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.legal-company-full {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 4px;
}
.legal-company-edrpou { text-align: right; }
.legal-company-edrpou-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  font-weight: 500;
}
.legal-company-edrpou-num {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  margin-top: 4px;
}
.legal-company-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 24px;
}
.legal-info-cell {}
.legal-info-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 4px;
}
.legal-info-val {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.005em;
}
.legal-info-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

/* Участники */
.participant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.participant-card {
  padding: 18px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.participant-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.participant-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.participant-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-active);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.theme-dark .participant-avatar { color: var(--c-mint); }
.participant-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.participant-role {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.participant-share-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.participant-share { flex: 1; }
.participant-share-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.participant-share-num span {
  font-size: 14px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 2px;
}
.participant-share-bar {
  height: 6px;
  background: var(--bg-sunken);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.participant-share-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.participant-share-amount {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

/* Timeline */
.legal-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.legal-change-row {
  display: grid;
  grid-template-columns: 44px 1fr 200px;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  align-items: center;
}
.legal-change-row:hover { border-color: var(--accent); background: var(--bg-hover); }
.legal-change-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.legal-change-body { min-width: 0; }
.legal-change-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.legal-change-type {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}
.legal-change-date { color: var(--ink-2); font-weight: 500; }
.legal-change-meta { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.legal-change-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.legal-change-summary {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.4;
}
.legal-change-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: right;
}
.legal-change-edr {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.legal-change-files {
  font-size: 11.5px;
  color: var(--ink-3);
}

/* Drawer: docs grid */
.legal-doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.legal-doc-cell {
  padding: 12px 14px;
  background: var(--bg-sunken);
  border-radius: 6px;
}
.legal-doc-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 4px;
}
.legal-doc-val {
  font-size: 14px;
  color: var(--ink);
  font-weight: 500;
}
.legal-doc-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

.legal-attach-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legal-attach-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 6px;
}

@media (max-width: 900px) {
  .legal-company-grid { grid-template-columns: repeat(2, 1fr); }
  .legal-change-row { grid-template-columns: 44px 1fr; }
  .legal-change-aside { grid-column: 2; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .legal-doc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .legal-company-grid { grid-template-columns: 1fr; }
}

/* ============ КЕП — статус-індикатори в Команді ============ */
/* tone-late статус-тег (для прострочених КЕП) — у системі його не було */
.status-tag.tone-late { background: var(--late-bg); color: var(--late); }

.kep-cell { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kep-dot-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
}
.kep-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-4);
  flex-shrink: 0;
}
.kep-dot-wrap.tone-live .kep-dot { background: var(--c-green-deep); }
.theme-dark .kep-dot-wrap.tone-live .kep-dot { background: var(--c-green); }
.kep-dot-wrap.tone-warn .kep-dot,
.kep-dot-wrap.tone-late .kep-dot { background: var(--late); }
.kep-dot-wrap.tone-warn,
.kep-dot-wrap.tone-late { color: var(--late); font-weight: 500; }

.kep-mini-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--late-bg);
  color: var(--late);
  white-space: nowrap;
}

/* Банер-нагадування в профілі */
.kep-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg-sunken);
}
.kep-banner.tone-warn,
.kep-banner.tone-late {
  background: var(--late-bg);
  border-color: rgba(251, 74, 71, 0.3);
}
.theme-dark .kep-banner.tone-warn,
.theme-dark .kep-banner.tone-late { background: rgba(251, 74, 71, 0.07); }
.kep-banner-icon { font-size: 22px; flex-shrink: 0; line-height: 1; }
.kep-banner-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.kep-banner.tone-warn .kep-banner-title,
.kep-banner.tone-late .kep-banner-title { color: var(--late); }
.kep-banner-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* ============ ДОВІДКА ПРО ДОХОДИ ============ */
.cert-page { max-width: 760px; }
.cert-table { margin-top: 4px; }
.cert-table thead th { white-space: nowrap; }
.cert-table .num-col,
.report-info-table.cert-table .num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cert-table tfoot td {
  border-top: 2px solid var(--ink);
  border-bottom: none;
  padding-top: 10px;
}
.cert-seal {
  width: 96px;
  height: 96px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink-4);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* Друк лише документа довідки */
@media print {
  body * { visibility: hidden !important; }
  .report-modal, .report-modal * { visibility: visible !important; }
  .report-modal {
    position: absolute !important;
    inset: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    width: 100% !important;
    transform: none !important;
    max-width: none !important;
  }
  .report-toolbar { display: none !important; }
  .report-page { padding: 0 !important; max-width: 100% !important; }
  .drawer-overlay { display: none !important; }
}

/* ============ КВАЛІФІКАЦІЙНІ СЕРТИФІКАТИ ============ */
.qual-class-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.theme-dark .qual-class-chip { background: var(--bg-active); color: var(--accent); }
.qual-class-next { font-weight: 500; opacity: 0.7; font-size: 11px; }

.qual-due { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }

/* Нагадування */
.qual-reminders { display: flex; flex-direction: column; gap: 8px; }
.qual-reminder {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.qual-reminder.tone-late,
.qual-reminder.tone-warn {
  border-left: 3px solid var(--late);
  background: var(--late-bg);
}
.theme-dark .qual-reminder.tone-late,
.theme-dark .qual-reminder.tone-warn { background: rgba(251, 74, 71, 0.06); }

/* Без сертифіката */
.qual-without { display: flex; flex-wrap: wrap; gap: 10px; }
.qual-without-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-sunken);
}

/* Картка сертифіката в профілі */
.qual-card {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  background: var(--bg-sunken);
  margin-bottom: 10px;
}
.qual-card:last-child { margin-bottom: 0; }
.qual-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.qual-card-kind { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.qual-card-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.qual-upgrade-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 6px 10px;
  border-radius: 8px;
}
.theme-dark .qual-upgrade-note { color: var(--accent); background: var(--bg-active); }
.qual-card-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.qual-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.qual-card-row.tone-late,
.qual-card-row.tone-warn { border-color: rgba(251, 74, 71, 0.3); }
.qual-card-row-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.qual-card-row-label { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.qual-card-row-meta { font-size: 11px; color: var(--ink-3); }

/* Таблиця страхування / членських внесків */
.ins-table td { vertical-align: top; }
.ins-table .cell-name { white-space: normal; text-wrap: pretty; }
.ins-table th:nth-child(3),
.ins-table th:nth-child(5) { width: 30%; }

/* Сканкопії документів */
.scan-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-elev);
  cursor: pointer;
  font: inherit;
  transition: border-color .12s, background .12s;
}
.scan-chip:hover { border-color: var(--accent); background: var(--bg-sunken); }
.scan-chip-ic {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #fff;
  background: var(--late);
  padding: 2px 5px;
  border-radius: 4px;
}
.scan-chip-name {
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qual-card-scan {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.qual-card-scan .scan-chip-name { max-width: 220px; }
.scan-modal-body {
  padding: 20px 24px 24px;
  overflow: auto;
  background: var(--bg-sunken);
  display: flex;
  justify-content: center;
}
.scan-modal-body image-slot { max-width: 460px; }

/* ============ КЛАС НАСЛІДКІВ (рухоме поле + дельта) ============ */
.btn-sm { padding: 4px 10px; font-size: 12px; }

.cc-panel {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 18px;
}
.cc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cc-panel-title { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.cc-empty { font-size: 12.5px; color: var(--ink-3); }

.cc-current { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.cc-grade-badge {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700; letter-spacing: -.01em;
}
.cc-current-meta { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.cc-scope { font-size: 12.5px; color: var(--ink-2); }
.cc-scope b { color: var(--ink); }

.cc-journal { border-top: 1px solid var(--line); padding-top: 12px; }
.cc-journal-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 10px; }
.cc-journal-row { display: flex; gap: 10px; padding-bottom: 12px; position: relative; }
.cc-journal-row:not(:last-child)::before {
  content: ""; position: absolute; left: 4px; top: 12px; bottom: 0;
  width: 1px; background: var(--line-strong);
}
.cc-journal-dot {
  flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; margin-top: 3px;
  background: var(--ink-4); border: 2px solid var(--bg-sunken); box-shadow: 0 0 0 1px var(--line-strong);
}
.cc-journal-dot[data-kind="calculated"] { background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cc-journal-body { min-width: 0; flex: 1; }
.cc-journal-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cc-journal-val { font-size: 13px; font-weight: 600; color: var(--ink); }
.cc-journal-from { color: var(--ink-3); font-weight: 500; }
.cc-journal-kind { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.cc-journal-date { font-size: 11.5px; color: var(--ink-3); margin-left: auto; font-family: var(--font-mono); }
.cc-journal-basis { font-size: 12px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }

/* модалка */
.cc-field { margin-bottom: 18px; }
.cc-field-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.cc-grade-pick { display: flex; gap: 8px; }
.cc-grade-opt {
  flex: 1; padding: 12px 0; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--bg-elev);
  font-size: 15px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.cc-grade-opt:hover { border-color: var(--line-strong); }
.cc-grade-opt.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.cc-check { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; line-height: 1.4; }
.cc-check input { margin-top: 2px; flex-shrink: 0; }

.cc-preview { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; }
.cc-preview-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 12px; }
.cc-row-neutral { font-size: 13px; color: var(--ink-2); }
.cc-change-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.cc-change-key { width: 130px; color: var(--ink-3); flex-shrink: 0; }
.cc-change-from { color: var(--ink-3); text-decoration: line-through; }
.cc-arrow { color: var(--accent); font-weight: 700; }
.cc-change-to { color: var(--ink); font-weight: 600; }

.cc-delta-group { margin-top: 12px; border-radius: var(--r-md); padding: 10px 12px; }
.cc-delta-group.is-add { background: var(--live-bg); }
.cc-delta-group.is-remove { background: var(--late-bg); }
.theme-dark .cc-delta-group.is-add { background: rgba(45,160,90,0.08); }
.theme-dark .cc-delta-group.is-remove { background: rgba(251,74,71,0.07); }
.cc-delta-title { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.cc-delta-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink); padding: 3px 0; }
.cc-delta-sign { font-weight: 700; width: 12px; text-align: center; }
.cc-delta-group.is-add .cc-delta-sign { color: var(--live); }
.cc-delta-group.is-remove .cc-delta-sign { color: var(--late); }
.cc-delta-note { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; line-height: 1.4; }

.cc-safe { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.cc-safe svg { flex-shrink: 0; color: var(--live); margin-top: 2px; width: 13px; height: 13px; }

/* наскрізні задачі в шаблонах */
.cc-applies { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; padding: 8px 10px; background: var(--bg-sunken); border-radius: 6px; }
.cc-applies-key { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.cc-applies-val { font-size: 12.5px; font-weight: 600; color: var(--ink); }

/* =====================================================================
   УПРАВЛІННЯ ПРОЄКТАМИ — робочий простір об'єкта + поглиблена картка задачі
   ===================================================================== */

/* — нові тони статус-тегів — */
.status-tag.tone-amber { background: rgba(240,191,48,.18); color: #876a02; border: 1px solid rgba(240,191,48,.35); }
.theme-dark .status-tag.tone-amber { background: rgba(240,191,48,.14); color: var(--c-amber); border-color: rgba(240,191,48,.3); }
.status-tag.tone-blue { background: var(--bg-active); color: var(--c-blue); }
.theme-dark .status-tag.tone-blue { color: var(--c-mint); }

/* — хедер об'єкта — */
.pw-top { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.pw-back {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 7px 11px 7px 8px; margin-top: 2px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: 12.5px; color: var(--ink-2); background: var(--bg-elev);
  transition: background .12s, border-color .12s, color .12s;
}
.pw-back:hover { background: var(--bg-hover); color: var(--ink); border-color: var(--line-strong); }
.pw-top-main { min-width: 0; flex: 1; }
.pw-top-id { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.pw-code { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); letter-spacing: .02em; }
.pw-scope { font-size: 11.5px; color: var(--ink-3); padding: 2px 8px; background: var(--bg-sunken); border-radius: 999px; }
.pw-name { font-size: 26px; font-weight: 700; letter-spacing: -0.015em; margin: 0; line-height: 1.15; }
.pw-top-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.pw-top-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.pw-top-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.pw-top-team { display: flex; }
.pw-top-team .team-avatar { margin-left: -6px; border: 2px solid var(--bg); }
.pw-top-team .team-avatar:first-child { margin-left: 0; }
.pw-tabs { position: sticky; top: 0; background: var(--bg); z-index: 5; }

/* — макет огляду — */
.pw-grid { display: grid; grid-template-columns: 1fr 332px; gap: 18px; align-items: start; }
.pw-main { min-width: 0; }
.pw-rail { display: flex; flex-direction: column; gap: 16px; }

.pw-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; margin-bottom: 16px; }
.pw-rail .pw-card { margin-bottom: 0; }
.pw-card-h { font-size: 12.5px; font-weight: 700; letter-spacing: .005em; color: var(--ink); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.pw-card-count { font-size: 11px; font-weight: 700; padding: 1px 8px; background: var(--late-bg); color: var(--late); border-radius: 999px; }
.pw-ok { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.pw-ok svg { color: var(--live); }

/* — алерти — */
.pw-alerts { display: flex; flex-direction: column; gap: 2px; }
.pw-alert { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
.pw-alert:last-child { border-bottom: 0; }
.pw-alert-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--ink-4); }
.pw-alert.tone-warn  .pw-alert-dot { background: var(--late); }
.pw-alert.tone-amber .pw-alert-dot { background: var(--c-amber); }
.pw-alert.tone-blue  .pw-alert-dot { background: var(--c-blue); }
.pw-alert.tone-live  .pw-alert-dot { background: var(--live); }
.pw-alert-kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; flex-shrink: 0; width: 78px; }
.pw-alert-title { color: var(--ink); font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-alert-meta { margin-left: auto; font-size: 11.5px; color: var(--ink-3); flex-shrink: 0; padding-left: 10px; }

/* — наступні віхи — */
.pw-ms { display: flex; flex-direction: column; }
.pw-ms-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.pw-ms-row:last-child { border-bottom: 0; }
.pw-ms-date { display: flex; flex-direction: column; width: 84px; flex-shrink: 0; }
.pw-ms-dm { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink); }
.pw-ms-dd { font-size: 10.5px; color: var(--ink-3); }
.pw-ms-date.is-over .pw-ms-dm, .pw-ms-date.is-over .pw-ms-dd { color: var(--late); }
.pw-ms-kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); width: 56px; flex-shrink: 0; font-weight: 600; }
.pw-ms-kind.is-pay { color: var(--c-blue); }
.pw-ms-title { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-ms-val { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); flex-shrink: 0; }

/* — паспорт / команда / стрічка у rail — */
.pw-passport { grid-template-columns: 1fr; gap: 10px; }
.pw-passport div { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.pw-passport dt { font-size: 11px; }
.pw-passport dd { text-align: right; font-size: 12.5px; font-weight: 500; }
.pw-team { display: flex; flex-direction: column; gap: 4px; }
.pw-team-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.pw-team-meta { min-width: 0; flex: 1; }
.pw-team-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.pw-team-role { font-size: 11px; color: var(--ink-3); }
.pw-team-tasks { display: flex; flex-direction: column; align-items: flex-end; font-size: 11.5px; color: var(--ink-2); flex-shrink: 0; }
.pw-team-late { color: var(--late); font-size: 10.5px; }
.pw-feed { display: flex; flex-direction: column; gap: 12px; }
.pw-feed-row { display: flex; gap: 9px; }
.pw-feed-body { min-width: 0; }
.pw-feed-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.pw-feed-text b { color: var(--ink); font-weight: 600; }
.pw-feed-date { font-size: 10.5px; color: var(--ink-4); font-family: var(--font-mono); margin-top: 2px; }

/* — РЕЄСТР РОЗДІЛІВ — */
.pw-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; padding: 3px 8px; font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--accent-ink); background: var(--bg-active); border-radius: 6px; letter-spacing: .02em; }
.theme-dark .pw-mark { color: var(--c-mint); }
.pw-mark-sm { min-width: 30px; padding: 2px 6px; font-size: 11px; }
.pw-dash { color: var(--ink-4); }
.pw-sec-table { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elev); }
.pw-sec-head, .pw-sec-row { display: grid; grid-template-columns: 70px minmax(0,1fr) 116px 130px 56px 50px 156px 64px; align-items: center; gap: 12px; padding: 0 16px; }
.pw-sec-head { height: 38px; background: var(--bg-sunken); border-bottom: 1px solid var(--line); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; }
.pw-sec-c-sheets, .pw-sec-c-rev { text-align: center; }
.pw-sec-c-due { text-align: right; }
.pw-sec-group { border-bottom: 1px solid var(--line); }
.pw-sec-group:last-child { border-bottom: 0; }
.pw-sec-row { min-height: 56px; padding-top: 10px; padding-bottom: 10px; cursor: pointer; transition: background .1s; border-left: 3px solid transparent; }
.pw-sec-row:hover { background: var(--bg-hover); }
.pw-sec-row.tone-warn  { border-left-color: var(--late); }
.pw-sec-row.tone-amber { border-left-color: var(--c-amber); }
.pw-sec-name { font-size: 13.5px; font-weight: 500; color: var(--ink); letter-spacing: -0.003em; }
.pw-sec-note { font-size: 11px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-people { display: flex; align-items: center; gap: 4px; }
.pw-people-sep { color: var(--ink-4); }
.pw-av-ghost { background: var(--bg-sunken) !important; color: var(--ink-3) !important; border: 1px dashed var(--line-strong) !important; }
.pw-rev { font-family: var(--font-mono); font-size: 11.5px; color: var(--c-blue); font-weight: 600; }
.theme-dark .pw-rev { color: var(--c-mint); }
.pw-prog { display: flex; align-items: center; gap: 8px; }
.pw-prog-bar { flex: 1; height: 5px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; }
.pw-prog-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.pw-prog-fill.is-done { background: var(--live); }
.pw-prog-val { font-size: 11.5px; font-variant-numeric: tabular-nums; color: var(--ink-2); width: 32px; text-align: right; }
.pw-sec-c-due.is-over { color: var(--late); font-weight: 600; }
.pw-sec-expand { padding: 4px 16px 18px 19px; background: var(--bg-sunken); border-top: 1px solid var(--line); }
.pw-sec-expand-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; padding: 12px 0; }
.pw-sec-expand-grid > div { display: flex; flex-direction: column; gap: 1px; }
.pw-kv-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.pw-kv-v { font-size: 12.5px; color: var(--ink); font-weight: 500; }
.pw-sec-tasks-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; margin: 8px 0 6px; }

/* — ЕТАПИ — */
.pw-stage { border: 1px solid var(--line); border-radius: var(--r-lg); margin-bottom: 10px; overflow: hidden; background: var(--bg-elev); }
.pw-stage.is-active { border-color: var(--accent); }
.pw-stage-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; transition: background .1s; }
.pw-stage-head:hover { background: var(--bg-hover); }
.pw-stage-caret { color: var(--ink-3); transition: transform .15s; flex-shrink: 0; }
.pw-stage-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.pw-stage-count { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pw-stage.is-completed .pw-stage-name { color: var(--ink-3); }
.pw-stage-body { padding: 0 16px 14px; border-top: 1px solid var(--line); }

/* — ГАНТ — */
.pw-leg { display: inline-flex; align-items: center; gap: 5px; }
.pw-leg-sw { width: 16px; height: 9px; border-radius: 3px; }
.pw-leg-sw.is-completed { background: var(--bg-sunken); border: 1px dashed var(--line-strong); }
.pw-leg-sw.is-active { background: var(--accent); }
.pw-leg-sw.is-future { background: var(--bg-active); border: 1px solid var(--accent-soft); }
.pw-leg-diamond { width: 9px; height: 9px; background: var(--c-blue); transform: rotate(45deg); }
.pw-gantt { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-elev); }
.pw-gantt-head { display: grid; background: var(--bg-sunken); border-bottom: 1px solid var(--line); }
.pw-gantt-corner { padding: 9px 14px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; border-right: 1px solid var(--line); }
.pw-gantt-months { display: grid; }
.pw-gantt-month { padding: 7px 4px; text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-2); text-transform: capitalize; border-right: 1px solid var(--line); display: flex; flex-direction: column; line-height: 1.1; }
.pw-gantt-month:last-child { border-right: 0; }
.pw-gantt-month.is-current { background: var(--bg-active); color: var(--accent-ink); }
.theme-dark .pw-gantt-month.is-current { color: var(--c-mint); }
.pw-gantt-month-yr { font-size: 9px; color: var(--ink-4); font-weight: 500; }
.pw-gantt-body { position: relative; }
.pw-gantt-row { display: grid; border-bottom: 1px solid var(--line); }
.pw-gantt-row:last-child { border-bottom: 0; }
.pw-gantt-label { padding: 11px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.pw-gantt-label-name { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.pw-gantt-label-sub { font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); }
.pw-gantt-track { position: relative; height: 44px; }
.pw-gantt-bar { position: absolute; top: 50%; transform: translateY(-50%); height: 22px; border-radius: 5px; display: flex; align-items: center; padding: 0 8px; overflow: hidden; }
.pw-gantt-bar-lbl { font-size: 10.5px; font-weight: 600; color: #fff; white-space: nowrap; }
.pw-gantt-bar.is-active { background: var(--accent); }
.pw-gantt-bar.is-completed { background: var(--bg-active); border: 1px dashed var(--line-strong); }
.pw-gantt-bar.is-completed .pw-gantt-bar-lbl { color: var(--ink-3); }
.pw-gantt-bar.is-future { background: var(--accent-soft); }
.pw-gantt-bar.is-future .pw-gantt-bar-lbl { color: var(--accent-ink); }
.theme-dark .pw-gantt-bar.is-active .pw-gantt-bar-lbl { color: #042230; }
.theme-dark .pw-gantt-bar.is-future .pw-gantt-bar-lbl { color: var(--c-mint); }
.pw-gantt-ms .pw-gantt-track { height: 38px; }
.pw-gantt-marker { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pw-gantt-diamond { width: 10px; height: 10px; background: var(--c-blue); transform: rotate(45deg); border: 1.5px solid var(--bg-elev); }
.pw-gantt-marker.is-paid .pw-gantt-diamond { background: var(--live); }
.pw-gantt-marker-lbl { font-size: 9.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pw-gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--late); z-index: 3; pointer-events: none; }
.pw-gantt-today-cap { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 700; color: #fff; background: var(--late); padding: 1px 5px; border-radius: 3px; white-space: nowrap; }

/* — КОМАНДА (картки) — */
.pw-team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pw-tc { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; background: var(--bg-elev); }
.pw-tc-top { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.pw-tc-id { flex: 1; min-width: 0; }
.pw-tc-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.pw-tc-role { font-size: 11.5px; color: var(--ink-3); }
.pw-tc-marks { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; min-height: 22px; }
.pw-tc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.pw-tc-stat { text-align: center; }
.pw-tc-num { font-size: 19px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pw-tc-num.is-late { color: var(--late); }
.pw-tc-lbl { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; margin-top: 1px; }
.pw-tc-bar { height: 5px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; }
.pw-tc-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* — кнопка відкриття об'єкта у списку — */
.obj-open-btn { flex-shrink: 0; align-self: center; margin-left: 8px; }

/* — ПОГЛИБЛЕНА КАРТКА ЗАДАЧІ (drawer) — */
.drawer-objlink { font-size: 12px; color: var(--ink-3); background: none; transition: color .1s; }
.drawer-objlink:hover { color: var(--accent); }
.drawer-tabs { margin-bottom: 16px; }
.pw-seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--bg-sunken); border-radius: var(--r-md); border: 1px solid var(--line); }
.pw-seg-btn { padding: 6px 12px; font-size: 12.5px; font-weight: 500; color: var(--ink-3); border-radius: 6px; transition: background .12s, color .12s; }
.pw-seg-btn:hover { color: var(--ink); }
.pw-seg-btn.is-on { background: var(--bg-elev); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.pw-seg-btn.is-on.seg-live { color: var(--live); }
.pw-seg-btn.is-on.seg-late { color: var(--late); }
.pw-seg-btn.is-on.seg-done { color: var(--ink-3); }
.drawer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.drw-time-val { font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.drw-time-of { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.drw-time-bar { height: 5px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.drw-time-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.drw-assignee { display: flex; align-items: center; gap: 9px; }
.drw-assignee-name { font-size: 13px; font-weight: 500; color: var(--ink); }
.drw-assignee-role { font-size: 11px; color: var(--ink-3); }
.drw-dep { display: flex; align-items: center; gap: 8px; padding: 7px 0; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--line); }
.drw-dep:last-child { border-bottom: 0; }
.drw-dep-tag { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--bg-sunken); color: var(--ink-3); flex-shrink: 0; }
.drw-dep.is-blocked .drw-dep-tag { background: var(--late-bg); color: var(--late); }
.drw-dep-tag.is-blocks { background: var(--bg-active); color: var(--c-blue); }
.theme-dark .drw-dep-tag.is-blocks { color: var(--c-mint); }
.drw-comments { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.drw-comment { display: flex; gap: 10px; }
.drw-comment-body { min-width: 0; flex: 1; }
.drw-comment-top { display: flex; align-items: baseline; gap: 8px; }
.drw-comment-top b { font-size: 13px; color: var(--ink); font-weight: 600; }
.drw-comment-date { font-size: 10.5px; color: var(--ink-4); font-family: var(--font-mono); }
.drw-comment-text { font-size: 13px; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }
.drw-comment-input { display: flex; gap: 8px; align-items: center; }
.drw-comment-input .cp-input { flex: 1; }
.drw-files { display: flex; flex-direction: column; gap: 8px; }
.drw-file { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-md); }
.drw-file-ic { width: 34px; height: 34px; border-radius: 6px; background: var(--bg-active); color: var(--accent-ink); display: grid; place-items: center; font-size: 10px; font-weight: 700; font-family: var(--font-mono); flex-shrink: 0; }
.theme-dark .drw-file-ic { color: var(--c-mint); }
.drw-file-body { flex: 1; min-width: 0; }
.drw-file-name { font-size: 13px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drw-file-meta { font-size: 11px; color: var(--ink-3); font-family: var(--font-mono); }
.drw-history { display: flex; flex-direction: column; gap: 14px; }
.drw-hist-row { display: flex; gap: 10px; }
.drw-hist-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-soft); border: 2px solid var(--accent); margin-top: 4px; flex-shrink: 0; }
.drw-hist-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.drw-hist-text b { color: var(--ink); font-weight: 600; }
.drw-hist-date { font-size: 10.5px; color: var(--ink-4); font-family: var(--font-mono); margin-top: 2px; }

@media (max-width: 820px) {
  .pw-grid { grid-template-columns: 1fr; }
  .pw-sec-head { display: none; }
  .pw-sec-row { grid-template-columns: 56px 1fr auto; grid-auto-rows: auto; row-gap: 6px; }
  .pw-sec-c-people, .pw-sec-c-rev, .pw-sec-c-sheets, .pw-sec-c-prog { display: none; }
}

/* ============ СКЛАД / МАЙНО ТА ІНВЕНТАРИЗАЦІЯ ============ */
.mini-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-active); color: var(--c-blue);
  display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 10.5px; font-weight: 700; letter-spacing: -0.02em;
}
.theme-dark .mini-avatar { color: var(--c-mint); }

.back-link {
  font-size: 12.5px; color: var(--ink-3); font-weight: 500;
  padding: 4px 0; transition: color 0.12s; cursor: pointer; background: none; border: 0;
}
.back-link:hover { color: var(--accent); }

.inv-no { font-size: 12px; color: var(--ink-2); letter-spacing: 0.01em; }
.inv-no-lg { font-size: 14px; color: var(--accent); font-weight: 600; }
.mask-chip {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  background: var(--bg-sunken); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 5px; white-space: nowrap;
}

/* Знос — інлайн прогрес у таблиці */
.wear-cell { display: flex; align-items: center; gap: 8px; }
.wear-track { flex: 1; height: 5px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; min-width: 54px; }
.wear-fill { height: 100%; background: var(--ink-4); border-radius: 3px; }
.wear-pct { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

/* QR-етикетка (плейсхолдер) */
.asset-qr {
  display: grid; gap: 1px; padding: 5px; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; box-sizing: border-box;
}
.asset-qr span { background: transparent; border-radius: 0.5px; aspect-ratio: 1; }
.asset-qr span.on { background: #0c1b22; }
.asset-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }

.drawer-wide { width: min(660px, 95vw); }
.asset-hero { display: flex; gap: 18px; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.asset-hero-main { min-width: 0; }

.assign-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--bg-sunken); border-radius: 8px;
}
.assign-person { display: flex; align-items: center; gap: 10px; }
.assign-person .mini-avatar { width: 34px; height: 34px; font-size: 12px; }
.assign-loc { font-size: 12.5px; color: var(--ink-2); }

/* Амортизація — велика смуга в картці */
.dep-bar {
  position: relative; height: 26px; background: var(--bg-sunken);
  border-radius: 6px; overflow: hidden; display: flex; align-items: center;
}
.dep-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft, var(--bg-active)); }
.theme-dark .dep-bar-fill { background: var(--bg-active); }
.dep-bar-label { position: relative; font-size: 11.5px; font-weight: 600; color: var(--ink-2); padding-left: 10px; }

/* Обслуговування */
.maint-list { display: flex; flex-direction: column; }
.maint-item { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.maint-item:last-child { border-bottom: 0; }
.maint-date { font-size: 11.5px; color: var(--ink-3); }
.maint-what { font-size: 13px; color: var(--ink); }
.maint-by { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.maint-cost { font-size: 12.5px; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Сесії інвентаризації */
.inv-session-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 900px) { .inv-session-list { grid-template-columns: 1fr; } }
.inv-session-card {
  text-align: left; padding: 18px 20px; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer;
  display: flex; flex-direction: column; gap: 14px; transition: border-color 0.15s, box-shadow 0.15s;
}
.inv-session-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.inv-session-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.inv-session-title { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.inv-session-meta { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.inv-session-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.iss-stat { display: flex; flex-direction: column; gap: 2px; }
.iss-num { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; }
.iss-lbl { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.03em; }
.inv-session-foot { display: flex; align-items: center; gap: 10px; }
.inv-progress-track { flex: 1; height: 6px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; }
.inv-progress-fill { height: 100%; border-radius: 3px; }
.inv-progress-lbl { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }
.inv-session-sub { font-size: 11.5px; color: var(--ink-3); }

/* Комісія */
.commission-row { display: flex; flex-wrap: wrap; gap: 10px; }
.commission-chip { display: flex; align-items: center; gap: 9px; padding: 8px 14px 8px 10px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 999px; }
.commission-chip .mini-avatar { width: 30px; height: 30px; font-size: 11px; }

/* QR-скан панель */
.scan-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 18px 22px; margin-bottom: 28px;
  background: var(--bg-active); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
}
.scan-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.scan-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.scan-last { font-size: 12px; color: var(--c-green-deep); margin-top: 8px; }
.theme-dark .scan-last { color: var(--c-green); }
.scan-btn { font-size: 14px; padding: 10px 20px; }

/* Розбіжності */
.discrep-list { display: flex; flex-direction: column; gap: 8px; }
.discrep-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; background: var(--bg-elev); border: 1px solid var(--line);
  border-left: 3px solid var(--ink-4); border-radius: var(--r-md);
}
.discrep-item.tone-warn { border-left-color: var(--late); }
.discrep-item.tone-amber { border-left-color: var(--c-amber); }
.discrep-item.tone-blue { border-left-color: var(--c-blue); }
.discrep-main { min-width: 0; }

/* Дії інвентаризації */
.inv-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.act-signed { font-size: 12.5px; color: var(--c-green-deep); font-weight: 500; }
.theme-dark .act-signed { color: var(--c-green); }

/* ============ P&L / ФІНАНСОВИЙ РЕЗУЛЬТАТ ============ */
.pl-sheet {
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 6px 20px; overflow: hidden;
}
.pl-group-h {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--ink-3); padding: 16px 0 6px; margin-top: 4px; border-bottom: 1px solid var(--line);
}
.pl-group-h:first-child { margin-top: 0; }
.pl-legend { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 28px; margin-top: 14px; }
@media (max-width: 760px) { .pl-legend { grid-template-columns: 1fr; } }
.pl-legend-item { display: flex; align-items: center; gap: 9px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.pl-legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.pl-legend-lbl { font-size: 12.5px; color: var(--ink-2); flex: 1; min-width: 0; }
.pl-legend-val { font-size: 12.5px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pl-legend-pct { font-size: 11.5px; color: var(--ink-3); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* ============ ГОТІВКОВА ЧАСТИНА ЗП ============ */
.cash-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px; border-radius: 999px; cursor: pointer;
  font-size: 12px; font-weight: 500; color: var(--ink-3);
  background: var(--bg-sunken); border: 1px solid var(--line); white-space: nowrap;
  transition: color .12s, border-color .12s, background .12s;
}
.cash-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.cash-toggle-track {
  width: 26px; height: 15px; border-radius: 999px; background: var(--ink-4);
  position: relative; flex-shrink: 0; transition: background .15s;
}
.cash-toggle-knob {
  position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.cash-toggle.is-on { color: var(--c-amber); border-color: rgba(240,191,48,.4); background: rgba(240,191,48,.1); }
.cash-toggle.is-on .cash-toggle-track { background: var(--c-amber); }
.cash-toggle.is-on .cash-toggle-knob { transform: translateX(11px); }

/* колонки «готівкою» у таблиці розрахунку — теплий відтінок */
.payroll-table th.cash-col, .payroll-table td.cash-col {
  background: rgba(240,191,48,.07);
}
.theme-dark .payroll-table th.cash-col, .theme-dark .payroll-table td.cash-col {
  background: rgba(240,191,48,.05);
}

/* розбивка в картці співробітника */
.cash-split { margin-top: 12px; border-top: 1px dashed var(--line-strong); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.cash-split-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.cash-split-row.is-total { border-top: 1px solid var(--line); margin-top: 2px; padding-top: 9px; }
.cash-split-tag { font-size: 12px; font-weight: 600; color: var(--ink-2); min-width: 88px; }
.cash-split-row.is-total .cash-split-tag { color: var(--ink); }
.cash-split-tag.is-cash { color: var(--c-amber); }
.cash-split-note { font-size: 11.5px; color: var(--ink-3); flex: 1; }
.cash-split-val { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.cash-split-row.is-total .cash-split-val { font-size: 15px; color: var(--c-green-deep); }

/* таблиця готівкових виплат у реєстрі */
.cash-table { border: 1px solid rgba(240,191,48,.3); border-radius: var(--r-md); overflow: hidden; }

/* окрема погодинна посада «Реєстратор ЄДЕССБ» у картці співробітника */
.edessb-job {
  margin-top: 14px; padding: 12px 14px;
  background: var(--bg-sunken); border: 1px solid var(--line);
  border-left: 3px solid var(--c-blue); border-radius: var(--r-md);
}
.edessb-job-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.edessb-job-type { font-size: 11.5px; color: var(--ink-3); }

/* ============ ВХІД / АВТОРИЗАЦІЯ ============ */
.auth-screen {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: var(--bg-sunken); padding: 24px; z-index: 1000;
}
.auth-splash { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.auth-logo { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.auth-logo .pdf-pd, .auth-logo .ubp-erp { color: var(--accent); }
.auth-logo .pdf-flow, .auth-logo .ubp-name { color: var(--ink); }
.auth-logo-lg { font-size: 30px; }
.auth-spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--line-strong); border-top-color: var(--accent);
  animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }
.auth-splash-sub { font-size: 13px; color: var(--ink-3); }

.auth-card {
  width: min(380px, 100%); background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(31,35,26,0.12));
  padding: 32px 30px; display: flex; flex-direction: column;
}
.auth-card .auth-logo-lg { margin-bottom: 18px; }
.auth-title { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.auth-sub { font-size: 13px; color: var(--ink-3); margin: 2px 0 22px; }
.auth-label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.auth-input {
  height: 40px; padding: 0 12px; margin-bottom: 16px;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  font-size: 14px; color: var(--ink); font-family: inherit; outline: none; transition: border-color 0.12s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-err { font-size: 12.5px; color: var(--late); margin-bottom: 12px; }
.auth-submit { height: 42px; justify-content: center; font-size: 14px; margin-top: 4px; }
.auth-hint { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 16px; }
.auth-hint code { font-family: var(--font-mono); background: var(--bg-sunken); padding: 1px 6px; border-radius: 4px; }
.auth-pw-rule { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); margin: -4px 0 14px; }
.auth-pw-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); transition: background .15s; }
.auth-pw-rule.is-ok { color: var(--c-green-deep); }
.auth-pw-rule.is-ok .auth-pw-dot { background: var(--accent); }

/* користувач + вихід у шапці */
.appbar-user-wrap { display: flex; align-items: center; gap: 2px; }
.appbar-logout {
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: var(--r-md); color: var(--ink-3); transition: background 0.12s, color 0.12s;
}
.appbar-logout:hover { background: var(--bg-sunken); color: var(--late); }


/* ============ LEADS · ВОРОНКА (двоколійна) ============ */
.lead-track-tabs { display: flex; gap: 10px; margin-bottom: 18px; }
.lead-track-tab {
  display: flex; align-items: center; gap: 12px; flex: 1;
  padding: 14px 18px; background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-lg); cursor: pointer; text-align: left; transition: border-color .12s, background .12s;
}
.lead-track-tab:hover { border-color: var(--line-strong); }
.lead-track-tab.is-active { border-color: var(--accent); background: var(--bg-tint); }
.theme-dark .lead-track-tab.is-active { background: var(--bg-active); }
.lead-track-tab .ic { width: 20px; height: 20px; color: var(--ink-3); flex-shrink: 0; }
.lead-track-tab.is-active .ic { color: var(--accent); }
.ltt-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ltt-text b { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.ltt-text span { font-size: 11.5px; color: var(--ink-3); }
.ltt-count {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ink-2);
  background: var(--bg-sunken); border-radius: 999px; min-width: 26px; height: 24px;
  display: grid; place-items: center; padding: 0 8px; font-variant-numeric: tabular-nums;
}
.lead-track-tab.is-active .ltt-count { background: var(--accent); color: #fff; }
.theme-dark .lead-track-tab.is-active .ltt-count { color: #04140d; }

.funnel-rail { display: flex; gap: 10px; margin: 4px 0 18px; }
.funnel-step { flex: 1; min-width: 0; }
.funnel-step-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.funnel-step-top .status-tag { font-size: 10.5px; }
.funnel-step-top b { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.funnel-step-bar { height: 6px; background: var(--bg-sunken); border-radius: 999px; overflow: hidden; }
.funnel-step-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; min-width: 2px; }

.sync-banner {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; margin-bottom: 16px;
  background: var(--bg-tint); border: 1px solid var(--accent-soft); border-radius: var(--r-md);
  font-size: 13px; color: var(--ink-2);
}
.theme-dark .sync-banner { background: var(--bg-active); }
.sync-banner .ic { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.sync-banner > span:first-of-type { flex: 1; }
.sync-badge {
  font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}

.lead-groups { display: flex; flex-direction: column; gap: 22px; }
.lead-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.lead-group-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.lead-stepper { display: flex; gap: 6px; margin: 4px 0 20px; flex-wrap: wrap; }
.lead-step { display: flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: var(--bg-sunken); border: 1px solid var(--line); }
.lead-step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.lead-step-label { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.lead-step.is-done .lead-step-dot { background: var(--accent); }
.lead-step.is-done .lead-step-label { color: var(--ink-2); }
.lead-step.is-current { background: var(--bg-tint); border-color: var(--accent); }
.theme-dark .lead-step.is-current { background: var(--bg-active); }
.lead-step.is-current .lead-step-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lead-step.is-current .lead-step-label { color: var(--ink); font-weight: 600; }

.tender-box { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px 14px; }
.tender-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.tender-row:last-child { border-bottom: 0; }
.tender-row > span { color: var(--ink-3); }
.tender-row > b { color: var(--ink); font-weight: 600; }
.tender-note { margin-top: 10px; padding: 11px 14px; background: rgba(240,191,48,.12); border: 1px solid rgba(240,191,48,.3); border-radius: var(--r-md); font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.theme-dark .tender-note { background: rgba(240,191,48,.1); }

@media (max-width: 820px) {
  .lead-track-tabs { flex-direction: column; }
  .funnel-rail { flex-wrap: wrap; }
  .funnel-step { flex-basis: calc(50% - 5px); }
}


/* ============ ОНБОРДИНГ · картка-документ ============ */
.onb-doc-card {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px;
  background: var(--bg-tint); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.theme-dark .onb-doc-card { background: var(--bg-active); }
.onb-doc-ic {
  flex-shrink: 0; width: 46px; height: 46px; border-radius: 11px; background: var(--bg);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--c-green-deep);
}
.onb-doc-ic .ic { width: 22px; height: 22px; }
.onb-doc-body { flex: 1; min-width: 0; }
.onb-doc-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.onb-doc-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.onb-doc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.onb-doc-actions .btn { text-decoration: none; }
@media (max-width: 720px) {
  .onb-doc-card { flex-direction: column; align-items: flex-start; }
  .onb-doc-actions { width: 100%; }
}

/* ============ ВИЇЗДИ (field visits) ============ */
/* Бейдж типу виїзду в списках/картках */
.vt-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  background: var(--bg-active); color: var(--c-blue); border-radius: 999px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.theme-dark .vt-badge { color: var(--c-mint); }
.vt-badge.is-small { font-size: 10px; padding: 1px 7px; }

.vt-panel { display: flex; flex-direction: column; gap: 0; }
.vt-count { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-left: auto; }

/* — Голова: тип + фаза + готовність — */
.vt-head-card { padding-bottom: 16px; }
.vt-head-top { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.vt-head-type { display: flex; align-items: flex-start; gap: 11px; flex: 1; min-width: 0; }
.vt-head-ic {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; background: var(--bg-sunken);
  display: grid; place-items: center;
}
.vt-head-label { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.vt-head-note { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.vt-ready-pill {
  flex-shrink: 0; font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  background: var(--late-bg); color: var(--late); white-space: nowrap;
}
.vt-ready-pill.is-ready { background: var(--live-bg); color: var(--live); }

/* — Фази — */
.vt-phase { margin-bottom: 16px; }
.vt-phase-track { display: flex; align-items: center; }
.vt-phase-node {
  display: flex; align-items: center; gap: 8px; padding: 0; background: none; border: none;
  cursor: pointer; color: var(--ink-3); flex-shrink: 0;
}
.vt-phase-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-sunken); border: 1.5px solid var(--line-strong); color: var(--ink-3);
  transition: background .15s, color .15s, border-color .15s;
}
.vt-phase-label { font-size: 12px; font-weight: 500; white-space: nowrap; }
.vt-phase-node.is-cur .vt-phase-dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.theme-dark .vt-phase-node.is-cur .vt-phase-dot { color: #010e1f; }
.vt-phase-node.is-cur { color: var(--ink); }
.vt-phase-node.is-cur .vt-phase-label { font-weight: 700; }
.vt-phase-node.is-done .vt-phase-dot { background: var(--live-bg); border-color: var(--live); color: var(--live); }
.vt-phase-node.is-done { color: var(--ink-2); }
.vt-phase-sep { flex: 1; height: 2px; background: var(--line); margin: 0 8px; border-radius: 2px; min-width: 14px; }
.vt-phase-sep.is-done { background: var(--live); }

/* — Готовність (4 умови) — */
.vt-ready-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 16px; margin-bottom: 14px; }
.vt-ready-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.vt-ready-check { display: grid; place-items: center; color: var(--ink-4); flex-shrink: 0; }
.vt-ready-item.is-done { color: var(--ink); }
.vt-ready-item.is-done .vt-ready-check { color: var(--live); }
.vt-ready-label { flex: 1; min-width: 0; }
.vt-ready-detail { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vt-ready-item.is-done .vt-ready-detail { color: var(--live); }
.vt-phase-cta { width: 100%; justify-content: center; }
.vt-done-note {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--live);
  background: var(--live-bg); border-radius: var(--r-md); padding: 9px 12px;
}

/* — Сегмент (статуси погодж./транспорту) — */
.vt-coord { display: flex; flex-direction: column; gap: 12px; }
.vt-coord-when { display: flex; flex-direction: column; gap: 8px; }
.vt-coord-seg, .vt-trans-pick { display: flex; gap: 4px; flex-wrap: wrap; }
.vt-coord-seg { padding: 3px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md); width: fit-content; }
.vt-seg-btn {
  padding: 5px 12px; font-size: 12px; font-weight: 500; color: var(--ink-3); border-radius: 6px;
  background: none; border: none; cursor: pointer; transition: background .12s, color .12s; white-space: nowrap;
}
.vt-seg-btn:hover { color: var(--ink); }
.vt-seg-btn.is-on { background: var(--bg-elev); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.vt-seg-btn.is-on.tone-live { color: var(--live); }
.vt-seg-btn.is-on.tone-amber { color: #876a02; }
.theme-dark .vt-seg-btn.is-on.tone-amber { color: var(--c-amber); }
.vt-seg-btn.is-on.tone-neutral { color: var(--ink-2); }

.vt-contact { display: flex; flex-direction: column; gap: 8px; }
.vt-contact-row { display: flex; gap: 8px; }
.vt-contact-row .cp-input { flex: 1; min-width: 0; }
.vt-notify { display: flex; align-items: center; gap: 12px; }
.vt-notify-state { font-size: 12px; color: var(--ink-3); }

/* — Хто їде — */
.vt-team { display: flex; flex-direction: column; gap: 7px; }
.vt-person {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md);
}
.vt-person-meta { flex: 1; min-width: 0; }
.vt-person-name { font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.vt-lead-tag { font-size: 10px; font-weight: 600; color: var(--accent-ink); background: var(--bg-active); padding: 1px 7px; border-radius: 999px; }
.theme-dark .vt-lead-tag { color: var(--c-mint); }
.vt-person-role { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.vt-empty { font-size: 12.5px; color: var(--ink-3); padding: 6px 0; }
.vt-add-row { margin-top: 9px; }
.vt-add-row .cp-input { width: 100%; }

.vt-x {
  flex-shrink: 0; background: none; border: none; color: var(--ink-4); cursor: pointer;
  display: grid; place-items: center; padding: 3px; border-radius: 5px; line-height: 0;
}
.vt-x:hover { color: var(--late); background: var(--late-bg); }
.vt-x svg { width: 14px; height: 14px; }

/* — Спорядження — */
.vt-kit { display: flex; flex-direction: column; gap: 6px; }
.vt-kit-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md);
}
.vt-kit-item.is-packed { background: var(--bg-active); border-color: var(--accent-soft); }
.vt-kit-item.is-future { opacity: .7; }
.vt-kit-check {
  flex-shrink: 0; width: 19px; height: 19px; border-radius: 5px; border: 1.5px solid var(--line-strong);
  background: var(--bg); display: grid; place-items: center; cursor: pointer; color: #fff; line-height: 0;
}
.vt-kit-item.is-packed .vt-kit-check { background: var(--c-green-deep); border-color: var(--c-green-deep); }
.vt-kit-check svg { width: 12px; height: 12px; }
.vt-kit-ic { flex-shrink: 0; color: var(--ink-3); display: grid; place-items: center; }
.vt-kit-main { flex: 1; min-width: 0; }
.vt-kit-name { font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.vt-soon { font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 6px; }
.vt-kit-asset { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.vt-mini-tag { font-size: 9.5px; padding: 1px 7px; }
.vt-kit-hint { font-size: 11px; color: var(--ink-3); }
.vt-kit-co {
  flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.vt-kit-co:hover { border-color: var(--accent); color: var(--accent); }
.vt-kit-co.is-on { background: var(--bg-active); border-color: var(--c-blue); color: var(--c-blue); }
.theme-dark .vt-kit-co.is-on { color: var(--c-mint); border-color: var(--c-mint); }
.vt-kit-compact .vt-kit-item { padding: 6px 10px; }

/* — Транспорт — */
.vt-trans-opt {
  display: flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: var(--r-md);
  background: var(--bg-sunken); border: 1px solid var(--line); color: var(--ink-2);
  font-size: 12.5px; font-weight: 500; cursor: pointer; transition: border-color .12s, background .12s;
}
.vt-trans-opt:hover { border-color: var(--line-strong); }
.vt-trans-opt.is-on { border-color: var(--accent); background: var(--bg-active); color: var(--ink); font-weight: 600; }
.vt-trans-detail { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.vt-trans-field { display: flex; flex-direction: column; gap: 6px; }
.vt-trans-field .cp-input { max-width: 160px; }
.vt-mini-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); }
.vt-trans-note { margin-top: 10px; width: 100%; }
.vt-cash-hint { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.vt-cash-hint .ic { color: var(--c-green-deep); }

/* — Результат виїзду — */
.vt-closeout { background: var(--bg-tint); border-color: var(--accent-soft); }
.theme-dark .vt-closeout { background: var(--bg-active); }
.vt-sub-h { font-size: 12px; font-weight: 700; color: var(--ink); margin-bottom: 9px; display: flex; align-items: center; gap: 10px; }
.vt-fill { margin-left: auto; }
.vt-did { margin-bottom: 16px; }
.vt-did-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.vt-did-text { flex: 1; font-size: 13px; color: var(--ink); }
.vt-did-item.is-done .vt-did-text { text-decoration: line-through; color: var(--ink-3); }
.vt-did-add { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.vt-did-add .cp-input { flex: 1; }
.vt-result-toggles { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.vt-toggle { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink); cursor: pointer; }
.vt-toggle input { width: 16px; height: 16px; accent-color: var(--c-green-deep); cursor: pointer; }
.vt-toggle .ic { color: var(--ink-3); }
.vt-photos { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink); }
.vt-photos .ic { color: var(--ink-3); }
.vt-photos-n { font-variant-numeric: tabular-nums; min-width: 56px; }
.vt-step { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink-2); cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; }
.vt-step:hover { border-color: var(--accent); color: var(--accent); }
.vt-expense { margin-bottom: 14px; }
.vt-expense-row { display: flex; align-items: center; gap: 12px; }
.vt-expense-in { max-width: 130px; }
.vt-expense-plan { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.vt-files { }
.vt-file-ph {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-top: 6px;
  background: var(--bg); border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  font-size: 12.5px; color: var(--ink-2);
}
.vt-file-ph .ic { color: var(--ink-3); flex-shrink: 0; }
.vt-file-up { margin-left: auto; font-size: 11.5px; }

/* — Тип-картки у модалці створення — */
.vt-type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.vt-type-card {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px;
  background: var(--bg-sunken); border: 1.5px solid var(--line); border-radius: var(--r-md);
  cursor: pointer; transition: border-color .12s, background .12s; text-align: center;
}
.vt-type-card:hover { border-color: var(--line-strong); }
.vt-type-card.is-active { border-color: var(--accent); background: var(--bg-active); }
.vt-type-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-elev); display: grid; place-items: center; }
.vt-type-name { font-size: 11.5px; font-weight: 600; color: var(--ink); line-height: 1.2; }
@media (max-width: 560px) {
  .vt-type-grid { grid-template-columns: repeat(3, 1fr); }
  .vt-ready-grid { grid-template-columns: 1fr; }
}

/* ============ ПІКЕР ВИСТАВЛЕННЯ РАХУНКУ ============ */
.ip-modal {
  inset: auto; top: 40px; left: 50%; transform: translateX(-50%);
  width: min(880px, calc(100% - 48px)); max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
}
.ip-head-ic {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--bg-active);
  color: var(--accent-ink); display: grid; place-items: center;
}
.theme-dark .ip-head-ic { color: var(--c-mint); }
.ip-head-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ip-head-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }

.ip-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 320px 1fr; overflow: hidden; }
.ip-col { display: flex; flex-direction: column; min-height: 0; padding: 18px 20px; }
.ip-col-contracts { border-right: 1px solid var(--line); background: var(--bg-sunken); }
.ip-col-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin-bottom: 12px; }
.ip-contract-list, .ip-milestones { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }

.ip-contract {
  text-align: left; background: var(--bg-elev); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 11px 13px; cursor: pointer; transition: border-color .12s, box-shadow .12s; display: block; width: 100%;
}
.ip-contract:hover { border-color: var(--line-strong); }
.ip-contract.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--bg-active); }
.ip-contract-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.ip-obj-code { font-size: 12px; font-weight: 700; color: var(--ink); }
.ip-c-status { font-size: 9.5px; padding: 1px 7px; }
.ip-obj-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-bottom: 5px; }
.ip-contract-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ip-client { font-size: 11.5px; color: var(--ink-2); }
.ip-c-num { font-size: 11px; color: var(--ink-3); }
.ip-next { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ip-next-stage { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-next-sum { font-size: 12px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ip-next-paid { font-size: 11.5px; color: var(--live); }

.ip-ms {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  background: var(--bg-sunken); border: 1.5px solid var(--line); border-radius: var(--r-md); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.ip-ms:hover { border-color: var(--line-strong); }
.ip-ms.is-on { border-color: var(--accent); background: var(--bg-active); }
.ip-ms.is-disabled { opacity: .55; cursor: default; }
.ip-ms input { position: absolute; opacity: 0; pointer-events: none; }
.ip-ms-radio {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong);
  position: relative; transition: border-color .12s;
}
.ip-ms.is-on .ip-ms-radio { border-color: var(--accent); }
.ip-ms.is-on .ip-ms-radio::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent);
}
.ip-ms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ip-ms-stage { font-size: 13px; font-weight: 600; color: var(--ink); }
.ip-ms-sub { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.ip-ms-right { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.ip-ms-amount { font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ip-ms-tag { font-size: 9.5px; padding: 1px 7px; }

.ip-summary {
  margin-top: 16px; padding: 14px 16px; background: var(--bg-sunken);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.ip-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 12.5px; color: var(--ink-2); padding: 3px 0; }
.ip-summary-row > span:first-child { white-space: nowrap; }
.ip-summary-row > span:last-child { white-space: nowrap; }
.ip-summary-vat { color: var(--ink-3); }
.ip-summary-total { margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--ink); }
.ip-empty { font-size: 13px; color: var(--ink-3); padding: 20px 0; }

.ip-foot { flex-shrink: 0; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--bg-elev); }

@media (max-width: 680px) {
  .ip-body { grid-template-columns: 1fr; }
  .ip-col-contracts { border-right: none; border-bottom: 1px solid var(--line); max-height: 38vh; }
}

/* ============ ГРАФІК ФІНАНСУВАННЯ (contract billing) ============ */
.bs-wrap { padding-top: 4px; }
.bs-schedule-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.bs-channel {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}
.bs-channel.tone-neutral { background: var(--bg-sunken); color: var(--ink-2); border: 1px solid var(--line-strong); }
.bs-channel.tone-live { background: var(--bg-active); color: var(--accent-ink); }
.theme-dark .bs-channel.tone-live { color: var(--c-mint); }

.bs-stages { display: flex; flex-direction: column; gap: 7px; }

/* — Перемикач ролі сторін — */
.bs-role { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-bottom: 14px;
  padding: 11px 14px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md); }
.bs-role-field { display: flex; align-items: center; gap: 9px; }
.bs-role-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); white-space: nowrap; }
.bs-seg { margin: 0; }

/* ============ АВТОРСЬКИЙ НАГЛЯД (supervision tasks) ============ */
.sup-block {
  margin-bottom: 16px; padding: 16px; border-radius: var(--r-md);
  background: var(--bg-tint); border: 1px solid var(--accent-soft);
}
.theme-dark .sup-block { background: var(--bg-active); }
.sup-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.sup-head-ic { flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; background: var(--bg-elev);
  display: grid; place-items: center; color: var(--c-green-deep); }
.sup-head-txt { flex: 1; min-width: 0; }
.sup-head-title { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; display: flex; align-items: center; gap: 9px; }
.sup-pct-tag { font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 999px; background: var(--live-bg); color: var(--live); }
.sup-head-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.sup-goto { flex-shrink: 0; white-space: nowrap; }

.sup-empty-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.sup-empty-list { display: flex; flex-direction: column; gap: 6px; }
.sup-empty-list span { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.sup-empty-list .ic { color: var(--ink-3); }

.sup-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.sup-stat { padding: 11px 13px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md); }
.sup-stat-val { font-size: 22px; font-weight: 750; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sup-stat-of { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 3px; }
.sup-next-val { font-size: 16px; }
.sup-stat-label { font-size: 11px; color: var(--ink-3); margin-top: 4px; line-height: 1.3; }

.sup-stages { display: flex; flex-direction: column; gap: 7px; }
.sup-stage-row { display: flex; align-items: center; gap: 10px; }
.sup-stage-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.sup-stage-name { font-size: 12.5px; color: var(--ink-2); width: 210px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-stage-bar { flex: 1; height: 7px; background: var(--bg-sunken); border-radius: 4px; overflow: hidden; }
.sup-stage-fill { display: block; height: 100%; border-radius: 4px; transition: width .3s; }
.sup-stage-count { font-size: 11.5px; color: var(--ink-3); width: 38px; text-align: right; flex-shrink: 0; }

.sup-bill { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sup-bill-note { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.sup-bill-note .ic { color: var(--c-green-deep); flex-shrink: 0; }

@media (max-width: 860px) {
  .sup-stats { grid-template-columns: repeat(2, 1fr); }
  .sup-stage-name { width: 130px; }
}
.bs-stage {
  display: grid;
  grid-template-columns: 26px minmax(190px, 1.4fr) auto minmax(280px, auto) auto;
  align-items: center; gap: 16px;
  padding: 12px 14px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color .12s;
}
.bs-stage:hover { border-color: var(--line-strong); }
.bs-stage.is-paid { background: var(--bg-sunken); }
.bs-stage.is-late { border-color: color-mix(in oklch, var(--late) 40%, var(--line)); }
.bs-num { font-size: 12px; color: var(--ink-3); text-align: center; }

.bs-main { min-width: 0; }
.bs-stage-name { font-size: 13.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; line-height: 1.3; }
.bs-chip { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.bs-chip-edessb { background: color-mix(in oklch, var(--c-blue) 14%, transparent); color: var(--c-blue); }
.theme-dark .bs-chip-edessb { color: var(--c-mint); }
.bs-stage-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; }
.bs-type { font-weight: 600; }
.bs-type.is-advance { color: #876a02; }
.theme-dark .bs-type.is-advance { color: var(--c-amber); }
.bs-type.is-work { color: var(--ink-2); }
.bs-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); flex-shrink: 0; }
.bs-due.is-late { color: var(--late); font-weight: 600; }
.bs-fact { color: var(--ink-3); }
.bs-late-days { color: var(--late); }

.bs-amount { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; white-space: nowrap; }
.bs-amount-val { font-size: 14px; font-weight: 700; color: var(--ink); }
.bs-status { font-size: 9.5px; padding: 1px 8px; }

.bs-track { display: flex; gap: 7px; }
.bs-doc {
  display: flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px;
  background: var(--bg-sunken); border: 1px solid var(--line); min-width: 92px;
}
.bs-doc.is-done { background: var(--live-bg); border-color: color-mix(in oklch, var(--live) 35%, transparent); }
.bs-doc.is-muted { opacity: .5; }
.bs-doc-ic { flex-shrink: 0; color: var(--ink-4); display: grid; place-items: center; }
.bs-doc.is-done .bs-doc-ic { color: var(--live); }
.bs-doc-body { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.bs-doc-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--ink-3); }
.bs-doc-val { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bs-doc.is-done .bs-doc-val { color: var(--ink); }

.bs-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bs-actions .btn { white-space: nowrap; }
.bs-closed { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--live); }

.bs-totals { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 16px; padding: 12px 14px; background: var(--bg-sunken); border-radius: var(--r-md); }
.bs-total-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); }
.bs-total-item b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bs-total-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.bs-total-item.is-paid .bs-total-dot { background: var(--live); }
.bs-total-item.is-billed .bs-total-dot { background: var(--c-blue); }
.bs-total-item.is-overdue .bs-total-dot { background: var(--late); }
.bs-total-item.is-planned .bs-total-dot { background: var(--ink-4); }

/* — Реєстр додаткових угод — */
.bs-amend { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.bs-amend-head {
  display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none;
  cursor: pointer; padding: 4px 0; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.bs-amend-head:hover { color: var(--ink); }
.bs-amend-head > span:nth-child(2) { color: var(--ink); }
.bs-amend-count { font-size: 10.5px; font-weight: 700; background: var(--bg-active); color: var(--accent-ink); padding: 1px 7px; border-radius: 999px; }
.theme-dark .bs-amend-count { color: var(--c-mint); }
.bs-amend-chev { margin-left: auto; color: var(--ink-3); display: grid; place-items: center; transition: transform .18s; }
.bs-amend-chev.is-open { transform: rotate(180deg); }
.bs-amend-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bs-amend-item { padding: 11px 13px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-md); border-left: 3px solid var(--accent-soft); }
.bs-amend-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bs-amend-no { font-size: 12.5px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.bs-amend-date { font-size: 11.5px; color: var(--ink-3); }
.bs-amend-reason { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.bs-amend-changes { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.bs-amend-changes li { font-size: 12px; color: var(--ink-2); line-height: 1.4; }

@media (max-width: 1100px) {
  .bs-stage { grid-template-columns: 24px 1fr auto; grid-template-areas: "num main amount" "track track track" "actions actions actions"; gap: 10px 14px; }
  .bs-num { grid-area: num; }
  .bs-main { grid-area: main; }
  .bs-amount { grid-area: amount; }
  .bs-track { grid-area: track; flex-wrap: wrap; }
  .bs-actions { grid-area: actions; flex-direction: row; align-items: center; justify-content: flex-end; }
}

/* ============ ТАБЕЛЬ ОБЛІКУ РОБОЧОГО ЧАСУ (П-5) ============ */
.tabel-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elev);
}
.tabel-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-variant-numeric: tabular-nums;
}
.tabel-table th, .tabel-table td { border-bottom: 1px solid var(--line); }
.tabel-table thead th {
  background: var(--bg-sunken);
  padding: 7px 3px;
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  text-align: center; white-space: nowrap;
}
/* липкий перший стовпець */
.tabel-name-col {
  position: sticky; left: 0; z-index: 2;
  background: var(--bg-elev);
  min-width: 230px; max-width: 230px;
  text-align: left !important;
  padding-left: 14px !important;
  box-shadow: 1px 0 0 var(--line);
}
.tabel-table thead th.tabel-name-col { z-index: 4; background: var(--bg-sunken); }
.tabel-person { display: flex; align-items: center; gap: 9px; }
.tabel-person-text { min-width: 0; }
.tabel-name-col .cell-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 178px; }
.tabel-name-col .cell-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 178px; }
.tabel-table tbody td { height: 46px; vertical-align: middle; }

.tabel-day { min-width: 36px; }
.tabel-day-dow { display: block; font-size: 9px; font-weight: 500; color: var(--ink-4); text-transform: none; letter-spacing: 0; }
.tabel-day-num { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-top: 1px; }
.tabel-day.is-weekend { background: var(--bg-sunken); }
.tabel-day.is-weekend .tabel-day-num { color: var(--ink-4); }
.tabel-day.is-holiday .tabel-day-num { color: var(--late); }
.tabel-day.is-today { background: var(--bg-active); }
.tabel-day.is-today .tabel-day-num { color: var(--accent-ink); }

.tabel-sum-col, .tabel-norm-col, .tabel-att-col { text-align: center !important; min-width: 56px; padding: 0 8px; }
.tabel-att-col { min-width: 96px; }
.tabel-table td.tabel-sum-col { font-size: 13.5px; background: var(--bg-sunken); }
.tabel-table td.tabel-norm-col { font-size: 12.5px; color: var(--ink-3); }

.tabel-cell {
  text-align: center;
  padding: 5px 2px;
  font-size: 13px;
  min-width: 36px;
  color: var(--ink);
  transition: background .1s;
}
.tabel-cell.is-editable { cursor: pointer; }
.tabel-cell.is-editable:hover { background: var(--bg-active); box-shadow: inset 0 0 0 1.5px var(--accent); }
.tabel-cell.is-off { background: var(--bg-sunken); }
.tabel-cell.is-dim { background: color-mix(in srgb, var(--bg-sunken) 60%, transparent); }
.tabel-cell.is-today { box-shadow: inset 0 0 0 1px var(--accent); }
.tabel-cell.has-code { background: color-mix(in srgb, var(--bg-tint) 50%, transparent); }
.tabel-h { font-weight: 500; }
.tabel-empty { color: var(--ink-4); font-weight: 400; }
.tabel-cell.is-editable .tabel-empty { color: transparent; }
.tabel-cell.is-editable:hover .tabel-empty { color: var(--accent); }
.tabel-off { font-size: 10px; color: var(--ink-4); font-weight: 500; }
.tabel-foot-note { font-size: 12px; color: var(--ink-3); text-align: left !important; padding-left: 8px; }

/* код-чипи */
.tabel-code {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; padding: 2px 6px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1.5;
}
.tabel-code.tc-work    { background: var(--bg-sunken); color: var(--ink-2); border: 1px solid var(--line); }
.tabel-code.tc-blue    { background: var(--bg-active); color: var(--c-blue); }
.theme-dark .tabel-code.tc-blue { color: var(--c-mint); }
.tabel-code.tc-amber   { background: rgba(240,191,48,.20); color: #876a02; }
.theme-dark .tabel-code.tc-amber { color: var(--c-amber); }
.tabel-code.tc-live    { background: var(--live-bg); color: var(--live); }
.tabel-code.tc-neutral { background: var(--bg-sunken); color: var(--ink-3); border: 1px solid var(--line); }
.tabel-code.tc-late    { background: var(--late-bg); color: var(--late); }

/* легенда */
.tabel-legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-left: auto; }
.tabel-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.tabel-legend-label { font-size: 11.5px; color: var(--ink-3); }

/* поповер-редактор */
.tabel-pop-overlay { position: fixed; inset: 0; z-index: 2000; }
.tabel-pop {
  position: fixed; z-index: 2001; width: 230px;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong, var(--line));
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0,0,0,.20);
  padding: 12px;
}
.tabel-pop-h { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.tabel-pop-hours { display: flex; gap: 6px; }
.tabel-pop-hours input {
  flex: 1; min-width: 0; padding: 7px 9px;
  border: 1px solid var(--line-strong, var(--line)); border-radius: 8px;
  background: var(--bg-base, var(--bg-elev)); color: var(--ink);
  font-size: 14px; font-variant-numeric: tabular-nums;
}
.btn.btn-sm { padding: 5px 10px; font-size: 12px; }
.tabel-pop-quick { display: flex; gap: 6px; margin-top: 8px; }
.tabel-q {
  flex: 1; padding: 6px 0; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg-sunken); color: var(--ink-2); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background .1s, border-color .1s;
}
.tabel-q:hover { background: var(--bg-active); border-color: var(--accent); color: var(--ink); }
.tabel-pop-sep { font-size: 10.5px; color: var(--ink-4); text-transform: uppercase; letter-spacing: .05em; margin: 12px 0 7px; }
.tabel-pop-codes { display: flex; flex-direction: column; gap: 5px; }
.tabel-code.is-btn {
  width: 100%; justify-content: flex-start; gap: 9px; padding: 6px 9px;
  cursor: pointer; border: 1px solid transparent;
}
.tabel-code.is-btn:hover { box-shadow: inset 0 0 0 1.5px currentColor; }
.tabel-code-cap { font-size: 11.5px; font-weight: 500; color: var(--ink-2); }
.tabel-pop-clear {
  width: 100%; margin-top: 9px; padding: 6px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-3); font-size: 12px; cursor: pointer;
}
.tabel-pop-clear:hover { background: var(--bg-sunken); color: var(--ink); }

/* передача у ЗП */
.tabel-handoff {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 22px; padding: 16px 18px;
  background: var(--bg-active);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: var(--r-md);
}
.tabel-handoff-text { flex: 1; min-width: 240px; }
.tabel-handoff-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.tabel-handoff-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; line-height: 1.5; max-width: 720px; }
.tabel-handoff-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============ ПДВ ============ */
.vat-alerts { display: flex; flex-direction: column; gap: 8px; }
.vat-alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-radius: var(--r-md);
  background: var(--bg-elev); border: 1px solid var(--line);
  border-left: 3px solid var(--ink-4);
}
.vat-alert.tone-late  { border-left-color: var(--late);     background: var(--late-bg); }
.theme-dark .vat-alert.tone-late { background: rgba(251,74,71,.06); }
.vat-alert.tone-amber { border-left-color: var(--c-amber);  background: rgba(240,191,48,.10); }
.vat-alert.tone-live  { border-left-color: var(--c-green-deep); background: var(--live-bg); }
.vat-alert-ic { display: flex; flex-shrink: 0; margin-top: 1px; font-size: 17px; color: var(--ink-3); }
.vat-alert.tone-late  .vat-alert-ic { color: var(--late); }
.vat-alert.tone-amber .vat-alert-ic { color: #876a02; }
.theme-dark .vat-alert.tone-amber .vat-alert-ic { color: var(--c-amber); }
.vat-alert.tone-live  .vat-alert-ic { color: var(--c-green-deep); }
.vat-alert-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.vat-alert-sub { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.5; }

.vat-kind {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 700;
}
.vat-kind-out { background: var(--bg-active); color: var(--c-blue); }
.theme-dark .vat-kind-out { color: var(--c-mint); }
.vat-kind-in { background: var(--live-bg); color: var(--c-green-deep); }
.theme-dark .vat-kind-in { color: var(--c-green); }
.vat-table .cell-sub.td-mono { font-size: 11px; color: var(--ink-3); }

/* форма додавання ПН */
.vat-addbar {
  margin-top: 14px; padding: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: var(--r-md); background: var(--bg-active);
}
.vat-addbar-row { display: flex; align-items: center; gap: 12px; }
.vat-addbar-x {
  margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.vat-addbar-x:hover { background: var(--bg-sunken); color: var(--ink); }
.vat-addbar-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 14px;
}
.vat-addbar-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em;
}
.vat-addbar-grid input, .vat-addbar-grid select {
  padding: 7px 9px; border: 1px solid var(--line-strong, var(--line)); border-radius: 8px;
  background: var(--bg-elev); color: var(--ink); font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0;
}
.vat-addbar-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.vat-addbar-calc { font-size: 12.5px; color: var(--ink-2); margin-right: auto; }
.vat-addbar-calc b { color: var(--ink); }
@media (max-width: 980px) { .vat-addbar-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ КАДРОВІ НАКАЗИ ============ */
.ord-typecards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.ord-typecard {
  display: flex; flex-direction: column; align-items: flex-start; gap: 7px;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-elev); cursor: pointer; text-align: left; transition: border-color .12s, background .12s;
}
.ord-typecard:hover { border-color: var(--accent); background: var(--bg-active); }
.ord-typecard.is-active { border-color: var(--accent); background: var(--bg-active); box-shadow: inset 0 0 0 1px var(--accent); }
.ord-typecard-ic { display: flex; font-size: 18px; color: var(--ink-3); }
.ord-typecard.is-active .ord-typecard-ic { color: var(--accent-ink); }
.ord-typecard-n { font-size: 24px; font-weight: 700; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.ord-typecard-l { font-size: 11.5px; color: var(--ink-2); line-height: 1.35; }

.ord-row-type { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--ink); }
.ord-row-ic { display: flex; font-size: 14px; color: var(--ink-3); }
.ord-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* майстер */
.ow-root { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 24px; }
.ow-backdrop { position: absolute; inset: 0; background: rgba(4,18,26,.5); backdrop-filter: blur(2px); }
.ow-modal { position: relative; z-index: 2; width: 640px; max-width: 100%; max-height: 90vh; overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column; }
.ow-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.ow-head > div:first-child { flex: 1 1 auto; min-width: 0; }
.ow-title { font-size: 15px; font-weight: 650; color: var(--ink); }
.ow-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.ow-x { width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ow-x:hover { background: var(--bg-sunken); color: var(--ink); }
.ow-body { padding: 20px; overflow-y: auto; }
.ow-step-label { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.ow-back { border: 0; background: transparent; color: var(--ink-3); font-size: 12px; cursor: pointer; padding: 0; margin-bottom: 12px; }
.ow-back:hover { color: var(--ink); }

.ow-types { display: flex; flex-direction: column; gap: 8px; }
.ow-type { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-base, var(--bg-elev)); cursor: pointer; text-align: left; transition: border-color .12s, background .12s; }
.ow-type:hover { border-color: var(--accent); background: var(--bg-active); }
.ow-type-ic { display: flex; font-size: 18px; color: var(--ink-3); }
.ow-type:hover .ow-type-ic { color: var(--accent-ink); }
.ow-type-label { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.ow-type-arrow { display: flex; color: var(--ink-4); }

.ow-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ow-field { display: flex; flex-direction: column; gap: 5px; }
.ow-field.ow-wide { grid-column: 1 / -1; }
.ow-label { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.ow-field input, .ow-field select {
  padding: 8px 10px; border: 1px solid var(--line-strong, var(--line)); border-radius: 8px;
  background: var(--bg-base, var(--bg-elev)); color: var(--ink); font-size: 13px; width: 100%; box-sizing: border-box;
}
.ow-field input:focus, .ow-field select:focus { outline: none; border-color: var(--accent); }
.ow-note { grid-column: 1 / -1; font-size: 12px; color: var(--ink-2); padding: 8px 10px; background: var(--bg-active); border-radius: 8px; }
.ow-note b { color: var(--ink); }
.ow-foot { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.ow-foot-hint { flex: 1; font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 680px) { .ow-grid { grid-template-columns: 1fr; } .ord-typecards { grid-template-columns: repeat(2, 1fr); } }

/* ============ ЄДРПОУ-пошук + договори ============ */
.edr-lookup { margin-bottom: 4px; }
.edr-lookup-row { display: flex; gap: 8px; }
.edr-input { flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 11px;
  border: 1px solid var(--line-strong, var(--line)); border-radius: 9px; background: var(--bg-base, var(--bg-elev)); color: var(--ink-3); }
.edr-input.found { border-color: var(--c-green-deep); }
.edr-input.error { border-color: var(--late); }
.edr-input input { flex: 1; border: 0; background: transparent; color: var(--ink); font-size: 14px; padding: 10px 0;
  font-variant-numeric: tabular-nums; letter-spacing: .03em; outline: none; }
.edr-result { margin-top: 12px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--c-green-deep) 35%, var(--line));
  border-radius: 10px; background: var(--live-bg); }
.edr-result-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--c-green-deep); }
.edr-result-h .status-tag { margin-left: auto; }
.edr-result-name { font-size: 14px; font-weight: 650; color: var(--ink); margin: 8px 0 10px; }
.edr-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.edr-result-grid > div { font-size: 12px; color: var(--ink); }
.edr-result-grid span { display: block; font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 1px; }
.edr-result-src { margin-top: 10px; font-size: 10.5px; color: var(--ink-3); }
.edr-error { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--late);
  padding: 9px 12px; background: var(--late-bg); border-radius: 8px; }
.edr-hint { margin-top: 10px; font-size: 11px; color: var(--ink-3); line-height: 1.5; }
.edr-hint b { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.cw-client-card { grid-column: 1 / -1; padding: 10px 12px; background: var(--bg-sunken); border-radius: 8px;
  font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.cw-client-card b { color: var(--ink); }
.cw-sched { margin-top: 16px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cw-sched-h { padding: 9px 14px; background: var(--bg-sunken); font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  text-transform: uppercase; letter-spacing: .04em; }
.cw-sched-table { width: 100%; border-collapse: collapse; }
.cw-sched-table td { padding: 9px 14px; border-top: 1px solid var(--line); font-size: 12.5px; }
.cw-sched-stage { color: var(--ink); }
.cw-sched-pct { color: var(--ink-3); width: 50px; text-align: right; font-variant-numeric: tabular-nums; }
.cw-sched-amt { text-align: right; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cw-sched-due { text-align: right; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; width: 130px; }

/* ── Панель інтеграції з Докс ── */
.doks-panel { border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 10px;
  background: var(--bg-active); padding: 14px; margin-bottom: 18px; }
.doks-panel-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.doks-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent-ink); }
.theme-dark .doks-badge { color: var(--accent); }
.doks-panel-sub { font-size: 11.5px; color: var(--ink-3); }
.doks-panel-row { display: flex; gap: 8px; }
.doks-result { margin-top: 12px; padding: 12px; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 8px; }
.doks-result-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 650; color: var(--ink); }
.doks-result-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-2); margin-top: 5px; }
.doks-result-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.doks-kosht { width: 100%; border-collapse: collapse; margin: 10px 0 6px; }
.doks-kosht td { padding: 6px 4px; border-top: 1px solid var(--line); font-size: 12px; }
.doks-form { color: var(--ink-3); font-size: 11px; white-space: nowrap; text-align: center; }
.doks-sum { text-align: right; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.doks-kosht-total td { font-weight: 700; color: var(--ink); border-top: 1.5px solid var(--ink-3); }
.doks-kosht-total td:first-child { font-weight: 500; font-size: 11.5px; color: var(--ink-2); }
.doks-result-src { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }

/* ============ ПРОЄКТНА ДІЯЛЬНІСТЬ (ГО / грантові проєкти) ============ */
.proj-stack { display: flex; flex-direction: column; gap: 12px; }
.proj-card {
  display: grid; grid-template-columns: 1fr auto;
  gap: 6px 20px; align-items: start;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 0 0; cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.proj-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.proj-card-top { padding-left: 18px; min-width: 0; }
.proj-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.proj-code { font-size: 12px; color: var(--ink-3); letter-spacing: .02em; }
.proj-name { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -0.01em; line-height: 1.25; text-wrap: pretty; }
.proj-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }
.proj-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.proj-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-right: 18px; text-align: right; }
.proj-period { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.proj-period-label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-4); }
.proj-period-val { font-size: 12px; color: var(--ink-2); }
.proj-amount-val { font-size: 17px; font-weight: 700; }
.proj-amount-paid { font-size: 11.5px; color: var(--ink-3); }
.proj-team { display: flex; }
.proj-team .team-avatar { margin-left: -6px; border: 2px solid var(--bg-elev); }
.proj-team .team-avatar:first-child { margin-left: 0; }

/* Бейдж юрособи-виконавця */
.pd-entity { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .03em; }
.pd-entity-fop { background: var(--accent-soft); color: var(--accent-ink); }
.pd-entity-too { background: var(--bg-sunken); color: var(--ink-2); border: 1px solid var(--line); }
.theme-dark .pd-entity-fop { color: var(--accent); }

/* Бейдж «Проєкт ГО» на картці договору */
.pd-badge {
  display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink);
  vertical-align: middle; letter-spacing: .02em;
}
.theme-dark .pd-badge { color: var(--accent); }

/* Чипи громад */
.pd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pd-chip { font-size: 12px; padding: 4px 10px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }

/* Контакт партнера */
.pd-contact { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pd-contact-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.pd-contact-role { font-size: 12px; color: var(--ink-3); margin-bottom: 5px; }
.pd-contact-line { font-size: 12px; color: var(--ink-2); }

/* Бейдж «менеджер проєкту» */
.pd-manager { margin-left: 8px; font-size: 10px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; }
.theme-dark .pd-manager { color: var(--accent); }

@media (max-width: 720px) {
  .proj-card { grid-template-columns: 1fr; }
  .proj-card-side { align-items: flex-start; padding: 0 18px; text-align: left; }
  .proj-period { align-items: flex-start; }
}

/* ============ ПРИВАТНІ ЗАДАЧІ ДИРЕКТОРА (ДН тощо) ============ */
.task-private-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; color: var(--accent-ink);
  background: var(--accent-soft); padding: 1px 7px; border-radius: 999px;
}
.theme-dark .task-private-tag { color: var(--accent); }
.task-private-tag svg { opacity: .85; }

/* Віджет «Особисті нагадування» (дашборд) */
.dash-private-flag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 8px;
}
.bd-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.bd-row { display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: var(--r-md); transition: background .12s; }
.bd-row:hover { background: var(--bg-hover); }
.bd-row.is-greeted { opacity: .62; }
.bd-main { flex: 1; min-width: 0; }
.bd-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.bd-when { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.bd-soon { color: var(--accent-ink); font-weight: 600; }
.theme-dark .bd-soon { color: var(--accent); }
.bd-greet {
  flex-shrink: 0; font-size: 11.5px; font-weight: 600; padding: 5px 12px;
  border-radius: 999px; border: 1px solid var(--accent); color: #fff; background: var(--accent);
  cursor: pointer; transition: filter .12s, background .12s, color .12s;
}
.bd-greet:hover { filter: brightness(1.05); }
.bd-greet.is-on { background: transparent; color: var(--ink-3); border-color: var(--line-strong); }
.bd-foot { font-size: 11px; color: var(--ink-4); margin-top: 12px; line-height: 1.45; }

/* Інлайн-додавання у воркспейсі проєкту ГО */
.prj-add-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.prj-row-del {
  background: none; border: none; color: var(--ink-3); cursor: pointer; display: inline-flex;
  padding: 4px; border-radius: 6px; line-height: 0;
}
.prj-row-del:hover { color: var(--late); background: var(--late-bg); }

/* Довідник партнерів/донорів */
.ngo-dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

/* Білдер акта донора — рядки послуг */
.dact-items { display: flex; flex-direction: column; gap: 8px; }
.dact-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-elev); }
.dact-item.is-off { opacity: 0.5; }
.dact-chk { padding-top: 8px; flex-shrink: 0; }
.dact-item-body { flex: 1; min-width: 0; }
.dact-item-row { display: flex; gap: 8px; align-items: center; }
