:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --surface-muted: #f8f9fb;
  --ink: #202124;
  --muted: #70747d;
  --line: #e3e5e9;
  --line-strong: #d6d9df;
  --purple: #5b48e8;
  --purple-dark: #4935d3;
  --yellow: #0091ff;
  --green: #18794e;
  --red: #c7352d;
  --shadow: 0 1px 2px rgba(22, 27, 38, 0.04), 0 8px 26px rgba(22, 27, 38, 0.04);
}

/* Invoice review, contracts and agency fee controls. */
.invoice-rejection-banner,
.invoice-accountant-comment {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #e1b5b5;
  border-left: 4px solid var(--red);
  border-radius: 10px;
  background: #fff7f7;
}

.invoice-rejection-banner p,
.invoice-accountant-comment p { margin: 6px 0; }
.invoice-rejection-banner small { color: var(--muted); }

.invoice-reject-panel { margin-top: 18px; border-color: #e1b5b5; }
.invoice-reject-panel form { display: grid; gap: 12px; max-width: 720px; }
.invoice-reject-panel label span { display: block; margin-bottom: 6px; font-weight: 800; }
.invoice-reject-panel textarea { width: 100%; }
.invoice-reject-panel .danger-button { justify-self: start; }
.invoice-file-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.invoice-comment-flag { color: var(--red); font-weight: 800; }

.agency-fee-settings {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.agency-fee-settings h4,
.agency-fee-settings p { margin: 0; }
.agency-fee-settings p { color: var(--muted); font-size: 12px; line-height: 1.45; }
.agency-fee-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 140px 120px;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.agency-fee-row label { font-weight: 750; }
.agency-fee-row input[type="number"] { width: 100%; }
.agency-fee-row small { color: var(--muted); }

.service-contract-confirmation {
  display: grid;
  gap: 5px;
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 9px;
}
.service-contract-confirmation.is-signed { background: #f1faf5; border: 1px solid #b9ddc7; }
.service-contract-confirmation.is-unsigned { background: #fff4f4; border: 1px solid #e1b5b5; }
.service-contract-confirmation label { display: flex; gap: 8px; align-items: center; }

.client-contract-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.client-contract-card { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.client-contract-card.needs-attention { border-color: #e1b5b5; }
.client-contract-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.client-contract-card h3 { margin: 4px 0 0; }
.client-contract-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.client-contract-card dt { color: var(--muted); font-size: 11px; }
.client-contract-card dd { margin: 3px 0 0; font-weight: 750; }
.client-contract-documents { margin-top: 18px; }

.release-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.release-pagination > :last-child { justify-self: end; }
.release-pagination > span { color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .client-contract-grid { grid-template-columns: 1fr; }
  .agency-fee-row { grid-template-columns: 1fr; }
  .release-pagination { grid-template-columns: 1fr; }
  .release-pagination > :last-child { justify-self: stretch; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(32, 32, 32, 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--purple);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.version-badge:hover {
  border-color: var(--purple);
  color: var(--purple);
}

.brand span,
.login-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 30px;
  background: var(--purple);
  color: #fff;
  border-radius: 8px;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 900;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav a,
.nav button,
.login-panel button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 9px 13px;
  text-decoration: none;
}

/* Management finance */
.finance-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.finance-heading h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -0.03em;
}

.finance-heading .page-subtitle,
.finance-panel-head p {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.finance-period-control {
  display: flex;
  align-items: end;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  background: var(--panel);
}

.finance-period-control label {
  display: grid;
  gap: 3px;
}

.finance-period-control label span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-period-control input,
.finance-period-control button,
.finance-period-control a {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.finance-period-control input {
  padding: 0 12px;
}

.finance-period-control button,
.finance-period-control a {
  display: inline-grid;
  place-items: center;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.finance-period-control button {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.finance-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  scrollbar-width: thin;
}

.finance-tabs a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}

.finance-tabs a:hover,
.finance-tabs a:focus-visible {
  background: var(--surface-muted);
  color: var(--ink);
}

.finance-tabs a.active {
  background: #efedff;
  color: var(--purple-dark);
}

.finance-status-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--panel);
}

.finance-status-strip p {
  flex: 1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.finance-status-strip a {
  color: var(--red);
  font-size: 13px;
  font-weight: 800;
}

.finance-period-state,
.finance-margin-state,
.finance-payment-state {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef0f4;
  color: #555b66;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.finance-period-state.state-operations_closed,
.finance-payment-state.state-due,
.finance-payment-state.state-issued,
.finance-payment-state.state-partially_paid,
.finance-margin-state.state-low,
.finance-margin-state.state-normal {
  background: #fff3cf;
  color: #765700;
}

.finance-period-state.state-actual,
.finance-payment-state.state-paid,
.finance-margin-state.state-high {
  background: #ddf4e7;
  color: #11643f;
}

.finance-margin-state.state-loss,
.finance-payment-state.state-canceled {
  background: #fde5e2;
  color: #9e2c25;
}

.finance-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.finance-kpis.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.finance-kpis.compact.invoice-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.finance-kpis article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.finance-kpis header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.finance-kpis article > strong {
  display: block;
  overflow: hidden;
  margin-top: 8px;
  font-size: clamp(20px, 2vw, 27px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-kpis article > small {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-help {
  position: relative;
}

.metric-help summary {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--purple);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  list-style: none;
}

.metric-help summary::-webkit-details-marker {
  display: none;
}

.metric-help p {
  position: absolute;
  z-index: 20;
  top: 34px;
  right: 0;
  width: min(290px, 70vw);
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: 0 14px 35px rgba(22, 27, 38, 0.16);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.finance-negative {
  color: var(--red) !important;
}

.finance-warning-text {
  color: #8b6400 !important;
}

.finance-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 16px;
  margin-bottom: 16px;
}

.finance-project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.finance-panel-head h2,
.finance-closing-actions h2 {
  margin: 0;
  font-size: 19px;
}

.finance-panel-head > span,
.finance-panel-head > a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.finance-panel-head > a.primary-button {
  color: #fff;
}

.finance-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.finance-heading-actions > a:not(.primary-button),
.finance-panel-head form .ghost-button {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.finance-recurring-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.finance-recurring-list article {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-muted);
}

.finance-recurring-list article span,
.finance-recurring-list article b {
  display: grid;
  gap: 4px;
}

.finance-recurring-list article b {
  text-align: right;
}

.finance-recurring-list small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.finance-chart-wrap {
  position: relative;
  min-height: 255px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(#fff, #fafbfc);
}

.finance-line-chart {
  display: block;
  width: 100%;
  min-height: 220px;
}

.finance-line-chart text {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-revenue {
  stroke: var(--purple);
}

.chart-expenses {
  stroke: #dd8c00;
  stroke-dasharray: 9 5;
}

.chart-profit {
  stroke: var(--green);
  stroke-dasharray: 3 4;
}

.chart-zero {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.finance-chart-legend {
  position: absolute;
  top: 12px;
  left: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11px;
  font-weight: 800;
}

.finance-chart-legend span::before {
  display: inline-block;
  width: 18px;
  height: 3px;
  margin-right: 5px;
  border-radius: 2px;
  background: currentColor;
  content: "";
  vertical-align: middle;
}

.finance-chart-legend .revenue { color: var(--purple); }
.finance-chart-legend .expenses { color: #9b6200; }
.finance-chart-legend .profit { color: var(--green); }

.finance-data-table {
  margin-top: 10px;
}

.finance-dashboard-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
}

.finance-dashboard-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.finance-dashboard-filters select,
.finance-dashboard-filters button,
.finance-dashboard-filters > a {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.finance-dashboard-filters button,
.finance-dashboard-filters > a {
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.finance-dashboard-filters button {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.finance-global-alerts {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
}

.finance-global-alerts p {
  margin: 0;
  border-left: 4px solid #c18a16;
  border-radius: 7px;
  padding: 9px 12px;
  background: #fff9e7;
  color: #6d4b00;
  font-size: 12px;
  font-weight: 750;
}

.finance-margin-trend {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.finance-margin-trend > div {
  display: grid;
  gap: 4px;
}

.finance-margin-trend span {
  color: var(--muted);
  font-size: 10px;
}

.finance-margin-trend svg {
  width: 100%;
  min-width: 0;
}

.finance-expense-structure {
  margin-top: 16px;
}

.finance-category-ranking {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.finance-range-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.finance-range-switch > a,
.finance-range-switch summary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 11px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.finance-range-switch > a.active {
  border-color: #c9c2ff;
  background: #f2f0ff;
  color: var(--purple-dark);
}

.finance-range-switch details {
  position: relative;
}

.finance-range-switch details form {
  position: absolute;
  z-index: 4;
  top: 42px;
  right: 0;
  display: grid;
  min-width: 260px;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.finance-range-switch details label {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
}

.finance-range-switch input,
.finance-range-switch button {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 9px;
  font: inherit;
}

.finance-range-switch button {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.finance-data-table summary {
  min-height: 44px;
  padding: 12px 0;
  color: var(--purple);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.finance-ranking {
  display: grid;
  gap: 13px;
}

.finance-ranking article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
}

.finance-ranking article div,
.finance-project-list a span,
.finance-project-list a b {
  display: grid;
  gap: 3px;
}

.finance-ranking article span,
.finance-project-list small,
.finance-profit-table td span,
.finance-table-panel td span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.finance-ranking article b,
.finance-project-list b {
  font-variant-numeric: tabular-nums;
}

.finance-ranking article i {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceef2;
}

.finance-ranking article i span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
}

.finance-project-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

.finance-project-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  padding: 10px 12px;
  background: #fff;
  text-decoration: none;
}

.finance-project-list a:hover,
.finance-project-list a:focus-visible {
  background: var(--surface-muted);
}

.finance-project-list a b {
  text-align: right;
}

.finance-project-list.risk a b small {
  max-width: 210px;
  color: var(--red);
}

.finance-formula {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
}

.finance-formula > div {
  display: grid;
  flex: 1 0 145px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  background: var(--surface-muted);
}

.finance-formula > div.result {
  border-color: #cdc7ff;
  background: #f2f0ff;
}

.finance-formula > div span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.finance-formula > div strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.finance-formula > i {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.finance-comparison-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.finance-comparison-strip article {
  display: grid;
  gap: 5px;
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  background: #fff;
}

.finance-comparison-strip span,
.finance-comparison-strip small {
  color: var(--muted);
  font-size: 12px;
}

.finance-comparison-strip strong {
  font-size: clamp(18px, 2vw, 25px);
  font-variant-numeric: tabular-nums;
}

.finance-comparison-strip .is-pending {
  border-style: dashed;
  background: var(--surface-muted);
}

.finance-row-actions {
  display: grid;
  gap: 7px;
  min-width: 190px;
}

.finance-row-actions form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.finance-row-actions input {
  width: 104px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 6px 8px;
  font-variant-numeric: tabular-nums;
}

.finance-row-actions button {
  min-height: 40px;
  border: 1px solid #c9c2ff;
  border-radius: 8px;
  padding: 0 10px;
  background: #f2f0ff;
  color: var(--purple-dark);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.finance-row-actions .finance-danger-link {
  border-color: transparent;
  background: transparent;
  color: var(--red);
}

.finance-period-pending {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted) !important;
  white-space: nowrap;
}

.finance-table-panel {
  overflow: hidden;
}

.finance-table-panel .finance-panel-head {
  padding: 0 2px;
}

.finance-table-panel .compact-table {
  min-width: 980px;
}

.finance-profit-table {
  min-width: 1280px !important;
}

.finance-table-panel td,
.finance-table-panel th,
.finance-data-table td,
.finance-data-table th {
  font-variant-numeric: tabular-nums;
}

.finance-table-panel td > a {
  color: var(--purple-dark);
  font-weight: 800;
}

.finance-entry-form {
  display: grid;
  gap: 12px;
}

.finance-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.finance-form-grid label {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.finance-form-grid label.wide {
  grid-column: 1 / -1;
}

.finance-form-grid.allocation-form-grid {
  grid-template-columns: 1fr;
  margin-bottom: 14px;
}

.finance-form-grid label > span b {
  color: var(--red);
}

.finance-form-grid input,
.finance-form-grid select,
.finance-form-grid textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
}

.finance-form-grid select[multiple] {
  min-height: 160px;
}

.finance-form-grid textarea {
  resize: vertical;
}

.finance-form-grid input:focus,
.finance-form-grid select:focus,
.finance-form-grid textarea:focus,
.finance-period-control :focus-visible,
.finance-tabs a:focus-visible,
.metric-help summary:focus-visible {
  outline: 3px solid rgba(91, 72, 232, 0.22);
  outline-offset: 2px;
  border-color: var(--purple);
}
.finance-subtabs { display: flex; gap: 5px; margin: -4px 0 14px; border-bottom: 1px solid var(--line); }
.finance-subtabs a { display: inline-flex; min-height: 42px; align-items: center; border-bottom: 2px solid transparent; padding: 0 13px; color: var(--muted); font-size: 12px; font-weight: 800; text-decoration: none; }
.finance-subtabs a:hover,.finance-subtabs a:focus-visible,.finance-subtabs a.active { border-bottom-color: var(--purple); color: var(--purple); outline: none; }
.finance-kpi-detail-link { display: block; color: inherit; text-decoration: none; }
.finance-kpi-detail-link small { color: var(--purple) !important; }
.finance-kpi-detail-link:focus-visible { border-radius: 5px; outline: 3px solid rgba(91,72,232,.18); outline-offset: 3px; }
.finance-week-total { color: var(--purple); font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.finance-revenue-table { min-width: 1180px; }
.finance-revenue-week .finance-panel-head { align-items: center; }
.finance-recurring-table { min-width: 1320px; }

.finance-form-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.finance-form-grid em,
.finance-form-errors {
  color: var(--red);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.revenue-allocation-intro {
  display: grid;
  gap: 18px;
  margin-bottom: 14px;
}

.revenue-allocation-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.revenue-allocation-steps span {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.revenue-allocation-steps b {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
}

.revenue-invoice-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
}

.revenue-invoice-picker label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.revenue-invoice-picker select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.revenue-invoice-picker em {
  color: var(--red);
  font-size: 12px;
  font-style: normal;
}

.revenue-invoice-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.revenue-invoice-summary article {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.revenue-invoice-summary article.is-complete {
  border-color: #b9dfc9;
  background: #f2fbf6;
}

.revenue-invoice-summary span,
.revenue-invoice-summary small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.revenue-invoice-summary strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revenue-existing-allocations {
  margin-bottom: 14px;
}

.revenue-allocation-table {
  display: grid;
  gap: 8px;
}

.revenue-allocation-head,
.revenue-allocation-row {
  display: grid;
  grid-template-columns: minmax(150px, .75fr) minmax(190px, .9fr) minmax(260px, 1.8fr) 44px;
  gap: 10px;
  align-items: start;
}

.revenue-allocation-head {
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.revenue-allocation-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-muted);
}

.revenue-allocation-row label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.revenue-allocation-row label > span {
  display: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.revenue-allocation-row input[type="month"],
.revenue-allocation-row input[type="number"],
.revenue-allocation-row input[type="text"] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px 11px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.revenue-allocation-row input:focus,
.revenue-invoice-picker select:focus {
  border-color: var(--purple);
  outline: 3px solid rgba(91, 72, 232, .18);
  outline-offset: 2px;
}

.revenue-allocation-row em {
  color: var(--red);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.revenue-allocation-delete {
  position: relative;
  display: grid;
  min-height: 44px;
  place-items: center;
}

.revenue-allocation-delete > input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.revenue-allocation-delete .icon-action {
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.revenue-allocation-delete .icon-action:hover,
.revenue-allocation-delete .icon-action:focus-visible {
  border-color: #efc5c2;
  background: #fff2f1;
  outline: none;
}

.revenue-allocation-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 18px;
  align-items: end;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.revenue-allocation-total span,
.revenue-allocation-total small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.revenue-allocation-total strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--ink);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}

.finance-invoice-table {
  min-width: 1280px !important;
}

.finance-invoice-actions {
  display: grid;
  gap: 6px;
  min-width: 120px;
}

.finance-submit-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 0 24px;
}

.finance-submit-bar > a {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: var(--muted);
  font-weight: 800;
}

.finance-access-note,
.finance-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 24px;
  background: var(--surface-muted);
  color: var(--muted);
  text-align: center;
}

.finance-access-note strong,
.finance-empty strong {
  color: var(--ink);
}

.finance-access-note p,
.finance-empty p {
  margin: 6px auto 0;
  max-width: 620px;
  line-height: 1.5;
}

.finance-closing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.finance-close-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.finance-close-checks article {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: var(--surface-muted);
}

.finance-close-checks article.ok {
  border-color: #b7dfc9;
  background: #f0faf4;
}

.finance-close-checks article.needs-action {
  border-color: #ead18d;
  background: #fff9e7;
}

.finance-close-checks article span,
.finance-close-checks article small {
  color: var(--muted);
  font-size: 11px;
}

.finance-closing-actions form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.finance-closing-actions button {
  width: 100%;
  min-height: 44px;
}

.finance-reopen-reason {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.finance-reopen-reason textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 9px;
  resize: vertical;
  font: inherit;
  font-weight: 500;
}

.finance-import-help {
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-muted);
}

.finance-import-help summary {
  min-height: 34px;
  cursor: pointer;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 850;
}

.finance-import-help pre {
  overflow-x: auto;
  border-radius: 8px;
  padding: 10px;
  background: #242331;
  color: #fff;
  font-size: 11px;
}

.finance-row-alert {
  background: #fff9e7;
}

.finance-project-heading,
.finance-operation-summary,
.finance-milestone-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.finance-project-heading > div {
  max-width: 820px;
}

.finance-project-heading h2,
.finance-operation-panel h2 {
  margin: 3px 0 6px;
}

.finance-project-heading p,
.finance-operation-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.finance-project-operations {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.finance-operation-panel {
  overflow: hidden;
}

.finance-operation-list,
.finance-milestone-list {
  display: grid;
  gap: 10px;
}

.finance-operation-list > article,
.finance-milestone-list article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.finance-operation-summary {
  padding: 13px;
}

.finance-operation-summary > div:first-child,
.finance-milestone-list article > div:first-child {
  display: grid;
  gap: 4px;
}

.finance-operation-summary span,
.finance-milestone-list span {
  color: var(--muted);
  font-size: 11px;
}

.finance-operation-summary dl {
  display: flex;
  gap: 22px;
  margin: 0;
}

.finance-operation-summary dl div {
  display: grid;
  gap: 3px;
}

.finance-operation-summary dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.finance-operation-summary dd {
  margin: 0;
  font-weight: 850;
}

.finance-milestone-list article {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  min-height: 64px;
  padding: 12px 14px;
}

.finance-state-good,
.finance-state-warn {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 800;
}

.finance-state-good {
  background: #e9f7ef;
  color: #217a49 !important;
}

.finance-state-warn {
  background: #fff4d5;
  color: #8b5d00 !important;
}

.inline-action {
  min-height: 44px;
  border: 1px solid #c9c2ff;
  border-radius: 9px;
  padding: 0 11px;
  background: #f2f0ff;
  color: var(--purple-dark);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 850;
}

.inline-action:hover,
.inline-action:focus-visible {
  border-color: var(--purple);
  outline: 3px solid rgba(91, 72, 232, 0.16);
}

@media (max-width: 1100px) {
  .finance-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .finance-kpis.compact.invoice-kpis,
  .revenue-invoice-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-dashboard-grid,
  .finance-closing-layout {
    grid-template-columns: 1fr;
  }

  .finance-dashboard-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-operation-summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .finance-recurring-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .finance-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-panel-head > a,
  .finance-panel-head > form .ghost-button {
    width: 100%;
  }

  .finance-heading-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-project-heading,
  .finance-operation-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-operation-summary dl {
    justify-content: space-between;
  }

  .finance-milestone-list article {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .finance-period-control {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: end;
  }

  .finance-period-control label {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .finance-period-control input {
    width: 100%;
    min-width: 0;
  }

  .finance-period-control > a:first-of-type {
    grid-column: 1;
    grid-row: 1;
  }

  .finance-period-control > a:last-of-type {
    grid-column: 3;
    grid-row: 1;
  }

  .finance-period-control > button {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .finance-kpis,
  .finance-kpis.compact,
  .finance-kpis.compact.invoice-kpis,
  .finance-project-grid,
  .finance-form-grid,
  .finance-close-checks {
    grid-template-columns: 1fr;
  }

  .revenue-invoice-picker,
  .revenue-invoice-summary,
  .revenue-allocation-row {
    grid-template-columns: 1fr;
  }

  .revenue-allocation-head {
    display: none;
  }

  .revenue-allocation-row label > span {
    display: block;
  }

  .revenue-allocation-delete {
    justify-items: end;
  }

  .finance-comparison-strip {
    grid-template-columns: 1fr;
  }

  .finance-dashboard-filters,
  .finance-category-ranking {
    grid-template-columns: 1fr;
  }

  .finance-margin-trend {
    grid-template-columns: 1fr;
  }

  .finance-recurring-list {
    grid-template-columns: 1fr;
  }

  .finance-form-grid label.wide {
    grid-column: auto;
  }

  .finance-status-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .finance-project-list a {
    align-items: flex-start;
  }

  .finance-kpis article > strong {
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .finance-tabs a {
    transition: none;
  }
}

/* Inquiry pipeline */
.lead-page-head {
  align-items: flex-end;
}

.lead-page-head .toolbar-actions > a span {
  margin-left: 6px;
  color: var(--muted);
}

.lead-board-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.lead-board-toolbar form,
.lead-archive-filter {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.lead-board-toolbar label,
.lead-archive-filter label,
.lead-stage-action label {
  display: grid;
  gap: 6px;
}

.lead-board-toolbar label > span,
.lead-archive-filter label > span,
.lead-stage-action label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lead-board-toolbar input,
.lead-board-toolbar select,
.lead-archive-filter input,
.lead-stage-action select,
.lead-stage-action textarea {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

.lead-search input {
  width: min(360px, 32vw);
}

.lead-board-total {
  display: grid;
  min-width: 130px;
  text-align: right;
}

.lead-board-total span {
  color: var(--muted);
  font-size: 12px;
}

.lead-board-total strong {
  font-size: 24px;
}

.lead-board {
  display: grid;
  grid-auto-columns: minmax(280px, 320px);
  grid-auto-flow: column;
  align-items: start;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 18px;
  scroll-snap-type: x proximity;
}

.lead-column {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef0f4;
  scroll-snap-align: start;
}

.lead-column > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.lead-column > header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-column h2 {
  margin: 0;
  font-size: 14px;
}

.lead-column > header > strong {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--panel);
  font-size: 12px;
}

.lead-stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
}

.lead-column.is-archived-stage {
  opacity: .78;
}

.lead-column-cards {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.lead-column-empty {
  padding: 24px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.lead-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(22, 27, 38, .04);
  padding: 13px;
}

.lead-card > header {
  display: grid;
  gap: 5px;
}

.lead-card-title {
  font-weight: 850;
  text-decoration: none;
}

.lead-card-title:hover,
.lead-card-title:focus-visible {
  color: var(--purple);
}

.lead-linked-label {
  margin-left: 5px;
  color: var(--green);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-age {
  color: var(--muted);
  font-size: 11px;
}

.lead-age.is-stale,
.lead-card-meta .is-overdue {
  color: var(--red);
  font-weight: 800;
}

.lead-services {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.lead-services span {
  border: 1px solid #dfe3ff;
  border-radius: 999px;
  background: #f5f6ff;
  color: var(--purple-dark);
  font-size: 11px;
  font-weight: 750;
  padding: 4px 7px;
}

.lead-services span.is-empty {
  border-color: var(--line);
  background: var(--surface-muted);
  color: var(--muted);
}

.lead-card > p {
  margin: 0;
  color: #484b52;
  font-size: 13px;
  line-height: 1.45;
}

.lead-card-meta {
  display: grid;
  gap: 7px;
  margin: 0;
}

.lead-card-meta div {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
}

.lead-card-meta dt,
.lead-card-meta dd {
  margin: 0;
  font-size: 11px;
}

.lead-card-meta dt {
  color: var(--muted);
}

.lead-card-meta dd {
  text-align: right;
}

.lead-stage-action {
  position: relative;
}

.lead-stage-action > summary {
  color: var(--purple);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.lead-stage-action > summary::-webkit-details-marker {
  display: none;
}

.lead-stage-action > form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.lead-archive-panel {
  padding: 16px;
}

.lead-archive-filter {
  margin-bottom: 16px;
}

.lead-form-panel {
  max-width: 980px;
  padding: 20px;
}

.lead-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.lead-form-grid > label {
  display: grid;
  align-content: start;
  gap: 7px;
}

.lead-form-grid > .is-wide {
  grid-column: 1 / -1;
}

.lead-form-grid > label > span,
.lead-detail-side label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.lead-form-grid input:not([type="checkbox"]),
.lead-form-grid select,
.lead-form-grid textarea,
.lead-detail-side input:not([type="checkbox"]),
.lead-detail-side select,
.lead-detail-side textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  padding: 8px 10px;
}

.lead-form-grid ul,
.lead-detail-side form ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lead-form-grid ul label,
.lead-detail-side form ul label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
}

.lead-service-choice {
  display: grid;
  gap: 10px;
}

.lead-service-choice > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.lead-service-choice #id_interested_services {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.lead-service-choice #id_interested_services > div {
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.lead-service-choice #id_interested_services > div > label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.lead-service-choice #id_interested_services > div > div {
  display: grid;
  gap: 6px;
}

.lead-service-choice #id_interested_services label {
  display: flex;
  align-items: center;
  gap: 7px;
}

.lead-detail-head {
  align-items: flex-end;
}

.lead-detail-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.lead-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 370px);
  align-items: start;
  gap: 18px;
}

.lead-detail-main,
.lead-detail-side {
  display: grid;
  gap: 16px;
}

.lead-detail-layout .panel {
  padding: 18px;
}

.lead-summary-panel > p {
  color: #454a55;
  line-height: 1.6;
}

.lead-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.lead-detail-facts > div {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
}

.lead-detail-facts > div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.lead-detail-facts > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.lead-detail-facts dt,
.lead-detail-facts dd {
  margin: 0;
}

.lead-detail-facts dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.lead-detail-facts dd {
  font-size: 13px;
}

.lead-detail-facts dd.is-overdue {
  color: var(--red);
  font-weight: 800;
}

.lead-reminder-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid #f2d1cd;
  border-radius: 10px;
  background: #fff8f7;
  padding: 12px;
}

.lead-reminder-actions form {
  display: flex;
  align-items: end;
  gap: 8px;
}

.lead-reminder-actions label {
  display: grid;
  gap: 5px;
}

.lead-reminder-actions label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.lead-reminder-actions input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
}

.lead-reminder-actions summary {
  color: var(--purple);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.lead-reminder-actions details form {
  display: grid;
  min-width: 280px;
  margin-top: 10px;
}

.lead-timeline {
  display: grid;
}

.lead-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  padding-bottom: 20px;
}

.lead-timeline-item:not(:last-child)::before {
  position: absolute;
  top: 16px;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: #e4e1f7;
  content: "";
}

.lead-timeline-dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 3px solid #e5e1ff;
  border-radius: 50%;
  background: var(--purple);
}

.lead-timeline-item.tone-converted .lead-timeline-dot,
.lead-timeline-item.tone-proposal_presented .lead-timeline-dot {
  border-color: #d8f3e5;
  background: var(--green);
}

.lead-timeline-item > div > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.lead-timeline-item time,
.lead-timeline-item small {
  color: var(--muted);
  font-size: 10px;
}

.lead-timeline-item p {
  margin: 6px 0;
  color: #4d5260;
  font-size: 13px;
  line-height: 1.5;
}

.lead-detail-side .panel-head {
  align-items: flex-start;
}

.lead-detail-side .form-stack,
.lead-detail-main .form-stack {
  display: grid;
  gap: 10px;
}

.lead-detail-side .form-stack p,
.lead-detail-main .form-stack p {
  display: grid;
  gap: 5px;
  margin: 0;
}

.lead-detail-action {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.lead-detail-action > summary {
  color: var(--purple);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.lead-detail-action > form {
  margin-top: 14px;
}

.lead-proposal-list {
  display: grid;
  gap: 8px;
}

.lead-proposal-list > article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-muted);
  padding: 10px;
}

.lead-proposal-list small {
  color: var(--muted);
}

.lead-convert-panel {
  border-color: #cce9d8;
  background: #f7fcf9;
}

.lead-convert-panel > p {
  color: #4d5d53;
  font-size: 12px;
  line-height: 1.5;
}

.notification-kind-marker.tone-lead {
  background: #efedff;
  color: var(--purple);
}

.lead-stage-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  align-items: start;
  gap: 18px;
}

.lead-stage-settings-layout .panel {
  padding: 18px;
}

.lead-stage-settings-side,
.lead-stage-settings-list,
.lead-stage-archive-list {
  display: grid;
  gap: 12px;
}

.lead-stage-settings-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 90px auto auto;
  align-items: end;
  gap: 9px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.lead-stage-settings-row:last-child {
  border-bottom: 0;
}

.lead-stage-settings-row label,
.lead-stage-settings-side .form-stack p {
  display: grid;
  gap: 5px;
  margin: 0;
}

.lead-stage-settings-row label span,
.lead-stage-settings-side label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.lead-stage-settings-row input,
.lead-stage-settings-row select,
.lead-stage-settings-side input,
.lead-stage-settings-side select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 7px 9px;
}

.lead-stage-settings-side .form-stack {
  display: grid;
  gap: 11px;
}

.lead-stage-archive-list form {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px;
}

.lead-stage-archive-list span {
  display: grid;
  gap: 3px;
}

.lead-stage-archive-list small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .lead-page-head,
  .lead-board-toolbar,
  .lead-board-toolbar form,
  .lead-archive-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-search input,
  .lead-board-toolbar input,
  .lead-board-toolbar select {
    width: 100%;
  }

  .lead-board-total {
    text-align: left;
  }

  .lead-board {
    grid-auto-columns: minmax(270px, 86vw);
  }

  .lead-form-grid,
  .lead-detail-layout,
  .lead-detail-facts {
    grid-template-columns: 1fr;
  }

  .lead-form-grid > label.is-wide {
    grid-column: auto;
  }

  .lead-detail-facts > div,
  .lead-detail-facts > div:nth-child(odd),
  .lead-detail-facts > div:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .lead-detail-facts > div:last-child {
    border-bottom: 0;
  }

  .lead-reminder-actions,
  .lead-reminder-actions form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .lead-reminder-actions form {
    display: grid;
  }

  .lead-stage-settings-layout,
  .lead-stage-settings-row {
    grid-template-columns: 1fr;
  }
}

/* Lead workspace: compact CRM forms, autocomplete and readable history. */
.lead-existing-client {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-muted);
}

.checkbox-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: 18px !important;
  height: 18px;
}

.client-autocomplete {
  position: relative;
  margin-top: 12px;
}

.client-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% - 22px);
  right: 0;
  left: 0;
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 14px 32px rgb(15 23 42 / 14%);
}

.client-search-results:empty {
  display: none;
}

.client-search-results button,
.client-search-results p {
  margin: 0;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.client-search-results button {
  cursor: pointer;
}

.client-search-results button:hover,
.client-search-results button:focus-visible {
  background: var(--surface-muted);
  outline: 2px solid var(--purple);
  outline-offset: -2px;
}

.lead-event-form {
  display: grid;
  gap: 16px;
}

.lead-event-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lead-event-grid label {
  display: grid;
  gap: 6px;
}

.lead-event-grid .is-wide {
  grid-column: 1 / -1;
}

.lead-event-grid input,
.lead-event-grid select,
.lead-event-grid textarea {
  width: 100%;
}

.lead-event-grid #id_summary {
  min-height: 88px;
}

.lead-service-groups {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.lead-service-groups section {
  display: grid;
  gap: 7px;
}

.lead-service-groups section > strong {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.lead-proposal-list form {
  margin-top: 8px;
}

.lead-proposal-list button.danger-link {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 680px) {
  .lead-event-grid {
    grid-template-columns: 1fr;
  }

  .lead-event-grid .is-wide {
    grid-column: auto;
  }

  .lead-service-choice #id_interested_services {
    grid-template-columns: 1fr;
  }
}

.nav button,
.login-panel button {
  background: var(--purple);
  color: #fff;
}

.app-main {
  width: min(1320px, 100%);
  margin: 0 auto;
  overflow-x: clip;
  padding: 24px;
}

.page-head,
.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-head h1,
.login-panel h1 {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  font-size: 34px;
  font-weight: 850;
  letter-spacing: 0;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.user-chip {
  color: var(--muted);
  font-size: 14px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi,
.panel,
.login-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.kpi {
  position: relative;
  min-height: 104px;
  padding: 16px;
  overflow: hidden;
}

.kpi::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--yellow);
  content: "";
}

.kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.kpi strong {
  display: block;
  margin-top: 10px;
  font-family: Inter, system-ui, sans-serif;
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0;
}

.kpi .delta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.good {
  color: var(--green);
}

.bad {
  color: var(--red);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

section.panel + section.panel {
  margin-top: 16px;
}

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  background: #f6f7fb;
  color: #3f4450;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.alert-list,
.simple-list {
  display: grid;
  gap: 10px;
}

.alert-item,
.simple-list div,
.simple-list p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.alert-item b {
  display: block;
  font-size: 24px;
}

.alert-item span,
.simple-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.login-panel {
  width: min(420px, 100%);
  margin: 12vh auto;
  padding: 24px;
}

.auth-body {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(102, 71, 240, 0.06) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(102, 71, 240, 0.06) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: 42px 42px;
}

.login-mark {
  margin-bottom: 18px;
}

.login-panel form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  padding: 10px 12px;
}

.prototype-note,
.prototype-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(72, 64, 176, 0.18);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.prototype-note {
  align-items: flex-start;
  padding: 16px 18px;
  border-left: 5px solid var(--yellow);
}

.prototype-note strong {
  flex: 0 0 190px;
  color: var(--purple);
}

.prototype-note span,
.muted-label {
  color: var(--muted);
  font-size: 13px;
}

.prototype-toolbar {
  padding: 12px;
}

.segmented,
.toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.client-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  border-bottom: 1px solid var(--line);
}

.client-tabs a {
  min-height: 40px;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  color: var(--muted);
  font-weight: 900;
  padding: 10px 13px;
  text-decoration: none;
}

.client-tabs a.active {
  border-color: var(--line);
  background: #fff;
  color: var(--purple);
}

.segmented button,
.segmented a,
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 8px 12px;
  line-height: 1.15;
  text-decoration: none;
}

.segmented button,
.segmented a,
.ghost-button {
  background: #fff;
  color: var(--ink);
  text-decoration: none;
}

.segmented .active,
.primary-button {
  background: var(--purple);
  color: #fff;
}

.segmented.small button,
.segmented.small a {
  min-height: 30px;
  padding: 5px 9px;
}

.table-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--purple);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 5px 8px;
}

.inline-form {
  display: inline-flex;
  margin: 0 8px 4px 0;
}

.prototype-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.55fr);
}

.layout > *,
.prototype-layout > * {
  min-width: 0;
}

.client-stack {
  display: grid;
  gap: 12px;
}

.client-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  overflow: hidden;
}

.client-card summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 14px;
}

.client-card summary::-webkit-details-marker {
  display: none;
}

.client-card summary::before {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  content: "+";
  display: inline-grid;
  font-weight: 900;
  place-items: center;
}

.client-card[open] summary::before {
  content: "-";
}

.client-title {
  flex: 1 1 220px;
  color: var(--ink);
  font-weight: 900;
}

.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  padding: 3px 9px;
  white-space: nowrap;
}

.badge-a {
  background: rgba(216, 40, 24, 0.12);
  color: var(--red);
}

.badge-b {
  background: rgba(72, 64, 176, 0.12);
  color: var(--purple);
}

.badge-c {
  background: rgba(32, 122, 85, 0.12);
  color: var(--green);
}

.status-pill.ok {
  background: rgba(32, 122, 85, 0.12);
  color: var(--green);
}

.status-pill.warn {
  background: rgba(240, 192, 80, 0.22);
  color: #775a05;
}

.status-pill.pause {
  background: rgba(100, 101, 121, 0.12);
  color: var(--muted);
}

.status-pill.danger {
  background: rgba(216, 40, 24, 0.12);
  color: var(--red);
}

.client-details {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 14px;
}

.client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-meta span {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  padding: 8px 10px;
}

.compact-table th,
.compact-table td {
  padding: 8px 10px;
  vertical-align: top;
}

.compact-table {
  min-width: 760px;
}

.service-cell {
  display: grid;
  gap: 3px;
  min-width: 120px;
}

.service-cell strong {
  font-size: 14px;
}

.service-cell span,
.weekly-table td > span {
  color: var(--muted);
  font-size: 12px;
}

.service-board {
  display: grid;
  gap: 14px;
}

.service-block {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
}

.service-block-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.service-block-head h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.service-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.service-type-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.service-type-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid rgba(72, 64, 176, 0.18);
  border-radius: 999px;
  background: rgba(72, 64, 176, 0.08);
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
  padding: 2px 9px;
  white-space: nowrap;
}

.service-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.service-summary-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.service-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.service-summary-grid strong {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  font-size: 15px;
}

.service-summary-grid a {
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.budget-tracking {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(72, 64, 176, 0.14);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.budget-tracking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.budget-tracking-head strong {
  display: block;
  margin-top: 3px;
}

.budget-channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.budget-channel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  padding: 10px;
}

.budget-channel span,
.budget-channel small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.budget-channel strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}

.inner-table {
  border-radius: 6px;
  background: #fff;
}

.goals-mini-table,
.finance-table {
  min-width: 980px;
}

.clients-work-table {
  min-width: 1540px;
}

.client-table-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 3px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.progress-percent {
  color: var(--green);
  font-weight: 900;
}

.progress-percent.warn {
  color: #775a05;
}

.period-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
}

.weekly-report-form {
  max-width: 860px;
}

.weekly-report-editor { display: grid; gap: 14px; }
.report-page-head p { max-width: 680px; margin: 6px 0 0; color: var(--muted); }
.report-form-section { margin: 0; padding: 0; overflow: hidden; }
.report-form-section-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.report-form-section-head > span { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 7px; background: #ebe8ff; color: var(--purple); font-size: 11px; font-weight: 900; }
.report-form-section-head h2 { margin: 0; font-size: 17px; }
.report-form-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.report-form-grid { display: grid; gap: 12px; padding: 16px 18px; }
.report-form-grid-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.report-form-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.report-form-grid label,.report-text-fields label { display: grid; align-content: start; gap: 6px; }
.report-form-grid label > span,.report-text-fields label > span { color: var(--ink); font-size: 11px; font-weight: 800; }
.report-form-grid label > small { color: var(--muted); font-size: 10px; }
.report-form-grid input,.report-form-grid select,.report-form-grid textarea,.report-entry-table input,.report-entry-table textarea,.report-text-fields textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; padding: 9px 10px; color: var(--ink); font: inherit; font-size: 12px; }
.report-form-grid input:focus,.report-form-grid select:focus,.report-form-grid textarea:focus,.report-entry-table input:focus,.report-entry-table textarea:focus,.report-text-fields textarea:focus { border-color: var(--purple); outline: 3px solid rgba(91,72,232,.12); }
.report-expense-groups { display: grid; gap: 0; }
.report-expense-groups > article { border-bottom: 1px solid var(--line); }
.report-expense-groups > article:last-child { border-bottom: 0; }
.report-expense-groups header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 18px 0; }
.report-expense-groups header strong { font-size: 13px; }
.report-expense-groups header small { color: var(--muted); font-size: 10px; }
.report-entry-table-wrap { border: 0; border-radius: 0; }
.report-entry-table { min-width: 760px; }
.report-entry-table th,.report-entry-table td { padding: 11px 13px; vertical-align: middle; }
.report-entry-table td > strong,.report-entry-table td > .muted-label { display: block; }
.report-entry-table td > .muted-label { margin-top: 4px; }
.report-entry-table textarea { min-width: 210px; resize: vertical; }
.report-action-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 16px 18px 4px; }
.report-action-grid label { display: flex; min-height: 58px; align-items: flex-start; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; cursor: pointer; }
.report-action-grid input { margin-top: 2px; accent-color: var(--purple); }
.report-action-grid span,.report-action-grid strong,.report-action-grid small { display: block; }
.report-action-grid strong { font-size: 11px; }
.report-action-grid small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.report-text-fields { padding-top: 12px; }
.report-text-fields textarea { min-height: 120px; resize: vertical; }
.report-submit-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fafbfc; }
.report-delete-panel { margin-top: 16px; }

