@font-face {
  font-family: 'Montserrat';
  src: url('/assets/fonts/montserrat-variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --brand-navy: #0e2648;
  --brand-yellow: #ffcc00;
  --explanation: #a34406;
  --explanation-soft: #fff4e9;
  --ink: #192c43;
  --muted: #5d6d80;
  --line: #dfe5ed;
  --paper: #fff;
  --back: #f3f5f9;
  --blue: var(--brand-navy);
  --teal: #23614e;
  --soft: #edf6f0;
  --danger: #a02f38;
  --danger-soft: #fff1f1;
  --warning: #79560a;
  --warning-soft: #fff8dd;
  --focus: #2569b3;
  --control-line: #cfd8e3;
  --control-hover-line: #a8b8cb;
  --control-hover: #f2f5f9;
  --control-active: #e8edf4;
  --field-line: #cbd5e1;
  --field-hover-line: #8b9db3;
  --placeholder: #68788a;
  --disabled: #edf1f5;
  --neutral-soft: #edf1f6;
  --neutral-ink: #536579;
  --info: #214c7e;
  --info-soft: #edf4fc;
  --info-line: #c8d9ef;
  --success: #24614e;
  --success-soft: #edf7f0;
  --success-line: #c5dfcf;
  --danger-line: #e9c5cb;
  --danger-control-line: #e7c6cb;
  --danger-hover-line: #ce9ca4;
  --warning-line: #e8dba8;
  --stopped-ink: #6c6372;
  --stopped-soft: #f0edf3;
  --table-head: #f8f9fc;
  --table-head-ink: #526378;
  --row-line: #e9edf3;
  --row-hover: #f8faff;
  --link-line: #a6b6c9;
  --strong-ink: #0e2648;
  --inset: #f4f6fa;
  --preview: #eef3fa;
  --positive-label: #426751;
  --void-soft: #f7f2f4;
  --void-line: #e5d7dd;
  --history-line: #cfd9e5;
  --history-dot: #94a9c2;
  --history-arrow: #71849d;
  --action-icon: #637b99;
  --skeleton: #e4e9f0;
  --accent-control: #0e2648;
  --radius: 12px;
  --sidebar-width: 264px;
  font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
}

/* Тъмните стойности са само за екран; печатът запазва светлата палитра. */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e7edf7;
    --explanation: #ffb570;
    --explanation-soft: #32281f;
    --muted: #a4b3c7;
    --line: #2b3a50;
    --paper: #131f31;
    --back: #0b1220;
    --blue: #a9cfff;
    --teal: #8cdbb2;
    --soft: #173b31;
    --danger: #ffacb6;
    --danger-soft: #3e242e;
    --warning: #f4d783;
    --warning-soft: #3b321d;
    --focus: #91bdff;
    --control-line: #43546d;
    --control-hover-line: #6e839f;
    --control-hover: #1c2b41;
    --control-active: #273951;
    --field-line: #586d89;
    --field-hover-line: #8ca2bf;
    --placeholder: #a0aec0;
    --disabled: #1b293b;
    --neutral-soft: #26364d;
    --neutral-ink: #c0cde0;
    --info: #a8ceff;
    --info-soft: #1d304b;
    --info-line: #3e5d84;
    --success: #93dab7;
    --success-soft: #173a30;
    --success-line: #3b6a55;
    --danger-line: #78444e;
    --danger-control-line: #78444e;
    --danger-hover-line: #c47b89;
    --warning-line: #78642e;
    --stopped-ink: #c7bdd8;
    --stopped-soft: #312a3c;
    --table-head: #1b2a3f;
    --table-head-ink: #b9c7db;
    --row-line: #28384e;
    --row-hover: #1a2940;
    --link-line: #607fa6;
    --strong-ink: #e7edf7;
    --inset: #1b2a3e;
    --preview: #1c2e47;
    --positive-label: #9fd0b4;
    --void-soft: #332631;
    --void-line: #634050;
    --history-line: #3e516c;
    --history-dot: #8096b4;
    --history-arrow: #a4b3c7;
    --action-icon: #a4bfe1;
    --skeleton: #24334a;
    --accent-control: #ffcc00;
  }
}

* { box-sizing: border-box; }
html { scroll-padding-top: 88px; }
body { margin: 0; background: var(--back); color: var(--ink); font-size: 14px; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; text-underline-offset: .22em; }
button, a { touch-action: manipulation; }
button:disabled { cursor: not-allowed; opacity: .48; }
form[aria-busy='true'] button { cursor: progress; }
input, textarea { caret-color: var(--ink); }
::selection { background: var(--brand-yellow); color: var(--brand-navy); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.875rem; line-height: 1.25; letter-spacing: -.035em; font-weight: 730; overflow-wrap: anywhere; text-wrap: balance; }
h2 { font-size: 1.125rem; line-height: 1.4; letter-spacing: -.02em; font-weight: 700; }
h3 { font-size: .9375rem; font-weight: 680; line-height: 1.5; }
.icon { width: 20px; height: 20px; flex: 0 0 20px; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.65; }
.full { width: 100%; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.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; }
.eyebrow { display: none; }

