/*
 * SEOLAND Design System — Calm Operations
 *
 * Loaded after the legacy workspace styles.  This file intentionally changes
 * only visual foundations and component appearance: no grids, DOM order,
 * routes, data states or business behaviour live here.
 */

/*
 * Onest is self-hosted so the interface keeps the same Cyrillic typography
 * on the loopback runtime and never depends on a third-party font service.
 * Source: Google Fonts / Onest Project, SIL Open Font License 1.1.
 */
@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/onest-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/onest-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Onest";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("assets/fonts/onest-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --ds-font-sans: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ds-font-xs: 11.5px;
  --ds-font-sm: 12.5px;
  --ds-font-body: 15px;
  --ds-font-lead: 15px;
  --ds-font-card: 16px;
  --ds-font-section: 19px;
  --ds-font-page: clamp(30px, 2.4vw, 36px);
  --ds-weight-regular: 450;
  --ds-weight-medium: 550;
  --ds-weight-semibold: 650;
  --ds-weight-bold: 720;
  --ds-leading-tight: 1.18;
  --ds-leading-copy: 1.52;
  --ds-canvas: #f0f3f2;
  --ds-surface: #ffffff;
  --ds-surface-subtle: #f7f9f8;
  --ds-surface-muted: #edf1f1;
  --ds-surface-hover: #f0f5f3;
  --ds-border: #d8e0de;
  --ds-border-strong: #bcc8c5;
  --ds-text: #17212b;
  --ds-text-muted: #52606d;
  --ds-text-faint: #66737e;
  --ds-accent: #176b5d;
  --ds-accent-hover: #12594e;
  --ds-accent-soft: #e7f3ef;
  --ds-success: #137a4b;
  --ds-success-soft: #ebf7f0;
  --ds-warning: #925600;
  --ds-warning-soft: #fff4dc;
  --ds-danger: #b42318;
  --ds-danger-soft: #fdecea;
  --ds-info: #2458c6;
  --ds-info-soft: #edf3ff;
  --ds-focus: #176b5d;
  --ds-radius-control: 8px;
  --ds-radius-panel: 12px;
  --ds-radius-overlay: 16px;
  --ds-shadow-panel: 0 1px 2px rgba(16, 24, 40, 0.035), 0 8px 22px rgba(16, 24, 40, 0.035);
  --ds-shadow-overlay: 0 18px 48px rgba(16, 24, 40, 0.16);
  --ds-control-height: 38px;
  --ds-control-height-compact: 34px;
  --ds-touch-target: 44px;

  /* Backward-compatible semantic aliases used throughout the application. */
  --bg: var(--ds-canvas);
  --page-bg: var(--ds-canvas);
  --canvas: var(--ds-canvas);
  --surface: var(--ds-surface);
  --surface-raised: var(--ds-surface);
  --muted-surface: var(--ds-surface-subtle);
  --surface-soft: var(--ds-surface-subtle);
  --surface-muted: var(--ds-surface-subtle);
  --line: var(--ds-border);
  --line-soft: #eef0f3;
  --border: var(--ds-border);
  --text: var(--ds-text);
  --text-strong: var(--ds-text);
  --muted: var(--ds-text-muted);
  --text-muted: var(--ds-text-muted);
  --muted-strong: #4c5565;
  --blue: var(--ds-accent);
  --blue-dark: var(--ds-accent-hover);
  --blue-hover: var(--ds-accent-hover);
  --blue-soft: var(--ds-accent-soft);
  --blue-wash: #f8f8ff;
  --green: var(--ds-success);
  --green-soft: var(--ds-success-soft);
  --green-wash: #f7fbf9;
  --orange: var(--ds-warning);
  --orange-soft: var(--ds-warning-soft);
  --orange-wash: #fffaf0;
  --red: var(--ds-danger);
  --red-soft: var(--ds-danger-soft);
  --red-wash: #fff8f7;
  --shadow: var(--ds-shadow-panel);
  --shadow-soft: var(--ds-shadow-panel);
  --shadow-raised: var(--ds-shadow-overlay);
  --radius: var(--ds-radius-panel);
  font-family: var(--ds-font-sans);
}

html,
body {
  background: var(--ds-canvas);
  color: var(--ds-text);
  font-family: var(--ds-font-sans);
  font-size: var(--ds-font-body);
  font-weight: var(--ds-weight-regular);
  line-height: var(--ds-leading-copy);
  letter-spacing: 0;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font-family: var(--ds-font-sans);
  letter-spacing: 0;
  font-synthesis: none;
}

button,
a,
input,
select,
textarea,
summary {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--ds-focus);
  outline-offset: 1px;
}

::selection {
  background: var(--ds-accent-soft);
  color: var(--ds-text);
}

/* Shell ------------------------------------------------------------------ */

.app-header {
  border-bottom-color: var(--ds-border);
  background: var(--ds-surface);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04), 0 5px 16px rgba(16, 24, 40, 0.04);
}

.topline,
.workspace-top {
  background: #171b26;
}

.topline {
  min-height: 52px;
  padding-inline: 18px;
}

.brandline {
  gap: 10px;
}

.brandline strong,
.workspace-brand strong {
  font-weight: var(--ds-weight-bold);
  letter-spacing: 0.045em;
}

.brandline span,
.topline-actions,
.workspace-brand small {
  color: #b8c0cf;
}

.version-badge,
.mode-chip {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
  font-weight: 650;
}