.report-goal-cell {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.report-goal-cell strong {
  color: var(--ink);
  font-size: 15px;
}

.report-goal-meta {
  display: grid;
  gap: 3px;
}

.report-goal-meta span {
  color: var(--muted);
  font-size: 12px;
}

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.field-card {
  border: 1px solid rgba(72, 64, 176, 0.14);
  border-radius: 8px;
  background: #fbfcff;
  padding: 14px;
}

.info-note {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  border: 1px solid rgba(72, 64, 176, 0.12);
  border-radius: 8px;
  background: #fbfcff;
  padding: 14px;
}

.info-note p {
  margin: 0;
  color: var(--muted);
}

.service-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.service-filter-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(72, 64, 176, 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-decoration: none;
}

.service-filter-card:hover {
  border-color: rgba(72, 64, 176, 0.42);
}

.service-filter-card span {
  color: var(--muted);
  font-size: 13px;
}

.service-filter-card strong {
  color: var(--purple-dark);
  font-size: 26px;
  line-height: 1;
}

.user-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.user-activity-card {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(72, 64, 176, 0.14);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 14px;
  text-decoration: none;
}

.user-activity-card:hover {
  border-color: rgba(72, 64, 176, 0.42);
}

.user-activity-card span,
.user-activity-card small {
  color: var(--muted);
  font-size: 13px;
}

.document-primary-card {
  display: grid;
  grid-template-columns: minmax(180px, 0.3fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
  border: 1px solid rgba(72, 64, 176, 0.14);
  border-radius: 8px;
  background: #fbfcff;
  padding: 14px;
}

.document-primary-card strong {
  display: block;
  margin-top: 4px;
}

.document-primary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.document-primary-grid > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.document-primary-grid input,
.document-primary-grid select,
.document-primary-grid textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
}

.stacked-stat {
  display: grid;
  gap: 5px;
  align-items: start;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(72, 64, 176, 0.16);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.check-card input {
  width: auto;
  margin-top: 3px;
}

.check-card span {
  display: grid;
  gap: 3px;
}

.check-card small,
.inline-check {
  color: var(--muted);
  font-size: 12px;
}

.hypothesis-list {
  display: grid;
  gap: 12px;
}

.hypothesis-card {
  border: 1px solid rgba(72, 64, 176, 0.14);
  border-radius: 8px;
  background: #fbfcff;
  padding: 14px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--purple);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  padding: 0;
}

.link-button:hover {
  text-decoration: underline;
}

.table-actions {
  min-width: 150px;
}

.compact-table td.table-actions {
  display: table-cell;
  vertical-align: top;
}

.table-actions a {
  display: inline-block;
  margin: 0 8px 4px 0;
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.service-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 0 4px 4px 0;
  border-radius: 999px;
  background: rgba(72, 64, 176, 0.08);
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
  padding: 2px 8px;
}

.goal-name-cell {
  min-width: 220px;
}

.goal-name-cell strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
}

.goal-name-cell span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.metric-link {
  color: var(--purple);
  font-weight: 900;
  text-decoration: none;
}

.metric-link:hover {
  text-decoration: underline;
}

.weekly-table .month-head {
  border-left: 3px solid rgba(72, 64, 176, 0.45);
  background: #e9e5fb;
  color: var(--purple-dark);
}

.weekly-table .month-start-cell {
  border-left: 3px solid rgba(72, 64, 176, 0.28);
}

.weekly-table .month-summary-cell {
  background: #f6f4ff;
  font-weight: 900;
}

.weekly-table .kpi-danger {
  background: #fff1ef;
  color: #b42318;
}

.weekly-table .kpi-warn {
  background: #fff7df;
  color: #775a05;
}

.weekly-table.collapsed-periods .period-column {
  display: none;
}

.period-head {
  min-width: 150px;
}

.period-report-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 1px solid rgba(72, 64, 176, 0.22);
  border-radius: 6px;
  background: #fff;
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
  padding: 4px 7px;
  text-decoration: none;
}

.service-group-row td {
  z-index: 2;
  border-top: 2px solid rgba(72, 64, 176, 0.18);
  background: #edf1fb;
  color: var(--ink);
}

.service-group-row .service-group-title {
  position: sticky;
  left: 0;
  z-index: 4;
}

.service-group-row strong {
  margin-right: 8px;
  font-size: 15px;
}

.service-group-row span {
  color: var(--muted);
  font-size: 12px;
}

.service-group-row a {
  margin-left: 12px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.empty-state {
  border: 1px dashed rgba(72, 64, 176, 0.28);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  padding: 18px;
}

.contact-table,
.goals-table,
.weekly-table {
  min-width: 1380px;
}

.weekly-wrap {
  max-height: 70vh;
}

.weekly-table th:first-child,
.weekly-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.weekly-table th,
.weekly-table td {
  min-width: 118px;
}

.weekly-table td:first-child {
  min-width: 260px;
}

.weekly-table .service-group-row td {
  position: static;
  min-width: 0;
  background: #edf1fb;
}

.weekly-table .service-group-row .service-group-title {
  position: sticky;
  left: 0;
  z-index: 4;
  min-width: 260px;
  background: #edf1fb;
}

.weekly-table .service-group-row .period-report-link {
  margin-left: 0;
  font-size: 12px;
}

.weekly-table td:first-child strong,
.weekly-table td:first-child span {
  display: block;
}

.weekly-table input {
  min-width: 92px;
}

.copy-box {
  display: grid;
  gap: 12px;
}

.copy-box p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.copy-box textarea {
  min-height: 180px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: 13px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.5;
  padding: 12px;
}

.mini-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.mini-panel h3 {
  margin: 0;
}

.metrics-prototype {
  margin-top: 16px;
}

.progress-list {
  display: grid;
  gap: 16px;
}

.progress-list span,
.budget-split span,
.profile-strip span {
  color: var(--muted);
  font-size: 13px;
}

.progress-list strong,
.budget-split strong,
.profile-strip strong {
  display: block;
  margin-top: 4px;
}

.bar {
  height: 8px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #eceaf6;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.bar .warn-fill {
  background: var(--yellow);
}

.budget-split {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-panel {
  min-width: 0;
}

.prototype-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.prototype-form.single,
.prototype-form .wide {
  grid-template-columns: 1fr;
}

.prototype-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.prototype-form > div {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

.prototype-form input,
.prototype-form select,
.prototype-form textarea,
.prototype-form select[multiple],
.compact-table input,
.compact-table select,
.compact-table textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
}

.prototype-form .errorlist {
  margin: 0;
  padding-left: 18px;
  color: var(--red);
}

.form-error-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  border: 1px solid rgba(216, 40, 24, 0.28);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: #fffafa;
  color: var(--red);
  padding: 12px 14px;
}

.form-error-summary span {
  color: var(--muted);
  font-size: 13px;
}

.messages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.prototype-form textarea {
  min-height: 86px;
  resize: vertical;
}

.form-actions-bottom {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.upload-drop {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  border: 1px dashed rgba(72, 64, 176, 0.4);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 18px;
}

.upload-drop span {
  color: var(--muted);
  font-size: 13px;
}

.danger-panel {
  border-color: rgba(216, 40, 24, 0.28);
  background: #fffafa;
}

.danger-copy {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.confirm-delete-form {
  display: grid;
  gap: 12px;
}

.confirm-delete-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.confirm-delete-form input {
  width: 16px;
  height: 16px;
}

.danger-button {
  width: fit-content;
  min-height: 38px;
  border: 1px solid rgba(216, 40, 24, 0.28);
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  padding: 8px 12px;
}

.profile-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.profile-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 14px;
}

.profile-strip small,
.service-summary-grid small {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-delete-form {
  margin-top: 6px;
}

.table-actions .inline-delete-form {
  margin-top: 0;
}

.inline-delete-form button {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 0;
}

.matrix-wrap {
  max-height: 70vh;
}

.matrix-table {
  min-width: 1680px;
}

.matrix-table thead th,
.matrix-table tfoot th {
  position: sticky;
  z-index: 2;
}

.matrix-table thead th {
  top: 0;
}

.matrix-table tfoot th {
  bottom: 0;
  background: #f4f2ff;
}

.matrix-table th:first-child,
.matrix-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: #fff;
}

.weekly-table .metric-section-row td {
  background: #fbfcff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.danger-row td {
  background: #fff4f2;
}

.leader-row-text strong {
  color: #16854f;
}

.dashboard-stack {
  display: grid;
  gap: 18px;
}

.kpi-link {
  color: inherit;
  text-decoration: none;
}

.kpi-link:hover {
  border-color: rgba(88, 77, 255, 0.32);
  transform: translateY(-1px);
}

.compact-check-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.check-row {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 18px minmax(0, 1fr) 22px;
  min-height: 38px;
  padding: 7px 10px;
}

.check-row input {
  height: 16px;
  width: 16px;
}

.check-row strong {
  font-size: 14px;
}

.info-dot {
  align-items: center;
  background: #eef0ff;
  border-radius: 999px;
  color: var(--accent);
  cursor: help;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.service-goals-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.service-goals-details summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 900;
  justify-content: space-between;
  list-style: none;
  padding: 12px 14px;
}

.service-goals-details summary::-webkit-details-marker {
  display: none;
}

.service-goals-details summary span {
  color: var(--accent);
  font-size: 13px;
}

.service-goals-details[open] summary span {
  color: var(--muted);
}

.primary-goal-row td {
  background: #f1fff7;
}

.asset-items-list {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.asset-items-list span {
  background: #f6f7fb;
  border-radius: 6px;
  color: var(--muted);
  display: block;
  font-size: 12px;
  padding: 4px 6px;
}

.document-form-table input,
.document-form-table textarea {
  min-width: 150px;
}

.toolbar-search input,
.toolbar-filters select {
  min-height: 38px;
}

.toolbar-search {
  flex: 1 1 280px;
}

.toolbar-search label,
.toolbar-filters label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 4px;
  text-transform: uppercase;
}

.toolbar-filters {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.version-list {
  display: grid;
  gap: 14px;
}

.version-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.version-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.version-card h3 {
  margin: 0;
  font-size: 20px;
}

.version-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
}

.version-card li + li {
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .service-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .budget-channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-card summary {
    gap: 8px;
  }
}

@media (max-width: 980px) {
  .layout,
  .prototype-layout {
    grid-template-columns: 1fr;
  }

  .service-block-head {
    flex-direction: column;
  }

  .form-grid,
  .profile-strip,
  .period-fields,
  .document-primary-card,
  .document-primary-grid {
    grid-template-columns: 1fr;
  }

  .prototype-note,
  .prototype-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .prototype-note strong {
    flex: auto;
  }
}

@media (max-width: 720px) {
  .app-header,
  .page-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .service-summary-grid {
    grid-template-columns: 1fr;
  }

  .budget-channel-grid {
    grid-template-columns: 1fr;
  }

  .app-main {
    padding: 16px;
  }

  .prototype-form {
    grid-template-columns: 1fr;
  }
}

/* Real application shell aligned with the approved static prototypes. */
.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
}

.nav {
  min-width: 0;
  justify-content: flex-start;
  overflow-x: auto;
  scrollbar-width: thin;
}

.nav a {
  position: relative;
  flex: 0 0 auto;
  border-radius: 0;
  font-size: 13px;
  font-weight: 650;
}

.nav a:hover,
.nav a.active {
  background: transparent;
  color: var(--ink);
}

.nav a.active::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--purple);
  content: "";
}

.account-menu {
  position: relative;
  align-self: center;
}

.account-menu summary {
  display: flex;
  max-width: 190px;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #555a64;
  cursor: pointer;
  list-style: none;
}

.account-menu summary::-webkit-details-marker { display: none; }

.account-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}
.account-avatar img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

.settings-avatar-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px; margin-top: 16px; }
.settings-avatar-preview { display: grid; width: 180px; height: 180px; place-items: center; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 44px; font-weight: 900; overflow: hidden; touch-action: none; }
.settings-avatar-preview canvas { width: 100%; height: 100%; cursor: grab; outline-offset: -4px; }
.settings-avatar-preview canvas:active { cursor: grabbing; }
.settings-avatar-copy { display: grid; gap: 7px; }
.settings-avatar-copy h2,
.settings-avatar-copy p { margin: 0; }
.settings-avatar-copy p { color: var(--muted); font-size: 12px; }
.settings-avatar-copy small { color: var(--muted); }
.settings-avatar-zoom { display: grid; grid-template-columns: auto minmax(140px, 280px); align-items: center; gap: 10px; font-size: 12px; font-weight: 800; }
.settings-avatar-zoom input { width: 100%; }
.settings-avatar-remove { display: flex; align-items: center; gap: 7px; color: var(--red); font-size: 12px; }

@media (max-width: 640px) {
  .settings-avatar-panel { grid-template-columns: 1fr; justify-items: center; }
  .settings-avatar-copy { width: 100%; }
}

.account-menu-label {
  overflow: hidden;
  padding-right: 5px;
  font-size: 11px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 230px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 38px rgba(22, 27, 38, 0.14);
}

.account-menu-popover::before {
  position: absolute;
  inset: -8px 0 auto;
  height: 8px;
  content: "";
}

.account-menu-user {
  display: grid;
  gap: 3px;
  padding: 9px 10px 11px;
  border-bottom: 1px solid var(--line);
}

.account-menu-user strong { font-size: 12px; }
.account-menu-user span { color: var(--muted); font-size: 10px; }

.account-menu-popover a,
.account-menu-popover button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #454a53;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.account-menu-popover a:hover,
.account-menu-popover button:hover { background: #f3f2ff; color: var(--purple); }

.account-menu-popover form { margin: 0; border-top: 1px solid var(--line); }

.app-main {
  width: min(1320px, 100%);
  padding: 22px 24px 48px;
}

.panel,
.kpi-grid,
.profile-strip {
  box-shadow: var(--shadow);
}

.kpi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--line);
}

.kpi { min-width: 155px; flex: 1 1 155px; border-right: 0; }

.account-menu summary::marker { content: ""; }

.table-wrap > table th:first-child,
.table-wrap > table td:first-child { padding-left: 18px; }
.table-wrap > table th:last-child,
.table-wrap > table td:last-child { padding-right: 18px; }

.panel > .panel-head + .table-wrap {
  margin-right: -18px;
  margin-left: -18px;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.panel > .panel-head + .table-wrap:last-child {
  margin-bottom: -18px;
  border-bottom: 0;
  border-radius: 0 0 8px 8px;
}

@media (max-width: 980px) {
  .app-header { grid-template-columns: auto auto; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; height: 46px; order: 3; }
  .app-header { padding-top: 8px; }
  .account-menu { justify-self: end; }
}

@media (max-width: 720px) {
  .app-header { padding: 8px 14px 0; }
  .account-menu-label { display: none; }
  .app-main { padding: 18px 14px 36px; }
  .kpi { flex-basis: 100%; }
}

/* 2026 UI theme — shared visual language with the client design prototype. */
:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --ink: #202124;
  --muted: #70747d;
  --line: #e3e5e9;
  --purple: #5b48e8;
  --purple-dark: #4938c9;
  --yellow: #1677d2;
  --green: #18794e;
  --red: #c7352d;
  --shadow: 0 1px 2px rgba(22, 27, 38, 0.04), 0 8px 26px rgba(22, 27, 38, 0.04);
}

body {
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 62px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.brand span,
.login-mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  font-size: 12px;
}

.brand {
  color: var(--ink);
  font-size: 15px;
}

.version-badge {
  min-height: 22px;
  border-radius: 5px;
  font-size: 10px;
}

.nav {
  align-self: stretch;
  gap: 4px;
}

.nav a,
.nav button {
  display: inline-flex;
  align-items: center;
  height: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #565b65;
  font-size: 12px;
  font-weight: 700;
}

.nav a:hover {
  background: #f3f2ff;
  color: var(--purple);
}

.nav button {
  height: 36px;
  margin-top: 13px;
  border: 1px solid var(--line);
  background: #fff;
}

.app-main {
  padding-top: 22px;
}

.page-head {
  margin-bottom: 20px;
}

.page-head h1,
.login-panel h1 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
}

.panel-head h2 {
  font-size: 16px;
  font-weight: 800;
}

.eyebrow {
  margin-bottom: 5px;
  font-size: 10px;
  letter-spacing: 0;
}

.panel,
.login-panel,
.prototype-toolbar,
.prototype-note,
.version-card {
  border-radius: 8px;
}

.panel {
  padding: 18px;
}

