:root {
    --bg-top: #ffffff;
    --bg-bottom: #f5f5f5;
    --card-soft: rgba(255, 255, 255, 0.96);
    --text: #161616;
    --muted: rgba(22, 22, 22, 0.62);
    --accent: #111111;
    --accent-soft: rgba(17, 17, 17, 0.06);
    --accent-strong: #111111;
    --goods: #8d8d8d;
    --goods-soft: rgba(141, 141, 141, 0.14);
    --certificate: #c4871a;
    --certificate-soft: rgba(196, 135, 26, 0.16);
    --border: rgba(17, 17, 17, 0.1);
    --shadow: 0 18px 48px rgba(15, 15, 15, 0.06);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    width: 100%;
}

body {
    background:
        radial-gradient(circle at top left, rgba(0, 0, 0, 0.05), transparent 28%),
        radial-gradient(circle at right center, rgba(0, 0, 0, 0.035), transparent 20%),
        linear-gradient(135deg, var(--bg-top), var(--bg-bottom));
    color: var(--text);
    font-family: "Manrope", sans-serif;
    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

.app-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 32px;
    background: transparent;
}

.app-shell.is-loading .metric-card,
.app-shell.is-loading .chart-card,
.app-shell.is-loading .summary-card {
    opacity: 0.72;
}

.hero {
    padding: 8px 8px 0;
}