.account-button {
  min-height: 34px;
  border-color: rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.account-button:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.095);
}

.account-avatar {
  background: #e5e7ff;
  color: var(--ds-accent-hover);
}

.account-meta strong {
  font-weight: 650;
}

.app-nav {
  min-height: 44px;
  gap: 14px;
  padding: 4px 16px 5px;
  background: var(--ds-surface);
}

.app-nav-primary,
.app-nav-secondary {
  gap: 3px;
}

.app-nav-secondary {
  border-left-color: var(--ds-border);
}

.app-nav-primary a,
.app-nav-secondary a {
  min-height: 32px;
  padding-inline: 10px;
  border-radius: var(--ds-radius-control);
  color: var(--ds-text-muted);
  font-size: 13px;
  font-weight: var(--ds-weight-semibold);
}

.app-nav-secondary a {
  font-size: var(--ds-font-sm);
  font-weight: var(--ds-weight-medium);
  color: #7d8696;
}

.app-nav-primary a::after,
.app-nav-secondary a::after {
  display: none;
}

.app-nav-primary a:hover,
.app-nav-secondary a:hover {
  background: var(--ds-surface-hover);
  color: var(--ds-text);
}

.app-nav-primary a.is-active,
.app-nav-secondary a.is-active {
  background: transparent;
  color: var(--ds-accent-hover);
  box-shadow: inset 0 -2px 0 var(--ds-accent);
}

/* Page hierarchy --------------------------------------------------------- */

.workbench,
.dashboard-focus-page,
.ai-center-page,
.growth-page,
.bitrix-page,
.notebook-page,
.employees-page,
.reconciliation-page,
.service-page,
.sales-page,
.finance-page {
  width: min(1680px, 100%);
  margin-inline: auto;
}

:is(.finance-title-bar, .employee-title-bar, .bitrix-page-title, .growth-page-title, .notebook-titlebar, .service-hero-main, .ai-center-titlebar) h1,
.client-profile-title {
  color: var(--ds-text);
  font-size: clamp(22px, 2vw, 27px);
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.18;
}

:is(.finance-title-bar, .employee-title-bar, .bitrix-page-title, .growth-page-title, .notebook-titlebar, .ai-center-titlebar) p,
.client-profile-subtitle {
  color: var(--ds-text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.panel,
.workspace-panel {
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-panel);
}

.panel-header,
.workspace-panel > header {
  min-height: 48px;
  padding: 12px 15px;
  border-bottom-color: var(--line-soft);
  background: var(--ds-surface);
}

.panel-title,
.workspace-panel h2 {
  color: var(--ds-text);
  font-size: 15px;
  font-weight: 670;
  letter-spacing: -0.015em;
}

.panel-title-stack > span,
.panel-subtitle {
  color: var(--ds-text-muted);
  font-size: 12.5px;
  font-weight: 450;
}

.panel-body {
  padding: 14px 15px;
}

.compact-body {
  padding: 11px 13px;
}

:is(.stat-card, .director-main-metric, .director-metric-list, .director-action-rail, .client-desk-item, .client-desk-metric, .finance-analysis-card, .ai-decision-row, .roadmap-execution-item, .summary-card) {
  border-color: var(--ds-border);
  border-radius: 8px;
  box-shadow: none;
}

:is(.director-main-metric, .director-metric-list, .director-action-rail, .client-command-overview, .finance-movement-toolbar, .summary-card) {
  background: var(--ds-surface-subtle);
}

.section-kicker,
.modal-eyebrow,
.eyebrow {
  color: var(--ds-accent-hover);
  font-size: 11px;
  font-weight: 680;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

/* Controls --------------------------------------------------------------- */

:is(.primary-button, .secondary-button, .ghost-button, .link-button, .mini-button, .small-button, .danger-button, .top-button, .top-link, .button) {
  min-height: var(--ds-control-height);
  padding: 0 12px;
  border-radius: var(--ds-radius-control);
  box-shadow: none;
  font-size: 12.5px;
  font-weight: 630;
  line-height: 1.2;
}

:is(.primary-button, .button:not(.is-secondary):not(.is-quiet):not(.is-danger)) {
  border-color: var(--ds-accent);
  background: var(--ds-accent);
  color: #ffffff;
}

:is(.primary-button, .button:not(.is-secondary):not(.is-quiet):not(.is-danger)):hover {
  border-color: var(--ds-accent-hover);
  background: var(--ds-accent-hover);
}

:is(.secondary-button, .ghost-button, .mini-button, .small-button, .button.is-secondary) {
  border-color: var(--ds-border-strong);
  background: var(--ds-surface);
  color: #3f4755;
}

:is(.secondary-button, .ghost-button, .mini-button, .small-button, .button.is-secondary):hover {
  border-color: color-mix(in srgb, var(--ds-accent) 32%, var(--ds-border-strong));
  background: var(--ds-accent-soft);
  color: var(--ds-accent-hover);
}

.link-button {
  min-height: var(--ds-control-height-compact);
  border-color: transparent;
  background: transparent;
  color: var(--ds-accent-hover);
}

.link-button:hover {
  background: var(--ds-accent-soft);
  color: var(--ds-accent-hover);
}

:is(.danger-button, .button.is-danger) {
  border-color: transparent;
  background: transparent;
  color: var(--ds-danger);
}

:is(.danger-button, .button.is-danger):hover {
  border-color: color-mix(in srgb, var(--ds-danger) 22%, var(--ds-border));
  background: var(--ds-danger-soft);
}

:is(.primary-button, .secondary-button, .ghost-button, .link-button, .mini-button, .small-button, .danger-button, .button).is-compact {
  min-height: var(--ds-control-height-compact);
  padding-inline: 10px;
  font-size: 12px;
}

.app-icon,
.payment-cell-action-icon {
  display: block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

:is(.icon-button, .mini-icon-button, .modal-close, .dialog-close, .arrow-button) {
  display: inline-grid;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--ds-radius-control);
  background: transparent;
  color: var(--ds-text-muted);
  box-shadow: none;
  font-size: 0;
}

:is(.icon-button, .mini-icon-button, .modal-close, .dialog-close, .arrow-button):hover {
  border-color: var(--ds-border);
  background: var(--ds-surface-hover);
  color: var(--ds-text);
}

:is(.icon-button, .mini-icon-button).is-danger,
.icon-button.danger {
  color: var(--ds-text-muted);
}

:is(.icon-button, .mini-icon-button).is-danger:hover,
.icon-button.danger:hover {
  border-color: color-mix(in srgb, var(--ds-danger) 20%, var(--ds-border));
  background: var(--ds-danger-soft);
  color: var(--ds-danger);
}

:is(.icon-button, .mini-icon-button).is-success {
  border-color: transparent;
  background: transparent;
  color: var(--ds-success);
}

:is(.director-action-chip, .quick-action) {
  min-height: 38px;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-control);
  background: var(--ds-surface);
  color: #3f4755;
  box-shadow: none;
  font-size: 12.5px;
  font-weight: 600;
}

:is(.director-action-chip, .quick-action):hover {
  border-color: color-mix(in srgb, var(--ds-accent) 28%, var(--ds-border));
  background: var(--ds-accent-soft);
  color: var(--ds-accent-hover);
  transform: none;
}

:is(.director-action-chip, .quick-action) > span:first-child {
  display: inline-grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: currentColor;
  font-size: 0;
}

:is(.director-action-chip, .quick-action)[data-action="voice-command"],
:is(.director-action-chip, .quick-action).is-confirmed-work {
  border-color: var(--ds-border);
  background: var(--ds-surface);
  color: #3f4755;
}

/* Fields ----------------------------------------------------------------- */

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: var(--ds-control-height);
  border: 1px solid var(--ds-border-strong);
  border-radius: var(--ds-radius-control);
  background: var(--ds-surface);
  color: var(--ds-text);
  box-shadow: none;
  font-size: 13px;
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):hover {
  border-color: #bcc3ce;
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
  border-color: var(--ds-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-focus) 16%, transparent);
  outline: 0;
}