.kpi-grid {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.kpi {
  min-height: 108px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.kpi:last-child {
  border-right: 0;
}

.kpi::before {
  display: none;
}

.kpi span,
.kpi .delta {
  font-size: 11px;
}

.kpi strong {
  margin-top: 9px;
  font-size: 21px;
  font-weight: 800;
}

.table-wrap {
  border-radius: 7px;
}

th,
td,
.compact-table th,
.compact-table td {
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.35;
  vertical-align: middle;
}

th {
  background: #f8f9fb;
  color: #656a74;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

tbody tr:hover td {
  background: #fbfbfe;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.segmented,
.toolbar-actions {
  gap: 7px;
}

.segmented button,
.segmented a,
.primary-button,
.ghost-button,
.danger-button,
.table-button {
  min-height: 36px;
  border-radius: 7px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 750;
}

.ghost-button,
.segmented button,
.segmented a,
.table-button {
  border-color: #d6d9df;
  color: #454a53;
}

.primary-button,
.segmented .active {
  border-color: var(--purple);
  background: var(--purple);
}

.client-tabs {
  flex-wrap: nowrap;
  gap: 24px;
  overflow-x: auto;
}

.client-tabs a {
  flex: 0 0 auto;
  min-height: auto;
  padding: 0 2px 12px;
  border: 0;
  border-radius: 0;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.client-tabs a.active {
  margin-bottom: -1px;
  border-bottom: 3px solid var(--purple);
  background: transparent;
  color: var(--ink);
}

.badge,
.status-pill,
.service-type-badge {
  min-height: 21px;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
}

.badge-a { background: #fff0ef; color: var(--red); }
.badge-b { background: #eeecff; color: var(--purple); }
.badge-c { background: #e9f7ef; color: var(--green); }
.status-pill.ok { background: #e9f7ef; color: var(--green); }
.status-pill.warn { background: #fff5df; color: #a65f00; }
.status-pill.pause { background: #f0f1f3; color: #646975; }
.status-pill.danger { background: #fff0ef; color: var(--red); }

.prototype-note {
  border-left-width: 1px;
  background: #f7f6ff;
  box-shadow: none;
}

.prototype-form input,
.prototype-form select,
.prototype-form textarea,
.prototype-form select[multiple],
.compact-table input,
.compact-table select,
.compact-table textarea,
.login-panel input {
  min-height: 38px;
  border-color: #d6d9df;
  border-radius: 7px;
  font-size: 13px;
}

.prototype-form input:focus,
.prototype-form select:focus,
.prototype-form textarea:focus,
.compact-table input:focus,
.compact-table select:focus,
.compact-table textarea:focus,
.login-panel input:focus {
  border-color: var(--purple);
  outline: 3px solid rgba(91, 72, 232, 0.10);
}

.service-block,
.client-card,
.mini-panel,
.field-card,
.budget-tracking,
.budget-channel,
.service-goals-details,
.check-row {
  border-radius: 7px;
  background: #fff;
}

.service-block {
  gap: 12px;
  padding: 14px;
}

.service-block-head h3 {
  font-size: 16px;
}

.service-summary-grid {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f9fb;
  overflow: hidden;
}

.service-summary-grid div {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 12px;
}

.service-summary-grid span,
.service-summary-grid small,
.muted-label {
  font-size: 11px;
}

.service-summary-grid strong {
  font-size: 13px;
}

.profile-strip {
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.profile-strip div {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

.profile-strip div:last-child {
  border-right: 0;
}

.profile-strip span,
.profile-strip small {
  font-size: 11px;
}

.profile-strip strong {
  font-size: 14px;
}

.empty-state {
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .kpi:nth-child(3n) { border-right: 0; }
}

@media (max-width: 720px) {
  .app-header { padding: 14px; }
  .nav button { margin-top: 0; }
  .kpi { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi:last-child { border-bottom: 0; }
  .profile-strip { grid-template-columns: 1fr; }
  .profile-strip div { border-right: 0; border-bottom: 1px solid var(--line); }
  .profile-strip div:last-child { border-bottom: 0; }
}

/* Final layout invariants: keep variable-length KPI rows balanced. */
.kpi-grid { display: flex; flex-wrap: wrap; gap: 1px; }
.kpi { min-width: 155px; flex: 1 1 155px; border-right: 0; }

@media (max-width: 720px) {
  .kpi { flex-basis: 100%; }
}

/* Real clients page — same component contract as the approved prototype. */
.clients-page-head { align-items: flex-end; }
.page-subtitle { max-width: 760px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.client-add-button { min-height: 38px; padding: 9px 15px; color: #fff; text-decoration: none; }

.clients-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.clients-summary-grid article { min-height: 112px; padding: 16px; border-right: 1px solid var(--line); }
.clients-summary-grid article:last-child { border-right: 0; }
.clients-summary-grid span,.clients-summary-grid small,.clients-summary-grid strong { display: block; }
.clients-summary-grid span { color: var(--muted); font-size: 11px; }
.clients-summary-grid strong { margin-top: 10px; font-size: 21px; font-weight: 800; }
.clients-summary-grid small { margin-top: 7px; color: var(--muted); font-size: 10px; }
.clients-summary-grid .summary-danger strong,.clients-summary-grid .summary-danger small { color: var(--red); }
.clients-summary-five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.summary-line,.row-progress { height: 4px; margin-top: 9px; border-radius: 4px; background: #e7e8ec; overflow: hidden; }
.summary-line i,.row-progress i { position: relative; display: block; height: 100%; border-radius: inherit; }
.summary-line.danger i,.row-progress.danger i { background: #d84a42; }
.summary-line.warn i,.row-progress.warn i { background: #d99a18; }
.summary-line.ok i,.row-progress.ok i { background: #2b9962; }
.summary-line.overflow i::after,.row-progress.overflow i::after { position: absolute; top: -2px; right: 0; width: 5px; height: 8px; border-radius: 2px; background: currentColor; box-shadow: 0 0 0 2px #fff; content: ""; }

.clients-section-tabs { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.clients-section-tabs a { display: flex; align-items: center; gap: 7px; padding: 9px 12px; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; }
.clients-section-tabs a:hover,.clients-section-tabs a.active { background: #f1efff; color: var(--purple); }
.clients-section-tabs span { display: grid; min-width: 20px; height: 20px; padding: 0 5px; place-items: center; border-radius: 10px; background: #eeecff; color: var(--purple); font-size: 10px; }
.dashboard-applied-filter { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border: 1px solid #d8d3ff; border-radius: 8px; background: #f8f7ff; box-shadow: var(--shadow); }
.dashboard-applied-filter-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 7px; background: var(--purple); color: #fff; font-size: 18px; font-weight: 800; }
.dashboard-applied-filter div { display: grid; gap: 2px; }.dashboard-applied-filter small { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }.dashboard-applied-filter strong { font-size: 13px; }.dashboard-applied-filter > b { padding: 6px 9px; border-radius: 6px; background: #ebe8ff; color: var(--purple); font-size: 11px; }.dashboard-applied-filter > a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 8px; color: var(--purple); font-size: 11px; font-weight: 750; text-decoration: none; }

.role-pulse-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 20px 0 13px; }
.role-pulse-head h2 { margin: 2px 0 5px; font-size: 25px; letter-spacing: -.035em; }
.role-pulse-head p:last-child { margin: 0; color: var(--muted); font-size: 12px; }
.role-pulse-head form { display: flex; align-items: end; gap: 8px; }
.role-pulse-head label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.role-pulse-head input { min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; font: inherit; }
.role-pulse-signal { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; margin-bottom: 13px; padding: 12px 15px; border: 1px solid #d7dcf8; border-radius: 9px; background: linear-gradient(90deg,#f5f4ff,#fff); box-shadow: var(--shadow); }
.role-pulse-signal > span { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 8px; background: var(--purple); color: #fff; font-size: 17px; font-weight: 900; }
.role-pulse-signal div { display: grid; gap: 3px; }.role-pulse-signal strong { font-size: 13px; }.role-pulse-signal small { color: var(--muted); font-size: 10px; }
.role-pulse-signal > a { display: inline-flex; min-height: 40px; align-items: center; padding: 0 12px; border-radius: 7px; background: #171925; color: #fff; font-size: 10px; font-weight: 800; text-decoration: none; }
.role-pulse-metrics { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); margin-bottom: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.role-pulse-metrics > a { min-width: 0; min-height: 121px; padding: 15px; border-right: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.role-pulse-metrics > a:last-child { border-right: 0; }.role-pulse-metrics > a:hover { background: #fafaff; }
.role-pulse-metrics span,.role-pulse-metrics small { display: block; color: var(--muted); }.role-pulse-metrics span { font-size: 9px; font-weight: 850; text-transform: uppercase; }.role-pulse-metrics strong { display: block; margin: 15px 0 7px; font-size: 19px; letter-spacing: -.025em; }.role-pulse-metrics small { font-size: 9px; line-height: 1.45; }
.role-pulse-metrics .is-danger strong { color: var(--red); }
.role-pulse-grid { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(420px,1.28fr); gap: 13px; margin-bottom: 13px; }
.role-health-card,.role-alert-card { overflow: hidden; }.role-health-card .panel-head > strong { color: var(--green); font-size: 12px; }
.role-health-stack { display: flex; height: 9px; margin: 0 17px 13px; border-radius: 6px; background: #edf0f3; overflow: hidden; }.role-health-stack i { display: block; height: 100%; }.role-health-stack .good { background: #22956a; }.role-health-stack .warning { background: #dfa13a; }.role-health-stack .danger { background: #cf4a43; }.role-health-stack .new { background: #627de0; }.role-health-stack .unrated { background: #b7bec8; }
.role-health-links { padding: 0 17px 14px; }.role-health-links a { display: flex; min-height: 35px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); color: var(--ink); font-size: 10px; text-decoration: none; }.role-health-links span { color: var(--muted); }
.role-alert-list { border-top: 1px solid var(--line); }.role-alert-list > a { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 58px; padding: 9px 15px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }.role-alert-list > a:last-child { border-bottom: 0; }.role-alert-list > a:hover { background: #fafaff; }
.role-alert-list > a > b { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 6px; background: #ffebe8; color: var(--red); font-size: 11px; }.role-alert-list > a > b.good { background: #e7f6ed; color: var(--green); }.role-alert-list > a > span { display: grid; gap: 3px; }.role-alert-list strong { font-size: 10px; }.role-alert-list small { color: var(--muted); font-size: 9px; }.role-alert-list i { color: var(--purple); font-style: normal; }
.role-team-card { margin-bottom: 18px; }.role-team-card .muted-label { display: block; margin-top: 3px; }

@media (max-width: 1100px) {
  .role-pulse-metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .role-pulse-metrics > a { border-bottom: 1px solid var(--line); }
  .role-pulse-metrics > a:nth-child(3n) { border-right: 0; }
}

.clients-workspace-panel { padding: 0; overflow: visible; }
.clients-filter-row { display: flex; align-items: end; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.clients-filter-row label { margin: 0; }
.clients-filter-row select,.clients-filter-row input { min-height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.clients-filter-row select { width: 145px; min-width: 145px; padding: 0 30px 0 10px; }
.clients-search { position: relative; flex: 0 0 200px; width: 200px; min-width: 180px; max-width: 200px; }
.clients-search > span { position: absolute; z-index: 1; top: 10px; left: 11px; color: var(--muted); }
.clients-search input { width: 100%; padding: 0 10px 0 32px; }
.clients-month-control { display: block; }
.clients-month-control > span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.clients-month-control input { width: 142px; padding: 0 9px; }

.clients-status-tabs { display: flex; align-items: center; gap: 0; padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.clients-status-tabs::-webkit-scrollbar { display: none; }
.clients-status-tabs button { position: relative; min-height: 48px; padding: 0 14px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 12px; font-weight: 750; white-space: nowrap; }
.clients-status-tabs button span { margin-left: 5px; padding: 3px 6px; border-radius: 9px; background: #eef0f3; color: #626771; font-size: 10px; }
.clients-status-tabs button.active { color: var(--purple); }
.clients-status-tabs button:hover { color: var(--purple); }
.clients-status-tabs button.active::after { position: absolute; right: 8px; bottom: -1px; left: 8px; height: 3px; border-radius: 3px 3px 0 0; background: var(--purple); content: ""; }
.clients-status-tabs button:hover span,.clients-status-tabs button.active span { background: #eeecff; color: var(--purple); }

.clients-prototype-table-wrap { max-height: none; overflow-x: auto; overflow-y: visible; border: 0; border-radius: 0; }
.exact-clients-table thead th { background: #f8f9fb; box-shadow: inset 0 -1px 0 var(--line-strong); }
.clients-sticky-header { position: fixed; z-index: 18; display: none; overflow: hidden; border-bottom: 1px solid var(--line-strong); background: #f8f9fb; box-shadow: 0 7px 16px rgba(22,27,38,.08); }
.clients-sticky-header.visible { display: block; }
.clients-sticky-header table { margin: 0; table-layout: fixed; }
.clients-sticky-header thead th { height: 48px; background: #f8f9fb; }
.clients-sticky-header thead th:first-child { position: sticky; z-index: 3; left: 0; background: #f8f9fb; box-shadow: inset -1px 0 0 var(--line-strong), 7px 0 12px -12px rgba(22,27,38,.65); }
.clients-prototype-table { min-width: 1540px; table-layout: fixed; }
.clients-prototype-table th,.clients-prototype-table td { padding: 12px 11px; vertical-align: middle; }
.clients-prototype-table th:first-child,.clients-prototype-table td:first-child { padding-left: 18px; }
.clients-prototype-table th:last-child,.clients-prototype-table td:last-child { padding-right: 18px; }
.clients-prototype-table td { height: 82px; }
.clients-prototype-table td > .muted-label { display: block; margin-top: 4px; font-size: 10px; }
.clients-prototype-table .attention-row td { background: #fffdf9; }
.clients-prototype-table tfoot td { height: 58px; background: #fafbfc; }
.exact-clients-table { min-width: 1660px; }
.exact-clients-table th:nth-child(1) { width: 215px; }
.exact-clients-table th:nth-child(2) { width: 155px; }
.exact-clients-table th:nth-child(3) { width: 155px; }
.exact-clients-table th:nth-child(4) { width: 190px; }
.exact-clients-table th:nth-child(5) { width: 125px; }
.exact-clients-table th:nth-child(6) { width: 90px; }
.exact-clients-table th:nth-child(7) { width: 190px; }
.exact-clients-table th:nth-child(8) { width: 115px; }
.exact-clients-table th:nth-child(9) { width: 130px; }
.exact-clients-table th:nth-child(10) { width: 130px; }
.exact-clients-table th:nth-child(11) { width: 125px; }
.exact-clients-table th:nth-child(12) { width: 55px; }
.exact-clients-table th:first-child,.exact-clients-table td:first-child { position: sticky; left: 0; z-index: 4; border-right: 0; background: #fff; box-shadow: inset -1px 0 0 var(--line-strong), 7px 0 12px -12px rgba(22,27,38,.65); }
.exact-clients-table thead th:first-child { z-index: 7; background: #f8f9fb; }
.exact-clients-table tfoot td:first-child { z-index: 5; background: #fafbfc; }
.exact-clients-table tbody tr:hover td:first-child { background: #fbfbfe; }
.exact-clients-table thead th { font-size: 11px; text-transform: uppercase; }
.exact-clients-table tbody td,.exact-clients-table tfoot td { font-size: 13px; }
.exact-clients-table .client-table-title { font-size: 14px; line-height: 1.3; }

/* Dense, accessible controls used by management forms. */
.prototype-form input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; padding: 0; accent-color: var(--purple); }
.prototype-form > div:has(> input[type="checkbox"]) { display: flex; min-height: 48px; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; color: var(--ink); }
.prototype-form > div:has(> input[type="checkbox"]) > input { order: -1; flex: 0 0 16px; }
.prototype-form > div:has(> input[type="checkbox"]) > label { margin: 0; font-size: 12px; font-weight: 750; }
.compact-check-control { display: flex!important; min-height: 42px; align-items: center; gap: 10px!important; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.compact-check-control input { width: 16px!important; height: 16px; min-height: 16px!important; flex: 0 0 16px; accent-color: var(--purple); }
.compact-check-control span,.compact-check-control strong,.compact-check-control small { display: block; }.compact-check-control small { margin-top: 2px; color: var(--muted); font-size: 9px; }

.service-hypothesis-state { display: grid; grid-template-columns: auto minmax(220px,1fr) auto auto auto; align-items: center; gap: 10px 16px; margin-top: 10px; padding: 12px 14px; border: 1px solid #d8d2ff; border-radius: 8px; background: #f7f5ff; }
.service-hypothesis-state > span { color: var(--purple); font-size: 9px; font-weight: 900; text-transform: uppercase; }.service-hypothesis-state strong,.service-hypothesis-state small { display: block; }.service-hypothesis-state small { margin-top: 3px; color: var(--muted); font-size: 10px; }.service-hypothesis-state.overdue { border-color: #f0bbb7; background: #fff4f3; }.service-hypothesis-state.overdue > span { color: var(--red); }
.hypothesis-file-field input { padding: 8px; border: 1px dashed var(--line-strong); background: #fbfcfd; }
.report-state-pill { text-decoration: none; }.report-state-pill.monthly-done { background: #e9f7ef; color: var(--green); }.report-state-pill.monthly-pending { background: #fff5df; color: #8a6200; }.report-state-pill.monthly-missing { background: #fff0ef; color: var(--red); }

.report-readonly-comment { margin: 0; padding: 14px 16px; border: 1px solid #cec7ff; border-left: 4px solid var(--purple); border-radius: 7px; background: #f7f5ff; }.report-readonly-comment span { color: var(--purple); font-size: 10px; font-weight: 900; text-transform: uppercase; }.report-readonly-comment p { max-width: 80ch; margin: 7px 0 0; font-size: 13px; line-height: 1.55; }
.primary-goal-inline { display: inline-flex; min-height: 23px; align-items: center; justify-content: center; margin-left: 7px; padding: 0 9px; border-radius: 999px; background: #e9f7ef; color: var(--green); font-size: 9px; font-weight: 850; line-height: 1; text-align: center; text-transform: uppercase; vertical-align: middle; }
.primary-report-goal-row td:first-child { box-shadow: inset 4px 0 0 var(--green); background: #f6fcf8; }

.service-color-swatch { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }.service-color-swatch i { width: 24px; height: 24px; border: 1px solid rgba(0,0,0,.08); border-radius: 6px; background: var(--swatch); box-shadow: inset 0 0 0 3px rgba(255,255,255,.45); }
.management-sections { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }.management-sections a { display: block; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; box-shadow: var(--shadow); }.management-sections a:hover,.management-sections a.active { border-color: #c9c2ff; background: #f7f5ff; }.management-sections strong,.management-sections span { display: block; }.management-sections span { margin-top: 5px; color: var(--muted); font-size: 10px; }

.finance-summary-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }.finance-status-tabs a { position: relative; display: inline-flex; min-height: 48px; align-items: center; padding: 0 14px; color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; }.finance-status-tabs a span { margin-left: 6px; padding: 3px 6px; border-radius: 9px; background: #eef0f3; font-size: 10px; }.finance-status-tabs a.active { color: var(--purple); }.finance-status-tabs a.active::after { position: absolute; right: 8px; bottom: -1px; left: 8px; height: 3px; border-radius: 3px 3px 0 0; background: var(--purple); content: ""; }.finance-global-table { min-width: 1320px; }.primary-inline-action { color: var(--purple); font-weight: 800; }

.monthly-report-goals { min-width: 940px; }.monthly-report-goals textarea { min-width: 210px; }.monthly-report-text-grid label { align-content: start; }.monthly-report-gate { border-color: #efd48c; background: #fff8e5; }.monthly-report-gate strong { color: #775a05; }.monthly-report-gate p { margin: 6px 0 0; color: var(--muted); }.primary-button:disabled { cursor: not-allowed; opacity: .45; }
.form-danger-separated { max-width: 980px; margin: 18px auto 0; }.responsibility-list { display: grid; gap: 9px; }.responsibility-list div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }.responsibility-list span { color: var(--muted); font-size: 10px; }
.knowledge-process-nav-row { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; }.knowledge-process-nav-row > a:first-child { min-width: 0; }.knowledge-process-edit { display: grid!important; width: 30px; height: 30px; min-height: 0!important; padding: 0!important; place-items: center; border-radius: 6px!important; }
.specialist-clients-table { min-width: 1120px; }.specialist-clients-table th:nth-child(1){width:220px}.specialist-clients-table th:nth-child(2){width:180px}.specialist-clients-table th:nth-child(3){width:190px}.specialist-clients-table th:nth-child(4){width:210px}.specialist-clients-table th:nth-child(5){width:150px}.specialist-clients-table th:nth-child(6){width:145px}.specialist-clients-table th:nth-child(7){width:70px}

@media (max-width: 900px) { .management-sections,.finance-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.service-hypothesis-state { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .management-sections,.finance-summary-grid { grid-template-columns: 1fr; } }
.exact-clients-table .muted-label { font-size: 11px; line-height: 1.35; }
.exact-clients-table .status-pill { font-size: 11px; }
.table-head-main,.table-head-sub { display: block; }
.table-head-sub { margin-top: 3px; }
.real-service-list { display: flex; flex-wrap: wrap; gap: 4px; }
.real-service-list > :is(span,a):not(.muted-label) { display: inline-flex; align-items: center; padding: 4px 6px; border-radius: 5px; background: #f0f1f3; color: #555a64; font-size: 11px; font-weight: 750; text-decoration: none; }
.money-plan-fact strong,.money-plan-fact span,.invoice-total-real,.audit-date-real,.audit-date-real + small,.debt-only { display: block; }
.money-plan-fact strong { font-size: 14px; }
.money-plan-fact span { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.invoice-total-real { margin-top: 6px; font-size: 12px; }
.debt-only { font-size: 14px; }
.primary-goals-list { display: grid; gap: 7px; }
.primary-goals-list div { display: grid; gap: 2px; }
.primary-goals-list strong { font-size: 11px; }
.primary-goals-list span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.audit-date-real { font-weight: 800; }
.audit-date-real + small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.inactive-clients-panel { margin-top: 16px; }
.inactive-clients-table { min-width: 980px; }
.inactive-clients-table td { height: 64px; vertical-align: middle; }
.table-action-link { color: var(--purple); font-size: 11px; font-weight: 750; text-decoration: none; white-space: nowrap; }

.real-row-actions { position: relative; }
.real-row-actions summary { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; list-style: none; }
.real-row-actions summary::-webkit-details-marker,.real-row-actions summary::marker { display: none; content: ""; }
.real-row-actions > div { position: absolute; z-index: 15; top: 36px; right: 0; display: grid; width: 180px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 14px 34px rgba(22,27,38,.14); }
.real-row-actions a { padding: 8px; border-radius: 5px; font-size: 11px; font-weight: 700; text-decoration: none; }
.real-row-actions a:hover { background: #f3f2ff; color: var(--purple); }
.report-total strong,.report-total span { display: block; }
.report-total span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.weekly-report-states { display: grid; gap: 4px; }
.weekly-report-state { display: inline-flex; width: fit-content; min-height: 24px; align-items: center; padding: 3px 7px; border-radius: 5px; font-size: 10px; font-weight: 800; line-height: 1.15; text-decoration: none; white-space: nowrap; }
.weekly-report-state.done { background: #e7f6ed; color: #197044; }
.weekly-report-state.reviewed { background: #e7f6ed; color: #197044; }
.weekly-report-state.submitted { background: #fef3c7; color: #92400e; }
.weekly-report-state.needs_work { background: #fee2e2; color: #991b1b; }
.weekly-report-state.draft { background: #eef0f3; color: #555b66; }
.weekly-report-state.overdue { background: #ffebe8; color: #b42318; }
.weekly-report-state.upcoming { background: #eef0f3; color: #828793; }
.weekly-report-state:is(a):hover { filter: brightness(.97); text-decoration: underline; }
.weekly-report-state:is(a):focus-visible { outline: 3px solid rgba(98,74,217,.28); outline-offset: 2px; }
.last-touch-state { display: grid; gap: 3px; }
.last-touch-state strong,.last-touch-state span { display: block; }
.last-touch-state strong { font-size: 12px; }
.last-touch-state span { font-size: 11px; }
.last-touch-state.ok { color: #197044; }
.last-touch-state.warn { color: #815f05; }
.last-touch-state.danger { color: #b42318; }
.clients-pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.clients-pagination > div { display: flex; align-items: center; gap: 5px; }
.clients-pagination a,.clients-pagination > div > span { display: grid; min-width: 30px; height: 30px; padding: 0 7px; place-items: center; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); font-weight: 750; text-decoration: none; }
.clients-pagination a:hover,.clients-pagination > div > .active { border-color: var(--purple); background: #f1efff; color: var(--purple); }
.clients-pagination > div > .ellipsis { border-color: transparent; background: transparent; color: var(--muted); }

@media (max-width: 1180px) {
  .clients-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .clients-summary-grid article:nth-child(3n) { border-right: 0; }
  .clients-filter-row { align-items: stretch; flex-wrap: wrap; }
}

@media (max-width: 720px) {
  .clients-summary-grid { grid-template-columns: 1fr 1fr; }
  .clients-summary-grid article { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .clients-summary-grid article:nth-child(2n) { border-right: 0; }
  .clients-search { width: 100%; max-width: none; flex-basis: 100%; }
  .clients-filter-row select,.clients-filter-row label:not(.clients-search),.clients-month-control input { width: 100%; }
  .clients-pagination { align-items: flex-start; flex-direction: column; }
}

/* Real edit/create forms — semantic sections from the prototypes, native Django fields. */
.client-detail-head-real { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.client-detail-head-real > .toolbar-actions { align-items: center; align-self: center; }
.client-title-line-real { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.client-title-line-real h1 { margin: 0; font-size: 30px; }
.client-detail-meta-real { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.client-detail-meta-real a { color: var(--purple); font-weight: 750; text-decoration: none; }
.client-tag-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.client-tag-list span,.knowledge-chip-list > span:not(.muted-label) { padding: 4px 7px; border-radius: 5px; background: #f0f1f3; color: #555a64; font-size: 10px; font-weight: 750; }
.client-detail-kpis-real { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin-bottom: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.client-detail-kpis-real article { min-height: 112px; padding: 17px; border-right: 1px solid var(--line); }
.client-detail-kpis-real article:last-child { border-right: 0; }
.client-detail-kpis-real span,.client-detail-kpis-real small { display: block; color: var(--muted); font-size: 11px; }
.client-detail-kpis-real strong { display: block; margin: 10px 0 6px; font-size: 20px; }
.client-detail-kpis-real .debt strong,.client-detail-kpis-real .debt small { color: var(--red); }
.client-detail-kpis-real .paid small { color: var(--green); }

.client-tabs a > span { margin-left: 4px; padding: 2px 6px; border-radius: 9px; background: #eeecff; color: var(--purple); font-size: 9px; }
.client-hypotheses-table { min-width: 1120px; }
.client-hypotheses-table th:nth-child(1) { width: 170px; }
.client-hypotheses-table th:nth-child(2) { width: 290px; }
.client-hypotheses-table th:nth-child(3),.client-hypotheses-table th:nth-child(7) { width: 100px; }
.client-hypotheses-table th:nth-child(4) { width: 135px; }
.client-hypotheses-table th:nth-child(5) { width: 125px; }
.client-hypotheses-table th:nth-child(6) { width: 220px; }
.client-hypotheses-table th:nth-child(8) { width: 75px; }
.client-hypotheses-table thead th { font-size: 11px; text-transform: uppercase; }
.client-hypotheses-table tbody td { height: 72px; font-size: 13px; }
.client-hypotheses-table td > strong { font-size: 13px; }
.table-action-link { color: var(--purple); font-size: 11px; font-weight: 800; text-decoration: none; }

/* Goals by period use the same calm, readable table language as the client register. */
.weekly-wrap { border-color: var(--line); scrollbar-color: #c5c8d0 transparent; scrollbar-width: thin; }
.weekly-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.weekly-wrap::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: #c5c8d0; background-clip: padding-box; }
.goals-period-table-real { width: max-content; min-width: 100%; table-layout: fixed; }
.goals-period-table-real col.goal-period-name-col { width: 245px; }
.goals-period-table-real col.goal-period-summary-col { width: 92px; }
.goals-period-table-real col.goal-period-fact-col,.goals-period-table-real col.goal-period-progress-col { width: 74px; }
.goals-period-table-real col.goal-period-week-col { width: 132px; }
.goals-period-table-real thead th { padding: 11px 12px; background: #f8f9fb; color: #666b75; font-size: 11px; font-weight: 800; line-height: 1.35; text-align: center; text-transform: uppercase; vertical-align: middle; }
.goals-period-table-real tbody td { height: 32px; padding: 4px 10px; border-bottom-color: var(--line); color: #353a44; font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.25; text-align: right; vertical-align: middle; }
.goals-period-table-real tbody tr:not(.service-group-row):not(.metric-section-row):hover td { filter: brightness(.985); }
.goals-period-table-real thead tr:first-child > th:first-child,.goals-period-table-real tbody td:first-child { width: 245px; min-width: 245px; max-width: 245px; border-right: 0; padding-right: 14px; padding-left: 14px; text-align: left; white-space: normal; box-shadow: inset -1px 0 0 var(--line-strong), 9px 0 14px -14px rgba(22,27,38,.75); }
.goals-period-table-real thead tr:first-child > th:first-child { z-index: 6; background: #f8f9fb; }
.goals-period-table-real thead tr:nth-child(2) > th:first-child { position: static; z-index: auto; width: 92px; min-width: 92px; max-width: 92px; padding-right: 12px; padding-left: 12px; text-align: center; box-shadow: none; }
.goals-period-table-real .month-head { border-left-width: 1px; background: #eeecff; color: var(--purple); font-size: 12px; letter-spacing: .01em; }
.goals-period-table-real .month-head:nth-child(n+3) { background: #f0f3f8; color: #596272; }
.goals-period-table-real .month-summary-cell { width: 92px; min-width: 92px; max-width: 92px; background: #f7f6ff; font-weight: 800; }
.goals-period-table-real .month-summary-cell[colspan="3"] { width: 240px; min-width: 240px; max-width: 240px; }
.goals-period-table-real .month-start-cell.month-summary-cell { border-left: 1px solid #d8d3ff; background: #f4f2ff; color: #4f46b8; }
.goals-period-table-real .month-start-cell + .month-summary-cell { width: 74px; min-width: 74px; max-width: 74px; background: #f1f6fc; color: #3f5875; }
.goals-period-table-real .month-start-cell + .month-summary-cell + .month-summary-cell { width: 74px; min-width: 74px; max-width: 74px; background: #f1f8f4; color: #337052; }
.goals-period-table-real .period-head,.goals-period-table-real .period-column { width: 132px; min-width: 132px; max-width: 132px; }
.goals-period-table-real .period-head { background: #fafbfc; color: #777c85; font-size: 10px; text-transform: none; }
.goals-period-table-real .period-head > span:first-child { display: block; white-space: nowrap; }
.goals-period-table-real .period-column { background: #fff; }
.goals-period-table-real .service-group-row td { height: 34px; border-top: 1px solid #d8d3ff; background: #f1efff; color: var(--ink); }
.goals-period-table-real .service-group-row .service-group-title { background: #f1efff; box-shadow: inset -1px 0 0 #cfc8ff, 9px 0 14px -14px rgba(22,27,38,.75); }
.goals-period-table-real .service-group-title > strong { display: inline-block; max-width: 100%; margin-right: 0; font-size: 13px; line-height: 1.25; vertical-align: middle; }
.goals-period-table-real .service-group-title > a { display: inline-flex; min-height: 28px; align-items: center; margin-left: 0; padding: 4px 8px; border: 1px solid #d4ceff; border-radius: 6px; background: #fff; font-size: 11px; vertical-align: middle; }
.goals-period-table-real .metric-section-row td { height: 27px; background: #f6f7f9; color: #707681; font-size: 9px; letter-spacing: .035em; text-transform: uppercase; }
.goals-period-table-real .metric-section-row td:first-child { background: #f6f7f9; }
.goals-period-table-real .goal-name-cell strong { display: inline !important; color: #272b33; font-size: 12px; line-height: 1.25; }
.goals-period-table-real .goal-name-label { display: flex !important; align-items: center; flex-wrap: wrap; gap: 3px 6px; margin: 0; }
.goals-period-table-real .goal-name-cell .muted-label { display: inline !important; margin: 0; font-size: 9px; }
.goals-period-table-real .goal-name-cell .primary-goal-inline { display: inline-grid !important; min-height: 22px; place-items: center; margin-top: 0; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: #e8f7ee; color: #267148; font-size: 8px; font-weight: 850; line-height: 1; text-transform: uppercase; }
.goals-period-table-real .period-report-link { display: inline-flex; min-height: 18px; align-items: center; margin: 3px auto 0; padding: 1px 5px; border: 1px solid #d4ceff; border-radius: 5px; background: #fff; color: var(--purple); font-size: 8px; font-weight: 800; line-height: 1; text-decoration: none; white-space: nowrap; }
.period-report-ready { display: inline-flex; min-height: 18px; align-items: center; justify-content: center; margin-top: 3px; padding: 1px 5px; border-radius: 5px; background: #eaf6ef; color: #277149; font-size: 8px; font-weight: 800; line-height: 1; white-space: nowrap; }
.period-report-edit { display: inline-flex; min-height: 22px; align-items: center; margin: 3px 0 0 3px; padding: 2px 5px; border: 1px solid #d4ceff; border-radius: 5px; background: #fff; color: var(--purple); font-size: 8px; font-weight: 800; line-height: 1; text-decoration: none; }
.period-report-edit:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.table-comment-tip { position: relative; display: inline-grid !important; width: 20px; height: 15px; margin-left: 4px; place-items: center; border-radius: 5px; background: #ece9ff; color: var(--purple); cursor: help; font-size: 8px !important; font-weight: 900; line-height: 1; vertical-align: middle; }
.table-comment-tip::after { position: absolute; bottom: -3px; left: 4px; border-width: 3px 3px 0 0; border-style: solid; border-color: #ece9ff transparent transparent transparent; content: ""; }
.table-comment-tip > span { position: absolute; z-index: 20; right: 0; bottom: calc(100% + 8px); display: none !important; width: 240px; padding: 9px 10px; border: 1px solid #d9d5f7; border-radius: 7px; background: #fff; color: #353a44 !important; box-shadow: 0 8px 24px rgba(22,27,38,.16); font-size: 11px !important; font-weight: 500; line-height: 1.45; text-align: left; white-space: normal; }
.table-comment-tip:hover > span,.table-comment-tip:focus > span { display: block !important; }
.goals-period-table-real .kpi-danger { background: #fff1ef !important; color: #b42318 !important; }
.goals-period-table-real .kpi-warn { background: #fff7df !important; color: #775a05 !important; }

.not-found-page { max-width: 720px; margin: 56px auto; padding: 48px; text-align: center; }
.not-found-code { display: block; color: var(--purple); font-size: 68px; font-weight: 900; line-height: 1; letter-spacing: -.05em; }
.not-found-page h1 { margin: 18px 0 0; font-size: 28px; }
.not-found-page p { max-width: 520px; margin: 12px auto 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.not-found-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

.detail-back-link { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; }
.entity-page-head { margin-bottom: 18px; }
.entity-form-real-layout,.goal-form-real-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 16px; align-items: start; }
.entity-form-real-main { display: grid; gap: 16px; }
.entity-form-real-side { display: grid; gap: 16px; }
.form-section-real { padding: 0; overflow: hidden; }

.numbered-section-head { display: grid; grid-template-columns: 32px minmax(0,1fr); gap: 11px; padding: 17px 18px 14px; border-bottom: 1px solid var(--line); }
.numbered-section-head > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 6px; background: #eeecff; color: var(--purple); font-size: 10px; font-weight: 900; }
.numbered-section-head h2 { margin: 0; font-size: 16px; }
.numbered-section-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.real-form-grid { display: grid; gap: 14px; padding: 18px; }
.real-form-grid.two-columns { grid-template-columns: repeat(2,minmax(0,1fr)); }
.real-form-grid .field-wide { grid-column: 1/-1; }
.real-form-grid label,.contact-form-card label,.side-form-fields-real label { display: grid; align-content: start; gap: 6px; margin: 0; color: #50555f; font-size: 10px; font-weight: 750; }
.real-form-grid label > span:first-child,.contact-form-card label > span:first-child,.side-form-fields-real label > span:first-child { text-transform: none; }
.real-form-grid input,.real-form-grid select,.real-form-grid textarea,.contact-form-card input,.contact-form-card textarea,.side-form-fields-real input,.side-form-fields-real select,.side-form-fields-real textarea { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.real-form-grid textarea,.contact-form-card textarea,.side-form-fields-real textarea { min-height: 78px; resize: vertical; }
.real-form-grid input:focus,.real-form-grid select:focus,.real-form-grid textarea:focus,.contact-form-card input:focus,.contact-form-card textarea:focus,.side-form-fields-real input:focus,.side-form-fields-real select:focus,.side-form-fields-real textarea:focus { border-color: var(--purple); outline: 3px solid rgba(91,72,232,.1); }
.real-form-grid small { color: var(--muted); font-size: 9px; font-weight: 500; }
.real-form-grid b { color: var(--red); }
.file-field input { padding: 10px; border-style: dashed; background: #fafaff; }

.contact-form-list { display: grid; gap: 10px; padding: 18px; }
.contact-form-card { display: grid; grid-template-columns: 1.15fr 1fr .9fr 1.15fr; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fbfbfd; }
.contact-form-card .contact-comment { grid-column: 1/-2; }
.delete-contact { display: flex !important; align-items: center; align-self: end; grid-column: -2/-1; grid-row: 2; padding: 9px; border-radius: 6px; background: #fff0ef; color: var(--red) !important; }
.delete-contact input { width: 16px; min-height: 16px; }

.side-form-panel { padding: 17px; }
.side-form-panel h2,.goal-preview-real h2 { margin: 0 0 16px; font-size: 16px; }
.side-form-fields-real { display: grid; gap: 13px; }
.sticky-submit-panel { position: sticky; top: 78px; }
.completion-list-real { display: grid; gap: 9px; margin: 14px 0 18px; }
.completion-list-real span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.completion-list-real i { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #e9f7ef; color: var(--green); font-size: 9px; font-style: normal; font-weight: 900; }
.side-form-actions-real { display: grid; gap: 8px; }
.side-form-actions-real a,.side-form-actions-real button { justify-content: center; width: 100%; text-align: center; text-decoration: none; }

/* Real service form based on the numbered prototype sections. */
.service-form-real { display: grid; gap: 16px; }
.service-form-real-main { display: grid; grid-template-columns: 1fr; gap: 16px; }
.service-form-real .prototype-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 18px; }
.service-form-real .prototype-form > div { display: grid; align-content: start; gap: 6px; }
.service-form-real .prototype-form > div.wide,.service-form-real .prototype-form > div:has(textarea) { grid-column: 1/-1; }
.service-form-real .prototype-form label,.service-form-real .document-primary-grid label { color: #50555f; font-size: 10px; font-weight: 750; }
.service-form-real .prototype-form input,.service-form-real .prototype-form select,.service-form-real .prototype-form textarea { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.service-form-real .prototype-form textarea { min-height: 88px; resize: vertical; }
.service-form-real .prototype-form input:focus,.service-form-real .prototype-form select:focus,.service-form-real .prototype-form textarea:focus { border-color: var(--purple); outline: 3px solid rgba(91,72,232,.1); }
.service-form-section-real { padding: 0; overflow: hidden; }
.service-form-section-real > .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.service-form-section-real .compact-table thead th { background: #f8f9fb; color: #666b75; font-size: 10px; text-transform: uppercase; }
.service-form-section-real .compact-table td { padding: 10px; vertical-align: middle; }
.service-form-section-real .compact-table input,.service-form-section-real .compact-table select,.service-form-section-real .compact-table textarea { border-color: var(--line-strong); border-radius: 6px; font-size: 11px; }
.service-section-head-actions { grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; }
.document-primary-card { margin: 16px 18px; }
.field-heading { display: inline-flex; align-items: center; gap: 5px; }
.field-help { position: relative; display: inline-grid; flex: 0 0 18px; width: 18px; height: 18px; place-items: center; border: 1px solid #cbc6ed; border-radius: 50%; background: #fff; color: var(--purple); cursor: help; font-size: 10px; font-style: normal; font-weight: 900; line-height: 1; text-transform: none; }
.field-help > span { position: absolute; z-index: 30; top: calc(100% + 8px); left: 50%; display: none; width: min(260px,70vw); border: 1px solid var(--line); border-radius: 8px; padding: 10px 11px; background: #fff; box-shadow: 0 14px 35px rgba(22,27,38,.16); color: var(--ink); font-size: 11px; font-weight: 500; line-height: 1.45; text-align: left; text-transform: none; transform: translateX(-50%); white-space: normal; }
.field-help:hover > span,.field-help:focus-visible > span { display: block; }
.field-help:focus-visible { outline: 3px solid rgba(91,72,232,.18); outline-offset: 2px; }
.service-expense-template-table th:nth-last-child(-n+3) .field-help > span { right: 0; left: auto; transform: none; }
.service-expense-delete { display: inline-flex; min-height: 44px; align-items: center; gap: 6px; color: var(--red); cursor: pointer; font-size: 10px; font-weight: 750; }
.service-expense-delete input { width: 16px !important; min-height: 16px !important; accent-color: var(--red); }
.service-form-actions-real { position: sticky; z-index: 8; bottom: 12px; display: flex; justify-content: flex-end; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(22,27,38,.12); backdrop-filter: blur(8px); }
.page-head-copy { max-width: 650px; margin: 7px 0 0; color: var(--muted); font-size: 12px; }

.checkbox-field { display: flex; min-height: 40px; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 500; }
.checkbox-field input { width: 16px; min-height: 16px; }
.choice-card-grid > div { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; padding: 16px 18px; }
.choice-card-grid > div > div label { display: flex; min-height: 42px; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; font-size: 12px; font-weight: 650; }
.choice-card-grid input { width: 16px; height: 16px; min-height: 16px; accent-color: var(--purple); }
.choice-card-grid label:has(input:checked) { border-color: #c9c2ff; background: #f4f2ff; color: var(--purple); }
.knowledge-choice-sections { display: grid; gap: 1px; background: var(--line); }
.knowledge-choice-sections > div { background: #fff; }
.knowledge-choice-sections h3 { margin: 0; padding: 16px 18px 0; font-size: 12px; text-transform: capitalize; }
.checkbox-card-real { display: flex; align-items: center; gap: 10px; margin: 0; padding: 14px 18px; border-top: 1px solid var(--line); background: #fafbfc; }
.checkbox-card-real input { width: 17px; height: 17px; min-height: 17px; accent-color: var(--purple); }
.checkbox-card-real span,.checkbox-card-real strong,.checkbox-card-real small { display: block; }
.checkbox-card-real small { margin-top: 3px; color: var(--muted); font-size: 10px; }

.knowledge-section-real { padding: 0; overflow: hidden; }
.knowledge-head-real { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.knowledge-head-real h2 { margin: 0; font-size: 17px; }
.knowledge-head-real p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.knowledge-filter-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.knowledge-filter-row label { margin: 0; }
.knowledge-filter-row select,.knowledge-filter-row input { min-height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.knowledge-filter-row select { width: 145px; padding: 0 28px 0 10px; }
.knowledge-layout-real { display: grid; grid-template-columns: 210px minmax(0,1fr); }
.knowledge-nav-real { display: grid; align-content: start; gap: 3px; padding: 14px; border-right: 1px solid var(--line); background: #fafbfc; }
.knowledge-nav-real a { display: flex; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 6px; color: var(--muted); font-size: 11px; font-weight: 700; text-decoration: none; }
.knowledge-nav-real a:hover,.knowledge-nav-real a.active { background: #eeecff; color: var(--purple); }
.knowledge-nav-real a span { color: var(--purple); }
.knowledge-nav-real p { margin: 12px 10px 4px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.knowledge-content-real { min-width: 0; padding: 14px; }
.knowledge-table-real { min-width: 1000px; }
.knowledge-table-real td { vertical-align: middle; }
.knowledge-document-title { color: var(--ink); font-size: 13px; font-weight: 850; text-decoration: none; }
.knowledge-document-title:hover { color: var(--purple); }
.knowledge-table-real td > .muted-label { display: block; max-width: 320px; margin-top: 4px; line-height: 1.45; }
.knowledge-chip-list { display: flex; flex-wrap: wrap; gap: 4px; }

.management-tags-panel { margin-bottom: 16px; }
.management-tag-form,.management-tag-list form { display: grid; grid-template-columns: minmax(180px,1fr) 110px 130px auto; align-items: end; gap: 8px; padding: 14px 16px; }
.management-tag-form { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.management-tag-form label { margin: 0; }
.management-tag-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 750; }
.management-tag-form input,.management-tag-list input { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0 10px; background: #fff; font: inherit; }
.management-tag-list form { align-items: center; border-bottom: 1px solid var(--line); }
.management-tag-list form:last-child { border-bottom: 0; }

@media (max-width: 900px) {
  .client-detail-head-real { align-items: flex-start; flex-direction: column; }
  .client-detail-kpis-real { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .knowledge-layout-real { grid-template-columns: 1fr; }
  .knowledge-nav-real { grid-template-columns: repeat(3,minmax(0,1fr)); border-right: 0; border-bottom: 1px solid var(--line); }
  .choice-card-grid > div { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .clients-section-tabs { align-items: stretch; flex-direction: column; }
  .client-detail-kpis-real { grid-template-columns: 1fr; }
  .client-detail-kpis-real article { border-right: 0; border-bottom: 1px solid var(--line); }
  .choice-card-grid > div,.knowledge-nav-real { grid-template-columns: 1fr; }
  .management-tag-form,.management-tag-list form { grid-template-columns: 1fr; }
}
.goal-preview-real { padding: 18px; background: linear-gradient(145deg,#fff,#f7f6ff); }
.goal-preview-real > strong,.goal-preview-real > span { display: block; }
.goal-preview-real > strong { margin-top: 24px; font-size: 20px; }
.goal-preview-real > span { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.preview-progress { height: 5px; margin-top: 18px; border-radius: 5px; background: #e7e8ec; overflow: hidden; }
.preview-progress i { display: block; width: 72%; height: 100%; background: var(--purple); }
.errorlist { margin: 0; padding: 0; color: var(--red); font-size: 10px; list-style: none; }

@media (max-width: 980px) {
  .entity-form-real-layout,.goal-form-real-layout { grid-template-columns: 1fr; }
  .entity-form-real-side { grid-row: 1; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sticky-submit-panel { position: static; }
  .contact-form-card { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .contact-form-card .contact-comment,.delete-contact { grid-column: 1/-1; grid-row: auto; }
}

@media (max-width: 620px) {
  .real-form-grid.two-columns,.entity-form-real-side,.contact-form-card { grid-template-columns: 1fr; }
  .real-form-grid .field-wide,.contact-form-card .contact-comment,.delete-contact { grid-column: 1; }
  .service-form-real .prototype-form { grid-template-columns: 1fr; }
  .service-form-real .prototype-form > div.wide,.service-form-real .prototype-form > div:has(textarea) { grid-column: 1; }
  .service-section-head-actions { grid-template-columns: 32px minmax(0,1fr); }
  .service-section-head-actions .ghost-button { grid-column: 1/-1; }
  .service-expense-plan-summary > header,.service-expense-plan-total { align-items: flex-start; flex-direction: column; }
  .service-expense-plan-summary > header a { margin-left: -10px; }
}

/* Relationship health, service attention and per-service operational tables. */
.lifecycle-dot { display: inline-block; flex: 0 0 10px; width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--line-strong); }
.lifecycle-active { background: #2b9962; }
.lifecycle-paused { background: #d99a18; }
.lifecycle-finished,.lifecycle-lost { background: #d84a42; }
.lifecycle-lead { background: #786de8; }
.relationship-pill,.relationship-inline { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; font-weight: 800; line-height: 1; text-decoration: none; white-space: nowrap; }
.relationship-pill { min-height: 28px; padding: 6px 9px; font-size: 11px; }
.relationship-pill-button { border: 0; cursor: pointer; font-family: inherit; font-size: 11px; font-weight: 800; }
.relationship-pill-button:focus-visible { outline: 3px solid rgba(91,72,232,.2); outline-offset: 2px; }
.relationship-inline { margin-top: 5px; padding: 4px 6px; font-size: 9px; }
.relationship-new { background: #f2eaff; color: #7a2ea8; }
.relationship-loyal { background: #e2f5e9; color: #197044; }
.relationship-normal { background: #eef8f1; color: #3d7656; }
.relationship-issues { background: #fff4d8; color: #815f05; }
.relationship-complicated { background: #ffebe8; color: #a92e25; }
.relationship-form { display: grid; grid-template-columns: minmax(170px,.65fr) 160px minmax(260px,1.4fr) auto; gap: 12px; align-items: end; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.relationship-form label { display: grid; gap: 6px; margin: 0; color: var(--muted); font-size: 10px; font-weight: 800; }
.relationship-form select,.relationship-form input,.relationship-form textarea { width: 100%; min-height: 42px; padding: 9px 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.relationship-form textarea { min-height: 64px; resize: vertical; }
.relationship-form small { font-size: 9px; font-weight: 500; }
.relationship-history { display: grid; margin-top: 14px; }
.relationship-history article { display: grid; grid-template-columns: 110px minmax(0,1fr) 180px; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); align-items: start; }
.relationship-history time,.relationship-history article > span { color: var(--muted); font-size: 10px; }
.relationship-history time strong,.relationship-history time small { display: block; }
.relationship-history time strong { color: var(--ink); font-size: 11px; }
.relationship-history time small { margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.relationship-history article > span { text-align: right; }
.relationship-history strong { font-size: 12px; }
.relationship-history p { margin: 4px 0 0; color: #555a64; font-size: 11px; line-height: 1.45; }
.relationship-dialog { width: min(920px,calc(100vw - 32px)); max-height: calc(100vh - 32px); border: 0; border-radius: 12px; padding: 24px; background: #fff; box-shadow: 0 24px 70px rgba(20,24,36,.28); }
.relationship-dialog::backdrop { background: rgba(22,27,38,.46); backdrop-filter: blur(2px); }
.relationship-dialog-close { position: absolute; z-index: 2; top: 14px; right: 14px; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; font-size: 22px; line-height: 1; }
.relationship-dialog .relationship-panel { padding: 0; }
.relationship-dialog .panel-head { padding-right: 44px; }
.relationship-inline[data-relationship-history-open] { cursor: pointer; }
.relationship-inline[data-relationship-history-open]:hover,
.relationship-inline[data-relationship-history-open]:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
.relationship-list-dialog { width: min(920px,calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; border: 0; border-radius: 12px; padding: 0; background: #fff; box-shadow: 0 24px 70px rgba(20,24,36,.28); }
.relationship-list-dialog::backdrop { background: rgba(22,27,38,.46); backdrop-filter: blur(2px); }
.relationship-list-dialog-bar { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #fff; padding: 12px 16px; }
.relationship-list-dialog-bar button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; font-size: 20px; }
.relationship-list-dialog-body { min-height: 180px; padding: 20px; }
.relationship-list-dialog-body .relationship-panel { padding: 0; }
.relationship-dialog-loading,
.relationship-dialog-error { display: grid; min-height: 150px; place-items: center; color: var(--muted); text-align: center; }
.relationship-dialog-error { color: var(--red); }
.client-relationship-standalone { padding: 20px; }
.recurring-asset-form { display: grid; gap: 14px; }
.recurring-asset-section { padding: 0; overflow: hidden; }
.recurring-asset-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 18px; background: #fbfcfd; }
.recurring-asset-grid-four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.recurring-asset-grid > div { display: grid; min-width: 0; align-content: start; gap: 6px; }
.recurring-asset-grid > .wide { grid-column: 1/-1; }
.recurring-asset-grid label { color: #50555f; font-size: 10px; font-weight: 750; }
.recurring-asset-grid input:not([type="file"]),.recurring-asset-grid select,.recurring-asset-grid textarea { width: 100%; min-height: 40px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 9px 10px; background: #fff; color: var(--ink); font: inherit; font-size: 12px; }
.recurring-asset-grid textarea { min-height: 82px; resize: vertical; }
.recurring-asset-grid input:focus,.recurring-asset-grid select:focus,.recurring-asset-grid textarea:focus { border-color: var(--purple); outline: 3px solid rgba(91,72,232,.1); }
.recurring-asset-file .service-file-compact { min-height: 40px; }
.recurring-asset-section .document-form-table { min-width: 900px; }
.recurring-asset-actions { position: sticky; z-index: 8; bottom: 12px; margin-top: 0; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: rgba(255,255,255,.94); box-shadow: 0 8px 24px rgba(22,27,38,.12); backdrop-filter: blur(8px); }

@media (max-width: 900px) {
  .recurring-asset-grid-four { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 620px) {
  .recurring-asset-grid,.recurring-asset-grid-four { grid-template-columns: 1fr; }
}
.service-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.service-title-row h3 { margin: 0; }
.attention-pill { display: inline-flex; min-height: 24px; align-items: center; padding: 4px 7px; border-radius: 999px; font-size: 10px; font-weight: 850; line-height: 1; white-space: nowrap; }
.attention-normal { background: #e7f6ed; color: #197044; }
.attention-risk { background: #fff3d5; color: #815f05; }
.attention-problem { background: #ffebe8; color: #a92e25; }
.attention-tooltip {
  position: relative;
  display: inline-flex;
  border-radius: 999px;
  outline: none;
}
.attention-tooltip:focus-visible {
  box-shadow: 0 0 0 3px rgba(91,72,232,.2);
}
.attention-tooltip-copy {
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 9px);
  width: min(360px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: #202431;
  color: #fff;
  box-shadow: 0 12px 30px rgba(20,24,36,.22);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 160ms ease, transform 160ms ease;
  white-space: normal;
}
.attention-tooltip:hover .attention-tooltip-copy,
.attention-tooltip:focus .attention-tooltip-copy,
.attention-tooltip:focus-within .attention-tooltip-copy {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: reduce) {
  .attention-tooltip-copy { transition: none; }
}
.service-actions-menu { align-self: center; }
.service-actions-menu > div { width: 190px; }
.service-head-actions { display: flex; align-items: center; gap: 8px; }
.service-plan-button { display: inline-flex; min-height: 34px; align-items: center; padding: 6px 10px; border: 1px solid #d4ceff; border-radius: 7px; background: #fff; color: var(--purple); font-size: 10px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.service-plan-button:hover,.service-plan-button:focus-visible { background: #eeecff; }
.audit-request-active { border-color: #e3b64b; background: #fff7df; color: #775a05; }
.service-name-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: -8px 0 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.service-name-nav strong { margin-right: 4px; font-size: 11px; }
.service-name-nav a { display: inline-flex; min-height: 30px; align-items: center; padding: 5px 9px; border-radius: 6px; color: var(--muted); font-size: 11px; font-weight: 800; text-decoration: none; }
.service-name-nav a:hover,.service-name-nav a:focus-visible,.service-name-nav a.active { background: #eeecff; color: var(--purple); }
.service-name-nav a span { margin-left: 5px; font-variant-numeric: tabular-nums; }
.service-nav-current { margin-left: auto; color: var(--muted); font-size: 11px; font-weight: 700; }
.completed-services-table { min-width: 900px; }
.client-kpi-link { display: block; color: inherit; text-decoration: none; }
.client-kpi-link:focus-visible { outline: 3px solid rgba(91,72,232,.18); outline-offset: 3px; }
.debt-breakdown { display: flex !important; flex-wrap: wrap; gap: 5px 10px; margin-top: 8px; }
.debt-breakdown b { color: var(--muted); font-size: 9px; font-weight: 750; }
.service-core-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.service-core-summary > article { min-width: 0; padding: 14px; border-right: 1px solid var(--line); }
.service-core-summary > article:last-child { border-right: 0; }
.service-core-summary span,.service-core-summary small { display: block; color: var(--muted); font-size: 10px; }
.service-core-summary > article > strong { display: block; margin: 9px 0 6px; font-size: 19px; font-variant-numeric: tabular-nums; }
.service-core-summary a { color: var(--purple); font-weight: 800; text-decoration: none; }
.service-payment-state { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.service-payment-state small { flex-basis: 100%; }
.service-core-summary .invoice-state { display: inline-flex; min-height: 23px; align-items: center; padding: 3px 7px; border-radius: 5px; font-size: 9px; font-weight: 850; line-height: 1; }
.service-core-summary .invoice-paid { background: #e7f6ed; color: #197044; }
.service-core-summary .invoice-partially_paid { background: #fff3d5; color: #815f05; }
.service-core-summary .invoice-issued { background: #eef0f3; color: #555b67; }
.service-core-summary .invoice-overdue,.service-core-summary .invoice-missing { background: #ffebe8; color: #b42318; }
.service-core-summary .invoice-not_required { background: #f0f1f3; color: #707681; }
.service-expense-plan-summary { border: 1px solid #dcd8f5; border-radius: 8px; background: #fbfaff; overflow: hidden; }
.service-expense-plan-summary > header { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid #e6e2f8; }
.service-expense-plan-summary > header div,.service-expense-plan-summary > header span,.service-expense-plan-summary > header strong { display: block; }
.service-expense-plan-summary > header span { color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.service-expense-plan-summary > header strong { margin-top: 3px; font-size: 13px; }
.service-expense-plan-summary > header a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 10px; border-radius: 6px; color: var(--purple); font-size: 11px; font-weight: 800; text-decoration: none; }
.service-expense-plan-summary > header a:hover,.service-expense-plan-summary > header a:focus-visible { background: #efecff; outline: none; }
.service-expense-plan-total { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px 8px; }
.service-expense-plan-total strong { font-size: 19px; font-variant-numeric: tabular-nums; }
.service-expense-plan-total span { color: var(--muted); font-size: 10px; }
.service-expense-plan-items { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 1px; margin: 0 14px 14px; border: 1px solid #e6e2f8; border-radius: 7px; background: #e6e2f8; overflow: hidden; }
.service-expense-plan-items article { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 11px; background: #fff; }
.service-expense-plan-items article span,.service-expense-plan-items article strong,.service-expense-plan-items article small { display: block; min-width: 0; }
.service-expense-plan-items article strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.service-expense-plan-items article small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.service-expense-plan-items article b { flex: 0 0 auto; font-size: 11px; font-variant-numeric: tabular-nums; }
.service-expense-plan-empty { display: grid; gap: 4px; padding: 13px 14px; color: var(--muted); font-size: 10px; }
.service-expense-plan-empty strong { color: var(--ink); font-size: 11px; }
.service-budget-summary { background: #fbfcfd; }
.budget-source-list { min-height: 28px; margin-top: 4px; line-height: 1.4; }
.service-budget-values { display: flex; align-items: baseline; gap: 8px; margin-top: 7px; }
.service-budget-values strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.service-budget-values b { margin-left: auto; font-size: 14px; font-variant-numeric: tabular-nums; }
.service-budget-progress { height: 5px; margin: 9px 0 7px; border-radius: 999px; background: #eceef2; overflow: hidden; }
.service-budget-progress i { display: block; height: 100%; border-radius: inherit; background: currentColor; }
.budget-state-ok { color: #197044; }.budget-state-warn { color: #815f05; }.budget-state-danger { color: #c23830; }
.service-budget-summary > span,.service-budget-summary > small,.service-budget-summary .service-budget-values small { color: var(--muted); }
.service-primary-goal-summary { background: #fcfbff; }
.service-primary-goal-summary h4 { margin: 4px 0 10px; color: var(--ink); font-size: 17px; line-height: 1.25; }
.primary-goal-values { display: flex; align-items: baseline; gap: 8px; }
.primary-goal-values strong { font-size: 23px; font-variant-numeric: tabular-nums; }
.primary-goal-values b { margin-left: auto; font-size: 15px; font-variant-numeric: tabular-nums; }
.pace-ok { color: #197044 !important; }.pace-warn { color: #815f05 !important; }.pace-danger { color: #c23830 !important; }
.primary-goal-progress { height: 5px; margin: 9px 0 7px; border-radius: 999px; background: #eceef2; overflow: hidden; }
.primary-goal-progress i { display: block; height: 100%; border-radius: inherit; background: currentColor; }
.service-primary-goal-empty { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; background: #fffaf9; }
.service-primary-goal-empty h4 { color: #b42318; }
.service-primary-goal-empty p { max-width: 390px; margin: 0 0 9px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.service-primary-goal-empty a { display: inline-flex; min-height: 30px; align-items: center; padding: 5px 8px; border-radius: 6px; background: #eeecff; }
.audit-request-dialog { width: min(520px,calc(100vw - 32px)); padding: 0; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 24px 70px rgba(24,28,39,.28); }
.audit-request-dialog::backdrop { background: rgba(27,30,38,.48); }
.audit-request-dialog form { display: grid; gap: 14px; padding: 20px; }
.audit-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.audit-dialog-head span { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.audit-dialog-head h3 { margin: 3px 0 0; font-size: 19px; }
.audit-dialog-head > button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: #f1f2f5; font-size: 22px; cursor: pointer; }
.audit-request-dialog label { display: grid; gap: 6px; color: var(--ink); font-size: 11px; font-weight: 800; }
.audit-request-dialog input,.audit-request-dialog textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 7px; padding: 10px 11px; font: inherit; }
.audit-dialog-responsible { padding: 10px 12px; border-radius: 7px; background: #f7f7fa; }
.audit-dialog-responsible span,.audit-dialog-responsible strong { display: block; }
.audit-dialog-responsible span { color: var(--muted); font-size: 9px; text-transform: uppercase; }.audit-dialog-responsible strong { margin-top: 3px; font-size: 12px; }
.service-audit-request-state { display: grid; grid-template-columns: auto auto minmax(0,1fr) auto; align-items: center; gap: 8px 14px; padding: 10px 12px; border: 1px solid #efd48c; border-radius: 7px; background: #fff8e5; }
.service-audit-request-state span { color: #775a05; font-size: 9px; font-weight: 900; text-transform: uppercase; }.service-audit-request-state strong { font-size: 12px; }.service-audit-request-state small { color: var(--muted); font-size: 10px; }
.audit-request-actions { justify-self: end; }
.audit-request-actions > div button { width: 100%; border: 0; border-radius: 5px; background: transparent; padding: 8px; color: var(--ink); cursor: pointer; font: inherit; font-size: 11px; font-weight: 700; text-align: left; }
.audit-request-actions > div button:hover { background: #f3f2ff; color: var(--purple); }
.audit-request-actions > div form { margin: 0; }
.audit-request-actions > div .danger-link { color: #b42318; }
.report-state-pill,.report-period-chip { display: inline-flex; align-items: center; border-radius: 7px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.report-state-pill { min-height: 24px; padding: 4px 7px; font-size: 10px; }
.report-state-pill.done,.report-period-chip.done { background: #e7f6ed; color: #197044; }
.report-state-pill.missing { background: #ffebe8; color: #c23830; }
.service-report-strip { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfd; }
.service-report-strip > strong { margin-right: 2px; color: var(--muted); font-size: 11px; }
.report-period-chip { min-height: 28px; padding: 5px 9px; font-size: 10px; }
.report-period-chip.missing { background: #fff3d5; color: #815f05; }
.service-primary-goal-card { padding: 16px; border: 1px solid #d8d3ff; border-radius: 9px; background: #fcfbff; }
.service-primary-goal-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.service-primary-goal-card h4 { margin: 0; color: var(--ink); font-size: 19px; line-height: 1.25; }
.service-primary-goal-card header > div > span { display: inline-flex; min-height: 22px; align-items: center; margin-top: 7px; padding: 0 8px; border-radius: 999px; background: #e9f7ef; color: #197044; font-size: 9px; font-weight: 850; line-height: 1; text-transform: uppercase; }
.service-primary-goal-card header > b { font-size: 18px; font-variant-numeric: tabular-nums; }
.primary-goal-current { display: flex; align-items: baseline; gap: 12px; margin-top: 14px; }
.primary-goal-current strong { color: var(--ink); font-size: 28px; font-variant-numeric: tabular-nums; line-height: 1; }
.primary-goal-current span { color: var(--muted); font-size: 12px; }
.primary-goal-pace-copy { display: block; margin-top: 7px; color: var(--muted); font-size: 10px; }
.primary-goal-periods { display: grid; grid-template-columns: repeat(5,minmax(110px,1fr)); margin-top: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.primary-goal-periods > div { position: relative; min-width: 0; padding: 10px; border-right: 1px solid var(--line); text-align: center; }
.primary-goal-periods > div:last-child { border-right: 0; }
.primary-goal-periods span,.primary-goal-periods strong { display: block; }
.primary-goal-periods span { color: var(--muted); font-size: 9px; }
.primary-goal-periods strong { margin-top: 5px; color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.primary-goal-periods i { position: absolute; right: -7px; bottom: 7px; z-index: 1; color: #a8adb7; font-size: 14px; font-style: normal; }
.service-summary-grid .invoice-state { display: inline-block; margin-right: 6px; font-size: 9px; font-weight: 800; }
.invoice-paid { color: #197044; }.invoice-partially_paid { color: #815f05; }.invoice-issued,.invoice-missing { color: #a92e25; }.invoice-not_required { color: var(--muted); }
.service-summary-compact { margin-top: 12px; }
.service-board { grid-template-columns: minmax(0,1fr); gap: 40px; }
.service-block { position: relative; gap: 16px; border: 1px solid color-mix(in srgb,var(--service-accent,#7667e8) 30%,#dfe1e7); border-top: 4px solid var(--service-accent,#7667e8); background: #fff; box-shadow: 0 10px 28px rgba(28,35,51,.10); }
.service-block.contract-expired { border-right-color: #efb3ad; border-bottom-color: #efb3ad; border-left-color: #efb3ad; box-shadow: 0 10px 28px rgba(28,35,51,.10),inset 3px 0 0 #c9372c; }
.service-block + .service-block::before { position: absolute; top: -23px; right: 10%; left: 10%; height: 1px; background: #dfe1e7; content: ""; }
.service-block-head { margin: -14px -14px 0; padding: 15px 14px 14px; border-bottom: 1px solid color-mix(in srgb,var(--service-accent,#7667e8) 24%,#e7e8ec); border-radius: 4px 4px 0 0; background: color-mix(in srgb,var(--service-accent,#7667e8) 9%,#fff); }
.service-view-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 22px; margin: -2px 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #f8f9fb; }
.service-view-filters > div { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.service-view-filters strong { margin-right: 2px; color: var(--ink); font-size: 11px; }
.service-view-filters a { display: inline-flex; min-height: 30px; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 6px; color: var(--muted); font-size: 10px; font-weight: 800; text-decoration: none; transition: background-color .16s ease,color .16s ease; }
.service-view-filters a:hover,.service-view-filters a:focus-visible { background: #eeecff; color: var(--purple); }
.service-view-filters a.active { background: var(--purple); color: #fff; }
.service-view-filters a span { display: inline-grid; min-width: 18px; height: 18px; place-items: center; border-radius: 999px; background: rgba(255,255,255,.72); color: var(--purple); font-size: 9px; }
.service-view-filters a:not(.active) span { background: #eceef2; color: var(--muted); }
.service-block,.service-operational-section { min-width: 0; }
.service-operational-section { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.service-operational-section .weekly-wrap { width: 100%; max-width: 100%; }
.service-meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.service-meta-line span { display: inline-flex; align-items: center; }
.service-meta-line span + span { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line-strong); }
.service-meta-line strong { margin-left: 4px; color: var(--ink); font-weight: 750; }
.service-meta-line > span:first-child strong { margin-left: 0; color: var(--purple); }
.service-meta-line a { color: var(--purple); text-decoration: underline; text-underline-offset: 2px; }
.service-meta-line .meta-alert { display: inline-flex; min-height: 21px; align-items: center; margin-left: 4px; padding: 2px 6px; border-radius: 5px; background: #ffebe8; color: #b42318; font-size: 10px; text-decoration: none; }
.service-meta-line .service-contract-meta.expired { color: #8f241d; }
.service-meta-line .service-contract-warning { min-height: 21px; margin: 0 5px 0 0; padding: 2px 7px; border-radius: 5px; background: #ffebe8; color: #b42318; font-size: 10px; font-weight: 850; }
.service-meta-line .service-contract-meta.expired > strong:not(.service-contract-warning),.service-meta-line .service-contract-meta.expired > a { color: #8f241d; }
.client-detail-kpis-real .kpi-value-label { margin-top: 9px; color: var(--ink); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.client-detail-kpis-real .kpi-value-label + strong { margin-top: 3px; }
.specialist-client-kpis { grid-template-columns: minmax(180px,.65fr) minmax(320px,1.35fr); }
.specialist-client-kpis article:nth-child(2) { border-right: 0; }
.service-operational-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.service-operational-head span,.service-operational-head strong { display: block; }
.service-operational-head span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.service-operational-head strong { margin-top: 3px; font-size: 13px; }
.service-operational-head button { min-height: 36px; }
.operational-report-row td { background: #fbfcfd; }
.operational-budget-row td:first-child { background: #f6f4ff; }
.operational-metric-toggle-row button { display: flex; width: 100%; min-height: 34px; align-items: center; justify-content: space-between; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-weight: 900; text-align: left; text-transform: uppercase; }
.operational-metric-toggle-row button b { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid #d4ceff; border-radius: 6px; background: #fff; color: var(--purple); font-size: 16px; line-height: 1; }
.operational-metric-toggle-row button small { display: inline-grid; min-width: 18px; height: 18px; margin-left: 4px; place-items: center; border-radius: 999px; background: #e8e5ff; color: var(--purple); font-size: 8px; }
.monthly-plan-page { max-width: 980px; margin: 0 auto; }
.monthly-plan-page .panel-head h1 { margin: 0; font-size: 24px; }
.monthly-plan-page .panel-head p:last-child { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.monthly-plan-month-picker { display: flex; align-items: end; gap: 8px; margin: 14px 0; }
.monthly-plan-month-picker label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.monthly-plan-month-picker input { min-height: 38px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; font: inherit; }
.monthly-budget-plan-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 14px; padding: 16px; border: 1px solid #d8d3ff; border-radius: 8px; background: #f8f7ff; }
.monthly-budget-plan-card > div span,.monthly-budget-plan-card > div strong,.monthly-budget-plan-card > div small { display: block; }
.monthly-budget-plan-card > div span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.monthly-budget-plan-card > div strong { margin-top: 5px; font-size: 20px; }
.monthly-budget-plan-card > div small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.monthly-budget-plan-card .monthly-plan-input { flex-wrap: wrap; justify-content: flex-end; }
.monthly-budget-plan-card .monthly-plan-input > span { flex-basis: 100%; color: var(--muted); font-size: 10px; font-weight: 800; text-align: right; }
.primary-report-goal-row td { background: #f6fcf8; }
.primary-report-goal-row td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.weekly-report-dialog { width: min(1040px,calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 24px 70px rgba(20,24,36,.28); }
.weekly-report-dialog::backdrop { background: rgba(22,27,38,.46); backdrop-filter: blur(2px); }
.weekly-report-dialog-close { position: sticky; z-index: 3; top: 10px; float: right; width: 34px; height: 34px; margin: 10px 10px -44px 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; font-size: 22px; line-height: 1; }
.weekly-report-readonly { display: grid; gap: 20px; padding: 24px; }
.weekly-report-readonly-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-right: 34px; }
.weekly-report-readonly-head h2 { margin: 4px 0 0; font-size: 23px; }
.weekly-report-readonly-head p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.report-readonly-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.report-readonly-summary.full-width { grid-template-columns: minmax(0,1fr); }
.report-readonly-summary > div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.report-readonly-summary span,.report-readonly-kpis span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.report-readonly-summary p { margin: 7px 0 0; font-size: 12px; line-height: 1.55; }
.performance-value { display: block; font-variant-numeric: tabular-nums; }
.performance-value.ok { color: var(--green); }
.performance-value.warn { color: #8a6100; }
.performance-value.danger { color: var(--red); }
.performance-label { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.weekly-report-readonly section > h3 { margin: 0 0 9px; font-size: 14px; }
.report-readonly-kpis { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; }
.report-readonly-kpis > div { padding: 12px; border: 1px solid var(--line); border-radius: 7px; }
.report-readonly-kpis strong { display: block; margin-top: 5px; font-size: 15px; }
.report-metrics-table { width: 100%; table-layout: fixed; }
.report-metrics-table .report-metric-name-col { width: 31%; }
.report-metrics-table .report-metric-value-col { width: 18%; }
.report-metrics-table .report-metric-comment-col { width: 51%; }
.report-metrics-table td { vertical-align: top; }
.report-metrics-table td:nth-child(2) { font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-metric-comment { max-width: 100%; color: #555a64; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; white-space: normal; }
.report-readonly-actions { display: grid; gap: 5px; margin: 0; padding-left: 20px; font-size: 12px; }
.weekly-report-readonly-nav { display: flex; justify-content: space-between; padding-top: 14px; border-top: 1px solid var(--line); }
.weekly-report-readonly-nav a { color: var(--purple); font-size: 12px; font-weight: 800; text-decoration: none; }
.weekly-report-readonly-page { max-width: 1100px; margin: 0 auto; padding: 0; }
.monthly-plan-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.monthly-plan-table { min-width: 720px; }
.monthly-plan-table th:first-child { width: 44%; }
.monthly-plan-table td { vertical-align: middle; }
.monthly-plan-table td > strong,.monthly-plan-table td > span,.monthly-plan-table td > small { display: block; }
.monthly-plan-table td > small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.monthly-plan-history { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.monthly-plan-history .panel-head { margin-bottom: 10px; }
.monthly-plan-history-table { min-width: 720px; }
.monthly-plan-history-table td > .muted-label { display: block; margin-top: 3px; }
.monthly-plan-input { display: inline-flex; align-items: center; gap: 6px; }
.monthly-plan-input input { width: 150px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 7px; font: inherit; font-size: 12px; }
.monthly-plan-input b { color: var(--muted); font-size: 10px; }
.real-service-list > :is(a,span).service-attention-normal { border: 1px solid #b9dfc8; background: #e7f6ed; color: #197044; }
.real-service-list > :is(a,span).service-attention-risk { border: 1px solid #ead18b; background: #fff3d5; color: #815f05; }
.real-service-list > :is(a,span).service-attention-problem { border: 1px solid #efb3ad; background: #ffebe8; color: #a92e25; }
.real-service-list > .service-contract-expired { display: inline-flex; align-items: flex-start; flex-direction: column; gap: 1px; border: 1px solid #efb3ad; background: #ffebe8; color: #8f241d; }
.real-service-list > .service-contract-expired small { color: #b42318; font-size: 8px; font-weight: 800; line-height: 1.2; text-transform: uppercase; }

@media (max-width: 720px) {
  .role-pulse-head { align-items: stretch; flex-direction: column; }
  .role-pulse-head form { align-items: stretch; }
  .role-pulse-head label { flex: 1; }.role-pulse-head input { width: 100%; }
  .role-pulse-signal { grid-template-columns: auto minmax(0,1fr); }
  .role-pulse-signal > a { grid-column: 1 / -1; justify-content: center; }
  .role-pulse-metrics { grid-template-columns: 1fr 1fr; }
  .role-pulse-metrics > a:nth-child(3n) { border-right: 1px solid var(--line); }
  .role-pulse-metrics > a:nth-child(even) { border-right: 0; }
  .role-pulse-grid { grid-template-columns: 1fr; }
  .dashboard-applied-filter { grid-template-columns: auto minmax(0,1fr); }
  .dashboard-applied-filter > b { grid-column: 2; width: fit-content; }
  .dashboard-applied-filter > a { grid-column: 2; min-height: 36px; padding: 0; }
  .report-form-grid-2,.report-form-grid-3,.report-action-grid { grid-template-columns: 1fr; }
  .specialist-client-kpis { grid-template-columns: 1fr; }
  .report-expense-groups header { align-items: flex-start; flex-direction: column; }
  .report-submit-bar { align-items: stretch; flex-direction: column-reverse; }
  .report-submit-bar > * { justify-content: center; }
  .relationship-form { grid-template-columns: 1fr; }
  .relationship-history article { grid-template-columns: 90px minmax(0,1fr); }
  .relationship-history article > span { grid-column: 2; text-align: left; }
  .service-meta-line { display: grid; gap: 5px; }
  .service-meta-line span + span { margin-left: 0; padding-left: 0; border-left: 0; }
  .service-block-head,.service-primary-goal-card header { align-items: flex-start; flex-direction: column; }
  .service-head-actions { align-self: stretch; justify-content: space-between; }
  .primary-goal-periods { grid-template-columns: repeat(5,110px); overflow-x: auto; }
  .service-core-summary { grid-template-columns: 1fr; }
  .service-core-summary > article { border-right: 0; border-bottom: 1px solid var(--line); }
  .service-audit-request-state { grid-template-columns: 1fr; }
}

/* HR operations and shared notification center */
.app-header {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}

.notification-link {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.notification-link:hover,
.notification-link:focus-visible,
.notification-link.active {
  border-color: #cfc9ff;
  background: #f5f3ff;
  color: var(--purple-dark);
}

.notification-link b {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.notification-label-short { display: none; }

.dashboard-notifications {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.dashboard-notifications article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #d6d1ff;
  border-left: 4px solid var(--purple);
  border-radius: 10px;
  padding: 12px 14px;
  background: #f8f7ff;
}

.dashboard-notifications article > div:first-child {
  display: grid;
  gap: 3px;
}

.dashboard-notifications span,
.notification-row-meta {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.dashboard-notifications p,
.notification-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.notification-center {
  display: grid;
  gap: 1px;
  overflow: hidden;
  padding: 0;
  background: var(--line);
}

.notification-row {
  display: flex;
  min-height: 96px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
  background: #fff;
}

.notification-row.is-unread {
  box-shadow: inset 4px 0 0 var(--purple);
  background: #faf9ff;
}

.notification-row h2 {
  margin: 5px 0 0;
  font-size: 16px;
}

.notification-row-meta {
  display: flex;
  gap: 10px;
}

.hr-tabs {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  scrollbar-width: thin;
}

.hr-tabs a {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  padding: 0 13px;
}

.hr-source-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -8px 0 16px;
  border-left: 3px solid var(--yellow);
  border-radius: 6px;
  padding: 8px 11px;
  background: #eef7ff;
  color: #33556f;
  font-size: 11px;
  line-height: 1.45;
}

.hr-source-note span { color: #5d7486; }

.hr-dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-kpis .kpi-link {
  color: inherit;
  text-decoration: none;
}

.hr-kpis .kpi-link:hover,
.hr-kpis .kpi-link:focus-visible {
  background: #faf9ff;
  outline: 2px solid #d6d1ff;
  outline-offset: -2px;
}

.hr-plan-toolbar form {
  display: grid;
  gap: 4px;
}

.hr-plan-toolbar label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.hr-plan-toolbar select {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.hr-month-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.hr-month-summary article {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface-muted);
}

.hr-month-summary span,
.hr-month-summary small {
  color: var(--muted);
  font-size: 10px;
}

.hr-month-summary strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.hr-year-table {
  min-width: 1420px;
  table-layout: fixed;
}

.hr-year-table th:first-child {
  width: 210px;
}

.hr-year-table td,
.hr-year-table th {
  padding: 8px 5px;
  vertical-align: top;
}

.hr-plan-cell {
  display: block;
  margin: 2px 0;
  border: 1px solid #e2bf78;
  border-radius: 5px;
  padding: 4px;
  background: #fff6df;
  color: #6d500d;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.hr-plan-cell.is-approved {
  border-color: #add6bf;
  background: #e8f6ee;
  color: #17623d;
}

.hr-plan-empty {
  color: #b4b8c0;
}

.hr-birthday-callout {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid #d9d3ff;
  border-radius: 10px;
  padding: 11px 15px;
  background: #f5f2ff;
  color: #3e317d;
}

.hr-birthday-callout > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hr-birthday-callout p {
  margin: 0 0 3px;
}

.hr-birthday-callout a {
  font-weight: 800;
  text-decoration: none;
}

.hr-birthday-callout > span {
  color: #655b8d;
  font-size: 11px;
}

.hr-birthday-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
}

.hr-calendar-legend-panel {
  padding: 14px 16px;
}

.hr-calendar-legend-panel .panel-head {
  margin-bottom: 10px;
}

.hr-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.hr-calendar-legend > span {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.hr-calendar-swatch {
  width: 18px;
  height: 10px;
  border: 1px solid transparent;
  border-radius: 3px;
}

.hr-calendar-swatch.is-plan,
.hr-calendar-event.is-plan {
  border-color: #d7aa48;
  background: #fff3cf;
  color: #61470c;
}

.hr-calendar-swatch.is-requested,
.hr-calendar-event.is-requested {
  border-color: #5eaa83;
  background: #fff;
  color: #17623d;
}

.hr-calendar-swatch.is-approved,
.hr-calendar-event.is-approved {
  border-color: #8bc9a7;
  background: #dff3e8;
  color: #145c39;
}

.hr-calendar-swatch.is-completed,
.hr-calendar-event.is-completed {
  border-color: #17623d;
  background: #23784e;
  color: #fff;
}

.hr-calendar-swatch.is-sick,
.hr-calendar-event.is-sick {
  border-color: #91bddb;
  background: #e4f3fd;
  color: #245e82;
}

.hr-calendar-swatch.is-day-off,
.hr-calendar-event.is-day-off {
  border-color: #d8a7b5;
  background: #fae9ef;
  color: #7d4052;
}

.hr-calendar-swatch.is-birthday,
.hr-calendar-event.is-birthday {
  border-color: #b9afea;
  background: #eeeafd;
  color: #4d3d94;
}

.hr-calendar-swatch.is-other,
.hr-calendar-event.is-other,
.hr-calendar-event.is-unpaid,
.hr-calendar-event.is-business-trip,
.hr-calendar-event.is-unavailable {
  border-color: #c9ccd3;
  background: #f1f2f4;
  color: #4f545e;
}

.hr-calendar-table-wrap {
  overscroll-behavior-x: contain;
}

.hr-year-table {
  min-width: 1560px;
}

.hr-year-table th:first-child {
  width: 190px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  box-shadow: 1px 0 var(--line);
}

.hr-year-table thead th:first-child {
  background: var(--surface-muted);
}

.hr-year-table th:first-child small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.hr-year-table th:nth-child(2),
.hr-year-table td:nth-child(2) {
  width: 78px;
}

.hr-calendar-days {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.hr-calendar-days strong,
.hr-calendar-days small {
  display: block;
}

.hr-calendar-days small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.hr-calendar-event {
  display: grid;
  gap: 2px;
  margin: 2px 0;
  border: 1px solid;
  border-radius: 5px;
  padding: 4px;
  font-size: 8px;
  line-height: 1.25;
}

.hr-calendar-event b {
  font-size: 8px;
}

.hr-calendar-event small {
  color: inherit;
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.hr-calendar-event em {
  border-radius: 3px;
  padding: 2px 3px;
  background: #b42318;
  color: #fff;
  font-size: 7px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.hr-calendar-event.has-conflict {
  outline: 2px solid #b42318;
  outline-offset: 1px;
}

.hr-plan-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hr-plan-actions form {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.hr-plan-actions input {
  width: 130px;
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 8px;
  font: inherit;
  font-size: 11px;
}

.checklist {
  display: grid;
  gap: 7px;
}

.checklist-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px 8px 8px;
  background: #fff;
}

.checklist-row button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--purple);
  cursor: pointer;
  font-size: 18px;
}

.checklist-row div {
  display: grid;
  gap: 3px;
}

.checklist-row span {
  color: var(--muted);
  font-size: 10px;
}

.checklist-row.is-done {
  background: #f5fbf7;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .app-header { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; height: 46px; order: 4; }
  .notification-link { justify-self: end; }
  .account-menu { justify-self: end; }
  .hr-month-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-header { grid-template-columns: minmax(0, 1fr) auto auto; }
  .notification-label-full { display: none; }
  .notification-label-short { display: inline; }
  .notification-link { min-width: 52px; justify-content: center; padding: 0 7px; }
  .notification-link b { position: absolute; top: -5px; right: -5px; }
  .dashboard-notifications article,
  .notification-row { align-items: stretch; flex-direction: column; }
  .dashboard-notifications .toolbar-actions,
  .notification-row .toolbar-actions { width: 100%; }
  .dashboard-notifications .toolbar-actions > *,
  .notification-row .toolbar-actions > * { flex: 1; }
  .hr-dashboard-grid { grid-template-columns: 1fr; }
  .hr-source-note { align-items: flex-start; flex-direction: column; }
  .hr-month-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hr-birthday-callout { align-items: flex-start; flex-direction: column; }
  .hr-calendar-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .notification-link { transition: none; }
}

/* HR forms and people registry */
.hr-form-page-head .page-subtitle {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hr-form-top-actions {
  flex-wrap: nowrap;
}

.hr-form-shell {
  display: grid;
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
}

.hr-form-sections {
  display: grid;
  gap: 14px;
}

.hr-form-section {
  overflow: hidden;
  padding: 0;
}

.hr-form-section-head {
  align-items: flex-start;
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 17px 20px 15px;
  background: var(--surface-muted);
}

.hr-form-section-head h2 {
  margin: 2px 0 0;
  font-size: 17px;
  letter-spacing: -.015em;
}

.hr-form-section-head p:last-child {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.hr-form-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  padding: 20px;
}

.hr-form-field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.hr-form-field-wide {
  grid-column: 1 / -1;
}

.hr-field-label {
  color: #50555f;
  font-size: 11px;
  font-weight: 800;
}

.hr-field-label b {
  margin-left: 3px;
  color: var(--red);
}

.hr-form-control {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

textarea.hr-form-control {
  min-height: 96px;
  resize: vertical;
}

input[type="file"].hr-form-control {
  min-height: 50px;
  padding: 10px;
  background: var(--surface-muted);
}

.hr-form-control:hover {
  border-color: #bcc1ca;
}

.hr-form-control:focus-visible {
  border-color: var(--purple);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(91, 72, 232, .13);
}

.hr-form-field.has-error .hr-form-control {
  border-color: var(--red);
  background: #fffafa;
}

.hr-field-help {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.hr-field-error {
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
}

.hr-checkbox-field > label {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-muted);
  cursor: pointer;
}

.hr-checkbox-control {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  accent-color: var(--purple);
}

.hr-checkbox-field label > span {
  display: grid;
  gap: 3px;
}

.hr-checkbox-field label strong {
  color: var(--ink);
  font-size: 12px;
}

.hr-checkbox-field label small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.hr-checkbox-field:focus-within > label {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(91, 72, 232, .13);
}

.hr-password-tools {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  gap: 12px 20px;
  border-top: 1px solid var(--line);
  padding: 15px 20px;
  background: #f7f6ff;
}

.hr-password-tools > div:first-child {
  display: grid;
  gap: 4px;
}

.hr-password-tools strong {
  font-size: 12px;
}

.hr-password-tools span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.hr-password-tools .ghost-button,
.hr-form-footer .ghost-button,
.hr-form-footer .primary-button {
  min-height: 44px;
}

.hr-password-tools button:disabled,
.hr-form-shell button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.hr-password-status {
  grid-column: 1 / -1;
  min-height: 15px;
  color: var(--green) !important;
  font-weight: 750;
}

.hr-form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px 15px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hr-form-footer > span {
  margin-right: auto;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.hr-payroll-shell {
  margin-top: 14px;
}

.hr-payroll-section {
  border-color: #dcd8ff;
}

.hr-current-file {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--surface-muted);
}

.hr-current-file span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.hr-current-file strong {
  min-width: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hr-people-panel {
  overflow: hidden;
  padding: 0;
}

.hr-people-scopes {
  display: flex;
  gap: 7px;
  margin-bottom: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.hr-people-scopes a {
  display: inline-flex;
  min-height: 44px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 13px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.hr-people-scopes a:hover,
.hr-people-scopes a:focus-visible {
  border-color: #bcb3f3;
  color: var(--purple);
}

.hr-people-scopes a:focus-visible {
  outline: 3px solid rgba(91, 72, 232, .18);
  outline-offset: 2px;
}

.hr-people-scopes a.active {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.hr-people-scopes span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(112, 116, 125, .12);
  font-variant-numeric: tabular-nums;
}

.hr-people-scopes a.active span {
  background: rgba(255, 255, 255, .18);
}

.hr-people-search {
  width: 320px;
  max-width: 420px;
  flex: 1 1 280px;
}

.hr-engagement-filter select {
  width: 210px;
  min-width: 210px;
}

.hr-department-filter select,
.hr-role-filter select {
  width: 190px;
  min-width: 190px;
}

.hr-work-location-filter select {
  width: 160px;
  min-width: 160px;
}

.hr-people-result-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.hr-people-table-wrap {
  border: 0;
  border-radius: 0;
}

.hr-people-table thead th {
  background: var(--surface-muted);
}

.hr-people-table td {
  vertical-align: middle;
}

.hr-people-department-row th {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  background: #f4f3f8;
  color: var(--ink);
  text-align: left;
}

.hr-people-department-row th,
.hr-people-department-row th span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hr-people-department-row th strong {
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
}

.hr-person-cell {
  display: grid;
  grid-template-columns: 38px minmax(150px, 1fr);
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.hr-person-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: #efedff;
  color: var(--purple);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}

.hr-person-cell > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.hr-person-cell strong {
  font-size: 12px;
}

.hr-person-cell small {
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hr-person-cell:hover strong {
  color: var(--purple);
}

.hr-table-stack {
  display: grid;
  justify-items: start;
  gap: 4px;
}

/* Employee profile */
.hr-employee-head {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hr-employee-avatar {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border-radius: 15px;
  background: var(--purple);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: .02em;
}

.hr-employee-heading {
  min-width: 0;
}

.hr-employee-heading .eyebrow {
  margin: 0 0 5px;
}

.hr-employee-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.hr-employee-title h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -.035em;
}

.hr-employee-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.hr-employee-meta a {
  color: var(--purple);
  text-decoration: none;
}

.hr-employee-actions > * {
  min-height: 44px;
}

.hr-employee-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hr-employee-summary article {
  display: grid;
  min-height: 112px;
  align-content: center;
  gap: 7px;
  border-right: 1px solid var(--line);
  padding: 16px;
}

.hr-employee-summary article:last-child {
  border-right: 0;
}

.hr-employee-summary span,
.hr-employee-summary small {
  color: var(--muted);
  font-size: 10px;
}

.hr-employee-summary span {
  font-weight: 800;
}

.hr-employee-summary strong {
  font-size: 16px;
  line-height: 1.3;
}

.hr-employee-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr);
  align-items: start;
  gap: 16px;
}

.hr-employee-main,
.hr-employee-aside {
  display: grid;
  gap: 16px;
}

.hr-profile-panel {
  overflow: hidden;
  padding: 0;
}

.hr-profile-panel > .panel-head {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 15px 17px;
}

.hr-profile-panel > .panel-head h2 {
  margin: 2px 0 0;
  font-size: 16px;
}

.hr-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-profile-grid > div {
  display: grid;
  min-height: 76px;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 17px;
}

.hr-profile-grid > div:nth-child(2n) {
  border-right: 0;
}

.hr-profile-grid span,
.hr-side-facts span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.hr-profile-grid strong,
.hr-side-facts strong {
  font-size: 12px;
  line-height: 1.45;
}

.hr-profile-grid .hr-profile-wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.hr-profile-grid p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
}

.hr-document-list .stack-row {
  align-items: center;
}

.hr-document-list .stack-row > div:first-child {
  display: grid;
  gap: 4px;
}

.hr-document-list small {
  font-size: 10px;
  line-height: 1.4;
}

.hr-document-type {
  width: fit-content;
  border-radius: 999px;
  padding: 3px 7px;
  background: #efedff;
  color: var(--purple);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hr-timeline {
  display: grid;
  padding: 2px 17px 16px;
}

.hr-timeline article {
  display: grid;
  grid-template-columns: 104px 12px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-height: 64px;
}

.hr-timeline time {
  padding-top: 17px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.hr-timeline article > span {
  position: relative;
  height: 100%;
  border-left: 1px solid var(--line-strong);
}

.hr-timeline article > span::before {
  position: absolute;
  top: 19px;
  left: -5px;
  width: 9px;
  height: 9px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 0 1px #cfc8ff;
  content: "";
}

.hr-timeline article > div {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.hr-timeline small {
  color: var(--purple);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hr-timeline strong {
  font-size: 11px;
  line-height: 1.4;
}

.hr-timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.hr-side-facts {
  display: grid;
}

.hr-side-facts > div {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding: 13px 15px;
}

.hr-side-facts > div:last-child {
  border-bottom: 0;
}

.client-requisites-panel {
  overflow: hidden;
  padding: 0;
}

.client-requisites-panel > .panel-head {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 15px 17px;
  background: var(--surface-muted);
}

.client-requisites-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-requisites-grid > div {
  display: grid;
  min-height: 86px;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line);
  padding: 13px 15px;
}

.client-requisites-grid > div:nth-child(4) {
  border-right: 0;
}

.client-requisites-grid span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.client-requisites-grid strong {
  font-size: 12px;
  line-height: 1.45;
}

.client-requisite-file {
  grid-column: 1 / -1;
  grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.5fr) auto;
  align-items: center;
  border-top: 1px solid var(--line);
  border-right: 0 !important;
}

.client-requisite-file a {
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.client-requisite-file small {
  color: var(--muted);
  font-size: 10px;
}

.hr-comment-panel,
.hr-actions-panel,
.hr-offboarding-panel,
.hr-offboarding-complete {
  overflow: hidden;
  padding: 0;
}

.hr-comment-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.hr-comment-list p {
  display: grid;
  gap: 5px;
  margin: 0;
}

.hr-comment-list p strong {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.hr-comment-list p span {
  font-size: 13px;
  line-height: 1.5;
}

.hr-comment-list .ghost-button {
  justify-self: start;
}

.hr-action-stack {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.hr-inline-form {
  display: grid;
  gap: 9px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.hr-inline-form > div:first-child {
  display: grid;
  gap: 3px;
}

.hr-inline-form > div:first-child strong {
  font-size: 12px;
}

.hr-inline-form > div:first-child span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.hr-inline-form > button {
  justify-self: start;
  min-height: 42px;
}

.hr-inline-form-danger {
  border-color: rgba(199, 53, 45, .22);
  background: #fffafa;
}

.hr-action-disclosure {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.hr-action-disclosure > summary {
  min-height: 44px;
  padding: 13px;
  cursor: pointer;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.hr-action-disclosure .hr-inline-form {
  margin: 0 10px 10px;
}

.hr-admin-correction {
  border-color: #edc3bf;
  background: #fffafa;
}

.hr-danger-disclosure {
  min-width: 170px;
}

.hr-danger-disclosure summary {
  min-height: 36px;
  cursor: pointer;
  color: var(--red);
  font-size: 10px;
  font-weight: 800;
}

.hr-danger-disclosure form {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.hr-danger-disclosure input {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 8px;
  font: inherit;
  font-size: 10px;
}

.hr-offboarding-panel > .checklist {
  padding: 14px;
}

.hr-offboarding-add-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(190px, .45fr) auto auto;
  align-items: end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px;
  background: var(--surface-muted);
}

.checklist-row.is-readonly button,
.checklist-row button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.hr-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, .55fr);
  align-items: start;
  gap: 16px;
}

.hr-offboarding-template-list {
  overflow: hidden;
  padding: 0;
}

.hr-template-create {
  position: sticky;
  top: 74px;
}

.hr-template-create form {
  display: grid;
  gap: 12px;
}

.hr-template-create .primary-button {
  width: 100%;
  justify-content: center;
}

.hr-offboarding-required {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  cursor: pointer;
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
}

.hr-offboarding-required input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.hr-offboarding-complete > .hr-inline-form {
  margin: 14px;
}

.status-pill.neutral {
  background: var(--surface-muted);
  color: var(--muted);
}

.table-secondary {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.hr-onboarding-table {
  table-layout: fixed;
  min-width: 900px;
}

.hr-onboarding-table th:nth-child(1) { width: 25%; }
.hr-onboarding-table th:nth-child(2) { width: 12%; }
.hr-onboarding-table th:nth-child(3) { width: 18%; }
.hr-onboarding-table th:nth-child(4) { width: 15%; }
.hr-onboarding-table th:nth-child(5) { width: 20%; }
.hr-onboarding-table th:nth-child(6) { width: 10%; }

.hr-progress-cell,
.hr-onboarding-progress {
  display: grid;
  gap: 6px;
}

.hr-progress-track {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #ebe8f3;
}

.hr-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--purple);
  transition: width .2s ease;
}

.hr-onboarding-summary {
  display: grid;
  grid-template-columns: minmax(130px, .35fr) minmax(240px, 1fr) minmax(160px, .4fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 18px;
  background: #fff;
}

.hr-onboarding-summary > div:not(.hr-onboarding-progress) {
  display: grid;
  gap: 3px;
}

.hr-onboarding-summary span,
.hr-onboarding-summary small {
  color: var(--muted);
  font-size: 10px;
}

.hr-onboarding-summary strong {
  font-size: 18px;
}

.hr-onboarding-panel {
  overflow: hidden;
  padding: 0;
}

.hr-onboarding-checklist {
  padding: 14px;
}

.hr-onboarding-checklist .checklist-row {
  align-items: start;
  padding: 12px;
}

.hr-onboarding-checklist .checklist-row p {
  margin: 2px 0 3px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.hr-checklist-title {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hr-onboarding-complete,
.hr-onboarding-employee-card,
.hr-onboarding-finished {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 17px 18px;
  background: #fff;
}

.hr-onboarding-employee-card {
  margin: 0 0 16px;
  border-left: 4px solid var(--purple);
}

.hr-onboarding-complete h2,
.hr-onboarding-employee-card h2,
.hr-onboarding-finished strong {
  margin: 2px 0;
  font-size: 15px;
}

.hr-onboarding-complete p,
.hr-onboarding-employee-card p,
.hr-onboarding-finished span {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.hr-onboarding-finished {
  border-color: #bfdcc8;
  background: #f5fbf7;
}

@media (prefers-reduced-motion: reduce) {
  .hr-progress-track > span { transition: none; }
}

@media (max-width: 800px) {
  .hr-form-page-head,
  .hr-form-page-head .hr-form-top-actions {
    align-items: stretch;
  }

  .hr-form-page-head {
    flex-direction: column;
  }

  .hr-form-page-head .hr-form-top-actions > * {
    flex: 1;
  }

  .hr-form-fields {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .hr-form-field-wide {
    grid-column: 1;
  }

  .hr-password-tools {
    grid-template-columns: 1fr;
    padding: 15px 16px;
  }

  .hr-password-tools .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hr-password-status {
    grid-column: 1;
  }

  .hr-people-filters {
    align-items: stretch;
  }

  .hr-people-search,
  .hr-engagement-filter,
  .hr-engagement-filter select,
  .hr-work-location-filter,
  .hr-work-location-filter select,
  .hr-department-filter,
  .hr-department-filter select,
  .hr-role-filter,
  .hr-role-filter select {
    width: 100%;
    max-width: none;
  }

  .hr-people-result-count {
    width: 100%;
    margin-left: 0;
  }

  .hr-offboarding-add-form {
    grid-template-columns: 1fr;
  }

  .hr-settings-layout {
    grid-template-columns: 1fr;
  }

  .hr-onboarding-summary {
    grid-template-columns: 1fr;
  }

  .hr-onboarding-complete,
  .hr-onboarding-employee-card,
  .hr-onboarding-finished {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-template-create {
    position: static;
  }

  .hr-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-form-footer > span {
    margin-right: 0;
  }

  .hr-employee-head {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 15px;
  }

  .hr-employee-avatar {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    font-size: 16px;
  }

  .hr-employee-actions {
    grid-column: 1 / -1;
  }

  .hr-employee-actions > * {
    flex: 1;
    justify-content: center;
  }

  .hr-employee-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-profile-grid,
  .client-requisites-grid {
    grid-template-columns: 1fr;
  }

  .hr-profile-grid > div,
  .hr-profile-grid > div:nth-child(2n),
  .client-requisites-grid > div,
  .client-requisites-grid > div:nth-child(4) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hr-profile-grid > div:last-child,
  .client-requisites-grid > div:last-child {
    border-bottom: 0;
  }

  .hr-employee-summary article {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .hr-employee-summary article:nth-child(2n) {
    border-right: 0;
  }

  .hr-employee-summary article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .hr-employee-layout {
    grid-template-columns: 1fr;
  }

  .hr-profile-grid .hr-profile-wide {
    grid-column: 1;
  }

  .hr-timeline article {
    grid-template-columns: 78px 10px minmax(0, 1fr);
  }

  .client-requisite-file {
    grid-column: 1;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .hr-employee-summary {
    grid-template-columns: 1fr;
  }

  .hr-employee-summary article,
  .hr-employee-summary article:nth-child(2n),
  .hr-employee-summary article:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hr-employee-summary article:last-child {
    border-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hr-form-control {
    transition: none;
  }
}

/* Service editor tabs and financial states */
.service-form-tabs {
  position: sticky;
  z-index: 9;
  top: 58px;
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 18px rgba(22, 27, 38, .08);
  overflow-x: auto;
  scrollbar-width: thin;
  backdrop-filter: blur(10px);
}

.service-form-tabs button {
  min-height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  transition: background-color 160ms ease, color 160ms ease;
}

.service-form-tabs button:hover {
  background: var(--surface-muted);
  color: var(--ink);
}

.service-form-tabs button:focus-visible {
  outline: 3px solid rgba(91, 72, 232, .18);
  outline-offset: -2px;
}

.service-form-tabs button.active {
  background: var(--purple);
  color: #fff;
}

.service-form-actions-real[hidden] {
  display: none;
}

.service-meta-line .service-contract-file-missing,
.service-contract-file-note {
  color: var(--red);
}

.service-contract-file-note {
  margin-left: 4px;
  font-size: 9px;
  font-weight: 750;
}

.service-expense-template-table {
  min-width: 1120px;
}

.service-expense-template-table th:nth-child(1) { width: 18%; }
.service-expense-template-table th:nth-child(2) { width: 13%; }
.service-expense-template-table th:nth-child(3) { width: 15%; }
.service-expense-template-table th:nth-child(4) { width: 12%; }
.service-expense-template-table th:nth-child(5) { width: 11%; }
.service-expense-template-table th:nth-child(6) { width: 23%; }
.service-expense-template-table th:nth-child(7) { width: 8%; }
.service-expense-recipient {
  min-width: 230px;
}
.service-expense-recipient > div {
  margin-top: 6px;
}

@media (max-width: 720px) {
  .service-form-tabs {
    top: 54px;
    margin-right: -12px;
    margin-left: -12px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .service-form-tabs button {
    transition: none;
  }
}

/* Service editor: catalog-driven parameters, separated budgets and compact documents. */
.service-parameter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
  background: #fbfcfd;
}

.service-field-card {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.service-field-card-step {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
}

.service-field-step {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: #eeecff;
  color: var(--purple);
  font-size: 10px;
  font-weight: 900;
}

.service-field-card > div,
.service-field-card-step > div {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.service-field-card label,
.service-contract-card label,
.service-documents-card label,
.service-budget-groups label {
  color: #50555f;
  font-size: 10px;
  font-weight: 750;
}

.service-field-card input:not([type="color"], [type="hidden"]),
.service-field-card select,
.service-field-card textarea,
.service-contract-card input:not([type="checkbox"]),
.service-contract-card select,
.service-documents-card input:not([type="checkbox"]),
.service-documents-card select,
.service-documents-card textarea,
.service-budget-groups input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.service-field-card textarea {
  min-height: 82px;
  resize: vertical;
}

.service-field-card small,
.service-contract-card small,
.service-documents-card small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  line-height: 1.45;
}

.service-field-wide {
  grid-column: 1 / -1;
}

.service-color-field {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.service-color-control {
  display: grid;
  grid-template-columns: 42px 76px auto;
  min-height: 40px;
  align-items: center;
  gap: 8px;
}

.service-color-control input[type="color"] {
  width: 42px;
  height: 40px;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 3px;
  background: #fff;
  cursor: pointer;
}

.service-color-control > span {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.text-button {
  min-height: 36px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--purple);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  text-align: left;
}

.service-catalog-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.service-budget-groups {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #f8f9fb;
}

.service-budget-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.service-budget-card[hidden] {
  display: none;
}

.service-budget-card > header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
}

.service-budget-card h3,
.service-contract-card h3,
.service-documents-card h3 {
  margin: 0;
  font-size: 13px;
}

.service-budget-card p,
.service-contract-card header p,
.service-documents-card header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.service-budget-badge {
  display: grid;
  width: 42px;
  height: 38px;
  place-items: center;
  border-radius: 7px;
  background: var(--purple);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}

.service-budget-badge-ad {
  background: #eaf3ff;
  color: #2864a8;
}

.service-budget-badge-ops {
  background: #edf7f1;
  color: #24734a;
}

.service-budget-card-primary {
  border-color: #d8d3ff;
  box-shadow: inset 4px 0 0 var(--purple);
}

.service-money-field {
  display: grid;
  grid-template-columns: minmax(180px, 360px);
  gap: 6px;
  padding: 15px;
}

.service-money-field > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
}

.service-money-field > div input {
  min-height: 42px;
  border: 0;
  font-size: 16px;
  font-weight: 800;
}

.service-money-field > div b {
  color: var(--muted);
  font-size: 12px;
}

.service-budget-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 15px;
}

.service-budget-fields > div {
  display: grid;
  gap: 6px;
}

.service-document-layout {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #f8f9fb;
}

.service-contract-card,
.service-documents-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.service-contract-card > header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
}

.service-document-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 7px;
  background: #eeecff;
  color: var(--purple);
  font-size: 9px;
  font-weight: 900;
}

.service-contract-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 12px;
  padding: 15px;
}

.service-contract-grid > div,
.service-file-field,
.service-document-form > div {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 6px;
}

.service-file-field {
  border-top: 1px solid var(--line);
  padding: 15px;
}

.service-file-field > input[type="file"],
.service-document-upload > input[type="file"] {
  min-height: 44px;
  border-style: dashed;
  background: #fafaff;
}

.service-file-field input[type="file"]::file-selector-button,
.service-document-upload input[type="file"]::file-selector-button {
  min-height: 32px;
  margin-right: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 11px;
  background: #eeecff;
  color: var(--purple);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
}

.service-current-file {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  max-width: 620px;
  border: 1px solid #ddd8ff;
  border-radius: 7px;
  padding: 9px;
  background: #faf9ff;
}

.service-current-file > span {
  display: grid;
  width: 38px;
  height: 42px;
  place-items: center;
  border-radius: 6px;
  background: var(--purple);
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}

.service-current-file > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.service-current-file strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-current-file a,
.service-document-upload > a {
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.service-file-clear,
.service-document-delete {
  display: inline-flex !important;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  color: var(--red) !important;
  cursor: pointer;
  font-size: 10px !important;
  font-weight: 750 !important;
}

.service-file-clear input,
.service-document-delete input {
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  padding: 0 !important;
  accent-color: var(--red);
}

.service-documents-card > header {
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.service-document-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.service-document-form {
  display: grid;
  grid-template-columns: 1.15fr 1.6fr .8fr 1fr 1fr;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.service-document-type select {
  min-width: 190px;
  font-size: 12px;
}

.service-document-upload,
.service-document-description {
  grid-column: span 2;
}

.service-document-description textarea {
  min-height: 70px;
  resize: vertical;
}

.service-document-delete {
  align-self: end;
  justify-self: end;
}

.service-file-field {
  gap: 7px;
  padding-block: 11px;
}

.prototype-form > [hidden] {
  display: none !important;
}

.service-file-compact {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 6px 5px 10px;
  background: #fbfcfd;
}

.service-file-extension {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  border-radius: 5px;
  background: #eeecff;
  color: var(--purple);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.service-file-compact > strong {
  overflow: hidden;
  min-width: 80px;
  flex: 1 1 220px;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-file-empty {
  min-width: 110px;
  flex: 1 1 220px;
  color: var(--muted);
  font-size: 11px;
}

.service-file-compact > a {
  color: var(--purple);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}

.service-file-pick {
  display: inline-flex !important;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd8ff;
  border-radius: 6px;
  padding: 0 11px;
  background: #f3f1ff;
  color: var(--purple) !important;
  cursor: pointer;
  font-size: 10px !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

.service-file-pick:hover {
  border-color: var(--purple);
  background: #eeebff;
}

.service-file-pick:focus-within,
.service-file-pick:has(+ .service-file-selected:not(:empty)) {
  border-color: var(--purple);
}

.service-file-selected {
  overflow: hidden;
  max-width: 170px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.service-file-selected:empty {
  display: none;
}

.service-file-input-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.service-file-compact .service-file-clear {
  min-height: 34px;
  margin-left: 2px;
  padding-inline: 5px;
  white-space: nowrap;
}

.service-documents-disclosure > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  color: var(--purple);
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  list-style: none;
}

.service-documents-disclosure > summary::-webkit-details-marker {
  display: none;
}

.service-documents-disclosure > summary::before {
  content: "+";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 5px;
  background: #eeecff;
  font-size: 16px;
  line-height: 1;
}

.service-documents-disclosure[open] > summary::before {
  content: "−";
}

.service-documents-disclosure-body {
  border-top: 1px solid var(--line);
}

.service-documents-disclosure-body > p {
  margin: 0;
  padding: 12px 14px 0;
  color: var(--muted);
  font-size: 11px;
}

.goals-table {
  min-width: 1450px;
  table-layout: fixed;
}

.goals-table .goal-name-column {
  width: 270px;
}

.goals-table .goal-priority-column {
  width: 80px;
}

.goals-table .goal-check-column {
  width: 58px;
  padding-right: 7px;
  padding-left: 7px;
  text-align: center;
}

.goals-table th.goal-priority-column,
.goals-table th.goal-check-column {
  overflow: hidden;
  white-space: normal;
}

.goals-table th.goal-check-column abbr {
  border: 0;
  text-decoration: none;
}

.goals-table .goal-table-checkbox {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
  cursor: pointer;
}

.goals-table .goal-table-checkbox input {
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0;
  padding: 0 !important;
  accent-color: var(--purple);
}

.goals-table .goal-table-delete input {
  accent-color: var(--red);
}

.service-metric-configuration {
  display: grid;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 18px;
  background: #f8f9fb;
}

.service-metric-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.service-metric-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
}

.service-metric-card-head h3,
.service-metric-card-head p {
  margin: 0;
}

.service-metric-card-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.service-standard-metric-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.service-standard-metric-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  cursor: pointer;
}

.service-standard-metric-row:last-child {
  border-bottom: 0;
}

.service-standard-metric-row > input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
}

.service-standard-metric-row span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.service-standard-metric-row small {
  color: var(--muted);
}

.service-metric-empty {
  border-top: 1px solid var(--line);
  padding: 18px 16px;
  color: var(--muted);
  font-size: 12px;
}

.service-custom-metric-table {
  min-width: 1100px;
}

.service-custom-metric-table .goal-table-checkbox {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
}

.service-custom-metric-table .goal-table-checkbox input {
  width: 16px !important;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0;
  padding: 0 !important;
  accent-color: var(--purple);
}

.invoice-payment-link {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  margin-left: 10px;
  color: var(--green) !important;
  font-weight: 800;
  white-space: nowrap;
}

.entity-page-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.payment-entry-form { display: grid; gap: 16px; }
.payment-receipt-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.15fr) minmax(220px, 1fr) minmax(170px, .7fr);
  gap: 14px;
  padding: 18px;
}
.payment-receipt-grid label,
.payment-allocation-grid label {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #50555f;
  font-size: 10px;
  font-weight: 750;
}
.payment-receipt-grid label > span,
.payment-allocation-grid label > span { color: var(--ink); font-size: 11px; }
.payment-receipt-grid input,
.payment-receipt-grid select,
.payment-receipt-grid textarea,
.payment-allocation-grid input {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  padding: 10px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.payment-receipt-grid input:focus,
.payment-receipt-grid select:focus,
.payment-receipt-grid textarea:focus,
.payment-allocation-grid input:focus {
  border-color: var(--purple);
  outline: 3px solid rgba(91,72,232,.1);
}
.payment-receipt-grid small,
.payment-allocation-grid small { color: var(--muted); font-size: 10px; font-weight: 500; line-height: 1.45; }
.payment-amount-primary {
  grid-row: span 2;
  padding: 16px;
  border: 1px solid #d9d4ff;
  border-radius: 10px;
  background: #f8f7ff;
}
.payment-amount-primary > span { color: var(--purple) !important; font-size: 12px !important; }
.payment-amount-primary input {
  min-height: 58px;
  border-color: #a99df4;
  font-size: 24px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.payment-invoice-field select { min-height: 58px; }
.payment-comment-field { grid-column: 2 / -1; }
.payment-comment-field textarea { min-height: 74px; resize: vertical; }
.payment-allocation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px;
}
.payment-allocation-grid label {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfd;
}
.payment-allocation-grid label[hidden] { display: none; }
.payment-allocation-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8f9fb;
  overflow: hidden;
}
.payment-allocation-summary > div {
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
}
.payment-allocation-summary > div:nth-child(3) { border-right: 0; }
.payment-allocation-summary span { color: var(--muted); font-size: 10px; }
.payment-allocation-summary strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.payment-allocation-summary p {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.payment-allocation-summary.is-balanced p { background: #edf8f1; color: var(--green); }
.payment-allocation-summary.has-remainder p { background: #fff8e6; color: #8a6300; }
.payment-allocation-summary.is-over p { background: #fff0ef; color: var(--red); }
.payment-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  background: #f8f9fb;
}

@media (max-width: 900px) {
  .payment-receipt-grid { grid-template-columns: 1fr 1fr; }
  .payment-amount-primary { grid-row: auto; }
  .payment-invoice-field,
  .payment-comment-field { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .entity-page-head-actions { align-items: stretch; flex-direction: column; }
  .payment-receipt-grid,
  .payment-allocation-grid,
  .payment-allocation-summary { grid-template-columns: 1fr; }
  .payment-invoice-field,
  .payment-comment-field { grid-column: 1; }
  .payment-allocation-summary > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .payment-allocation-summary p { grid-column: 1; }
  .payment-form-actions { align-items: stretch; flex-direction: column-reverse; }
  .payment-form-actions > * { justify-content: center; width: 100%; }
}

.service-form-error-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.service-form-error-sections span {
  border-radius: 999px;
  padding: 5px 8px;
  background: #fff0ef;
  color: var(--red);
  font-size: 9px;
  font-weight: 800;
}

.service-form-section-real .compact-table tr.form-row-has-errors > td {
  background: #fff9f8;
}

.service-form-section-real .compact-table tr.form-row-has-errors td:has(.errorlist) input,
.service-form-section-real .compact-table tr.form-row-has-errors td:has(.errorlist) select,
.service-form-section-real .compact-table tr.form-row-has-errors td:has(.errorlist) textarea {
  border-color: #e9a9a4;
}

@media (max-width: 900px) {
  .service-budget-fields,
  .service-contract-grid {
    grid-template-columns: 1fr;
  }

  .service-document-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .service-metric-configuration {
    padding: 12px;
  }

  .service-metric-card-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .service-metric-card-head .ghost-button {
    min-height: 44px;
  }

  .service-standard-metric-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .service-standard-metric-row .status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .service-parameter-grid,
  .service-document-form {
    grid-template-columns: 1fr;
  }

  .service-field-wide,
  .service-document-upload,
  .service-document-description {
    grid-column: 1;
  }

  .service-color-field {
    grid-template-columns: 1fr;
  }

  .service-current-file {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .service-current-file > a {
    grid-column: 1 / -1;
  }

  .service-file-compact {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .service-file-compact > strong,
  .service-file-empty {
    width: calc(100% - 42px);
    flex-basis: calc(100% - 42px);
    padding-top: 8px;
  }
}

/* Finance category manager */
.finance-category-manager {
  scroll-margin-top: 76px;
  overflow: hidden;
  padding: 0;
}

.finance-category-manager > .finance-panel-head {
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.finance-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px 18px;
  background: var(--surface-muted);
}

.finance-category-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.finance-category-card.is-inactive {
  opacity: .62;
}

.finance-category-card > header {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 13px 14px;
}

.finance-category-card > header div {
  display: grid;
  gap: 3px;
}

.finance-category-card > header span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.finance-category-card h3 {
  margin: 0;
  font-size: 15px;
}

.finance-category-card a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.finance-category-articles {
  display: grid;
}

.finance-category-articles > div {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
}

.finance-category-articles > div + div {
  border-top: 1px solid var(--line);
}

.finance-category-articles > div.is-inactive {
  background: var(--surface-muted);
  color: var(--muted);
}

.finance-category-articles > div > span {
  display: grid;
  gap: 3px;
}

.finance-category-articles strong {
  font-size: 12px;
}

.finance-category-articles small {
  color: var(--muted);
  font-size: 9px;
}

.finance-category-articles > p {
  margin: 0;
  padding: 18px 14px;
  color: var(--muted);
  font-size: 11px;
}

.finance-category-card > footer {
  border-top: 1px solid var(--line);
  padding: 6px 14px;
  background: #fbfbfd;
}

/* Notification center */
.notification-page-head > div > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
}

.notification-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 10px;
  margin-bottom: 12px;
}

.notification-summary article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  background: #fff;
}

.notification-summary span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.notification-summary strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.notification-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
  background: #fff;
  overflow-x: auto;
}

.notification-filter-groups { margin-bottom: 12px; }
.notification-filter-groups .notification-filters { margin-bottom: 6px; }
.notification-category-filters { scrollbar-width: thin; }
.notification-category-filters a { flex: 0 0 auto; }

.notification-filters a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.notification-filters a.active {
  background: var(--purple);
  color: #fff;
}

.notification-filters a span {
  display: grid;
  min-width: 22px;
  min-height: 22px;
  place-items: center;
  border-radius: 999px;
  background: rgba(125, 125, 145, .12);
  font-size: 9px;
}

.notification-filters a.active span {
  background: rgba(255, 255, 255, .2);
}

.knowledge-section-tabs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.notification-center {
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.notification-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 118px;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
}

.notification-row.is-unread {
  box-shadow: inset 4px 0 0 var(--purple);
}

.notification-kind-marker {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 9px;
  background: #eff1f5;
  color: #4f5665;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.notification-kind-marker.tone-leave,
.notification-kind-marker.tone-hr {
  background: #edf7f1;
  color: #24734a;
}

.notification-kind-marker.tone-finance {
  background: #fff5dd;
  color: #8a6200;
}

.notification-kind-marker.tone-client {
  background: #efedff;
  color: var(--purple);
}

.notification-kind-marker.tone-task {
  background: #eeefff;
  color: #4e42c9;
}

.notification-row-content {
  min-width: 0;
}

.notification-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.notification-row-meta .notification-kind {
  color: var(--purple);
}

.notification-row h2 {
  margin: 7px 0 0;
  font-size: 15px;
}

.notification-row p {
  max-width: 760px;
  margin-top: 5px;
}

.notification-read-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.notification-read-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--purple);
}

.notification-row-actions {
  display: grid;
  min-width: 168px;
  gap: 7px;
}

.notification-row-actions > *,
.notification-row-actions button,
.notification-row-actions a {
  width: 100%;
  justify-content: center;
}

.notification-empty {
  display: grid;
  gap: 6px;
  padding: 44px 20px;
  background: #fff;
  text-align: center;
}

.notification-empty span {
  color: var(--muted);
  font-size: 11px;
}

/* Leave request detail */
.hr-leave-page-head {
  align-items: flex-end;
}

.hr-leave-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hr-leave-period span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #efedff;
  color: var(--purple);
  font-size: 10px;
  font-weight: 850;
}

.hr-leave-kpis article {
  min-height: 112px;
}

.hr-leave-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow);
}

.hr-leave-kpis article {
  display: grid;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line);
  padding: 16px;
}

.hr-leave-kpis article:last-child {
  border-right: 0;
}

.hr-leave-kpis article > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.hr-leave-kpis article > strong {
  font-size: 15px;
  line-height: 1.25;
}

.hr-leave-kpis article small {
  color: var(--muted);
  font-size: 9px;
}

.hr-leave-document {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid #dcd8ff;
  border-radius: 9px;
  padding: 12px;
  background: #faf9ff;
}

.hr-leave-document.is-empty {
  border-color: var(--line);
  background: var(--surface-muted);
}

.hr-leave-document.is-missing {
  border-color: #f2c7c2;
  background: #fff7f6;
}

.hr-leave-document-mark {
  display: grid;
  width: 46px;
  height: 52px;
  place-items: center;
  border-radius: 7px;
  background: var(--purple);
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}

.hr-leave-document.is-empty .hr-leave-document-mark {
  background: #d8dbe2;
  color: #687080;
}

.hr-leave-document.is-missing .hr-leave-document-mark {
  background: var(--danger);
}

.hr-leave-document > div {
  display: grid;
  gap: 4px;
}

.hr-leave-document > div > strong {
  color: var(--ink);
  font-size: 12px;
  text-transform: none;
}

.hr-leave-document > div > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .finance-category-grid {
    grid-template-columns: 1fr;
  }

  .notification-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .notification-row-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
  }

  .hr-leave-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-leave-kpis article {
    border-bottom: 1px solid var(--line);
  }

  .hr-leave-kpis article:nth-child(2n) {
    border-right: 0;
  }

  .hr-leave-kpis article:nth-last-child(-n + 2) {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .notification-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notification-row {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 14px 12px;
  }

  .notification-kind-marker {
    width: 36px;
    height: 36px;
  }

  .notification-row-actions {
    grid-template-columns: 1fr;
  }

  .hr-leave-document {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .hr-leave-document-mark {
    width: 42px;
    height: 48px;
  }

  .hr-leave-document .primary-button {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
  }

  .hr-leave-kpis {
    grid-template-columns: 1fr;
  }

  .hr-leave-kpis article,
  .hr-leave-kpis article:nth-child(2n),
  .hr-leave-kpis article:nth-last-child(-n + 2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hr-leave-kpis article:last-child {
    border-bottom: 0;
  }
}
.pulse-page-head .page-lead {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.management-pulse {
  margin: 0 0 20px;
  border: 1px solid #d9dce9;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.management-pulse-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px 16px;
}
.management-pulse-head h2 { margin: 2px 0 5px; font-size: 25px; letter-spacing: -.035em; }
.management-pulse-head p:last-child { max-width: 700px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pulse-period-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f4f5f8;
}
.pulse-period-switcher a {
  display: inline-flex;
  min-width: 84px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 7px;
  color: #565b67;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}
.pulse-period-switcher a:hover { color: var(--ink); background: #fff; }
.pulse-period-switcher a.active { background: #171925; color: #fff; box-shadow: 0 2px 8px rgba(18, 21, 33, .16); }
.pulse-period-switcher a:focus-visible,
.management-pulse-open:focus-visible,
.management-pulse-categories a:focus-visible,
.pulse-summary-grid a:focus-visible { outline: 3px solid rgba(98, 74, 217, .28); outline-offset: 2px; }
.management-pulse-overview {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  align-items: stretch;
  margin: 0 14px 14px;
  border: 1px solid #f1c9c4;
  border-radius: 11px;
  background: linear-gradient(105deg, #fff4f1 0%, #fff 56%);
  overflow: hidden;
}
.management-pulse-overview.is-calm { border-color: #bee2d2; background: linear-gradient(105deg, #edf9f3 0%, #fff 56%); }
.management-pulse-total { display: grid; align-content: center; padding: 16px 18px; border-right: 1px solid rgba(0,0,0,.06); }
.management-pulse-total span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.management-pulse-total strong { margin: 4px 0 1px; color: var(--red); font-size: 32px; line-height: 1; }
.management-pulse-overview.is-calm .management-pulse-total strong { color: var(--green); }
.management-pulse-total small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.management-pulse-focus { display: grid; align-content: center; gap: 5px; padding: 14px 18px; }
.management-pulse-focus > strong { font-size: 13px; }
.management-pulse-focus > span { color: var(--muted); font-size: 10px; }
.management-pulse-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.management-pulse-tags span { padding: 4px 7px; border-radius: 5px; background: #f1f2f5; color: #505560; font-size: 9px; font-weight: 750; }
.management-pulse-tags .tone-danger { background: #ffebe8; color: var(--red); }
.management-pulse-tags .tone-warning { background: #fff3d8; color: #895b00; }
.management-pulse-tags .tone-good { background: #e7f6ed; color: var(--green); }
.management-pulse-open { display: inline-flex; min-width: 150px; min-height: 52px; align-items: center; justify-content: center; gap: 8px; margin: 14px; padding: 0 16px; border-radius: 8px; background: #171925; color: #fff; font-size: 10px; font-weight: 850; text-decoration: none; }
.management-pulse-open:hover { background: #2b2e3b; }
.management-pulse-categories { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.management-pulse-categories a { display: grid; min-width: 0; min-height: 76px; align-content: space-between; gap: 8px; padding: 12px; border-right: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.management-pulse-categories a:last-child { border-right: 0; }
.management-pulse-categories a:hover { background: #fafaff; }
.management-pulse-categories span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.management-pulse-categories strong { font-size: 19px; }
.management-pulse-categories .tone-danger strong { color: var(--red); }
.management-pulse-categories .tone-warning strong { color: #a46b00; }
.pulse-period-switcher-page { width: fit-content; margin: 0 0 14px; }
.pulse-range-label { margin: 7px 0 0; color: var(--muted); font-size: 10px; font-weight: 750; }
.pulse-summary-hero {
  display: grid;
  grid-template-columns: minmax(250px, .55fr) minmax(440px, 1.45fr);
  gap: 24px;
  margin: 0 0 16px;
  padding: 20px;
  border: 1px solid #f1c9c4;
  border-radius: 12px;
  background: linear-gradient(105deg, #fff2ef, #fff 46%);
  box-shadow: var(--shadow);
}
.pulse-summary-hero.is-calm { border-color: #bee2d2; background: linear-gradient(105deg, #edf9f3, #fff 46%); }
.pulse-summary-hero h2 { margin: 3px 0 7px; font-size: 22px; letter-spacing: -.03em; }
.pulse-summary-hero p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.pulse-summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.pulse-summary-grid a { display: grid; min-height: 67px; align-content: space-between; gap: 8px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.82); color: var(--ink); text-decoration: none; }
.pulse-summary-grid a:hover { border-color: var(--line-strong); background: #fff; }
.pulse-summary-grid span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.pulse-summary-grid strong { font-size: 18px; }
.pulse-summary-grid .tone-danger strong { color: var(--red); }
.pulse-summary-grid .tone-warning strong { color: #a46b00; }

.pulse-priority-stack {
  display: grid;
  gap: 16px;
}

.pulse-panel {
  overflow: hidden;
  scroll-margin-top: 84px;
}

.pulse-panel-critical {
  border-color: color-mix(in srgb, var(--red) 34%, var(--line));
}

.pulse-count {
  display: inline-grid;
  min-width: 36px;
  min-height: 36px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pulse-count-danger {
  background: color-mix(in srgb, var(--red) 12%, white);
  color: var(--red);
}

.pulse-row-list,
.pulse-compact-list {
  display: grid;
  gap: 8px;
}

.pulse-risk-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) minmax(150px, .7fr) minmax(150px, .7fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: inherit;
  text-decoration: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.pulse-risk-row:hover,
.pulse-risk-row:focus-visible,
.pulse-compact-list a:hover,
.pulse-compact-list a:focus-visible {
  border-color: var(--purple);
  background: color-mix(in srgb, var(--purple) 4%, white);
}

.pulse-risk-row > span,
.pulse-table td > span,
.pulse-table td > strong {
  display: block;
}

.pulse-risk-row small,
.pulse-table td > span,
.pulse-compact-list small {
  margin-top: 3px;
  color: var(--muted);
}

.pulse-row-main {
  min-width: 0;
}

.pulse-row-main strong,
.pulse-row-main small {
  display: block;
}

.pulse-row-action {
  color: var(--purple);
  font-weight: 700;
  white-space: nowrap;
}

.pulse-rule-note {
  margin: -4px 0 14px;
  color: var(--muted);
  font-size: 14px;
}

.pulse-table {
  min-width: 820px;
}

.pulse-table td {
  vertical-align: top;
}

.pulse-trend-values {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.pulse-trend-values span {
  display: grid;
  gap: 2px;
}

.pulse-trend-values i {
  color: var(--red);
  font-style: normal;
}

.pulse-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pulse-compact-list a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
  transition: border-color 180ms ease, background-color 180ms ease;
}

.pulse-compact-list a > span:first-child {
  display: grid;
}

.pulse-compact-list a > span:last-child {
  color: var(--purple);
  font-weight: 700;
  text-align: right;
}

.pulse-empty-good {
  color: var(--green);
}

@media (max-width: 900px) {
  .management-pulse-head { align-items: stretch; flex-direction: column; padding: 17px 16px 13px; }
  .pulse-period-switcher { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .pulse-period-switcher a { min-width: 0; padding: 0 8px; }
  .management-pulse-overview { grid-template-columns: 105px minmax(0, 1fr); }
  .management-pulse-open { grid-column: 1 / -1; margin-top: 0; }
  .management-pulse-categories { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .management-pulse-categories a { border-bottom: 1px solid var(--line); }
  .management-pulse-categories a:nth-child(4n) { border-right: 0; }
  .pulse-period-switcher-page { width: 100%; }
  .pulse-summary-hero { grid-template-columns: 1fr; gap: 15px; padding: 16px; }
  .pulse-risk-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .pulse-risk-row > span:nth-child(3) {
    grid-column: 1;
  }

  .pulse-row-action {
    grid-column: 2;
    grid-row: 2;
  }

  .pulse-two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .management-pulse-overview { grid-template-columns: 1fr; }
  .management-pulse-total { border-right: 0; border-bottom: 1px solid rgba(0,0,0,.06); }
  .management-pulse-total strong { font-size: 28px; }
  .management-pulse-categories { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-pulse-categories a:nth-child(4n) { border-right: 1px solid var(--line); }
  .management-pulse-categories a:nth-child(2n) { border-right: 0; }
  .pulse-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pulse-risk-row {
    grid-template-columns: 1fr;
  }

  .pulse-row-action,
  .pulse-risk-row > span:nth-child(3) {
    grid-column: 1;
    grid-row: auto;
  }

  .pulse-compact-list a {
    align-items: flex-start;
  }
}

/* Invoice request workflow and advertising-platform directory */
.invoice-period-group {
  grid-column: 1 / -1;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fafafd;
}

.invoice-period-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.invoice-period-group legend {
  padding: 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.form-field-full {
  grid-column: 1 / -1;
}

.invoice-total-card {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #dcd7ff;
  border-radius: 9px;
  background: #f6f4ff;
}

.invoice-total-card span,
.invoice-total-card small {
  color: var(--muted);
  font-size: 10px;
}

.invoice-total-card strong {
  color: var(--ink);
  font-size: 19px;
}

.finance-panel-actions,
.invoice-file-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.compact-directory-form {
  max-width: 900px;
}

.compact-action {
  min-height: 32px;
  padding: 6px 10px;
}

@media (max-width: 680px) {
  .invoice-period-fields {
    grid-template-columns: 1fr;
  }

  .finance-panel-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .finance-panel-actions a {
    justify-content: center;
  }
}

.management-overview-section {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.management-overview-section > .panel-head {
  padding: 0 2px;
}

.management-overview-section a:focus-visible {
  border-radius: 4px;
  outline: 3px solid rgba(98, 74, 217, .28);
  outline-offset: 2px;
}

.management-overview-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.management-overview-cards .kpi {
  min-width: 0;
}

.management-overview-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.management-overview-placeholder {
  min-height: 120px;
  align-content: center;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
}

@media (max-width: 1100px) {
  .management-overview-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .management-overview-tables {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .management-overview-cards {
    grid-template-columns: 1fr;
  }
}

/* Release clarity and invoice basis — v0.25.1 */
.brand-wrap {
  min-width: 0;
}

.release-quick-tools,
.version-signature {
  display: inline-flex;
  min-width: 0;
  align-items: center;
}

.release-quick-tools {
  gap: 5px;
}

.version-signature {
  min-height: 36px;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 8px;
  background: var(--panel);
  color: var(--muted);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.version-signature strong {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

a.version-signature:hover,
a.version-signature:focus-visible {
  border-color: #cfc9ff;
  background: #f5f3ff;
  color: var(--purple-dark);
  outline: none;
}

.version-signature-static {
  cursor: default;
}

.feedback-header-tool {
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 2px;
}

.problem-report-link,
.tm-production .problem-report-link {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid #efd1ce;
  border-radius: 8px;
  background: #fff7f6;
  color: var(--red);
  text-decoration: none;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.problem-report-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.problem-report-link .problem-report-dot {
  fill: currentColor;
  stroke: none;
}

.feedback-header-counters {
  display: flex;
  min-height: 12px;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.feedback-header-counter {
  min-width: 9px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  text-decoration: none;
}

.feedback-header-counter.is-new { color: var(--red); }
.feedback-header-counter.is-active { color: #946200; }
.feedback-header-counter.is-resolved { color: var(--green); }
.feedback-header-counter.is-empty { opacity: .48; }
.feedback-header-counter:hover,
.feedback-header-counter:focus-visible {
  border-radius: 2px;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.feedback-header-counter strong { font: inherit; }

.problem-report-link:hover,
.problem-report-link:focus-visible {
  border-color: var(--red);
  background: #fff0ef;
  outline: 3px solid rgba(199, 53, 45, 0.14);
  outline-offset: 1px;
  transform: translateY(-1px);
}

.release-history-panel {
  padding: 0;
  overflow: hidden;
}

.release-current-head {
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #fbfaff, #f7f8fb);
}

.release-current-head h2 {
  max-width: 760px;
  line-height: 1.35;
}

.release-history-panel .version-list {
  gap: 0;
}

.release-history-panel .version-card {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  padding: 20px;
  box-shadow: none;
}

.release-history-panel .version-card:last-child {
  border-bottom: 0;
}

.release-history-panel .version-card-current {
  box-shadow: inset 3px 0 var(--purple);
}

.release-history-panel .version-card-head {
  margin-bottom: 14px;
}

.release-history-panel .version-card h3 {
  max-width: 820px;
  font-size: 18px;
  line-height: 1.35;
}

.release-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.release-metric {
  min-width: 0;
  padding: 13px 14px;
  border-right: 1px solid var(--line);
}

.release-metric:last-child {
  border-right: 0;
}

.release-metric span,
.release-metric small,
.release-metric strong {
  display: block;
}

.release-metric span {
  min-height: 28px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.release-metric strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.release-metric small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.release-change-list {
  max-width: 960px;
  line-height: 1.55;
}

.release-sections {
  display: grid;
  gap: 12px;
}

.release-section {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.release-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.release-section-head h4 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.release-section-audience {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: right;
}

.release-section .release-change-list {
  margin-bottom: 0;
}

.invoice-basis-panel {
  margin-bottom: 14px;
}

.invoice-basis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0 -18px -18px;
  border-top: 1px solid var(--line);
}

.invoice-basis-grid > div {
  min-width: 0;
  padding: 13px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.invoice-basis-grid > div:nth-child(3n) {
  border-right: 0;
}

.invoice-basis-grid dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.invoice-basis-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.invoice-file-state p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 1100px) {
  .release-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-metric:nth-child(2n) { border-right: 0; }
  .release-metric:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .brand-wrap .brand { gap: 0; font-size: 0; }
  .version-signature { padding-right: 6px; padding-left: 6px; }
  .release-current-head,
  .release-history-panel .version-card-head,
  .release-section-head { align-items: flex-start; flex-direction: column; }
  .release-section-audience { text-align: left; }
  .invoice-basis-grid { grid-template-columns: 1fr; }
  .invoice-basis-grid > div,
  .invoice-basis-grid > div:nth-child(3n) { border-right: 0; }
}

@media (max-width: 480px) {
  .release-metrics { grid-template-columns: 1fr; }
  .release-metric,
  .release-metric:nth-child(2n),
  .release-metric:nth-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .release-metric:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .version-signature,
  .problem-report-link { transition: none; }
  .problem-report-link:hover,
  .problem-report-link:focus-visible { transform: none; }
}

/* Client service overview */
.client-service-overview { margin: 0 0 16px; }
.client-service-overview-wrap { width: 100%; }
.client-service-overview-table { width: 100%; }
.client-service-overview-table td { vertical-align: top; }
.client-service-overview-table td:first-child { min-width: 205px; }
.service-overview-name { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--ink); text-decoration: none; }
.service-overview-name:hover strong,
.service-overview-name:focus-visible strong { color: var(--purple); text-decoration: underline; }
.service-overview-service > small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.service-plan-inline { display: inline-flex; min-height: 24px; align-items: center; margin-top: 7px; padding: 3px 7px; border-radius: 999px; background: #e7f6ed; color: #197044; font-size: 9px; font-weight: 800; text-decoration: none; }
.service-plan-inline.is-missing { background: #fff3d5; color: #815f05; }
.service-invoice-state { display: grid; justify-items: start; gap: 5px; min-width: 132px; }
.service-invoice-state > strong { font-variant-numeric: tabular-nums; }
.service-invoice-state > small { color: var(--muted); font-size: 9px; line-height: 1.35; }
.service-invoice-state > a { font-size: 9px; font-weight: 800; }
.client-service-overview-table td > span,
.client-service-overview-table td > a + span { display: block; margin-top: 5px; }
.client-service-overview-table .weekly-report-states { min-width: 92px; }
.client-service-overview-table tfoot td { border-top: 2px solid var(--line-strong); background: #fafbfc; }
.client-service-overview-table tfoot strong { display: block; font-variant-numeric: tabular-nums; }

/* Account manager operations dashboard */
.account-workspace-head .page-lead { max-width: 720px; margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.account-workspace-toolbar { margin-bottom: 0; }
.account-ops-hero { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 18px 0 12px; }
.account-ops-hero h2 { margin: 3px 0 5px; font-size: 25px; letter-spacing: -.035em; }
.account-ops-hero p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.account-ops-hero form { display: flex; align-items: end; gap: 8px; }
.account-ops-hero label { display: grid; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.account-ops-hero input { min-height: 40px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: #fff; font: inherit; }
.account-ops-focus { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; padding: 12px 15px; border: 1px solid #d7dcf8; border-radius: 9px; background: linear-gradient(90deg,#f5f4ff,#fff); }
.account-ops-focus div { display: grid; gap: 3px; }
.account-ops-focus span,.account-ops-focus small { color: var(--muted); font-size: 9px; }
.account-ops-focus span { font-weight: 850; text-transform: uppercase; }
.account-ops-focus strong { font-size: 13px; }
.account-ops-focus a { display: inline-flex; min-height: 40px; align-items: center; padding: 0 12px; border-radius: 7px; background: #171925; color: #fff; font-size: 10px; font-weight: 800; text-decoration: none; }
.account-ops-focus a:focus-visible { outline: 3px solid rgba(98,74,217,.28); outline-offset: 2px; }
.account-ops-summary { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); margin-bottom: 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.account-ops-summary a { min-width: 0; min-height: 116px; padding: 14px; border-right: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.account-ops-summary a:last-child { border-right: 0; }
.account-ops-summary a:hover { background: #fafaff; }
.account-ops-summary a:focus-visible,.account-ops-list a:focus-visible { outline: 3px solid rgba(98,74,217,.28); outline-offset: -3px; }
.account-ops-summary span,.account-ops-summary small { display: block; color: var(--muted); font-size: 9px; line-height: 1.4; }
.account-ops-summary span { font-weight: 850; text-transform: uppercase; }
.account-ops-summary strong { display: block; margin: 14px 0 7px; font-size: 19px; font-variant-numeric: tabular-nums; }
.account-ops-summary .is-danger strong { color: var(--red); }
.account-ops-summary .is-warning strong { color: #8a6100; }
.account-ops-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(340px,.8fr); gap: 12px; margin-bottom: 12px; }
.account-ops-grid-tables { grid-template-columns: repeat(2,minmax(0,1fr)); }
.account-ops-panel { min-width: 0; overflow: hidden; }
.account-ops-count,.account-ops-change { color: var(--muted); font-size: 10px; font-weight: 800; }
.account-ops-change.good { color: var(--green); }
.account-ops-change.danger { color: var(--red); }
.account-ops-report-groups { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.account-ops-report-groups > div + div { border-left: 1px solid var(--line); }
.account-ops-report-groups h3 { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; font-size: 11px; }
.account-ops-report-groups h3 span { color: var(--muted); }
.account-ops-list { display: grid; }
.account-ops-list a { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.account-ops-list a:last-child { border-bottom: 0; }
.account-ops-list a:hover { background: #fafaff; }
.account-ops-list a > span { min-width: 0; }
.account-ops-list strong,.account-ops-list small { display: block; }
.account-ops-list strong { font-size: 10px; line-height: 1.35; }
.account-ops-list small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.account-ops-list b { flex: 0 0 auto; color: var(--purple); font-size: 9px; }
.account-ops-list b.state-missing { color: var(--red); }
.account-ops-list b.state-draft,.account-ops-list b.state-submitted { color: #8a6100; }
.account-ops-list b.state-accepted { color: var(--green); }
.account-ops-list.compact a { min-height: 54px; }
.account-ops-empty { margin: 0; padding: 18px 14px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.account-payment-bars { display: grid; gap: 12px; padding: 16px; }
.account-payment-bars > div { display: grid; grid-template-columns: 86px minmax(80px,1fr) 100px; align-items: center; gap: 5px 10px; }
.account-payment-bars span { color: var(--muted); font-size: 9px; }
.account-payment-bars i { display: flex; height: 9px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.account-payment-bars i b { display: block; height: 100%; }
.account-payment-bars i b.is-service { background: var(--purple); }
.account-payment-bars i b.is-budget { background: #e79a35; }
.account-payment-bars strong { text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.account-payment-bars small { grid-column: 2 / 4; color: var(--muted); font-size: 8px; text-align: right; }
.account-payment-legend { display: flex; gap: 14px; padding: 12px 16px 0; color: var(--muted); font-size: 9px; }
.account-payment-legend span::before { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; content: ""; }
.account-payment-legend .is-service::before { background: var(--purple); }
.account-payment-legend .is-budget::before { background: #e79a35; }
.account-ops-actions form { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.account-ops-actions form:last-child { border-bottom: 0; }
.account-ops-actions form > span { min-width: 0; }
.account-ops-actions strong,.account-ops-actions small { display: block; }
.account-ops-actions strong { font-size: 10px; line-height: 1.35; }
.account-ops-actions small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.account-ops-actions button { flex: 0 0 auto; }
.service-audit-result { display: grid; gap: 3px; margin-top: 8px; padding: 10px 12px; border: 1px solid #b9ddc7; border-radius: 8px; background: #f2fbf5; color: var(--ink); text-decoration: none; }
.service-audit-result.is-pending { border-color: #ead39b; background: #fff9eb; }
.service-audit-result span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.service-audit-result strong { font-size: 11px; }
.service-audit-result small { color: var(--muted); font-size: 9px; }
.service-audit-result:focus-visible { outline: 3px solid rgba(98,74,217,.28); outline-offset: 2px; }
.audit-readonly { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0; padding: 0; overflow: hidden; }
.audit-readonly > div { min-width: 0; padding: 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.audit-readonly > div:nth-child(even) { border-right: 0; }
.audit-readonly span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.audit-readonly p { margin: 0; font-size: 12px; line-height: 1.65; }
.audit-acceptance-form,.audit-acceptance-state { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(280px,1fr) auto; align-items: end; gap: 18px; margin-top: 12px; }
.audit-acceptance-form h2,.audit-acceptance-state h2 { margin: 2px 0 5px; }
.audit-acceptance-form p,.audit-acceptance-state p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.audit-acceptance-form label { display: grid; gap: 6px; font-size: 10px; font-weight: 800; }
.audit-acceptance-form textarea { width: 100%; resize: vertical; }
.audit-acceptance-state.is-accepted { border-color: #b9ddc7; background: #f2fbf5; }
.audit-acceptance-state blockquote { grid-column: 1 / -1; margin: 0; padding: 12px; border-left: 3px solid var(--green); background: #fff; font-size: 11px; }
.account-ops-note { margin: 0; padding: 0 16px 14px; color: var(--muted); font-size: 9px; }
@media (max-width: 1100px) {
  .account-ops-summary { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .account-ops-summary a { border-bottom: 1px solid var(--line); }
  .account-ops-summary a:nth-child(3n) { border-right: 0; }
  .account-ops-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .account-ops-hero { align-items: stretch; flex-direction: column; }
  .account-ops-hero form { align-items: stretch; }
  .account-ops-hero label { flex: 1; }
  .account-ops-hero input { width: 100%; }
  .account-ops-focus { align-items: stretch; flex-direction: column; }
  .account-ops-focus a { justify-content: center; }
  .account-ops-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .account-ops-summary a:nth-child(3n) { border-right: 1px solid var(--line); }
  .account-ops-summary a:nth-child(even) { border-right: 0; }
  .account-ops-report-groups { grid-template-columns: 1fr; }
  .account-ops-report-groups > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .account-payment-bars > div { grid-template-columns: 78px minmax(50px,1fr) 82px; }
  .audit-readonly { grid-template-columns: 1fr; }
  .audit-readonly > div { border-right: 0; }
  .audit-acceptance-form,.audit-acceptance-state { grid-template-columns: 1fr; align-items: stretch; }
}
.real-service-list a { color: inherit; }
.real-service-list a:hover,
.real-service-list a:focus-visible { text-decoration: underline; }
@media (max-width: 900px) {
  .client-service-overview-table { table-layout: auto; }
  .client-service-overview-table th,
  .client-service-overview-table td { white-space: normal; overflow-wrap: anywhere; }
}
.clients-summary-grid .client-kpi-link { color: inherit; text-decoration: none; }
.clients-summary-grid .client-kpi-link:hover strong,
.clients-summary-grid .client-kpi-link:focus-visible strong { color: var(--purple); }

/* Interface cohesion: equipment states and padded HR surfaces */
.equipment-state-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}

.equipment-state-tabs a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.equipment-state-tabs a strong {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 10px;
}

.equipment-state-tabs a:hover,
.equipment-state-tabs a:focus-visible {
  border-color: var(--purple);
  outline: 3px solid color-mix(in srgb, var(--purple) 14%, transparent);
  outline-offset: 1px;
}

.equipment-state-tabs a.active {
  border-color: #c9c2ff;
  background: #f2f0ff;
  color: var(--purple-dark);
}

.equipment-register-head {
  border-bottom: 1px solid var(--line);
}

.equipment-register-head p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel > .panel-head + .panel-table-surface,
.panel-table-surface {
  width: auto;
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.equipment-register-section > .panel-table-surface {
  margin-top: 16px;
}

.equipment-department-row th {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 10px 18px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 11px;
  letter-spacing: .01em;
}

.equipment-department-row th span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin-left: 6px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 9px;
}

.equipment-table.equipment-sold-table {
  min-width: 900px;
}

.equipment-lifecycle-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
}

.equipment-lifecycle-copy {
  display: grid;
  max-width: 780px;
  gap: 4px;
}

.equipment-lifecycle-copy h2,
.equipment-lifecycle-copy p {
  margin: 0;
}

.equipment-lifecycle-copy p:last-child {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.equipment-lifecycle {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 0;
  margin: 0;
  overflow-x: auto;
  padding: 0 0 4px;
  list-style: none;
}

.equipment-lifecycle li {
  position: relative;
  display: grid;
  min-width: 110px;
  gap: 8px;
  padding: 4px 12px 10px 0;
  color: var(--muted);
  font-size: 10px;
}

.equipment-lifecycle li::before {
  position: absolute;
  top: 10px;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--line-strong);
  content: "";
}

.equipment-lifecycle li > span {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.equipment-lifecycle li.is-current {
  color: var(--ink);
}

.equipment-lifecycle li.is-current > span {
  background: var(--purple);
  box-shadow: 0 0 0 2px #cfc8ff;
}

.equipment-lifecycle li.is-current strong::after {
  display: block;
  margin-top: 3px;
  color: var(--purple);
  content: "Сейчас";
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.equipment-process-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.equipment-process-actions > div:first-child {
  display: grid;
  gap: 3px;
}

.equipment-process-actions > div:first-child span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.equipment-card-tools {
  align-self: center;
}

.hr-offboarding-template-list > .panel-head,
.hr-process-surface > .panel-head {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.hr-offboarding-template-list > .panel-table-surface {
  margin-top: 16px;
}

.hr-profile-panel > .hr-profile-grid,
.hr-profile-panel > .stack-list,
.hr-profile-panel > .hr-side-facts {
  margin: 0 16px 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hr-profile-panel > .hr-profile-grid > div:last-child,
.hr-profile-panel > .hr-side-facts > div:last-child,
.hr-profile-panel > .stack-list > :last-child {
  border-bottom: 0;
}

.monthly-report-metric-name {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.monthly-report-text-grid > label { grid-column: 1 / -1; }
.monthly-report-text-grid textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.monthly-report-submit-guidance { display: grid; gap: 5px; border: 1px solid #eed592; border-radius: 7px; padding: 10px; background: #fff8e5; color: #735400; }
.monthly-report-submit-guidance p { margin: 0; font-size: 10px; line-height: 1.45; }
.kpi-state-label { display: block; margin-top: 3px; font-size: 9px; font-weight: 700; }
.kpi-ok { background: #e7f6ed; color: #197044; }
.kpi-warn { background: #fff5df; color: #7b5700; }
.kpi-danger { background: #ffebe8; color: #b9322b; }
.delta-ok { color: #197044; }
.delta-danger { color: #b9322b; }
.delta-neutral { color: var(--muted); }
.month-head > span { display: inline-block; }
.month-report-badge { display: inline-flex; min-height: 22px; align-items: center; margin-left: 7px; border-radius: 999px; padding: 3px 7px; font-size: 8px; font-weight: 900; text-decoration: none; white-space: nowrap; }
.month-report-badge.submitted { background: #fff2c7; color: #775500; }
.month-report-badge.accepted { background: #e3f5ea; color: #176a40; }
.month-report-badge:hover,
.month-report-badge:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.month-report-badge.draft { background: #eef0f4; color: #5c626d; }
.month-report-missing { display: inline-flex; margin-left: 7px; color: var(--muted); font-size: 8px; font-weight: 800; white-space: nowrap; }
.month-report-submit { display: inline-flex; min-height: 22px; align-items: center; margin-left: 5px; border: 1px solid #d4ceff; border-radius: 5px; padding: 3px 7px; background: #fff; color: var(--purple); font-size: 8px; font-weight: 900; text-decoration: none; white-space: nowrap; }
.report-edit-icon { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; margin-left: 4px; border: 1px solid #d4ceff; border-radius: 6px; background: #fff; color: var(--purple); text-decoration: none; vertical-align: middle; }
.report-edit-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.report-edit-icon:hover,
.report-edit-icon:focus-visible,
.month-report-submit:hover,
.month-report-submit:focus-visible { border-color: var(--purple); outline: 2px solid rgba(91, 72, 232, .18); outline-offset: 2px; }
.period-report-edit.report-edit-icon { width: 14px; height: 14px; min-height: 14px; margin-left: 2px; border-radius: 4px; padding: 0; font-size: inherit; }
.period-report-edit.report-edit-icon svg { width: 7px; height: 7px; }
.monthly-report-subhead { margin: 24px 0 10px 42px; }
.monthly-report-bottom-actions { display: grid; gap: 14px; padding: 18px; }
.monthly-report-bottom-actions h2 { margin: 3px 0 6px; }
.monthly-report-bottom-actions p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.completion-list-real span.done i { background: #e9f7ef; color: var(--green); }
.completion-list-real span.missing { color: #8a5550; }
.completion-list-real span.missing i { background: #ffebe8; color: var(--red); }
.monthly-plan-created-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin: 0 16px 16px; border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: var(--surface-muted); }
.monthly-plan-created-meta strong { font-size: 11px; }
.monthly-plan-created-meta span { color: var(--muted); font-size: 10px; }
.invoice-status-link { text-decoration: none; }
.invoice-status-link:hover,
.invoice-status-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.invoice-request-queue { margin-bottom: 22px; }
.invoice-request-history { margin-top: 24px; }
.form-cancel-button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; border: 1px solid var(--line-strong); border-radius: 7px; padding: 9px 14px; background: #fff; color: var(--ink); font-size: 11px; font-weight: 800; text-decoration: none; }
.form-cancel-button:hover,
.form-cancel-button:focus-visible { border-color: var(--purple); color: var(--purple); outline: 2px solid rgba(91, 72, 232, .15); outline-offset: 2px; }

@media (max-width: 720px) {
  .monthly-report-subhead { margin-left: 0; }
  .monthly-plan-created-meta { display: grid; }
}

/* Problems and improvement feedback */
.feedback-filters,
.feedback-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.feedback-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.feedback-filter-group { display: grid; gap: 7px; min-width: 0; }
.feedback-filter-group > strong { font-size: 10px; text-transform: uppercase; color: var(--muted); }
.feedback-kind-filters,
.feedback-attention-filters,
.feedback-status-filters {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 2px 5px;
  scrollbar-width: thin;
}
.feedback-filter-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
}
.feedback-filter-tab span {
  min-width: 20px;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--surface-muted);
  color: var(--ink);
  text-align: center;
}
.feedback-filter-tab:hover,
.feedback-filter-tab:focus-visible {
  border-color: var(--purple);
  color: var(--purple);
  outline: 2px solid rgba(91, 72, 232, .16);
  outline-offset: 2px;
}
.feedback-filter-tab.active { border-color: var(--purple); background: var(--purple); color: #fff; }
.feedback-filter-tab.active span { background: rgba(255, 255, 255, .18); color: #fff; }
.feedback-attention-new { color: var(--red); }
.feedback-attention-active { color: #946200; }
.feedback-attention-resolved { color: var(--green); }
.feedback-attention-new.active { border-color: var(--red); background: var(--red); }
.feedback-attention-active.active { border-color: #946200; background: #946200; }
.feedback-attention-resolved.active { border-color: var(--green); background: var(--green); }

.feedback-filters label,
.feedback-form label,
.feedback-comment-form label,
.feedback-admin-form label,
.feedback-verify-panel label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.feedback-filters select,
.feedback-form input,
.feedback-form select,
.feedback-form textarea,
.feedback-comment-form textarea,
.feedback-admin-form input,
.feedback-admin-form select,
.feedback-admin-form textarea,
.feedback-verify-panel textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.feedback-form textarea,
.feedback-comment-form textarea,
.feedback-admin-form textarea,
.feedback-verify-panel textarea { min-height: 108px; resize: vertical; line-height: 1.55; }

.feedback-form { padding: 18px; }
.feedback-form .field-wide { grid-column: 1 / -1; }
.feedback-form small,
.feedback-card small { color: var(--muted); font-weight: 500; line-height: 1.45; }
.field-error { color: var(--red); font-weight: 700; }

.feedback-card-list { display: grid; }
.selection-card-list { display: grid; gap: 10px; padding: 0 18px 18px; }
.selection-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); text-decoration: none; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.selection-card:hover { border-color: #c9c2ff; box-shadow: 0 8px 22px rgba(43,35,92,.08); transform: translateY(-1px); }
.selection-card:focus-visible { outline: 3px solid rgba(109,92,231,.24); outline-offset: 2px; }
.selection-card span { display: grid; gap: 4px; min-width: 0; }
.selection-card strong { font-size: 14px; }
.selection-card small { color: var(--muted); }
.selection-card b { flex: 0 0 auto; color: var(--purple); font-size: 12px; }
.finance-table tr:target > td { background: #fff8d8; }
.feedback-card {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto 112px;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  color: var(--ink);
  text-decoration: none;
}
.feedback-card:last-child { border-bottom: 0; }
.feedback-card:hover,
.feedback-card:focus-visible { background: #f7f6ff; outline: 3px solid color-mix(in srgb, var(--purple) 14%, transparent); outline-offset: -3px; }
.feedback-card > div { display: grid; gap: 4px; min-width: 0; }
.feedback-card strong,
.feedback-card small { min-width: 0; overflow-wrap: anywhere; }
.feedback-card time { color: var(--muted); font-size: 10px; text-align: right; }
.feedback-kind { color: var(--purple); font-size: 10px; font-weight: 900; text-transform: uppercase; }
.feedback-pagination { display: flex; align-items: center; justify-content: center; gap: 16px; border-top: 1px solid var(--line); padding: 14px 16px; font-size: 11px; }

.feedback-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.feedback-detail-main,
.feedback-detail-side { display: grid; min-width: 0; gap: 16px; }
.feedback-detail-side { position: sticky; top: 82px; }
.feedback-detail-head > div { min-width: 0; }
.feedback-detail-head h1 { overflow-wrap: anywhere; }
.feedback-original { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.feedback-original > div { display: grid; min-width: 0; gap: 7px; border-bottom: 1px solid var(--line); padding: 16px 18px; }
.feedback-original > div:last-child { border-bottom: 0; }
.feedback-original span,
.feedback-resolution-meta span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.feedback-original a,
.feedback-original p,
.feedback-resolution a,
.feedback-resolution p,
.feedback-comments p { min-width: 0; max-width: 75ch; overflow-wrap: anywhere; }
.feedback-original p,
.feedback-resolution p,
.feedback-comments p { margin: 0; line-height: 1.6; }
.feedback-screenshot-link { width: fit-content; }
.feedback-resolution { padding: 18px; }
.feedback-resolution-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; }
.feedback-comments { display: grid; }
.feedback-comments article { display: grid; gap: 8px; border-bottom: 1px solid var(--line); padding: 14px 18px; }
.feedback-comments article > div { display: flex; justify-content: space-between; gap: 10px; }
.feedback-comments time { color: var(--muted); font-size: 10px; }
.feedback-comment-form { display: grid; gap: 10px; padding: 16px 18px; }
.feedback-comment-form button { justify-self: start; }
.feedback-admin-form,
.feedback-verify-panel { display: grid; gap: 12px; }
.feedback-admin-form h2,
.feedback-verify-panel h2 { margin: 0; }
.feedback-verify-panel form { display: grid; gap: 10px; }

@media (max-width: 900px) {
  .feedback-detail-layout { grid-template-columns: 1fr; }
  .feedback-detail-side { position: static; }
}

@media (max-width: 700px) {
  .feedback-filters,
  .feedback-form-grid { grid-template-columns: 1fr; }
  .feedback-form .field-wide { grid-column: auto; }
  .feedback-card {
    grid-template-areas:
      "kind status"
      "copy copy"
      "time time";
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px 12px;
    padding: 14px 16px;
  }
  .feedback-card .feedback-kind { grid-area: kind; }
  .feedback-card > div { grid-area: copy; }
  .feedback-card .status-pill { grid-area: status; }
  .feedback-card time { grid-area: time; }
  .feedback-card .feedback-kind,
  .feedback-card time { text-align: left; }
}

@media (max-width: 760px) {
  .equipment-state-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .equipment-state-tabs a {
    justify-content: space-between;
  }

  .equipment-process-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .equipment-process-actions .toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .equipment-process-actions .toolbar-actions a {
    justify-content: center;
  }

  .panel > .panel-head + .panel-table-surface,
  .panel-table-surface,
  .hr-profile-panel > .hr-profile-grid,
  .hr-profile-panel > .stack-list,
  .hr-profile-panel > .hr-side-facts {
    margin-right: 12px;
    margin-left: 12px;
  }
}

/* HR library and explicit workflow actions */
.library-kpis a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.library-kpis a:hover,
.library-kpis a:focus-visible {
  border-color: var(--purple);
}

.library-kpis .is-attention {
  border-color: #f1b8b8;
  background: #fff8f8;
}

.library-filter-panel {
  margin-bottom: 18px;
}

.library-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(190px, 1fr) minmax(170px, 0.8fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.library-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.library-layout,
.library-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 18px;
  align-items: start;
}

.library-detail-main {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.library-table {
  min-width: 840px;
}

.library-table th:first-child,
.library-table td:first-child {
  min-width: 250px;
}

.library-copy-table {
  min-width: 780px;
}

.library-reading-table {
  min-width: 680px;
}

.library-book-link {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  text-decoration: none;
}

.library-book-link:hover,
.library-book-link:focus-visible {
  color: var(--purple);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.library-table td small,
.library-copy-table td small,
.library-reading-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.library-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.library-tags span,
.library-tags a,
.library-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--surface-muted);
  color: #50545c;
  font-size: 10px;
  font-weight: 800;
}

.library-tags a {
  text-decoration: none;
}

.library-tags a:hover,
.library-tags a:focus-visible {
  border-color: var(--purple);
  color: var(--purple-dark);
  outline: none;
}

.library-status.is-available {
  border-color: #b9dfcb;
  background: #f1fbf5;
  color: var(--green);
}

.library-status.is-issued {
  border-color: #d6ccff;
  background: #f7f5ff;
  color: var(--purple-dark);
}

.library-status.is-overdue {
  border-color: #efb7b2;
  background: #fff1f0;
  color: #b42318;
}

.library-table tr.is-issued:not(.is-overdue) td {
  background: #faf9ff;
}

.library-table tr.is-overdue td,
.library-copy-table tr.is-overdue td {
  background: #fff9f8;
}

.library-overdue-label {
  color: #b42318 !important;
  font-weight: 850;
}

.library-registry-head {
  align-items: center;
}

.library-page-count {
  color: var(--muted);
  font-size: 11px;
}

.library-page-count strong {
  color: var(--ink);
}

.library-loan-line {
  display: grid;
  gap: 2px;
  min-width: 130px;
  margin-bottom: 8px;
}

.library-loan-line:last-child {
  margin-bottom: 0;
}

.library-loan-line.is-overdue strong,
.library-loan-line.is-overdue small {
  color: #b42318;
}

.library-loan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.library-category-picker {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.library-category-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-muted);
}

.library-category-option {
  display: flex;
  min-height: 44px;
  gap: 9px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.library-category-option:has(input:checked) {
  border-color: #bdb1f5;
  background: #f6f3ff;
  color: var(--purple-dark);
}

.library-category-option:focus-within {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.library-category-option input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  accent-color: var(--purple);
}

.category-settings-table {
  min-width: 620px;
}

.category-settings-table td:last-child {
  width: 220px;
}

.table-button.danger {
  border-color: #efc6c2;
  color: #a32a22;
}

.absence-detail-panel {
  margin-bottom: 18px;
}

.absence-detail-comment {
  padding: 0 16px 18px;
  color: var(--ink);
  line-height: 1.65;
}

.destructive-confirm-card {
  display: grid;
  max-width: 760px;
  gap: 18px;
  padding: 20px;
}

.destructive-confirm-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.library-leaders ol,
.library-queue-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 16px 12px;
  list-style: none;
}

.library-leaders li,
.library-queue-list li {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.library-leaders li > span,
.library-queue-list li > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  background: #f0edff;
  color: var(--purple);
  font-size: 11px;
  font-weight: 900;
}

.library-leaders li div,
.library-queue-list li div {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 3px;
}

.library-leaders li small,
.library-queue-list li small {
  color: var(--muted);
}

.library-own-queue {
  display: grid;
  gap: 7px;
  margin: 0 16px 14px;
  border: 1px solid #cfc6ff;
  border-radius: 12px;
  padding: 14px;
  background: #f8f6ff;
}

.hr-leave-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hr-leave-stepper article {
  position: relative;
  display: flex;
  min-height: 74px;
  gap: 10px;
  align-items: center;
  border-right: 1px solid var(--line);
  padding: 14px 16px;
  color: var(--muted);
}

.hr-leave-stepper article:last-child {
  border-right: 0;
}

.hr-leave-stepper article > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
}

.hr-leave-stepper article div {
  display: grid;
  gap: 3px;
}

.hr-leave-stepper article small {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hr-leave-stepper article strong {
  color: inherit;
  font-size: 12px;
}

.hr-leave-stepper .is-complete {
  background: #f3fbf6;
  color: var(--green);
}

.hr-leave-stepper .is-current {
  box-shadow: inset 0 -3px 0 var(--purple);
  background: #f8f6ff;
  color: var(--purple-dark);
}

.hr-leave-stepper .is-stopped {
  box-shadow: inset 0 -3px 0 #b42318;
  background: #fff7f6;
  color: #b42318;
}

.toolbar-actions .ghost-button.danger {
  border-color: #e1b8b5;
  color: #a32a22;
}

@media (max-width: 980px) {
  .library-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-layout,
  .library-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .library-leaders,
  .library-detail-side {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .library-filters {
    grid-template-columns: 1fr;
  }

  .library-category-options {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .hr-leave-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-leave-stepper article:nth-child(2) {
    border-right: 0;
  }

  .hr-leave-stepper article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .library-book-link,
  .library-kpis a {
    transition: none;
  }
}

/* HR equipment register */
.equipment-panel {
  overflow: hidden;
}

.equipment-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(150px, 0.8fr)) auto auto;
  gap: 10px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.equipment-filters select,
.equipment-filters input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.equipment-filters select {
  padding: 0 36px 0 12px;
}

.equipment-filters input:focus-visible,
.equipment-filters select:focus-visible,
.equipment-delete-form textarea:focus-visible {
  border-color: var(--purple);
  outline: 3px solid color-mix(in srgb, var(--purple) 18%, transparent);
  outline-offset: 1px;
}

.equipment-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
}

.equipment-col-owner { width: 170px; }
.equipment-col-number { width: 108px; }
.equipment-col-name { width: 220px; }
.equipment-col-condition { width: 165px; }
.equipment-col-spec { width: 150px; }
.equipment-col-inspection { width: 155px; }
.equipment-col-date { width: 112px; }
.equipment-col-price { width: 125px; }

.equipment-table td {
  vertical-align: middle;
}

.equipment-table td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.equipment-status,
.equipment-conflict,
.novabench-score {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.equipment-status.status-available {
  background: #eef2f6;
  color: #465568;
}

.equipment-status.status-ready {
  background: #e4f5ec;
  color: #12633e;
  box-shadow: inset 0 0 0 1px #b8dfca;
}

.equipment-status.status-in_use {
  background: #e7f5ed;
  color: #12633e;
}

.equipment-status.status-broken {
  background: #fff0ef;
  color: #a92d27;
}

.equipment-status.status-repair {
  background: #fff6df;
  color: #8a5a00;
}

.equipment-status.status-sold {
  background: #f0ecfa;
  color: #5c4190;
}

.equipment-conflict {
  margin-top: 6px;
  border: 1px solid #efca76;
  background: #fff8e6;
  color: #7a5200;
}

.novabench-score {
  min-width: 58px;
  justify-content: center;
  border: 1px solid currentColor;
}

.novabench-score.tone-low {
  background: #fff0ef;
  color: #a92d27;
}

.novabench-score.tone-medium {
  background: #fff6df;
  color: #8a5a00;
}

.novabench-score.tone-good {
  background: #edf7f1;
  color: #23714b;
}

.novabench-score.tone-high {
  background: #dff3e8;
  color: #0f613a;
}

.equipment-count-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 48px;
  border-radius: 8px;
  color: var(--purple);
  text-decoration: none;
}

.equipment-count-link strong {
  font-size: 17px;
}

.equipment-count-link span {
  color: var(--muted);
  font-size: 12px;
}

.equipment-count-link:focus-visible,
.equipment-count-link:hover {
  outline: 2px solid color-mix(in srgb, var(--purple) 30%, transparent);
  outline-offset: 3px;
}

.equipment-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.7fr);
  gap: 16px;
  align-items: start;
}

.equipment-detail-main,
.equipment-detail-side {
  display: grid;
  gap: 16px;
}

.equipment-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.equipment-facts div {
  display: grid;
  gap: 5px;
  min-height: 76px;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
}

.equipment-facts div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.equipment-facts .equipment-fact-wide {
  grid-column: 1 / -1;
  border-right: 0;
}

.equipment-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.equipment-facts dd {
  margin: 0;
  font-weight: 700;
}

.equipment-timeline {
  display: grid;
  gap: 0;
}

.equipment-timeline article {
  display: grid;
  gap: 4px;
  padding: 13px 16px;
  border-top: 1px solid var(--line);
}

.equipment-timeline time,
.equipment-timeline span {
  color: var(--muted);
  font-size: 12px;
}

.equipment-danger-zone {
  display: grid;
  gap: 16px;
  border-color: #efc1be;
  background: #fffafa;
  padding: 16px;
}

.equipment-danger-zone h2,
.equipment-danger-zone p {
  margin: 4px 0 0;
}

.danger-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  border: 1px solid #b72e27;
  border-radius: 10px;
  background: #c7352d;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 9px 14px;
  text-decoration: none;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: #a82b25;
  outline: 3px solid rgba(199, 53, 45, 0.2);
  outline-offset: 2px;
}

.equipment-delete-form {
  display: grid;
  gap: 20px;
  max-width: 760px;
  padding: 22px;
}

.equipment-delete-form textarea {
  width: 100%;
  min-height: 120px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px;
  font: inherit;
}

@media (max-width: 1120px) {
  .equipment-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .equipment-search {
    grid-column: span 2;
  }
}

@media (max-width: 820px) {
  .equipment-detail-grid {
    grid-template-columns: 1fr;
  }

  .equipment-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .equipment-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .equipment-filters {
    grid-template-columns: 1fr;
  }

  .equipment-search {
    grid-column: auto;
  }

  .equipment-facts {
    grid-template-columns: 1fr;
  }

  .equipment-facts div:nth-child(odd) {
    border-right: 0;
  }

  .equipment-facts .equipment-fact-wide {
    grid-column: auto;
  }
}

/* HR operations refresh: equipment, leave calendar and employee profile */
.hr-section-head {
  margin-top: 16px;
}

.equipment-category-tabs,
.hr-year-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}

.equipment-category-tabs a,
.hr-year-switch a,
.hr-year-switch strong {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.equipment-category-tabs a:hover,
.equipment-category-tabs a:focus-visible,
.hr-year-switch a:hover,
.hr-year-switch a:focus-visible {
  border-color: var(--purple);
  outline: 3px solid color-mix(in srgb, var(--purple) 14%, transparent);
  outline-offset: 1px;
}

.equipment-category-tabs a.active {
  border-color: var(--purple);
  background: var(--purple);
  color: #fff;
}

.equipment-category-tabs a span {
  min-width: 24px;
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(88, 68, 169, .1);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.equipment-category-tabs a.active span {
  background: rgba(255, 255, 255, .2);
}

.hr-year-switch {
  justify-content: center;
}

.hr-year-switch strong {
  min-width: 84px;
  border-color: var(--purple);
  color: var(--purple);
}

.equipment-filter-panel,
.equipment-register-section {
  overflow: hidden;
  padding: 0;
}

.equipment-filter-panel {
  margin-bottom: 16px;
}

.equipment-filter-panel .equipment-filters {
  grid-template-columns: minmax(280px, 1.5fr) minmax(220px, .8fr) auto auto;
  border-bottom: 0;
}

.equipment-register-section {
  margin-bottom: 16px;
  overflow: visible;
}

.equipment-register-section > .panel-head {
  margin: 0;
  padding: 16px;
}

.panel-count {
  display: inline-grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.equipment-department-group {
  border-top: 1px solid var(--line);
}

.equipment-department-group > h3 {
  margin: 0;
  padding: 12px 16px;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 12px;
}

.equipment-owner-group + .equipment-owner-group {
  border-top: 1px solid var(--line);
}

.equipment-owner-label {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: #fff;
}

.equipment-owner-label strong {
  font-size: 13px;
}

.equipment-owner-label span {
  color: var(--muted);
  font-size: 11px;
}

.equipment-owner-cell {
  overflow-wrap: anywhere;
}

.equipment-owner-cell a,
.equipment-owner-link {
  color: var(--purple);
  font-weight: 800;
  text-decoration: none;
}

.equipment-owner-cell a:hover,
.equipment-owner-cell a:focus-visible,
.equipment-owner-link:hover,
.equipment-owner-link:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.equipment-repair-costs {
  display: grid;
  min-width: 150px;
  gap: 3px;
}

.equipment-repair-costs small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.equipment-table-wrap {
  border-top: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 2px;
}

.equipment-primary-link,
.equipment-name-link,
.hr-service-link {
  color: var(--purple);
  text-decoration: none;
}

.equipment-primary-link {
  font-weight: 900;
  white-space: nowrap;
}

.equipment-name-link {
  display: grid;
  gap: 3px;
  min-width: 170px;
}

.equipment-name-link span,
.equipment-spec-brief small {
  color: var(--muted);
  font-size: 10px;
}

.equipment-primary-link:hover,
.equipment-name-link:hover,
.hr-service-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.equipment-phone {
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.equipment-spec-brief {
  display: grid;
  gap: 2px;
}

.equipment-sold-section {
  opacity: .94;
}

.equipment-entity-head {
  margin-top: 16px;
}

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}

.detail-kpis article {
  display: grid;
  min-height: 104px;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-kpis.library-kpis a {
  min-height: 104px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-kpis article > span,
.detail-kpis article > small,
.detail-kpis.library-kpis a > span,
.detail-kpis.library-kpis a > small {
  color: var(--muted);
  font-size: 10px;
}

.detail-kpis article > span,
.detail-kpis.library-kpis a > span {
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.detail-kpis article > strong,
.detail-kpis.library-kpis a > strong {
  font-size: 16px;
  line-height: 1.3;
}

.equipment-inventory-chip,
.equipment-condition,
.equipment-inspection-due {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 800;
}

.equipment-inventory-chip,
.equipment-condition {
  background: var(--surface-muted);
  color: var(--ink);
}

.equipment-hero-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.equipment-inspection-due,
.detail-kpis article.is-attention {
  border-color: #efca76;
  background: #fff8e6;
  color: #7a5200;
}

.equipment-inspection-row > div:first-child {
  display: grid;
  gap: 3px;
}

.equipment-inspection-row small {
  color: var(--muted);
}

.hr-calendar-event {
  color: inherit;
  text-decoration: none;
}

a.hr-calendar-event:hover,
a.hr-calendar-event:focus-visible {
  filter: brightness(.97);
  outline: 2px solid currentColor;
  outline-offset: 1px;
}

.hr-personal-month-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hr-personal-month-grid > article {
  min-height: 108px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 11px 12px;
}

.hr-personal-month-grid > article:nth-child(4n) {
  border-right: 0;
}

.hr-personal-month-grid h3 {
  margin: 0 0 10px;
  font-size: 12px;
}

.hr-personal-month-empty {
  color: var(--muted);
  font-size: 10px;
}

.pagination {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  color: var(--muted);
  font-size: 11px;
}

.pagination a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  color: var(--purple);
  font-weight: 800;
  text-decoration: none;
}

.hr-employee-layout {
  grid-template-columns: minmax(0, 1fr);
}

.hr-employee-aside {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hr-employee-equipment-table .compact-table {
  min-width: 760px;
}

.hr-profile-panel > .table-wrap {
  margin: 0;
}

/* HR workplace, documents, leave balance and employee workspace */
.hr-dashboard-head .page-subtitle {
  max-width: 760px;
}

.hr-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.hr-summary-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 104px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px 17px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.hr-summary-card:hover {
  border-color: #c9c2ff;
  background: #fbfaff;
  box-shadow: 0 1px 2px rgba(22, 27, 38, 0.04), 0 10px 28px rgba(72, 64, 176, 0.08);
}

.hr-summary-card:focus-visible {
  outline: 3px solid #d6d1ff;
  outline-offset: 2px;
}

.hr-summary-card > span,
.hr-summary-card > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hr-summary-card > strong {
  margin: 5px 0 3px;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.1;
}

.hr-summary-card.is-warning {
  border-color: #ead08f;
  background: #fffdf6;
}

.hr-summary-card.is-warning > small {
  color: #785400;
  font-weight: 700;
}

.hr-workplace-kpi strong {
  font-variant-numeric: tabular-nums;
}

.hr-dashboard-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  align-items: start;
}

.hr-dashboard-grid > .panel + .panel {
  margin-top: 0;
}

.hr-availability-panel,
.hr-upcoming-leaves-panel {
  overflow: hidden;
}

.hr-availability-head {
  align-items: center;
}

.hr-availability-head > a {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border-radius: 7px;
  padding: 0 10px;
  color: var(--purple);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.hr-availability-head > a:hover,
.hr-availability-head > a:focus-visible {
  background: #f3f2ff;
}

.hr-availability-head > a:focus-visible,
.hr-availability-row:focus-visible,
.hr-upcoming-leave-row:focus-visible,
.hr-other-absence-list a:focus-visible {
  outline: 3px solid #d6d1ff;
  outline-offset: 2px;
}

.hr-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hr-panel-title > span,
.hr-other-absences-head > span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: #e9f7ef;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
}

.hr-availability-list,
.hr-upcoming-leave-list {
  display: grid;
  gap: 8px;
}

.hr-availability-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  border: 1px solid #dcece3;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fbfefc;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.hr-availability-row:hover {
  border-color: #a8d5bb;
  background: #f4fbf7;
}

.hr-availability-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px #e3f4ea;
}

.hr-availability-person,
.hr-availability-until,
.hr-upcoming-leave-row > span:first-child {
  display: grid;
  gap: 3px;
}

.hr-availability-person strong,
.hr-upcoming-leave-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hr-availability-person small,
.hr-availability-until small,
.hr-upcoming-leave-row small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.hr-availability-until {
  justify-items: end;
  padding-left: 12px;
  border-left: 1px solid #dcece3;
  font-variant-numeric: tabular-nums;
}

.hr-availability-until strong {
  font-size: 12px;
}

.hr-availability-empty {
  min-height: 62px;
  display: grid;
  place-items: center start;
  padding: 14px;
}

.hr-other-absences {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.hr-other-absences-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.hr-other-absences-head > span {
  background: #f0f1f3;
  color: #646975;
}

.hr-other-absence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hr-other-absence-list a {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  background: #f8f9fb;
  color: inherit;
  font-size: 10px;
  text-decoration: none;
}

.hr-other-absence-list a:hover {
  border-color: #c9c2ff;
  background: #f3f2ff;
}

.hr-other-absence-list span {
  color: var(--muted);
}

.hr-upcoming-leave-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 8px 2px;
  color: inherit;
  text-decoration: none;
}

.hr-upcoming-leave-row:last-child {
  border-bottom: 0;
}

.hr-upcoming-leave-row:hover strong {
  color: var(--purple);
}

.hr-onboarding-document {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px;
  background: var(--surface-muted);
}

.hr-onboarding-document > strong {
  min-width: 180px;
  flex: 1;
  font-size: 11px;
}

.hr-onboarding-document .ghost-button {
  min-height: 34px;
}

.hr-offboarding-blockers {
  overflow: hidden;
  border-color: #efb0aa;
}

.hr-offboarding-blocker-grid,
.hr-employee-facts-grid,
.hr-employee-assets-grid,
.hr-contract-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.hr-offboarding-blocker-grid {
  padding: 0 16px 16px;
}

.hr-offboarding-blocker-grid > div {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hr-offboarding-blocker-grid h3,
.hr-engagement-history h3 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: var(--surface-muted);
  font-size: 11px;
}

.hr-employee-facts-grid,
.hr-employee-assets-grid {
  margin-bottom: 16px;
}

.hr-employee-facts-grid > .panel,
.hr-employee-assets-grid > .panel {
  margin-bottom: 0;
}

.hr-employee-assets-grid.is-single {
  grid-template-columns: 1fr;
}

.hr-private-library-note {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.hr-side-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hr-side-facts > div {
  display: grid;
  min-height: 76px;
  align-content: center;
  gap: 6px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 13px 17px;
}

.hr-side-facts > div:nth-child(2n) {
  border-right: 0;
}

.hr-employee-summary article.is-attention,
.hr-calendar-days.is-risk,
.hr-leave-summary-strip .is-risk {
  background: #fff0ee;
  color: #9e2f27;
}

.hr-leave-summary-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.hr-leave-summary-strip > div {
  display: grid;
  gap: 4px;
  border-right: 1px solid var(--line);
  padding: 12px 16px;
}

.hr-leave-summary-strip > div:last-child {
  border-right: 0;
}

.hr-leave-summary-strip dt,
.hr-leave-year-metrics dt {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.hr-leave-summary-strip dd,
.hr-leave-year-metrics dd {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.hr-leave-year-metrics {
  display: grid;
  min-width: 120px;
  gap: 4px;
  margin: 0;
}

.hr-leave-year-metrics > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.hr-leave-year-metrics .hr-leave-balance {
  border-top: 1px solid var(--line);
  padding-top: 4px;
}

.hr-year-table {
  min-width: 1660px;
}

.hr-year-table th:nth-child(2),
.hr-year-table td:nth-child(2) {
  width: 150px;
}

.hr-employee-calendar-legend {
  border-top: 1px solid var(--line);
  padding: 10px 16px 14px;
}

.hr-contract-workspace {
  padding: 0 16px 16px;
}

.hr-contract-workspace > .stack-list,
.hr-engagement-history {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hr-button-with-icon {
  gap: 7px;
}

.hr-button-with-icon svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hr-document-row {
  gap: 12px;
}

.hr-document-actions {
  justify-content: flex-end;
}

.hr-document-actions .ghost-button {
  min-height: 38px;
  padding: 7px 10px;
  font-size: 10px;
}

.hr-cooperation-terms .panel-head > div:first-child {
  max-width: 760px;
}

.hr-terms-body {
  padding: 16px 18px 18px;
}

.hr-terms-body p {
  max-width: 900px;
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  white-space: normal;
}

.hr-terms-preview {
  display: block;
  min-width: 240px;
  color: var(--muted);
  line-height: 1.45;
}

.hr-services-panel > .panel-head + .table-wrap:last-child {
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  overflow-y: visible;
}

.hr-engagement-history .stack-row,
.hr-offboarding-blocker-grid .stack-row {
  border-radius: 0;
}

.hr-employee-timeline {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .hr-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .equipment-filter-panel .equipment-filters,
  .hr-employee-aside,
  .hr-employee-facts-grid,
  .hr-employee-assets-grid,
  .hr-contract-workspace {
    grid-template-columns: 1fr;
  }

  .hr-leave-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-personal-month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hr-personal-month-grid > article:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .hr-personal-month-grid > article:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 560px) {
  .hr-availability-head {
    align-items: flex-start;
  }

  .hr-availability-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .hr-availability-until {
    grid-column: 2;
    justify-items: start;
    padding: 6px 0 0;
    border-top: 1px solid #dcece3;
    border-left: 0;
  }
}

@media (max-width: 360px) {
  .hr-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hr-summary-card,
  .hr-availability-row {
    transition: none;
  }
}

@media (max-width: 560px) {
  .equipment-category-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .equipment-category-tabs a {
    justify-content: space-between;
  }

  .hr-personal-month-grid {
    grid-template-columns: 1fr;
  }

  .hr-attention-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .hr-attention-strip a {
    border-top: 1px solid #e2c77f;
    border-left: 0;
    padding-top: 7px;
    padding-left: 0;
  }

  .hr-leave-summary-strip,
  .hr-side-facts {
    grid-template-columns: 1fr;
  }

  .hr-personal-month-grid > article,
  .hr-personal-month-grid > article:nth-child(2n),
  .hr-personal-month-grid > article:nth-child(4n) {
    border-right: 0;
  }

  .hr-document-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hr-document-actions .ghost-button {
    min-height: 42px;
  }
}
.report-status-draft { background: #f1f5f9; color: #475569; }
.report-status-submitted { background: #fef3c7; color: #92400e; }
.report-status-needs_work { background: #fee2e2; color: #991b1b; }
.report-status-reviewed { background: #dcfce7; color: #166534; }
.report-status-canceled { background: #e2e8f0; color: #475569; text-decoration: line-through; }
.report-period-chip.report-status-draft { background: #f1f5f9; color: #475569; }
.report-period-chip.report-status-submitted { background: #fef3c7; color: #92400e; }
.report-period-chip.report-status-needs_work { background: #fee2e2; color: #991b1b; }
.report-period-chip.report-status-reviewed { background: #dcfce7; color: #166534; }
.report-period-chip.report-status-canceled { background: #e2e8f0; color: #475569; text-decoration: line-through; }
.report-review-note { border: 1px solid #fecaca; border-radius: 14px; background: #fff7f7; padding: 16px; }
.report-review-note p { margin: 8px 0; }
.report-action-disclosures { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.report-action-direct { margin: 0; }
.report-action-button { width: fit-content; max-width: 100%; min-height: 40px; border-radius: 8px; box-sizing: border-box; padding: 8px 14px; text-align: center; touch-action: manipulation; }
.report-action-disclosure { min-width: 0; }
.report-action-disclosure[open] { flex-basis: 100%; }
.report-action-disclosure > summary { list-style: none; cursor: pointer; user-select: none; }
.report-action-disclosure > summary::-webkit-details-marker { display: none; }
.report-action-disclosure > summary::marker { content: ""; }
.report-action-panel { display: grid; gap: 12px; width: min(100%,680px); margin-top: 10px; border: 1px solid #fde68a; border-radius: 12px; background: #fffbeb; padding: 16px; }
.report-action-panel h3,.report-action-panel p { margin: 0; }
.report-action-panel p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.report-return-form { display: grid; gap: 10px; }
.report-return-form label { display: grid; gap: 6px; }
.report-return-form .report-action-button { justify-self: start; }
.report-cancel-zone { padding-top: 8px; }
.report-action-panel-danger { border-color: #fecaca; background: #fff7f7; }
.report-transition-history ol { display: grid; gap: 10px; margin: 0; padding-left: 22px; }
.report-transition-history li span { display: block; color: #64748b; font-size: .85rem; }
.service-requirements-grid { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.service-requirements-grid label { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 8px; }
.service-requirements-grid input { width: auto; margin-top: 3px; }
.service-requirements-grid label span { font-weight: 700; }
.service-requirements-grid label small { grid-column: 2; }
.platform-spend-panel { margin-top: 20px; }
.platform-spend-table th:not(:first-child),.platform-spend-table td:not(:first-child) { text-align: right; white-space: nowrap; }
.invoice-number-link { font-weight: 700; text-decoration: none; }
@media (max-width: 760px) {
  .service-requirements-grid { grid-template-columns: 1fr; }
}
.client-contour-nav {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  padding: 4px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.client-contour-nav a {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 1px solid var(--line, #dfe3ea);
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #20242c);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.client-contour-nav a.active,
.client-contour-nav a[aria-current="page"] {
  border-color: #e25a53;
  background: #fff3f1;
  color: #b7342f;
}

.client-contour-nav a:focus-visible {
  outline: 3px solid rgba(226, 90, 83, .28);
  outline-offset: 2px;
}

.contour-summary-grid { margin-bottom: 18px; }
.contour-table-wrap { max-width: 100%; overflow-x: auto; }
.contour-table { min-width: 1050px; }
.contour-table td > a > span,
.contour-table td small { display: block; margin-top: 3px; color: var(--muted, #69707d); }
.contour-state-expired,
.contour-state-needs_type,
.contour-state-conflict { background: #fff8f7; }
.contour-state-remind_due,
.contour-state-exhausted,
.contour-state-debt { background: #fffdf4; }

@media (max-width: 640px) {
  .client-contour-nav { margin-inline: -4px; padding-inline: 4px; }
}