/* Единна навигация и работно пространство. */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); padding: 32px 18px 20px; background: var(--brand-navy); color: #fff; display: flex; flex-direction: column; z-index: 30; overflow-y: auto; }
.sidebar-brand { padding: 0 17px 30px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: #fff; }
.brand-logo { display: block; width: 44px; height: 52px; object-fit: contain; flex-shrink: 0; }
.brand-copy { display: flex; flex-direction: column; gap: 5px; }
.brand-wordmark { color: #fff; font-size: 23px; font-weight: 740; line-height: 1.2; letter-spacing: -.03em; white-space: nowrap; }
.brand-product { color: var(--brand-yellow); font-size: 12px; font-weight: 650; letter-spacing: .025em; line-height: 1.25; }
.sidebar-caption { margin-top: 13px; font-size: 10px; color: #b8c8dc; }
.navigation { display: grid; gap: 23px; }
.nav-group { display: grid; gap: 4px; }
.nav-group-label { font-size: 10px; color: #a8bbd4; padding: 0 14px 6px; font-weight: 550; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 8px; color: #dae3ef; font-size: 12px; font-weight: 550; line-height: 1.45; transition: background 160ms ease-out, color 160ms ease-out; }
.nav-link .icon { opacity: .75; width: 19px; height: 19px; flex-basis: 19px; }
.nav-link:hover { color: #fff; background: #1b375b; }
.nav-link.selected { color: var(--brand-navy); background: var(--brand-yellow); font-weight: 720; }
.nav-link.selected .icon { opacity: 1; }
.sidebar :focus-visible { outline-color: var(--brand-yellow); }
.sidebar-user { margin-top: auto; padding: 24px 12px 0; display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #254263; color: #fff; font-weight: 700; flex-shrink: 0; }
.sidebar-user-info { min-width: 0; }
.sidebar-user strong { display: block; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.sidebar-user p { font-size: 10px; color: #b8c8dc; margin-top: 2px; }
.workspace { min-width: 0; width: calc(100% - var(--sidebar-width)); margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.topbar { min-height: 76px; padding: 15px 36px; background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-location, .topbar-actions { display: flex; align-items: center; gap: 20px; min-width: 0; }
.workspace-label { color: var(--ink); font-size: 12px; font-weight: 600; }
.breadcrumb-detail { color: var(--muted); font-size: 11px; padding-left: 18px; border-left: 1px solid var(--line); }
.today-label { color: var(--muted); font-size: 11px; white-space: nowrap; }
.menu-toggle { display: none !important; }
.main-content { padding: 34px 36px 48px; width: 100%; max-width: 1536px; margin: 0 auto; flex: 1; }
.main-content:focus { outline: none; }
.workspace-footer { margin: auto 36px 0; padding: 16px 0 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 10px; }
.page-stack { display: grid; gap: 24px; min-width: 0; }
.page-stack > * { min-width: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 0 5px; }
.page-heading > div { min-width: 0; }
.page-heading h1 { margin-bottom: 8px; }
.page-heading .muted { max-width: 76ch; font-size: 12px; line-height: 1.75; }
.page-heading > .button { flex-shrink: 0; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; background: var(--paper); min-width: 0; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.card-heading > div { min-width: 0; }
.card-heading h2 + p { margin-top: 6px; }
.card-heading .button { flex-shrink: 0; }
.profile-card { width: 100%; max-width: none; }
.profile-card > h2 + p { margin-top: 8px; }
.card > h3 { margin-top: 26px; margin-bottom: 14px; }
.card > h3 + .history-list { margin-top: 15px; }
.card > .details-grid + h3 { margin-top: 28px; }
.details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 36px; margin: 0; }
.details-grid dt { color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.details-grid dd { margin: 0; font-size: 13px; font-weight: 560; overflow-wrap: anywhere; }
.client-workspace > .page-heading .status { flex-shrink: 0; }
.back-link { display: inline-flex; color: var(--muted); font-size: 11px; margin-bottom: 15px; }
.back-link:hover { color: var(--blue); text-decoration: underline; }

/* Еднакви форми, потвърждения и състояния по всички маршрути. */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 10px 16px; border: 1px solid var(--control-line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 650; line-height: 1.45; text-align: center; transition: background 160ms ease-out, border-color 160ms ease-out, color 160ms ease-out; }
.button .icon { width: 17px; height: 17px; flex-basis: 17px; }
.button:hover:not(:disabled) { border-color: var(--control-hover-line); background: var(--control-hover); }
.button:active:not(:disabled) { background: var(--control-active); }
.button.primary { color: var(--brand-navy); background: var(--brand-yellow); border-color: var(--brand-yellow); }
.button.primary:hover:not(:disabled) { background: #f0c000; border-color: #f0c000; }
.button.primary:active:not(:disabled) { background: #e3b600; }
.button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.button.ghost:hover:not(:disabled) { color: var(--ink); background: var(--neutral-soft); border-color: transparent; }
.button.danger { color: var(--danger); background: var(--paper); border-color: var(--danger-control-line); }
.button.danger:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger-hover-line); }
.button.small { min-height: 34px; padding: 7px 11px; font-size: 11px; }
.logout-button { font-size: 11px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; min-width: 0; }
.field label { font-weight: 650; font-size: 11px; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 12px; line-height: 1.5; transition: border-color 160ms ease-out; }
.field textarea { resize: vertical; min-height: 92px; }
.field select { padding-right: 28px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--field-hover-line); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 2px; }
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); opacity: 1; }
.field input:disabled, .field select:disabled, .field textarea:disabled { background: var(--disabled); color: var(--muted); cursor: not-allowed; }
.field input:user-invalid, .field textarea:user-invalid, .field select:user-invalid { border-color: var(--danger); }
.field > .small { font-size: 11px; }
.form-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding-top: 10px; }
form > p.muted { margin-bottom: 22px; }
.notice { padding: 14px 16px; border-radius: 8px; color: var(--danger); border: 1px solid var(--danger-line); background: var(--danger-soft); margin-bottom: 20px; font-size: 12px; line-height: 1.65; }
.notice:has(> .icon) { display: flex; gap: 10px; align-items: flex-start; }
.notice > .icon { margin-top: 1px; width: 18px; height: 18px; flex-basis: 18px; }
.notice > div { min-width: 0; }
.notice.info { color: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.notice.success { color: var(--success); border-color: var(--success-line); background: var(--success-soft); }
.notice.warning { color: var(--warning); border-color: var(--warning-line); background: var(--warning-soft); }
.notice.warning p { margin-top: 6px; }
.notice.warning ul { padding-left: 20px; margin: 8px 0 0; }
.page-stack > .notice { margin: 0; }
.pill, .status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 5px; font-size: 10px; font-weight: 650; line-height: 1.5; background: var(--soft); color: var(--teal); white-space: nowrap; }
.pill.subtle { background: var(--neutral-soft); color: var(--neutral-ink); font-weight: 550; }
.pill.warning, .status.warning { background: var(--warning-soft); color: var(--warning); }
.pill.danger, .status.danger { background: var(--danger-soft); color: var(--danger); }
.role-pill { background: var(--neutral-soft); }
.role-pill .icon { width: 13px; height: 13px; flex-basis: 13px; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status.stopped { color: var(--stopped-ink); background: var(--stopped-soft); }
.pill + .pill, .status + .pill { margin-left: 5px; }
.empty-state { padding: 48px 24px; text-align: center; }
.empty-state h3, .empty-state h2 { margin-bottom: 9px; }
.empty-state p { font-size: 12px; max-width: 62ch; margin-left: auto; margin-right: auto; }
.empty-state .button { margin-top: 20px; }
.error-state { margin: 36px auto; max-width: 680px; padding: 36px; }
.error-state > .icon { width: 32px; height: 32px; color: var(--danger); margin-bottom: 18px; }
.error-state h1 { font-size: 1.5rem; margin-bottom: 20px; }
.error-state > .button { margin-right: 10px; }

/* Данни: заглавията и редовете водят, числата пазят еднаква ширина. */
.table-card { padding: 0; overflow: hidden; }
.table-title { padding: 22px 26px 18px; border-bottom: 1px solid var(--line); }
.table-title p { margin-top: 6px; font-size: 11px; }
.table-scroll { overflow: auto; max-width: 100%; overscroll-behavior-x: contain; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table th { background: var(--table-head); color: var(--table-head-ink); font-size: 10px; font-weight: 680; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 18px 20px; font-size: 12px; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
.data-table th:first-child, .data-table td:first-child { padding-left: 26px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 26px; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--row-hover); }
.data-table td strong { font-weight: 650; }
.data-table td > .button + .button { margin-left: 7px; }
.team-table { table-layout: fixed; min-width: 900px; }
.team-table th:nth-child(1) { width: 18%; }
.team-table th:nth-child(2) { width: 22%; }
.team-table th:nth-child(3) { width: 14%; }
.team-table th:nth-child(4) { width: 12%; }
.team-table th:nth-child(5) { width: 10%; }
.team-table th:nth-child(6) { width: 24%; }
.team-table td { white-space: normal; overflow-wrap: anywhere; }
.team-table .team-actions > .button { display: flex; width: max-content; max-width: 100%; white-space: normal; text-align: left; }
.team-table .team-actions > .button + .button { margin: 8px 0 0; }
.client-link { color: var(--blue); font-weight: 650; text-decoration: underline; text-decoration-color: var(--link-line); text-underline-offset: 4px; }
.client-link:hover { text-decoration-color: var(--blue); }
.data-table .money-value { font-weight: 600; white-space: nowrap; }
.client-filters { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(200px, 1fr) auto; gap: 16px; align-items: end; padding: 21px 24px; }
.client-filters:has(#reminderView) { grid-template-columns: 1fr 1.2fr 1fr auto; }
.archive-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.archive-table { table-layout: fixed; min-width: 1040px; }
.archive-table th:nth-child(1) { width: 20%; }
.archive-table th:nth-child(2) { width: 14%; }
.archive-table th:nth-child(3) { width: 16%; }
.archive-table th:nth-child(4) { width: 14%; }
.archive-table th:nth-child(5) { width: 21%; }
.archive-table th:nth-child(6) { width: 15%; }
.archive-table th, .archive-table td { white-space: normal; overflow-wrap: anywhere; }
.archive-table .table-prose { min-width: 0; max-width: none; }
.archive-table .status { white-space: normal; overflow-wrap: normal; max-width: 100%; }

.client-filters .field, .report-filters .field { margin: 0; }
.filter-actions { display: flex; gap: 8px; }
.summary-row { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.summary-card { min-width: 0; }
.summary-row > .summary-card { padding: 20px 24px; display: flex; flex: 1; justify-content: space-between; gap: 20px; align-items: center; }
.summary-row > .summary-card + .summary-card { border-left: 1px solid var(--line); }
.summary-card span { font-size: 12px; color: var(--muted); }
.summary-card strong { color: var(--ink); font-size: 22px; font-weight: 680; font-variant-numeric: tabular-nums; }
.report-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.report-metrics > .summary-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 22px; border-bottom: 1px solid var(--line); }
.report-metrics > .summary-card:nth-child(odd) { border-right: 1px solid var(--line); }
.report-metrics > .summary-card:last-child { border-bottom: 0; }
.report-metrics > .summary-card:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.report-metrics dt { color: var(--muted); font-size: 11px; line-height: 1.65; }
.report-metrics dd { max-width: 100%; overflow-x: auto; margin: 0; color: var(--ink); font-size: 18px; font-weight: 680; line-height: 1.5; font-variant-numeric: tabular-nums; }
.report-metrics dd .money-value { color: inherit; font-size: inherit; white-space: nowrap; }
.report-workspace .profile-card > .report-metrics { margin-top: 20px; border: 0; border-radius: 0; }
.report-filters { padding: 21px 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 14px; }
.client-service-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 185px; max-width: 300px; white-space: normal; }
.client-service-cell strong { font-size: 12px; font-variant-numeric: tabular-nums; }
.finance-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.context-help { margin-bottom: 28px; padding: 24px 28px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 24px; }
.context-help[hidden] { display: none; }
.help-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.help-heading h2 { margin-bottom: 7px; }
.help-search { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
.help-search .field { margin: 0 0 14px; }
.help-topic { border-bottom: 1px solid var(--line); }
.help-topic:last-child { border-bottom: 0; }
.dialog-help { margin: 0 0 22px; padding: 0 16px; background: var(--inset); border-radius: 7px; }
.dialog-help > summary { padding: 13px 0; cursor: pointer; font-size: 12px; font-weight: 650; }
.help-topic > summary, .current-report > summary { cursor: pointer; font-weight: 650; padding: 18px 0; color: var(--ink); }
.help-copy { max-width: 72ch; font-size: 13px; line-height: 1.8; padding: 0 0 22px; }
.help-copy p, .help-copy ol { margin: 0 0 16px; }
.help-copy h3 { font-size: 13px; margin: 22px 0 10px; }
.help-copy li + li { margin-top: 10px; }
.help-example { padding: 15px 18px; background: var(--inset); border-radius: 7px; }
.help-example h3 { margin-top: 0; }
.help-example p:last-child { margin-bottom: 0; }
.current-report { padding: 0 24px 20px; }
.current-report:not([open]) { padding-bottom: 0; }
.report-explanation { max-width: 85ch; }
@media (max-width: 760px) {
  .help-button-text { display: none; }
  .help-toggle { min-width: 40px; min-height: 40px; padding: 9px; }
  .context-help { padding: 20px; }
  .help-search { grid-template-columns: 1fr; gap: 0; }
  .help-copy { font-size: 13px; }
}
.finance-actions .button { background: var(--paper); border-color: var(--control-line); color: var(--ink); }
.finance-actions .button.primary:is(:hover, :active):not(:disabled) { color: var(--brand-navy); }
.finance-actions .button:first-child { background: var(--brand-yellow); border-color: var(--brand-yellow); color: var(--brand-navy); }
.report-empty { padding: 26px; font-size: 12px; }
.finance-form .form-actions { flex-wrap: wrap; }

/* Началното табло е работен преглед, без измислени графики. */
.dashboard-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.dashboard-tile { display: grid; grid-template-columns: 1fr auto; gap: 13px; padding: 24px; transition: background 160ms ease-out; }
.dashboard-tile + .dashboard-tile { border-left: 1px solid var(--line); }
.dashboard-tile .icon { color: var(--muted); }
.dashboard-tile span { grid-column: 1/-1; color: var(--muted); font-size: 11px; }
.dashboard-tile strong { font-size: 28px; line-height: 1.1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.dashboard-tile:hover { background: var(--row-hover); }
.dashboard-tile.has-attention strong { color: var(--danger); }
.dashboard-content { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
.action-list { margin: 8px 0 0; padding: 0; list-style: none; }
.action-row { display: flex; align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.action-list li:last-child .action-row { border-bottom: 0; padding-bottom: 0; }
.action-row > .icon:first-child { color: var(--action-icon); width: 23px; height: 23px; flex-basis: 23px; }
.action-row > .icon:last-child { margin-left: auto; color: var(--muted); }
.action-row h3 { font-size: 12px; }
.action-row p { font-size: 11px; color: var(--muted); margin-top: 4px; }
.action-row:hover h3 { text-decoration: underline; text-underline-offset: 4px; }
.dashboard-note { background: var(--brand-navy); color: #fff; border: 0; }
.dashboard-note h2 { color: var(--brand-yellow); margin-bottom: 16px; }
.dashboard-note p { font-size: 12px; color: #d3dfef; line-height: 1.9; margin-bottom: 24px; }
.dashboard-note .button { width: 100%; }
.dashboard-note > .small { margin-top: 18px; margin-bottom: 0; color: #aebfd6; font-size: 10px; }

/* Абонаменти, плащания, работни записи и проследима история. */
.operator-client-list { list-style: none; padding: 0; margin: 0; }
.operator-client-list li { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.operator-client-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.operator-client-list li:first-child { padding-top: 14px; }
.operator-client-list li > div:first-child { min-width: 0; }
.operator-client-list li p { margin-top: 5px; }
.operator-client-list li p.small:not(.muted) { padding: 8px 11px; background: var(--inset); border-radius: 5px; margin-top: 10px; }
.period-list { display: grid; gap: 0; margin-top: 20px; }
.period-card { padding: 24px 0; border-top: 1px solid var(--line); }
.period-card:first-child { padding-top: 0; border-top: 0; }
.period-card:last-child { padding-bottom: 0; }
.period-card-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.period-card-heading h3 { font-size: 13px; }
.period-card-heading p { margin-top: 5px; }
.period-price { white-space: nowrap; font-size: 23px; color: var(--strong-ink); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.period-actions { display: flex; justify-content: flex-end; margin-top: 19px; }
.period-history { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.period-history summary, .work-versions summary { cursor: pointer; font-weight: 650; font-size: 11px; color: var(--blue); padding: 4px 0; }
.period-history .history-list { margin-top: 23px; }
.period-form-intro { margin-bottom: 23px; }
.period-form-row { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; }
.period-preview { padding: 18px; margin: 18px 0; background: var(--preview); border-radius: 8px; }
.period-preview h3 { font-size: 12px; margin-bottom: 12px; }
.period-preview p { font-size: 12px; }
.period-preview .details-grid { gap: 16px; }
.period-preview .details-grid dd { font-size: 12px; }
.payment-coverage { margin: 0 0 22px; padding: 17px 20px; background: var(--soft); border-radius: 8px; }
.payment-coverage dt { font-size: 11px; color: var(--positive-label); margin-bottom: 5px; }
.payment-coverage dd { margin: 0; font-size: 13px; font-weight: 650; color: var(--success); }
.receipt-list { margin: 22px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.receipt-list:empty { display: none; }
.receipt-card { padding: 19px 20px; background: var(--inset); border-radius: 8px; min-width: 0; }
.receipt-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 8px; }
.receipt-heading strong { font-variant-numeric: tabular-nums; }
.receipt-details { margin-top: 17px; gap: 16px 30px; }
.receipt-details dd { font-size: 11px; }
.receipt-void { background: var(--void-soft); }
.payment-void-reason { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--void-line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.payment-form-balance { background: var(--soft); border-radius: 8px; padding: 16px; margin: 20px 0; }
.payment-form-balance p { margin-top: 7px; }
.history-list { list-style: none; margin: 0; padding: 0; }
.history-event { position: relative; padding: 0 0 23px 24px; margin-left: 3px; border-left: 1px solid var(--history-line); }
.history-event::before { content: ''; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--history-dot); }
.history-event:last-child { padding-bottom: 0; }
.history-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.history-heading strong { font-size: 12px; font-weight: 650; }
.history-event p { margin-top: 6px; font-size: 12px; }
.change-list { display: grid; gap: 10px; margin: 14px 0 0; }
.change-list dt { font-size: 10px; color: var(--muted); }
.change-list dd { margin: 4px 0 0; font-size: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.change-before { color: var(--muted); }
.change-arrow { color: var(--history-arrow); }
.work-list { list-style: none; margin: 0; padding: 0; }
.work-entry { border-top: 1px solid var(--line); padding: 23px 0; overflow-wrap: anywhere; }
.work-entry:first-child { border-top: 0; padding-top: 0; }
.work-entry:last-child { padding-bottom: 0; }
.work-content { margin: 14px 0; font-size: 13px; overflow-wrap: anywhere; }
.work-entry-actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 17px; }
.work-versions { flex: 1; min-width: 0; }
.work-versions .history-list { margin-top: 20px; }
.work-call-details { margin: 20px 0; gap: 17px 30px; }
.work-call-details dd { font-weight: 500; font-size: 12px; }
.work-call-details > div:nth-child(n+3) { grid-column: 1/-1; }
.package-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.package-card h2 { overflow-wrap: anywhere; }
.package-card .card-heading { align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.package-card > .muted { font-size: 12px; }
.package-card .period-actions { margin-top: 27px; }

/* Административни настройки. */
.access-section { margin-top: 26px; padding-top: 23px; border-top: 1px solid var(--line); }
.access-section h3 { font-size: 13px; margin-bottom: 7px; }
.access-section > p { margin-bottom: 17px; }
.password-form { max-width: 430px; }
.permission-selector { max-width: 620px; }
.permission-selector .field { margin: 0; }
.permissions-form { max-width: none; }
.permission-areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.section-intro { margin-top: 9px; margin-bottom: 23px; max-width: 80ch; }
.permission-operator-list { margin: 5px 0 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 14px; max-height: 280px; overflow: auto; }
.permission-operator-list legend { font-size: 11px; color: var(--muted); padding: 0 7px; }
.transfer-client-list { min-width: 0; max-height: none; overflow: visible; }
.permission-checkbox { display: flex; align-items: center; gap: 11px; cursor: pointer; font-size: 12px; }
.permission-checkbox input { width: 18px; height: 18px; accent-color: var(--accent-control); flex-shrink: 0; }
.permission-actions { display: grid; gap: 19px; padding: 3px 0; }
.permission-footer { display: flex; justify-content: space-between; align-items: center; gap: 28px; }
.permission-footer p { max-width: 65ch; }

/* Диалозите пазят фокуса и превъртат независимо от таблиците. */
.dialog { width: min(560px, calc(100vw - 40px)); max-height: calc(100dvh - 64px); padding: 28px; border: 0; border-radius: 14px; background: var(--paper); color: var(--ink); box-shadow: 0 22px 80px rgba(5, 24, 48, .24); overflow-y: auto; overscroll-behavior: contain; }
.dialog::backdrop { background: rgba(5, 22, 45, .6); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--line); }
.dialog-heading h2 { font-size: 19px; line-height: 1.45; }
.dialog-close { flex-shrink: 0; width: 36px; min-height: 36px; padding: 7px; }
.dialog .form-actions { margin-top: 22px; padding-top: 19px; border-top: 1px solid var(--line); }
.dialog .form-actions .button.primary { margin-left: auto; }
.dialog > form > p.muted { margin-top: -4px; }

/* Вход — оригиналната идентичност, ясна служебна задача. */
.login-layout { min-height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--paper); }
.login-story { padding: 48px 64px 36px; background: var(--brand-navy); color: #fff; display: flex; flex-direction: column; min-width: 0; }
.login-story .brand-logo { width: 52px; height: 62px; }
.login-story .brand-wordmark { font-size: 28px; }
.login-story .brand-product { font-size: 14px; }
.story-copy { margin: auto 0; padding: 75px 0; max-width: 560px; }
.story-copy h1 { font-size: 2.75rem; line-height: 1.25; letter-spacing: -.035em; font-weight: 700; margin-bottom: 25px; }
.story-copy h1 span { color: var(--brand-yellow); }
.story-copy > p { color: #c6d5e8; max-width: 44ch; font-size: 14px; line-height: 1.9; }
.login-features { margin: 38px 0 0; padding: 0; list-style: none; display: grid; gap: 18px; }
.login-features li { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #e0e9f5; }
.login-features .icon { color: var(--brand-yellow); width: 18px; height: 18px; flex-basis: 18px; }
.story-footer { color: #aebfd6; font-size: 10px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px; }
.login-card { width: 100%; max-width: 370px; }
.login-card h2 { font-size: 28px; line-height: 1.25; letter-spacing: -.03em; margin-bottom: 11px; }
.login-card > p { font-size: 12px; }
.login-form { margin-top: 30px; }
.login-form .field { margin-bottom: 23px; }
.login-form .field input { min-height: 48px; font-size: 13px; }
.login-form .button { min-height: 48px; margin-top: 6px; font-size: 13px; }
.login-help { text-align: center; margin-top: 25px; line-height: 1.8; }

/* Зареждането запазва структурата; няма декоративни входни анимации. */
.boot-loading { padding: 40px; font-size: 13px; color: var(--muted); }
.loading { padding: 28px 0; font-size: 12px; color: var(--muted); }
.loading-state { display: grid; gap: 24px; }
.skeleton { background: var(--skeleton); border-radius: 8px; }
.skeleton-title { height: 60px; max-width: 400px; }
.skeleton-toolbar { height: 100px; }
.skeleton-content { height: 330px; }
.skip-link { position: fixed; left: 14px; top: -100px; background: var(--brand-yellow); color: var(--brand-navy); padding: 10px 16px; border-radius: 5px; font-weight: 650; z-index: 100; }
.skip-link:focus { top: 14px; }

@media (min-width: 1600px) {
  .main-content { padding-top: 42px; }
  .topbar { padding-left: 48px; padding-right: 48px; }
}
@media (max-width: 1250px) {
  :root { --sidebar-width: 236px; }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .main-content { padding: 28px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .today-label { display: none; }
  .report-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-filters > .button { grid-column: 1/-1; justify-self: start; }
  .client-filters:has(#reminderView) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-filters:has(#reminderView) > .button { justify-self: start; }
  .dashboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-tile:nth-child(3) { border-left: 0; }
  .dashboard-tile:nth-child(n+3) { border-top: 1px solid var(--line); }
  .dashboard-content { grid-template-columns: 1fr; }
  .dashboard-note { display: grid; grid-template-columns: 1fr auto; gap: 0 24px; align-items: center; }
  .dashboard-note h2, .dashboard-note p { grid-column: 1; }
  .dashboard-note p { margin-bottom: 0; }
  .dashboard-note .button { grid-column: 2; grid-row: 1/3; }
  .dashboard-note .small { grid-column: 1/-1; }
}
@media (max-width: 1000px) {
  .login-story { padding: 38px; }
  .story-copy h1 { font-size: 2.25rem; }
  .client-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-actions { grid-column: 1/-1; }
  .topbar-actions { gap: 10px; }
  .breadcrumb-detail { display: none; }
  .page-heading { flex-wrap: wrap; align-items: flex-start; gap: 18px; }
  .report-metrics { grid-template-columns: 1fr; }
  .report-metrics > .summary-card:nth-child(odd) { border-right: 0; }
  .report-metrics > .summary-card:nth-last-child(2):nth-child(odd) { border-bottom: 1px solid var(--line); }
  .summary-row > .summary-card { padding: 17px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .card-heading { flex-wrap: wrap; gap: 15px; }
  .workspace-footer { margin-left: 28px; margin-right: 28px; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 80px; }
  .app-shell { display: block; }
  .workspace { width: 100%; margin-left: 0; }
  .sidebar { visibility: hidden; transform: translateX(-100%); transition: transform 160ms ease-out, visibility 160ms; width: 264px; top: 70px; box-shadow: 15px 15px 35px rgba(5, 24, 48, .18); }
  .sidebar.is-open { visibility: visible; transform: translateX(0); }
  .sidebar .navigation { gap: 19px; }
  .sidebar-brand { padding-bottom: 24px; }
  .sidebar-user { padding-top: 25px; }
  .menu-toggle { display: inline-flex !important; padding: 7px; min-height: 36px; font-size: 11px; gap: 6px; }
  .topbar { min-height: 70px; position: sticky; top: 0; z-index: 40; padding: 14px 16px; }
  .topbar-location { gap: 12px; }
  .workspace-label { font-size: 11px; }
  .topbar-actions { gap: 3px; }
  .role-pill { display: none; }
  .logout-button { min-height: 36px; padding: 7px; font-size: 10px; gap: 5px; }
  .main-content { padding: 26px 20px 36px; }
  .workspace-footer { margin-left: 20px; margin-right: 20px; font-size: 9px; }
  .workspace-footer span:last-child { display: none; }
  h1 { font-size: 1.625rem; }
  .page-stack { gap: 20px; }
  .page-heading { gap: 16px; }
  .page-heading h1 { margin-bottom: 8px; }
  .page-heading .muted { font-size: 11px; }
  .card { padding: 22px 20px; }
  .table-card { padding: 0; }
  .table-title { padding: 20px; }
  .data-table th, .data-table td { padding-left: 17px; padding-right: 17px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 20px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 20px; }
  .client-filters { padding: 19px; }
  .details-grid { gap: 20px 22px; }
  .details-grid dt { font-size: 10px; }
  .details-grid dd { font-size: 12px; }
  .operator-client-list li { align-items: flex-start; flex-direction: column; gap: 12px; }
  .history-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .permission-areas { grid-template-columns: 1fr; }
  .permission-footer { align-items: stretch; flex-direction: column; gap: 16px; }
  .work-entry-actions { flex-direction: column; gap: 12px; }
  .work-versions { width: 100%; }
  .period-card-heading { flex-wrap: wrap; gap: 12px; }
  .receipt-heading { flex-wrap: wrap; }
  .report-filters { padding: 19px; }
  .finance-actions { gap: 9px; }
  .finance-actions .button { flex: 1 1 100%; }
  .report-metrics > .summary-card { padding: 17px 20px; gap: 16px; }
  .report-metrics dd { font-size: 17px; }
  .report-metrics dt { font-size: 10px; }
  .dashboard-tile { padding: 20px; gap: 12px; }
  .dashboard-tile strong { font-size: 26px; }
  .dashboard-tile span { font-size: 10px; }
  .dashboard-content { gap: 20px; }
  .dashboard-note { display: block; }
  .dashboard-note .button { margin-top: 22px; }
  .dialog { padding: 23px; width: calc(100vw - 28px); max-height: calc(100dvh - 28px); border-radius: 12px; }
  .dialog-heading { gap: 14px; }
  .dialog-heading h2 { font-size: 17px; }
  .dialog .form-actions { flex-wrap: wrap; gap: 9px; }
  .dialog .form-actions > .button { flex: 1; min-width: 110px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .field label { font-size: 11px; }
  .login-layout { display: block; }
  .login-story { padding: 30px 26px; }
  .login-story .brand { gap: 11px; }
  .login-story .brand-logo { width: 40px; height: 48px; }
  .login-story .brand-wordmark { font-size: 23px; }
  .login-story .brand-product { font-size: 12px; }
  .story-copy { padding: 33px 0 0; }
  .story-copy h1 { font-size: 1.75rem; margin-bottom: 15px; }
  .story-copy > p { font-size: 12px; }
  .login-features, .story-footer { display: none; }
  .login-panel { padding: 36px 26px 48px; }
  .login-card { max-width: 440px; }
  .login-card h2 { font-size: 25px; }
  .login-form .field input { font-size: 16px; }
}
@media (max-width: 440px) {
  .main-content { padding-left: 16px; padding-right: 16px; }
  .client-filters, .client-filters:has(#reminderView), .report-filters { grid-template-columns: 1fr; }
  .filter-actions { grid-column: auto; }
  .filter-actions > .button { flex: 1; }
  .client-filters:has(#reminderView) > .button, .report-filters > .button { width: 100%; }
  .details-grid { grid-template-columns: 1fr; }
  .period-preview .details-grid { grid-template-columns: 1fr 1fr; }
  .period-form-row { grid-template-columns: minmax(0, 2fr) minmax(75px, 1fr); gap: 10px; }
  .summary-row { flex-direction: column; }
  .summary-row > .summary-card { flex-direction: row; align-items: center; }
  .summary-row > .summary-card + .summary-card { border-left: 0; border-top: 1px solid var(--line); }
  .report-metrics > .summary-card { flex-wrap: wrap; gap: 6px 15px; }
  .report-metrics dt { flex: 1 1 48%; }
  .report-metrics dd { max-width: 100%; font-size: 16px; }
  .dashboard-tile { padding: 18px 16px; }
  .dashboard-tile span { min-height: 30px; }
  .topbar-location { gap: 8px; }
  .menu-toggle span { display: none; }
  .workspace-label { max-width: 175px; }
  .card-heading .button { max-width: 100%; }
  .period-actions .button { white-space: normal; }
  .workspace-footer { margin-left: 16px; margin-right: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
  .sidebar, .topbar, .workspace-footer, .form-actions, .finance-actions, .button, .client-filters, .report-filters { display: none !important; }
  .workspace { margin-left: 0; width: 100%; }
  body { background: #fff; }
  .main-content { padding: 0; max-width: none; }
  .table-scroll { overflow: visible; }
  .data-table { white-space: normal; font-size: 10px; }
  .card { break-inside: avoid; }
}

.data-table .table-prose { min-width: 200px; max-width: 340px; white-space: normal; overflow-wrap: anywhere; line-height: 1.75; }
.data-table .table-money { white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }

.client-section-nav { position: sticky; top: 0; z-index: 10; display: flex; gap: 4px; padding: 7px; margin-top: -4px; background: var(--back); border-bottom: 1px solid var(--line); overflow: auto; }
.client-section-link { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 10px 13px; white-space: nowrap; font-size: 11px; font-weight: 600; }
.client-section-link:hover, .client-section-link:focus-visible { background: var(--paper); color: var(--blue); }
.client-workspace h2[id] { scroll-margin-top: 75px; }
.table-mobile-hint { display: none; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
@media (max-width: 760px) {
  .client-section-nav { top: 70px; margin-left: -4px; margin-right: -4px; padding-left: 0; padding-right: 0; }
  .client-section-link { padding: 9px 11px; font-size: 10px; }
  .client-workspace h2[id] { scroll-margin-top: 140px; }
  .table-mobile-hint { display: block; }
}

.settings-form > .field { max-width: 300px; }
.settings-form { max-width: 780px; }

/* Изборът на режим е достъпен преди и след вход. */
.theme-toggle { white-space: nowrap; }
.theme-toggle > span { display: inline-flex; align-items: center; gap: 8px; }
:root[data-theme='dark'] .theme-when-light,
:root[data-theme='light'] .theme-when-dark { display: none; }
.login-panel { position: relative; }
.login-theme-toggle { position: absolute; top: 24px; right: 24px; }
@media (max-width: 760px) {
  .theme-toggle { min-height: 40px; min-width: 40px; padding: 8px; }
  .theme-label { display: none; }
  .login-theme-toggle { top: 20px; right: 20px; }
}

/* Кратки пояснения на място: посочване, клавиатура и докосване. */
.page-explanation { display: flex; align-items: flex-start; gap: 10px; color: var(--explanation); font-size: 12px; line-height: 1.8; max-width: 95ch; margin: -9px 0 0; }
.page-explanation .icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 2px; }
.explanation-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 28px; min-height: 28px; padding: 4px; border: 0; border-radius: 5px; color: var(--explanation); background: transparent; cursor: pointer; vertical-align: middle; }
.explanation-toggle .icon { width: 17px; height: 17px; flex-basis: 17px; }
.explanation-toggle:hover, .explanation-toggle[aria-expanded='true'] { background: var(--explanation-soft); }
.explanation-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.field-label-row, .explained-label { display: flex; align-items: center; gap: 5px; }
.field-label-row { margin-bottom: 7px; }
.field-label-row > label { margin-bottom: 0; }
.explained-label { justify-content: flex-start; }
.explained-action { display: inline-flex; align-items: center; gap: 3px; min-width: 0; }
.page-heading > .explained-action { flex-shrink: 0; }
.report-filters > .explained-action { align-self: end; }
.explanation-tooltip { position: fixed; inset: auto; margin: 0; width: max-content; max-width: min(360px, calc(100vw - 24px)); padding: 14px 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-size: 12px; line-height: 1.8; white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 1250px) {
  .report-filters > .explained-action { grid-column: 1/-1; justify-self: start; }
}
@media (max-width: 760px) {
  .explanation-toggle { width: 32px; height: 32px; flex-basis: 32px; min-height: 32px; }
  .page-explanation { font-size: 11px; margin-top: -5px; }
}
@media (max-width: 440px) {
  .report-filters > .explained-action { width: 100%; }
  .report-filters > .explained-action > .button { flex: 1; }
}
@media print { .explanation-toggle, .explanation-tooltip { display: none !important; } }

.finance-explanation { color: var(--explanation); line-height: 1.8; }
.finance-form > .finance-explanation, .finance-form > .muted { margin-bottom: 20px; }
.finance-form > .permission-checkbox + .finance-explanation { margin-top: 12px; }
.finance-incomplete { display: block; margin-top: 4px; color: var(--explanation); font-size: 10px; font-weight: 500; white-space: normal; }
.finance-table th { white-space: normal; min-width: 130px; max-width: 190px; }
.finance-table td { vertical-align: top; }
.finance-table td > p { margin-top: 7px; max-width: 250px; white-space: normal; }
.finance-row-actions { display: flex; flex-wrap: wrap; gap: 7px; width: 210px; }
.finance-row-actions .button { white-space: normal; }
.legacy-finance > summary { cursor: pointer; font-size: 12px; font-weight: 650; padding: 18px 0; color: var(--muted); }
.legacy-finance > .finance-explanation { font-size: 12px; margin-bottom: 20px; max-width: 90ch; }
.legacy-finance > .card + .card { margin-top: 20px; }
.finance-actions > .explained-action:first-child > .button { background: var(--brand-yellow); color: var(--brand-navy); border-color: var(--brand-yellow); }
.finance-actions > .explained-action:not(:first-child) > .button { background: var(--paper); color: var(--ink); border-color: var(--control-line); }
@media (max-width: 760px) {
  .finance-actions > .explained-action { flex: 1 1 100%; }
  .finance-actions > .explained-action > .button { flex: 1; }
  .finance-table th { min-width: 125px; }
}
.section-explanation { color: var(--explanation); line-height: 1.8; max-width: 90ch; }
.section-explanation > .icon { display: inline-block; width: 16px; height: 16px; margin: 0 7px -3px 0; vertical-align: baseline; }
.card-heading + .section-explanation { margin-top: -9px; margin-bottom: 22px; }
.field-label-row { margin-bottom: 0; }
.operator-finance-table, .commission-finance-table { table-layout: fixed; min-width: 1030px; }
.operator-finance-table th, .commission-finance-table th { min-width: 0; max-width: none; }
.operator-finance-table :is(th, td), .commission-finance-table :is(th, td) { padding-left: 14px; padding-right: 14px; white-space: normal; overflow-wrap: anywhere; }
.operator-finance-table :is(th, td):first-child, .commission-finance-table :is(th, td):first-child { width: 23%; padding-left: 20px; }
.operator-finance-table :is(th, td):nth-child(2) { width: 10%; }
.operator-finance-table :is(th, td):nth-child(3) { width: 17%; }
.operator-finance-table :is(th, td):nth-child(4) { width: 13%; }
.operator-finance-table :is(th, td):nth-child(5) { width: 19%; }
.operator-finance-table :is(th, td):last-child { width: 18%; padding-right: 20px; }
.commission-finance-table :is(th, td):nth-child(2) { width: 13%; }
.commission-finance-table :is(th, td):nth-child(3) { width: 12%; }
.commission-finance-table :is(th, td):nth-child(4) { width: 15%; }
.commission-finance-table :is(th, td):nth-child(5) { width: 19%; }
.commission-finance-table :is(th, td):last-child { width: 18%; padding-right: 20px; }
:is(.operator-finance-table, .commission-finance-table) .finance-row-actions { width: 100%; flex-direction: column; align-items: flex-start; }
:is(.operator-finance-table, .commission-finance-table) .finance-row-actions > .button { max-width: 100%; }
:is(.operator-finance-table, .commission-finance-table) .pill { margin-top: 8px; }
.payout-finance-table { table-layout: fixed; min-width: 1030px; }
.payout-finance-table :is(th, td) { min-width: 0; max-width: none; padding-left: 14px; padding-right: 14px; white-space: normal; overflow-wrap: anywhere; }
.payout-finance-table :is(th, td):first-child { width: 12%; padding-left: 20px; }
.payout-finance-table :is(th, td):nth-child(2) { width: 20%; }
.payout-finance-table :is(th, td):nth-child(3) { width: 10%; }
.payout-finance-table :is(th, td):nth-child(4) { width: 23%; }
.payout-finance-table :is(th, td):nth-child(5) { width: 20%; }
.payout-finance-table :is(th, td):last-child { width: 15%; padding-right: 20px; }
.payout-finance-table .finance-row-actions { width: 100%; flex-direction: column; align-items: flex-start; }
.payout-finance-table .finance-row-actions > .button { max-width: 100%; }
.finance-disclosure { border-top: 1px solid var(--line); }
.finance-disclosure > summary { padding: 18px 0; color: var(--blue); cursor: pointer; font-size: 13px; font-weight: 650; }
.finance-disclosure-content { display: grid; gap: 20px; padding-bottom: 12px; }
.finance-history-reference { min-width: 170px; max-width: 260px; white-space: normal; overflow-wrap: anywhere; }
.finance-history-reference p { margin: 6px 0; }
.finance-history-reference .client-link { display: inline-block; margin-top: 5px; }

/* На телефон финансовите записи подреждат стойностите и действията вертикално. */
@media (max-width: 760px) {
  .table-scroll:has(:is(.operator-finance-table, .commission-finance-table, .payout-finance-table)) { overflow: visible; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) { display: block; width: 100%; min-width: 0; table-layout: auto; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) thead { display: none; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) tbody { display: block; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 18px; padding: 22px 20px; border-top: 1px solid var(--line); }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) tbody tr:first-child { border-top: 0; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) td { display: block; min-width: 0; max-width: none; width: auto !important; padding: 0 !important; border: 0; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) td::before { content: attr(data-label); display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 550; line-height: 1.7; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) td:is(:first-child, :last-child) { grid-column: 1/-1; }
  :is(.operator-finance-table, .commission-finance-table) td:first-child::before,
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) td:last-child::before { display: none; }
  .payout-finance-table td:nth-child(4), .payout-finance-table td:nth-child(5) { grid-column: 1/-1; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) td p { max-width: none; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) .finance-row-actions { flex-direction: row; align-items: stretch; gap: 8px; }
  :is(.operator-finance-table, .commission-finance-table, .payout-finance-table) .finance-row-actions > .button { flex: 1 1 125px; }
  .table-scroll:has(:is(.operator-finance-table, .commission-finance-table, .payout-finance-table)) + .table-mobile-hint { display: none; }
}