:is(input, select, textarea)::placeholder {
  color: var(--ds-text-faint);
}

:is(.finance-filters, .finance-filterbar, .employee-page-filters, .payment-verification-toolbar, .bitrix-task-filterbar, .bitrix-filterbar, .calendar-filters, .client-history-filters) {
  border-color: var(--ds-border);
  border-radius: 9px;
  background: var(--ds-surface-subtle);
  box-shadow: none;
}

/* Tabs and local navigation --------------------------------------------- */

:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) {
  gap: 3px;
  border-color: var(--ds-border);
  border-radius: 9px;
  background: var(--ds-surface-subtle);
  box-shadow: none;
}

:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button) {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ds-text-muted);
  box-shadow: none;
  font-size: 12.5px;
  font-weight: 600;
}

:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button):hover {
  background: var(--ds-surface-hover);
  color: var(--ds-text);
}

:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button).is-active,
:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button)[aria-current="page"] {
  border: 0;
  background: var(--ds-surface);
  color: var(--ds-accent-hover);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), inset 0 0 0 1px var(--ds-border);
}

/* Tables and dense records ---------------------------------------------- */

table {
  color: var(--ds-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

table thead th,
.sticky-table-head-grid {
  border-color: var(--ds-border);
  background: var(--ds-surface-subtle);
  color: #616a79;
  font-size: 11.5px;
  font-weight: 680;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

table tbody td {
  border-color: var(--line-soft);
  font-size: 13px;
}

table:not(.payment-plan-matrix-table) :is(th, td) {
  padding-top: 9px;
  padding-bottom: 9px;
}

table tbody tr:hover {
  background: color-mix(in srgb, var(--ds-accent-soft) 34%, var(--ds-surface));
}

:is(.finance-table-wrap, .task-table-wrap, .calendar-table-wrap, .client-history-table-wrap, .employee-detail-table-wrap, .bitrix-table-wrap, .sales-table-wrap) {
  border-color: var(--ds-border);
  border-radius: 9px;
  background: var(--ds-surface);
  box-shadow: none;
}

:is(table, .finance-book-row, .calendar-row, .employee-roster-row) :is(strong, b),
:is(.stat-value, .director-main-metric strong, .director-metric-row strong, .client-desk-metric strong, [class*="-amount"], [class*="-money"]) {
  font-variant-numeric: tabular-nums;
}

/* Badges and states ------------------------------------------------------ */

:is(.status-pill, .health-badge, .due-pill, .payment-status-pill, .panel-counter, .panel-count, .payment-plan-legend span) {
  min-height: 23px;
  padding-inline: 8px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.panel-counter,
.panel-count {
  background: var(--ds-surface-muted);
  color: var(--ds-text-muted);
}

.status-pill.is-status-open,
.due-pill.is-today,
.health-badge.is-blue {
  border-color: transparent;
  background: var(--ds-info-soft);
  color: var(--ds-info);
}

.status-pill.is-status-done,
.health-badge.is-green,
.due-pill.is-done {
  border-color: transparent;
  background: var(--ds-success-soft);
  color: var(--ds-success);
}

.status-pill.is-status-waiting,
.health-badge.is-orange,
.due-pill.is-soon {
  border-color: transparent;
  background: var(--ds-warning-soft);
  color: var(--ds-warning);
}

.health-badge.is-red,
.due-pill.is-overdue {
  border-color: transparent;
  background: var(--ds-danger-soft);
  color: var(--ds-danger);
}

.empty-state,
.compact-empty,
.bitrix-empty,
.workspace-message {
  border-color: var(--ds-border);
  border-radius: 8px;
  background: var(--ds-surface-subtle);
  color: var(--ds-text-muted);
  box-shadow: none;
}

/* Financial plan: status owns color, actions stay neutral. */
.plan-month-cell.is-paid {
  background: var(--ds-success-soft);
}

.plan-month-cell.is-invoiced {
  background: var(--ds-warning-soft);
}

.plan-month-cell.is-overdue {
  background: var(--ds-danger-soft);
}

.plan-month-cell.is-partial {
  background: var(--ds-info-soft);
}

.plan-month-cell.is-planned,
.plan-month-cell.is-empty {
  background: var(--ds-surface-muted);
}

.plan-month-cell.is-declared:not(.is-paid):not(.is-overdue):not(.is-invoiced):not(.is-partial) {
  background: var(--ds-surface-muted);
}

.payment-plan-cell-quick-actions {
  gap: 5px;
}

.payment-plan-cell-quick-actions .mini-icon-button,
.payment-plan-cell-quick-actions .payment-cell-quick-invoice,
.payment-plan-cell-quick-actions .payment-cell-quick-paid {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-color: transparent;
  border-radius: var(--ds-radius-control);
  background: color-mix(in srgb, var(--ds-surface) 78%, transparent);
  color: #4f5867;
}

.payment-plan-cell-quick-actions .mini-icon-button:hover {
  border-color: var(--ds-border-strong);
  background: var(--ds-surface);
  color: var(--ds-accent-hover);
}

.payment-plan-cell-quick-actions .payment-cell-quick-invoice.is-active,
.payment-plan-cell-quick-actions .payment-cell-quick-invoice:disabled {
  border-color: transparent;
  background: color-mix(in srgb, var(--ds-surface) 70%, transparent);
  color: var(--ds-warning);
  opacity: 0.72;
}

.payment-verification-badge,
.payment-evidence-gap,
.verification-gap {
  border-color: var(--ds-border-strong);
  background: var(--ds-surface-subtle);
  color: var(--ds-text-muted);
}

/* Overlays --------------------------------------------------------------- */

.modal-backdrop {
  background: rgba(20, 24, 34, 0.42);
  backdrop-filter: blur(5px);
}

.modal-card,
.task-dialog {
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-overlay);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-overlay);
}

.modal-head {
  min-height: 60px;
  padding: 13px 17px;
  border-bottom-color: var(--ds-border);
  background: var(--ds-surface);
}

.modal-head h2,
.task-dialog h2 {
  color: var(--ds-text);
  font-size: 17px;
  font-weight: 680;
  letter-spacing: -0.018em;
}

.modal-form {
  background: var(--ds-surface);
}

.modal-actions {
  border-top-color: var(--ds-border);
  background: var(--ds-surface-subtle);
}

.toast {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: #202531;
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.2);
  font-size: 13px;
}

/* Product-specific surfaces -------------------------------------------- */

.ai-card,
.ai-center-overview {
  border: 1px solid var(--ds-border);
  border-top: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-panel);
}