.top-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.top-nav__link {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.top-nav__link.is-active {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: #ffffff;
    color: #111111;
    border: 1px solid var(--border);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero__topline {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-top: 24px;
    align-items: flex-start;
}

.hero__eyebrow {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 14px;
}

.hero__title {
    margin: 0;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 0.98;
    letter-spacing: -0.04em;
    max-width: 720px;
}

.hero__subtitle,
.hero__status {
    color: var(--muted);
    font-size: 15px;
}

.hero__subtitle {
    max-width: 620px;
    margin: 16px 0 0;
}

.hero__status {
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.filters,
.summary-card,
.metric-card,
.chart-card,
.masters-card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.98));
    backdrop-filter: blur(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
    box-shadow: var(--shadow);
}

.filters {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    padding: 20px;
    border-radius: 28px;
}

.filters__group {
    display: flex;
    gap: 14px;
    align-items: end;
    flex-wrap: wrap;
}

.filters__group--branches {
    align-items: center;
    justify-content: flex-end;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field--inline {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.field__label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.field__label--inline {
    margin-right: 2px;
    white-space: nowrap;
}

.field__input {
    min-width: 180px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field__input:focus {
    border-color: rgba(17, 17, 17, 0.24);
    box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.06);
}

.button,
.branch-switcher__button {
    border: 1px solid transparent;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.button {
    padding: 14px 20px;
    background: #111111;
    color: #ffffff;
    font-weight: 800;
}

.button:hover,
.branch-switcher__button:hover {
    transform: translateY(-1px);
}

.button--ghost {
    border-color: rgba(17, 17, 17, 0.1);
}

.branch-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.branch-switcher__button {
    padding: 12px 16px;
    background: #ffffff;
    color: #444444;
    border-color: var(--border);
    font-weight: 700;
}

.branch-switcher__button.is-active {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}

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

.summary-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    border-radius: 28px;
}

.summary-card__label,
.metric-card__label {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.summary-card__title {
    margin: 0;
    font-size: 24px;
    letter-spacing: -0.03em;
}

.summary-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-weight: 700;
}

.summary-card__divider {
    width: 1px;
    height: 18px;
    background: var(--border);
}

.notification {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.notification--hidden {
    display: none;
}

.notification--info {
    border-color: rgba(17, 17, 17, 0.12);
    color: #222222;
}

.notification--success {
    border-color: rgba(25, 135, 84, 0.24);
    color: #146c43;
}

.notification--error {
    border-color: rgba(220, 53, 69, 0.24);
    color: #b02a37;
}

.card-like {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 250, 0.98));
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
    border-radius: 28px;
    padding: 22px 24px;
}

.tasks-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.tasks-toolbar__left,
.tasks-toolbar__right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.tasks-search {
    min-width: 280px;
}

.tasks-select {
    min-width: 140px;
}

.tasks-table-wrap {
    overflow: auto;
}

.tasks-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.tasks-table th,
.tasks-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.tasks-table th {
    background: #fafafa;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tasks-title {
    font-weight: 800;
}

.tasks-subtitle {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.tasks-error {
    max-width: 280px;
    color: #7b7b7b;
    white-space: normal;
    word-break: break-word;
}

.progress-wrap {
    min-width: 180px;
}

.progress-line {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(17, 17, 17, 0.08);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: #111111;
}

.progress-text {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.task-status {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border);
    background: #ffffff;
}

.task-status.queued {
    color: #7a5d00;
    background: rgba(255, 220, 120, 0.22);
}

.task-status.running {
    color: #004085;
    background: rgba(115, 177, 255, 0.18);
}

.task-status.completed {
    color: #146c43;
    background: rgba(25, 135, 84, 0.16);
}

.task-status.failed {
    color: #b02a37;
    background: rgba(220, 53, 69, 0.14);
}

.task-details-btn {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.funds-form-card {
    overflow: hidden;
}

.funds-form {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: end;
}

.funds-form .field {
    grid-column: span 3;
}

.funds-form__wide {
    grid-column: span 6 !important;
}

.funds-form__actions {
    grid-column: span 12;
    display: flex;
    justify-content: flex-end;
}

.fund-source-items {
    display: grid;
    gap: 10px;
}

.fund-source-item {
    display: grid;
    grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.funds-table {
    min-width: 1040px;
}

.funds-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.funds-delete-btn {
    color: #b02a37;
}

.chat-admin {
    align-items: start;
}

.chat-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.chat-grid {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.4fr);
    gap: 18px;
    align-items: start;
}

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

.chat-master-form,
.chat-assign-form {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

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

.chat-master-form .field__input,
.chat-assign-form .field__input,
.chat-client-search .field__input {
    min-width: 0;
    width: 100%;
}

.chat-checkbox {
    justify-content: flex-start;
}

.chat-form-actions {
    grid-column: span 2;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.chat-master-list {
    display: grid;
    gap: 10px;
    max-height: 620px;
    overflow: auto;
    padding-right: 4px;
}

.chat-master-item,
.chat-search-item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.chat-master-item:hover,
.chat-search-item:hover {
    border-color: rgba(17, 17, 17, 0.24);
}

.chat-master-item.is-active {
    border-color: #111111;
    box-shadow: inset 0 0 0 1px #111111;
}

.chat-master-item__main,
.chat-master-item__side,
.chat-search-item span {
    min-width: 0;
}

.chat-master-item__main {
    display: grid;
    gap: 4px;
}

.chat-master-item__side {
    display: grid;
    justify-items: end;
    gap: 8px;
    flex: 0 0 auto;
}

.chat-master-item__name,
.chat-search-item__name {
    display: block;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-master-item__meta,
.chat-master-item__count {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.chat-assign-form {
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
}

.chat-client-search {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.chat-search-results {
    display: grid;
    gap: 8px;
}

.chat-search-empty {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.chat-clients-table {
    min-width: 920px;
}

.chat-message-preview {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 700;
}

.chat-message-preview--button {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-strong);
    cursor: pointer;
    font: inherit;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.chat-history-modal-window {
    width: min(860px, 100%);
}

.chat-history-body {
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 22px;
    overflow-y: auto;
    background: #fafafa;
}

.chat-history-message {
    width: min(78%, 620px);
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.chat-history-message--out {
    justify-self: end;
    background: rgba(17, 17, 17, 0.06);
}

.chat-history-message--in {
    justify-self: start;
}

.chat-history-message__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.chat-history-message__text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
    font-size: 14px;
}

.tasks-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.tasks-pagination__label {
    min-width: 40px;
    text-align: center;
    font-weight: 800;
}

.task-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(17, 17, 17, 0.28);
    z-index: 20;
}

.task-modal-window {
    width: min(920px, 100%);
    max-height: 90vh;
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.task-modal-head,
.task-modal-footer {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.task-modal-footer {
    border-bottom: none;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.task-modal-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.task-modal-subtitle {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
}

.task-modal-close {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

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

.task-modal-body {
    margin: 0;
    padding: 24px;
    overflow: auto;
    background: #fafafa;
    color: #1f1f1f;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.metrics-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
    gap: 18px;
    align-items: start;
}

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

.metric-card {
    grid-column: span 6;
    padding: 24px;
    border-radius: 28px;
}

.metric-card--nav {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

.metric-card--nav:hover {
    transform: translateY(-1px);
}

.metric-card--nav:hover .metric-card__value {
    text-decoration: underline;
    text-underline-offset: 6px;
}

.metric-card--nav:focus-visible {
    outline: 2px solid rgba(17, 17, 17, 0.45);
    outline-offset: 4px;
}

.metric-card--accent {
    background:
        radial-gradient(circle at top right, rgba(0, 0, 0, 0.04), transparent 34%),
        linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(248, 248, 248, 0.98));
}

.metric-card--wide {
    grid-column: span 12;
}

.metric-card__value {
    margin: 0;
    font-size: clamp(32px, 4.4vw, 52px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.05em;
    transition: transform 0.35s ease, opacity 0.35s ease;
    color: #111111;
}

.metric-card.is-updating .metric-card__value {
    transform: translateY(6px);
    opacity: 0.42;
}

.metric-card__hint {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.chart-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: 28px;
    min-height: 100%;
}

.masters-card {
    overflow: hidden;
    padding: 24px;
    border-radius: 28px;
}

.chart-card::before {
    content: "";
    position: absolute;
    inset: auto -40px -80px auto;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.05), transparent 70%);
    pointer-events: none;
}

.chart-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.chart-card__title {
    margin: 0;
    font-size: 26px;
    letter-spacing: -0.04em;
}

.masters-card__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: end;
    margin-bottom: 18px;
}

.masters-card__title,
.masters-card__hint {
    margin: 0;
}

.masters-card__title {
    font-size: 26px;
    letter-spacing: -0.04em;
}

.masters-card__hint {
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.employees-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.employees-tabs__button {
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    color: #444444;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}

.employees-tabs__button.is-active {
    background: #111111;
    border-color: #111111;
    color: #ffffff;
}

.chart-card__share {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: #444444;
    font-size: 14px;
    font-weight: 700;
    background: #ffffff;
}

.donut-wrap {
    display: flex;
    justify-content: center;
    padding: 30px 0 22px;
}

.donut-chart {
    --service-angle: 180deg;
    --goods-angle: 90deg;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.98) 0 42%, transparent 43%),
        conic-gradient(
            from -90deg,
            var(--accent-strong) 0deg,
            var(--accent-strong) var(--service-angle),
            rgba(17, 17, 17, 0.08) var(--service-angle),
            rgba(17, 17, 17, 0.08) calc(var(--service-angle) + 2deg),
            var(--goods) calc(var(--service-angle) + 2deg),
            var(--goods) calc(var(--service-angle) + var(--goods-angle)),
            rgba(17, 17, 17, 0.08) calc(var(--service-angle) + var(--goods-angle)),
            rgba(17, 17, 17, 0.08) calc(var(--service-angle) + var(--goods-angle) + 2deg),
            var(--certificate) calc(var(--service-angle) + var(--goods-angle) + 2deg),
            var(--certificate) 360deg
        );
    width: min(100%, 280px);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(17, 17, 17, 0.06);
    transition: transform 0.45s ease, filter 0.45s ease;
}

.donut-chart.is-updating {
    transform: scale(0.96) rotate(-10deg);
    filter: saturate(0.88);
}

.donut-chart::after {
    content: "";
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    border: 1px solid rgba(17, 17, 17, 0.08);
}

.donut-chart__center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
}

.donut-chart__center-label {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
}

.donut-chart__center-value {
    max-width: 160px;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #111111;
}

.chart-legend {
    display: grid;
    gap: 12px;
}

.masters-table-wrap {
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #ffffff;
}

.masters-table {
    width: 100%;
    min-width: 1280px;
    border-collapse: collapse;
}

.masters-table--info {
    min-width: 720px;
}

.masters-table--salary {
    min-width: 1280px;
}

.masters-table th,
.masters-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

.masters-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fafafa;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.masters-table tbody tr:hover {
    background: rgba(17, 17, 17, 0.02);
}

.masters-table tbody tr:last-child td {
    border-bottom: none;
}

.table-link {
    color: var(--accent-strong);
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}

.table-link:hover {
    border-bottom-color: currentColor;
}

.masters-table__empty {
    padding: 28px 16px;
    color: var(--muted);
    text-align: center !important;
}

.visits-table {
    min-width: 1100px;
}

.visits-page {
    overflow-x: auto;
}

.visits-page .visits-card {
    overflow: visible;
}

.visits-table-wrap {
    overflow: visible;
}

.visits-table__services {
    min-width: 280px;
    white-space: normal !important;
}

.visits-table__goods {
    min-width: 240px;
    white-space: normal !important;
}

.client-link-button {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent-strong);
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.client-history-modal-window {
    width: min(1240px, 100%);
}

.client-history-modal-body {
    padding: 24px;
    overflow-y: auto;
    overflow-x: auto;
    background: #fafafa;
}

.client-history-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.client-history-summary__item {
    padding: 18px 20px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #ffffff;
}

.client-history-summary__label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.client-history-summary__value {
    margin-top: 8px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.client-history-empty {
    padding: 32px 18px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #ffffff;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.client-history-table-wrap {
    background: #ffffff;
    overflow: visible;
}

.client-history-table {
    min-width: 980px;
}

.client-history-table__amount {
    min-width: 140px;
    white-space: nowrap;
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
}

.legend-item__dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: none;
}

.legend-item__dot--service {
    background: var(--accent-strong);
    box-shadow: 0 0 0 8px rgba(17, 17, 17, 0.08);
}

.legend-item__dot--goods {
    background: var(--goods);
    box-shadow: 0 0 0 8px var(--goods-soft);
}

.legend-item__dot--certificate {
    background: var(--certificate);
    box-shadow: 0 0 0 8px var(--certificate-soft);
}

.legend-item__title,
.legend-item__value {
    margin: 0;
}

.legend-item__title {
    color: var(--muted);
    font-size: 14px;
}

.legend-item__value {
    margin-top: 3px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

@media (max-width: 1080px) {
    .metrics-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 980px) {
    .filters,
    .hero__topline,
    .summary-card {
        flex-direction: column;
        align-items: stretch;
    }

    .filters__group--branches {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .app-shell {
        padding: 16px;
        min-height: 100vh;
    }

    .hero,
    .summary-card,
    .metric-card,
    .chart-card,
    .filters,
    .masters-card {
        padding: 18px;
    }

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

    .metric-card,
    .metric-card--wide {
        grid-column: auto;
    }

    .field__input {
        min-width: 100%;
    }

    .chart-card__header {
        flex-direction: column;
    }

    .masters-card__header {
        flex-direction: column;
        align-items: stretch;
    }

    .tasks-toolbar {
        align-items: stretch;
    }

    .tasks-toolbar__left,
    .tasks-toolbar__right {
        align-items: stretch;
    }

    .tasks-search,
    .tasks-select {
        min-width: 100%;
    }

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

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

    .funds-form .field,
    .funds-form__wide,
    .funds-form__actions {
        grid-column: auto !important;
    }

    .fund-source-item {
        grid-template-columns: 1fr;
    }

    .chat-master-form,
    .chat-assign-form {
        grid-template-columns: 1fr;
    }

    .chat-form-actions {
        grid-column: auto;
    }

    .chat-master-item,
    .chat-search-item {
        align-items: stretch;
        flex-direction: column;
    }

    .chat-master-item__side {
        justify-items: start;
    }
}