.ai-card-header,
.ai-decision-detail-head,
.ai-workspace-head,
.ai-conversation-head {
  background: var(--ds-surface);
}

.ai-brief,
.ai-decision-options,
.ai-pulse-strip,
.ai-control-summary {
  background: var(--ds-surface-subtle);
}

.ai-brief-block {
  border: 0;
  border-left: 2px solid var(--ds-border-strong);
  border-radius: 0;
  background: transparent;
}

.ai-decision-row.is-active {
  background: var(--ds-accent-soft);
  box-shadow: inset 2px 0 0 var(--ds-accent);
}

:is(.sales-workspace, .sales-board, .sales-command-panel, .sales-quality-automation, .bitrix-command-panel, .growth-command-panel, .employee-command-panel, .payment-verification-panel) {
  border-color: var(--ds-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-panel);
}

.sales-hero,
.sales-overview,
.sales-toolbar {
  border-color: var(--ds-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-panel);
}

.sales-hero {
  border-left: 2px solid var(--ds-accent);
}

.sales-hero h1,
.sales-metrics strong,
.sales-overview-links strong {
  color: var(--ds-text);
}

.sales-hero p,
.sales-sync-state,
.sales-metrics :is(span, small),
.sales-overview-links :is(span, small) {
  color: var(--ds-text-muted);
}

.sales-finance-note {
  background: var(--ds-surface-muted);
  color: var(--ds-text-muted);
}

.sales-toolbar {
  background: color-mix(in srgb, var(--ds-surface) 96%, transparent);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.07);
}

.sales-tab-group {
  border-right-color: var(--ds-border);
}

.sales-tabs button strong {
  background: var(--ds-surface);
  color: var(--ds-text-muted);
}

.sales-metrics button,
.sales-overview-links button {
  border-color: var(--line-soft);
  background: var(--ds-surface);
  box-shadow: none;
}

.sales-metrics button:hover,
.sales-overview-links button:hover {
  background: var(--ds-surface-hover);
}

.sales-metrics button.is-orange,
.sales-overview-links button.has-attention {
  background: var(--ds-warning-soft);
  box-shadow: inset 2px 0 0 var(--ds-warning);
}

.sales-metrics button.is-green {
  background: var(--ds-success-soft);
  box-shadow: inset 2px 0 0 var(--ds-success);
}

:is(.sales-card, .sales-launch-section, .sales-quality-auto-row, .bitrix-brief-row, .bitrix-decision-row, .employee-today-row, .client-history-row) {
  border-color: var(--ds-border);
  box-shadow: none;
}

/* Employee workspace ---------------------------------------------------- */

.workspace-shell {
  color: var(--ds-text);
}

.workspace-hero h1 {
  color: var(--ds-text);
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 680;
  letter-spacing: -0.03em;
}

.workspace-hero p,
.task-meta,
.task-head span,
.time-row span,
.time-row small,
.context-card span,
.context-card a {
  color: var(--ds-text-muted);
}

.summary-card {
  padding: 14px;
  background: var(--ds-surface);
}

.summary-card strong {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.025em;
}

.task-card,
.time-row,
.context-card {
  border-bottom-color: var(--line-soft);
}

.task-review {
  border-left: 2px solid var(--ds-info);
  background: var(--ds-info-soft);
  color: #45516a;
}

/* Public login uses the same visual vocabulary without sharing app data. */
.login-top {
  background: #171b26;
}

.login-shell {
  border-color: var(--ds-border);
  border-radius: var(--ds-radius-overlay);
  background: var(--ds-surface);
  box-shadow: var(--ds-shadow-overlay);
}

.login-head {
  border-bottom-color: var(--ds-border);
}

.login-head small {
  color: var(--ds-accent-hover);
  font-weight: 680;
  letter-spacing: 0.055em;
}

.login-shell label {
  color: #3f4755;
  font-size: 12.5px;
  font-weight: 630;
}

.login-shell input {
  min-height: var(--ds-touch-target);
}

.login-shell button:not(.mode-link) {
  min-height: var(--ds-touch-target);
  border-radius: var(--ds-radius-control);
  background: var(--ds-accent);
  font-weight: 650;
}

.login-shell button:not(.mode-link):hover {
  background: var(--ds-accent-hover);
}

.login-shell .mode-link {
  color: var(--ds-accent-hover);
}

.login-shell .mode-link:hover {
  background: var(--ds-accent-soft);
}

/* Responsive refinement ------------------------------------------------- */

@media (max-width: 900px) {
  .finance-filters,
  .finance-filterbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 9px;
  }

  .finance-filters > *,
  .finance-filterbar > * {
    min-width: 0;
  }

  .finance-filters :is(input, select, button),
  .finance-filterbar :is(input, select, button) {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .app-nav {
    min-height: 48px;
    padding-block: 2px 4px;
    scroll-padding-inline: 12px;
  }

  .app-nav-primary a,
  .app-nav-secondary a {
    min-height: var(--ds-touch-target);
  }

  .account-button {
    min-height: var(--ds-touch-target);
  }

  :is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button) {
    min-height: var(--ds-touch-target);
  }

  :is(.icon-button, .mini-icon-button, .modal-close, .dialog-close, .arrow-button) {
    width: var(--ds-touch-target);
    height: var(--ds-touch-target);
    min-height: var(--ds-touch-target);
  }

  .app-icon,
  .payment-cell-action-icon {
    width: 19px;
    height: 19px;
  }

  :is(.primary-button, .secondary-button, .ghost-button, .link-button, .mini-button, .small-button, .danger-button, .button):not(.is-compact) {
    min-height: var(--ds-touch-target);
  }

  :is(.director-action-chip, .quick-action) {
    min-height: var(--ds-touch-target);
  }

  .payment-plan-cell-quick-actions .mini-icon-button,
  .payment-plan-cell-quick-actions .payment-cell-quick-invoice,
  .payment-plan-cell-quick-actions .payment-cell-quick-paid {
    width: var(--ds-touch-target);
    height: var(--ds-touch-target);
    min-height: var(--ds-touch-target);
  }
}

@media (max-width: 640px) {
  .topline {
    padding-inline: 12px;
  }

  .workbench,
  .dashboard-focus-page,
  .ai-center-page,
  .growth-page,
  .bitrix-page,
  .notebook-page,
  .employees-page,
  .reconciliation-page,
  .service-page {
    padding-inline: 10px;
  }

  .panel-header,
  .panel-body {
    padding-inline: 12px;
  }

  .modal-card {
    border-radius: 12px;
  }
}

/* Type + Hierarchy -------------------------------------------------------
 * The second visual pass deliberately changes character, scale and rhythm.
 * It keeps every route, control, DOM position and business-state color intact.
 */

body {
  font-feature-settings: "kern" 1, "liga" 1;
}

:is(
  .stat-value,
  .summary-card strong,
  .director-main-metric strong,
  .director-metric-row strong,
  .client-desk-metric strong,
  .ai-pulse-strip strong,
  .sales-metrics strong,
  .sales-overview-links strong,
  [class*="-amount"],
  [class*="-money"]
) {
  font-variant-numeric: tabular-nums lining-nums;
}

.topline {
  min-height: 52px;
}

.brandline strong,
.workspace-brand strong {
  font-weight: var(--ds-weight-bold);
  letter-spacing: 0.07em;
}

.brandline > span:not(.version-badge),
.workspace-brand small {
  font-size: 14px;
  font-weight: var(--ds-weight-regular);
}

.version-badge,
.mode-chip,
.account-meta small {
  font-size: 12px;
  font-weight: var(--ds-weight-medium);
}

.account-meta strong {
  font-size: 13px;
  font-weight: var(--ds-weight-semibold);
}

.app-nav {
  min-height: 44px;
  padding-block: 3px 4px;
}

.app-nav-primary a,
.app-nav-secondary a {
  min-height: 36px;
  padding-inline: 11px;
  font-size: 13px;
  font-weight: var(--ds-weight-semibold);
  letter-spacing: -0.005em;
}

.app-nav-secondary a {
  font-size: var(--ds-font-sm);
  font-weight: var(--ds-weight-medium);
  color: var(--ds-text-faint);
}

.app-nav :is(a.is-active, a[aria-current="page"]) {
  background: transparent;
  color: var(--ds-accent-hover);
  box-shadow: inset 0 -2px 0 var(--ds-accent);
}

:is(.finance-title-bar, .employee-title-bar, .bitrix-title-bar) {
  min-height: 76px;
  padding: 18px 22px;
}

:is(
  .finance-title-bar,
  .employee-title-bar,
  .bitrix-title-bar,
  .bitrix-page-title,
  .growth-page-title,
  .notebook-titlebar,
  .service-hero-main,
  .ai-center-titlebar,
  .sales-hero
) h1,
.client-profile-title,
.workspace-hero h1 {
  margin-block: 0 6px;
  font-size: var(--ds-font-page);
  font-weight: var(--ds-weight-bold);
  line-height: var(--ds-leading-tight);
  letter-spacing: -0.035em;
}

:is(
  .finance-title-bar,
  .employee-title-bar,
  .bitrix-title-bar,
  .bitrix-page-title,
  .growth-page-title,
  .notebook-titlebar,
  .service-hero-main,
  .ai-center-titlebar,
  .sales-hero
) p,
.bitrix-title-bar .panel-title-stack > span,
.client-profile-subtitle,
.workspace-hero p {
  max-width: 76ch;
  font-size: var(--ds-font-lead);
  font-weight: var(--ds-weight-regular);
  line-height: 1.55;
}

.panel-header,
.workspace-panel > header {
  min-height: 54px;
  padding: 12px 17px;
  background: color-mix(in srgb, var(--ds-surface) 97%, var(--ds-surface-subtle));
}

.panel-title,
.workspace-panel h2,
.employee-section-head h2,
.section-title-row h2,
.sales-board-head h2,
.ai-workspace-head h2 {
  font-size: var(--ds-font-section);
  font-weight: var(--ds-weight-semibold);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.panel-title-stack > span,
.panel-subtitle,
.employee-section-head > div > span,
.section-title-row .mini {
  font-size: var(--ds-font-sm);
  font-weight: var(--ds-weight-regular);
  line-height: 1.48;
}

.panel-body {
  padding: 16px 17px;
}

.compact-body {
  padding: 12px 14px;
}

.section-title-row {
  margin-block: 24px 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ds-border);
}

.section-kicker,
.modal-eyebrow,
.eyebrow,
.subhead {
  font-size: var(--ds-font-xs);
  font-weight: var(--ds-weight-bold);
  line-height: 1.3;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

:is(.primary-button, .secondary-button, .ghost-button, .link-button, .mini-button, .small-button, .danger-button, .top-button, .top-link, .button) {
  font-size: 13.5px;
  font-weight: var(--ds-weight-semibold);
}

:is(.primary-button, .secondary-button, .ghost-button, .link-button, .mini-button, .small-button, .danger-button, .button).is-compact {
  font-size: 12.5px;
}

:is(.director-action-chip, .quick-action) {
  min-height: 40px;
  font-size: 13.5px;
  font-weight: var(--ds-weight-medium);
}

:is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  font-size: 14px;
  line-height: 1.35;
}

:is(
  .finance-filters,
  .employee-filterbar,
  .sales-filters,
  .bitrix-filterbar,
  .bitrix-task-filterbar,
  .calendar-filters,
  .payment-verification-toolbar
) {
  padding: 10px 12px;
  border: 1px solid var(--ds-border);
  background: var(--ds-surface-subtle);
}

:is(
  .finance-filters,
  .employee-filterbar,
  .sales-filters,
  .bitrix-filterbar,
  .calendar-filters,
  .modal-form
) label > span {
  color: var(--ds-text-muted);
  font-size: var(--ds-font-sm);
  font-weight: var(--ds-weight-semibold);
  letter-spacing: 0;
  text-transform: none;
}

/* Local navigation is now a rail instead of another card inside the page. */
:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) {
  min-height: 42px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px solid var(--ds-border);
  border-radius: 0;
  background: transparent;
}

:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button) {
  min-height: 42px;
  border-radius: 0;
  font-size: 13px;
  font-weight: var(--ds-weight-medium);
}

:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button):hover {
  background: transparent;
  color: var(--ds-accent-hover);
}

:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button).is-active,
:is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button)[aria-current="page"] {
  background: transparent;
  color: var(--ds-accent-hover);
  box-shadow: inset 0 -2px 0 var(--ds-accent);
}

/* Tables read as one data surface, not a grid of tiny boxes. */
table {
  font-size: 13.5px;
  line-height: 1.45;
}

table thead th,
table th :is(span, strong, small, em, a, button),
.sticky-table-head-grid,
.sticky-table-head-grid span {
  color: var(--ds-text-muted);
  font-size: 11.5px !important;
  font-weight: var(--ds-weight-bold);
  line-height: 1.3;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

table tbody td {
  font-size: 13.5px;
  line-height: 1.45;
}

table td > :is(strong, a),
table td > a > strong {
  font-size: 14px;
  font-weight: var(--ds-weight-semibold);
}

table td :is(small, em) {
  color: var(--ds-text-muted);
  font-size: 12px !important;
  line-height: 1.42;
}

.client-history-table thead th,
.bank-workspace-table th,
.bank-workspace-table td > small {
  font-size: 12.5px !important;
}

.bank-workspace-table select {
  min-height: var(--ds-control-height);
  font-size: 13px;
}

:is(.review-table, .payment-verification-table, .finance-cash-forecast-table, .finance-annual-table, .finance-book-table, .data-quality-table, .bitrix-time-review-table) td {
  font-size: 13.5px !important;
}

table:not(.payment-plan-matrix-table) :is(th, td) {
  padding: 10px 12px;
  border-right-color: transparent;
}

/* Director dashboard: one continuous command surface with strong anchors. */
.director-command-head .panel-title {
  font-size: 23px;
  font-weight: var(--ds-weight-bold);
  letter-spacing: -0.025em;
}

.director-command-body {
  padding-top: 14px;
}

.director-morning-brief,
.director-acceptance-pulse {
  border: 0;
  border-bottom: 1px solid var(--ds-border);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.director-morning-brief.is-red,
.director-acceptance-pulse.is-red {
  box-shadow: inset 3px 0 0 var(--ds-danger);
}

.director-morning-brief.is-orange,
.director-acceptance-pulse.is-orange {
  box-shadow: inset 3px 0 0 var(--ds-warning);
}

.director-morning-brief.is-green,
.director-acceptance-pulse.is-green {
  box-shadow: inset 3px 0 0 var(--ds-success);
}

:is(.director-morning-status, .director-morning-column-head, .director-acceptance-pulse-title) > span,
.director-morning-person span,
.director-morning-bitrix p,
.director-acceptance-pulse :is(span, p) {
  font-size: 13px;
  line-height: 1.45;
}

:is(.director-morning-status, .director-morning-column-head, .director-acceptance-pulse-title) > strong,
.director-morning-person strong,
.director-morning-bitrix > strong {
  font-size: 14.5px;
  font-weight: var(--ds-weight-semibold);
}

.director-overview,
.client-command-overview {
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-panel);
  background: var(--ds-surface);
}

.director-overview > :is(.director-main-metric, .director-metric-list, .director-action-rail),
.client-command-overview > :is(.director-main-metric, .director-metric-list, .client-profile-side) {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.director-overview > :is(.director-metric-list, .director-action-rail),
.client-command-overview > :is(.director-metric-list, .client-profile-side) {
  border-left: 1px solid var(--ds-border);
}

.director-main-metric > span,
.director-metric-row > span {
  font-size: 13px;
  font-weight: var(--ds-weight-medium);
}

.director-main-metric > strong {
  font-size: clamp(32px, 2.4vw, 36px);
  font-weight: var(--ds-weight-bold);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.director-main-metric > em,
.director-metric-row > em {
  font-size: 12.5px;
  font-style: normal;
  line-height: 1.45;
}

.director-metric-row > strong {
  font-size: 16px;
  font-weight: var(--ds-weight-semibold);
}

.director-daily-main > strong,
.director-daily-control > strong {
  font-size: var(--ds-font-card);
  font-weight: var(--ds-weight-semibold);
}

.director-daily-main > span,
.director-daily-control > span {
  font-size: 13px;
  line-height: 1.45;
}

/* Payment matrix remains compact, while clients and sums become legible. */
.payment-plan-matrix .section-title-row h2 {
  font-size: 23px;
  font-weight: var(--ds-weight-bold);
}

.payment-plan-legend {
  padding-block: 8px;
  border-block: 1px solid var(--ds-border);
}

.payment-plan-legend span {
  font-size: 12px;
  font-weight: var(--ds-weight-medium);
}

.payment-plan-matrix-table th {
  font-size: 12px !important;
}

.payment-plan-matrix-table td {
  font-size: 13px !important;
}

.payment-plan-matrix-table td:first-child strong,
.payment-plan-matrix-table td > a > strong,
.plan-cell-summary-button > strong,
.payment-plan-cell-compact > strong {
  font-size: 15px !important;
  font-weight: var(--ds-weight-semibold);
}

.payment-plan-matrix-table td :is(span, em, small),
.payment-plan-matrix-table td:first-child span,
.payment-plan-section-row span,
.plan-row-compact-meta {
  font-size: 12px !important;
  line-height: 1.4;
}

.plan-cell-split b {
  font-size: 12.5px;
  font-weight: var(--ds-weight-semibold);
}

/* Client workspace: one profile band and quieter record rows. */
.client-profile-title {
  margin-top: 4px;
}

.client-profile-card-head > div > em,
.client-profile-legal-identity,
.client-profile-side-row :is(p, strong, a) {
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.client-profile-actions {
  border: 0;
  border-top: 1px solid var(--ds-border);
  border-radius: 0;
  background: transparent;
}

.client-desk-item {
  border: 0;
  border-bottom: 1px solid var(--ds-border);
  border-radius: 0;
  background: transparent;
}

.client-desk-item strong {
  font-size: var(--ds-font-card);
  font-weight: var(--ds-weight-semibold);
}

.client-desk-item p,
.client-desk-item span {
  font-size: 13px;
  line-height: 1.48;
}

/* Sales and AI open their page headers and keep data inside one work surface. */
.sales-hero,
.ai-center-overview {
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.sales-hero h1,
.ai-center-titlebar h1 {
  font-size: clamp(30px, 2.6vw, 36px);
}

.sales-overview,
.sales-toolbar,
.ai-pulse-strip {
  border-color: var(--ds-border);
  box-shadow: none;
}

.sales-metrics button,
.sales-overview-links button {
  border: 0;
  border-right: 1px solid var(--ds-border);
  border-radius: 0;
  background: transparent;
}

.ai-pulse-strip > div {
  border: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
}

.ai-pulse-strip > div + div {
  border-left: 1px solid var(--ds-border);
}

.sales-metrics button:last-child,
.sales-overview-links button:last-child,
.ai-pulse-strip > div:last-child {
  border-right: 0;
}

.sales-metrics strong,
.sales-overview-links strong {
  font-size: 25px;
  font-weight: var(--ds-weight-bold);
  letter-spacing: -0.025em;
}

.ai-pulse-strip strong {
  font-size: 25px;
  font-weight: var(--ds-weight-bold);
  letter-spacing: -0.02em;
}

.sales-card h3,
.ai-decision-row-copy strong {
  font-size: var(--ds-font-card);
  font-weight: var(--ds-weight-semibold);
  line-height: 1.35;
}

.ai-decision-detail-head h2 {
  font-size: 28px;
  font-weight: var(--ds-weight-bold);
  letter-spacing: -0.025em;
}

/* Employee workspace typography follows the same scale. */
.summary-card strong {
  font-size: 28px;
  font-weight: var(--ds-weight-bold);
}

.summary-card span,
.task-head span,
.task-meta,
.time-row span,
.time-row small,
.context-card span,
.context-card a {
  font-size: 13px;
  line-height: 1.45;
}

.task-head strong {
  font-size: var(--ds-font-card);
  font-weight: var(--ds-weight-semibold);
}

.time-row strong,
.context-card strong {
  font-size: 14px;
  font-weight: var(--ds-weight-semibold);
}

@media (max-width: 900px) {
  .director-overview > :is(.director-metric-list, .director-action-rail),
  .client-command-overview > :is(.director-metric-list, .client-profile-side) {
    border-left: 0;
    border-top: 1px solid var(--ds-border);
  }
}

@media (max-width: 820px) {
  :root {
    --ds-control-height: 44px;
    --ds-control-height-compact: 44px;
  }

  html,
  body {
    font-size: 14px;
    line-height: 1.5;
  }

  :is(.finance-title-bar, .employee-title-bar, .bitrix-title-bar) {
    min-height: 0;
    padding: 15px 14px;
  }

  :is(
    .finance-title-bar,
    .employee-title-bar,
    .bitrix-title-bar,
    .bitrix-page-title,
    .growth-page-title,
    .notebook-titlebar,
    .service-hero-main,
    .ai-center-titlebar,
    .sales-hero
  ) h1,
  .client-profile-title,
  .workspace-hero h1 {
    font-size: 26px;
  }

  .panel-header,
  .workspace-panel > header {
    min-height: 52px;
    padding: 11px 12px;
  }

  .panel-title,
  .workspace-panel h2,
  .employee-section-head h2,
  .section-title-row h2 {
    font-size: 17px;
  }

  .panel-body {
    padding: 13px 12px;
  }

  .director-overview > :is(.director-metric-list, .director-action-rail),
  .client-command-overview > :is(.director-metric-list, .client-profile-side) {
    border-left: 0;
    border-top: 1px solid var(--ds-border);
  }

  .director-main-metric > strong {
    font-size: 28px;
  }

  .payment-plan-matrix .section-title-row h2 {
    font-size: 20px;
  }

  .sales-metrics button {
    border-right: 0;
    border-bottom: 1px solid var(--ds-border);
  }

  .sales-metrics button:last-child {
    border-bottom: 0;
  }

  :is(.dashboard-nav, .workspace-nav, .finance-tabs, .finance-tabbar, .docs-tabs, .sales-tabs, .client-portfolio-tabs, .data-quality-tabs, .ai-center-domain-nav, .bitrix-tabs) :is(a, button) {
    min-height: var(--ds-touch-target);
  }

  .app-nav-primary a,
  .app-nav-secondary a,
  .account-button,
  :is(.primary-button, .secondary-button, .ghost-button, .link-button, .mini-button, .small-button, .danger-button, .button).is-compact,
  :is(.director-action-chip, .quick-action, .status-action),
  .status-action.is-compact {
    min-height: var(--ds-touch-target);
  }

  .status-action.is-compact {
    width: var(--ds-touch-target);
    min-width: var(--ds-touch-target);
    height: var(--ds-touch-target);
    flex-basis: var(--ds-touch-target);
  }

  .modal-card .modal-close,
  .task-dialog .dialog-close {
    width: var(--ds-touch-target) !important;
    min-width: var(--ds-touch-target);
    height: var(--ds-touch-target);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
