/**
 * FITCRM ? ???-??????. ??: ?????? ????, ???????????? ?????????, ????????????.
 * ??? ????? ?????? ? CSS-??????.
 */

:root {
    --crm-bg: #1a1d21;
    --crm-surface: #24282e;
    --crm-border: #3a3f47;
    --crm-text: #e6e8eb;
    --crm-text-muted: #9ca3ad;
    --crm-accent: #4a9eff;
    --crm-accent-hover: #6bb0ff;
    --crm-success: #34c759;
    --crm-error: #ff453a;
    --crm-radius: 6px;
    --crm-font: system-ui, -apple-system, sans-serif;
    /* для табеля и таблиц */
    --bg-surface: var(--crm-surface);
    --border-color: var(--crm-border);
    --text-main: var(--crm-text);
    --text-muted: var(--crm-text-muted);
}

.crm-skip-link {
    position: absolute;
    top: -100px;
    left: 12px;
    padding: 10px 14px;
    background: var(--crm-accent);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--crm-radius);
    z-index: 1000;
    transition: top 0.2s;
}

.crm-skip-link:focus {
    top: 12px;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.crm-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ??????? ????????? ?????? ??? ????????? ? ?????????? */
.crm-btn:focus-visible,
.crm-nav-link:focus-visible,
.crm-action-link:focus-visible,
.crm-filter-link:focus-visible,
.crm-breadcrumb-link:focus-visible,
.crm-footer-link:focus-visible,
.crm-search-link:focus-visible,
.crm-widget-salary-debt-link:focus-visible,
.crm-director-stat-card:focus-visible,
.crm-logo:focus-visible,
.crm-org-section-summary:focus-visible {
    outline: 2px solid var(--crm-accent);
    outline-offset: 2px;
}

.crm-input:focus-visible,
.crm-select:focus-visible,
.crm-search-input:focus-visible {
    outline: none;
    border-color: var(--crm-accent);
    box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.3);
}

.crm-body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--crm-bg);
    color: var(--crm-text);
    font-family: var(--crm-font);
    font-size: 14px;
    line-height: 1.5;
}

.crm-wrapper {
    flex: 1 0 auto;
}

.crm-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--crm-border);
    background: var(--crm-surface);
    margin-top: 32px;
}

.crm-footer-inner {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-sizing: border-box;
    font-size: 12px;
    color: var(--crm-text-muted);
}

.crm-footer-brand {
    font-weight: 600;
    color: var(--crm-text);
}

.crm-footer-link {
    color: var(--crm-accent);
    text-decoration: none;
}

.crm-footer-link:hover {
    text-decoration: underline;
}

/* ???????? ????? */
.crm-login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.crm-login-card {
    width: 100%;
    max-width: 360px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    padding: 32px;
}

.crm-login-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 600;
}

.crm-login-subtitle {
    margin: 0 0 24px;
    color: var(--crm-text-muted);
    font-size: 13px;
}

.crm-login-hint {
    margin: -12px 0 18px;
    font-size: 12px;
    line-height: 1.45;
}

.crm-messages {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.crm-message {
    padding: 8px 12px;
    border-radius: var(--crm-radius);
    font-size: 13px;
}

.crm-message-error {
    background: rgba(255, 69, 58, 0.15);
    color: var(--crm-error);
}

.crm-message-success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--crm-success);
}

.crm-login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.crm-label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--crm-text-muted);
}

.crm-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    color: var(--crm-text);
    font-size: 14px;
}

.crm-input:focus {
    outline: none;
    border-color: var(--crm-accent);
}

.crm-input-qty {
    max-width: 120px;
}

.crm-select {
    min-width: 200px;
    box-sizing: border-box;
    padding: 10px 12px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    color: var(--crm-text);
    font-size: 14px;
}

.crm-select:focus {
    outline: none;
    border-color: var(--crm-accent);
}

/* ????? ?????? ???????? ?? ???? ????????? */
.crm-filters-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 24px;
}

.crm-filter-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crm-filter-field .crm-label {
    margin-bottom: 0;
    white-space: nowrap;
}

.crm-remainder-select-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 24px;
}

.crm-remainder-select-form .crm-filter-field .crm-label {
    margin-bottom: 0;
}

.crm-remainder-select-form .crm-select {
    min-width: 180px;
}

.crm-remainder-form .crm-table {
    margin-bottom: 16px;
}

/* ????????? ????? ???????? ? ???????? */
.crm-remainder-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.crm-remainder-form-header .crm-lead {
    margin: 0;
}
.crm-remainder-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ??????? ???????? ? ??????? */
.crm-remainder-table .crm-col-days {
    min-width: 80px;
    width: 90px;
    text-align: right;
}

.crm-remainder-table .crm-col-qty {
    min-width: 140px;
    width: 160px;
}
.crm-remainder-table .crm-cell-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
    white-space: nowrap;
}
.crm-remainder-table .crm-cell-critical {
    color: var(--color-danger, #ef4444);
    font-weight: 600;
    white-space: nowrap;
}
.crm-remainder-table .crm-cell-mono {
    font-family: var(--font-mono, monospace);
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ?????? ? ??? ?????????? ????????? */
.crm-rem-row-filled td:last-child input {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.4);
}

/* ?????? ??????? */
.crm-icon-warn {
    color: var(--color-danger, #ef4444);
    margin-left: 4px;
    font-size: 0.8rem;
}
.crm-icon-info {
    color: var(--color-primary, #6366f1);
    margin-right: 4px;
}

.crm-delivery-receive-form .crm-table {
    margin-bottom: 16px;
}

.crm-input-comment {
    min-width: 200px;
}

.crm-order-edit-form .crm-table {
    margin-bottom: 16px;
}

.crm-order-edit-add {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    margin-bottom: 20px;
}

.crm-order-edit-add .crm-label {
    margin-bottom: 4px;
}

.crm-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.crm-checkbox {
    width: auto;
}

/* ????? ?????? ???? */
.crm-form {
    max-width: 760px;
}

.crm-form-group {
    margin-bottom: 16px;
}

.crm-form-group .crm-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--crm-text);
}

.crm-form-group-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.crm-label-inline {
    margin-bottom: 0;
    font-size: 14px;
    cursor: pointer;
}

.crm-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.crm-form-row .crm-form-group {
    flex: 1 1 180px;
    min-width: 0;
}

.crm-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.crm-dadata-fill-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--crm-text-muted);
}

.crm-required {
    color: var(--crm-error);
    margin-left: 2px;
}

/* Fieldset ??? ??????????? ????? ????? */
.crm-fieldset {
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    padding: 16px 20px 8px;
    margin-bottom: 20px;
}

.crm-fieldset-legend {
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ?????????????? dl */
.crm-dl-two-col {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 4px 16px;
    align-items: baseline;
}

.crm-dl-two-col dt {
    font-size: 13px;
    color: var(--crm-text-muted);
    padding: 6px 0;
}

.crm-dl-two-col dd {
    margin: 0;
    padding: 6px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-dl-two-col dt {
    border-bottom: 1px solid var(--crm-border);
}

/* Badges / ????????? ????? */
.crm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
}

.crm-badge-ok {
    background: rgba(52, 199, 89, 0.15);
    color: var(--crm-success);
}

.crm-badge-warn {
    background: rgba(255, 159, 10, 0.15);
    color: var(--crm-warning, #ff9f0a);
}

.crm-badge-neutral {
    background: rgba(255, 255, 255, 0.08);
    color: var(--crm-text-muted);
}

.crm-badge-muted {
    background: rgba(255, 255, 255, 0.05);
    color: var(--crm-text-muted);
    font-style: italic;
}

.crm-badge-tiny {
    font-size: 0.62rem;
    padding: 1px 6px;
    font-style: normal;
    font-weight: 600;
    vertical-align: middle;
    line-height: 1.4;
}

.crm-cell-date {
    white-space: nowrap;
    color: var(--crm-text-muted);
    font-size: 0.82rem;
}

.crm-cell-muted {
    color: var(--crm-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ??????????????? ????????? */
.crm-message-warn {
    background: rgba(255, 159, 10, 0.15);
    color: var(--crm-warning, #ff9f0a);
}

.crm-message-info {
    background: rgba(74, 158, 255, 0.12);
    color: var(--crm-text, #e8eaed);
    border: 1px solid rgba(74, 158, 255, 0.28);
}

.crm-autosave-status {
    margin-left: 12px;
    font-size: 13px;
    color: var(--crm-text-muted);
}

.crm-autosave-status-error {
    color: var(--crm-danger, #e55353);
}

.crm-btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--crm-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}

.crm-btn-primary {
    background: var(--crm-accent);
    color: #fff;
}

.crm-btn-primary:hover {
    background: var(--crm-accent-hover);
}

.crm-btn-ghost {
    background: transparent;
    color: var(--crm-text-muted);
}

.crm-btn-ghost:hover {
    color: var(--crm-text);
}

.crm-btn-accent {
    background: #2ecc71;
    color: #fff;
}

.crm-btn-accent:hover {
    background: #27ae60;
}

/* ????? layout: ??????? ???? ????? (?? ????????? ???????), ??????? ?????? */
.crm-app-layout {
    display: flex;
    min-height: 100vh;
    flex-direction: row;
}

.crm-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--crm-surface);
    border-right: 1px solid var(--crm-border);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 90;
    overflow-y: auto;
    transition: transform 0.2s ease, width 0.2s ease;
}

.crm-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 85;
    background: rgba(0, 0, 0, 0.45);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.crm-sidebar-backdrop[hidden] {
    display: none !important;
}

body.crm-sidebar-closed .crm-sidebar {
    width: 56px;
    overflow: hidden;
}

.crm-app-content {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.2s ease;
}

body.crm-sidebar-closed .crm-app-content {
    margin-left: 56px;
}

.crm-app-content-full {
    margin-left: 0 !important;
}

.crm-sidebar-nav {
    padding: 72px 0 20px;
}

.crm-sidebar-group {
    margin-bottom: 12px;
}

.crm-sidebar-group:first-child {
    margin-top: 0;
}

.crm-sidebar-group-title {
    display: block;
    padding: 4px 16px 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.25;
    color: var(--crm-text-muted);
}

.crm-sidebar-link {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    color: var(--crm-text-muted);
    text-decoration: none;
    font-size: 14px;
    line-height: 1.35;
    transition: color 0.15s, background 0.15s;
}

.crm-sidebar-link:hover {
    color: var(--crm-text);
    background: rgba(255, 255, 255, 0.05);
}

.crm-sidebar-link-active {
    color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.12);
    font-weight: 500;
}

.crm-sidebar-icon {
    margin-right: 8px;
    font-size: 1.05rem;
    opacity: 0.9;
    flex-shrink: 0;
}

/* Mini-sidebar: ?????? ?????? ????? */
body.crm-sidebar-closed .crm-sidebar-group-title {
    display: none;
}

body.crm-sidebar-closed .crm-sidebar-link-label {
    display: none;
}

body.crm-sidebar-closed .crm-sidebar-link {
    padding: 8px 0;
    justify-content: center;
}

body.crm-sidebar-closed .crm-sidebar-icon {
    margin-right: 0;
    font-size: 1.15rem;
}

body.crm-sidebar-closed .crm-sidebar-group {
    margin-bottom: 6px;
}

.crm-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--crm-text);
    border-radius: var(--crm-radius);
    cursor: pointer;
}

.crm-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

.crm-sidebar-toggle-icon-closed {
    display: none;
}

body.crm-sidebar-closed .crm-sidebar-toggle-icon-open {
    display: none;
}

body.crm-sidebar-closed .crm-sidebar-toggle-icon-closed {
    display: inline-block;
}

/* ????? ? ????????? */
.crm-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--crm-surface);
    border-bottom: 1px solid var(--crm-border);
}

.crm-header-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px 24px;
    box-sizing: border-box;
}

.crm-logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 18px;
    color: var(--crm-text);
    text-decoration: none;
}

.crm-logo-icon {
    font-size: 1.25em;
    color: var(--crm-accent);
}

.crm-search-form {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    max-width: 320px;
}

.crm-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.crm-search-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    color: var(--crm-text);
    font-size: 14px;
}

.crm-search-input:focus {
    outline: none;
    border-color: var(--crm-accent);
}

.crm-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: var(--crm-accent);
    color: #fff;
    border-radius: var(--crm-radius);
    cursor: pointer;
}

.crm-search-btn:hover {
    background: var(--crm-accent-hover);
}

.crm-nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--crm-text);
    font-size: 1.35rem;
    cursor: pointer;
    border-radius: var(--crm-radius);
}

.crm-nav-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--crm-text);
}

.crm-nav-toggle-icon-close {
    display: none;
}

.crm-nav-toggle-icon-open {
    display: inline-block;
}

body.crm-nav-open .crm-nav-toggle-icon-open {
    display: none;
}

body.crm-nav-open .crm-nav-toggle-icon-close {
    display: inline-block;
}

.crm-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.crm-nav-icon {
    margin-right: 6px;
    font-size: 1.05em;
    opacity: 0.9;
    vertical-align: -0.15em;
}

.crm-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--crm-text-muted);
    text-decoration: none;
    border-radius: var(--crm-radius);
    font-size: 13px;
}

.crm-nav-link:hover {
    color: var(--crm-text);
    background: rgba(255, 255, 255, 0.05);
}

/* ===== Дропдаун в верхней навигации (Настройки и др.) ===== */
.crm-nav-dropdown-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.crm-nav-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--crm-text-muted);
    background: none;
    border: none;
    border-radius: var(--crm-radius);
    font-size: 13px;
    cursor: pointer;
    gap: 6px;
    font-family: inherit;
    line-height: inherit;
}

.crm-nav-dropdown-trigger:hover,
.crm-nav-dropdown-trigger[aria-expanded="true"] {
    color: var(--crm-text);
    background: rgba(255, 255, 255, 0.05);
}

.crm-nav-dropdown-trigger-icon {
    margin-right: 6px;
    font-size: 1.05em;
    opacity: 0.9;
    vertical-align: -0.15em;
}

.crm-nav-dropdown-chevron {
    font-size: 0.75em;
    opacity: 0.7;
    transition: transform 0.18s;
}

.crm-nav-dropdown-trigger[aria-expanded="true"] .crm-nav-dropdown-chevron {
    transform: rotate(180deg);
}

.crm-nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 300;
    padding: 4px 0;
}

.crm-nav-dropdown-menu[hidden] {
    display: none;
}

.crm-nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    color: var(--crm-text-muted);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
}

.crm-nav-dropdown-item:hover {
    color: var(--crm-text);
    background: rgba(255, 255, 255, 0.06);
}

.crm-nav-dropdown-item.crm-nav-link-active {
    color: var(--crm-text);
    background: rgba(255, 255, 255, 0.08);
}

.crm-nav-dropdown-item-icon {
    font-size: 1em;
    opacity: 0.85;
    flex-shrink: 0;
}

.crm-nav-dropdown-divider {
    height: 1px;
    background: var(--crm-border);
    margin: 4px 0;
}

.crm-header-user {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-header-user-icon {
    margin-right: 4px;
    font-size: 0.9em;
    opacity: 0.85;
    vertical-align: -0.05em;
}

.crm-btn-icon {
    margin-right: 6px;
    font-size: 1em;
    vertical-align: -0.1em;
}

.crm-user-phone {
    font-weight: 500;
}

.crm-user-name {
    font-weight: 500;
}

.crm-user-role {
    font-size: 12px;
    color: var(--crm-text-muted);
}

.crm-role-switch-wrap {
    position: relative;
}

.crm-role-switch-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: min(14rem, 42vw);
    padding: 6px 10px;
    margin: 0;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: rgba(255, 255, 255, 0.04);
    color: var(--crm-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.25;
}

.crm-role-switch-trigger:hover,
.crm-role-switch-trigger[aria-expanded="true"] {
    border-color: var(--crm-accent, #4a9eff);
    color: var(--crm-text);
}

.crm-role-switch-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-role-switch-chevron {
    flex-shrink: 0;
    font-size: 0.7rem;
    opacity: 0.85;
}

.crm-role-switch-trigger[aria-expanded="true"] .crm-role-switch-chevron {
    transform: rotate(180deg);
}

.crm-role-switch-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 15rem;
    max-width: min(18rem, 92vw);
    max-height: min(70vh, 22rem);
    overflow-y: auto;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    z-index: 120;
}

.crm-role-switch-menu[hidden] {
    display: none !important;
}

.crm-role-switch-li {
    margin: 0;
    padding: 0;
}

.crm-role-switch-form {
    margin: 0;
}

.crm-role-switch-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: var(--crm-text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.crm-role-switch-item:hover {
    background: rgba(74, 158, 255, 0.1);
}

.crm-role-switch-item-active {
    color: var(--crm-accent, #4a9eff);
    font-weight: 600;
    background: rgba(74, 158, 255, 0.08);
}

.crm-logout-form {
    margin: 0;
}

/* ====== ??????????? ? ????? ====== */
.crm-notif-wrap {
    position: relative;
}
.crm-notif-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    color: var(--crm-text-secondary, var(--text-secondary));
    transition: background 0.15s, color 0.15s;
    position: relative;
}
.crm-notif-btn:hover {
    background: var(--crm-surface-hover, rgba(255,255,255,0.07));
    color: var(--crm-text, var(--text-primary));
}
.crm-notif-icon {
    font-size: 1.1rem;
}
.crm-notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--color-danger, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}
.crm-notif-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-width: 95vw;
    background: var(--crm-surface, #1e2130);
    border: 1px solid var(--crm-border, rgba(255,255,255,0.1));
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 2000;
    overflow: hidden;
}
.crm-notif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--crm-border, rgba(255,255,255,0.08));
    color: var(--crm-text, var(--text-primary));
}
.crm-notif-mark-all-form {
    margin: 0;
}
.crm-notif-mark-all {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--color-primary, #6366f1);
    padding: 2px 0;
    text-decoration: underline;
}
.crm-notif-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 360px;
    overflow-y: auto;
}
.crm-notif-item {
    padding: 10px 16px;
    border-bottom: 1px solid var(--crm-border, rgba(255,255,255,0.05));
    font-size: 0.82rem;
}
.crm-notif-item:last-child {
    border-bottom: none;
}
.crm-notif-type-delivery_receive .crm-notif-item-title {
    color: var(--crm-warning, #ff9f0a);
}
.crm-notif-type-timesheet_closed .crm-notif-item-title {
    color: var(--color-danger, #ef4444);
}
.crm-notif-type-remainder_reminder .crm-notif-item-title {
    color: var(--color-primary, #6366f1);
}
.crm-notif-item-title {
    font-weight: 600;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.crm-notif-item-body {
    color: var(--crm-text-muted);
    margin-bottom: 6px;
    line-height: 1.4;
}
.crm-notif-item-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.crm-notif-date {
    color: var(--crm-text-muted);
    font-size: 0.75rem;
}
.crm-notif-read-form {
    margin: 0;
}
.crm-notif-read-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--crm-success, #34c759);
    padding: 2px 0;
}

/* AI ?????????: ?????? ? ?????????? ??? ? ????? */
.crm-ai-dropdown-wrap {
    position: relative;
}

.crm-ai-trigger {
    display: inline-flex;
    align-items: center;
}

.crm-ai-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 520px;
    max-width: calc(100vw - 24px);
    min-width: 300px;
    min-height: 320px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.crm-ai-dropdown[hidden] {
    display: none;
}

/* ????? ???? ? ???????? ??????? */
.crm-ai-dropdown-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--crm-border);
    flex-shrink: 0;
    background: var(--crm-bg);
}
.crm-ai-dropdown-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--crm-text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.crm-ai-size-btns {
    display: flex;
    gap: 2px;
}
.crm-ai-size-btn {
    background: none;
    border: none;
    padding: 3px 5px;
    cursor: pointer;
    color: var(--crm-text-muted);
    font-size: 1rem;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.crm-ai-size-btn:hover {
    color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.12);
}
.crm-ai-size-btn.crm-ai-size-active {
    color: var(--crm-accent);
}

.crm-ai-chat-messages {
    overflow-y: auto;
    padding: 12px;
    flex: 1 1 auto;
    min-height: 160px;
    height: 340px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Drag-handle ??? ????????? ??????? (?????? ????? ????) */
.crm-ai-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 28px;
    height: 22px;
    cursor: sw-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--crm-border);
    font-size: 1rem;
    border-radius: 0 0 0 var(--crm-radius);
    transition: color 0.15s;
    user-select: none;
}
.crm-ai-resize-handle:hover {
    color: var(--crm-accent);
}

.crm-ai-msg {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-ai-msg-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.crm-ai-msg-time {
    font-size: 10px;
    font-weight: 500;
    color: var(--crm-text-muted);
    white-space: nowrap;
}

.crm-ai-msg-role {
    font-size: 11px;
    font-weight: 600;
    color: var(--crm-text-muted);
    text-transform: uppercase;
}

.crm-ai-msg-user .crm-ai-msg-role {
    color: var(--crm-accent);
}

.crm-ai-msg-content {
    font-size: 13px;
    line-height: 1.45;
    color: var(--crm-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.crm-ai-chat-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--crm-border);
    flex-shrink: 0;
}

.crm-ai-chat-input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    color: var(--crm-text);
    font-size: 14px;
}

.crm-ai-chat-input:focus {
    outline: none;
    border-color: var(--crm-accent);
}

.crm-ai-chat-input::placeholder {
    color: var(--crm-text-muted);
}

.crm-ai-chat-send {
    flex-shrink: 0;
}

.crm-ai-dropdown-actions {
    border-top: 1px solid var(--crm-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

.crm-ai-dropdown-full-link {
    font-size: 12px;
    color: var(--crm-accent);
    text-decoration: none;
}

.crm-ai-dropdown-full-link:hover {
    color: var(--crm-text);
}

.crm-ai-clear-inline-form {
    margin: 0;
}

.crm-ai-dropdown-clear-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: var(--crm-text-muted);
    cursor: pointer;
}

.crm-ai-dropdown-clear-btn:hover {
    color: var(--crm-text);
}

.crm-ai-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.crm-ai-page-header .crm-page-title {
    margin: 0;
}

.crm-ai-clear-form {
    margin: 0;
}

.crm-ai-history-hint {
    margin-top: 4px;
    margin-bottom: 16px;
    max-width: 52rem;
}

.crm-ai-history-title {
    margin: 0;
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-ai-history-empty {
    margin: 0;
    padding: 28px 16px;
    text-align: center;
    color: var(--crm-text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Страница AI: колонка со списком диалогов + чат */
.crm-ai-layout {
    display: flex;
    gap: 0;
    align-items: stretch;
    margin-top: 16px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    overflow: hidden;
    background: var(--crm-card-bg);
    max-width: 56rem;
}

.crm-ai-sessions {
    width: 260px;
    flex-shrink: 0;
    border-right: 1px solid var(--crm-border);
    background: rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    min-height: 280px;
    max-height: 70vh;
}

.crm-ai-sessions-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-ai-sessions-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.crm-ai-sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-ai-session-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 11px;
    border-radius: var(--crm-radius);
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.crm-ai-session-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.crm-ai-session-link-active {
    background: rgba(30, 111, 223, 0.12);
    border-color: var(--crm-border);
}

.crm-ai-session-title {
    font-size: 0.8125rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.crm-ai-session-time {
    font-size: 0.7rem;
    color: var(--crm-text-muted);
}

.crm-ai-sessions-empty {
    margin: 10px 12px;
    font-size: 0.85rem;
    color: var(--crm-text-muted);
}

.crm-ai-workspace {
    flex: 1;
    min-width: 0;
}

.crm-ai-workspace .crm-ai-chat-section {
    border: none;
    border-radius: 0;
    background: transparent;
}

@media (max-width: 900px) {
    .crm-ai-layout {
        flex-direction: column;
        max-height: none;
    }

    .crm-ai-sessions {
        width: 100%;
        max-height: 38vh;
        border-right: none;
        border-bottom: 1px solid var(--crm-border);
    }
}

/* Страница AI Чат: секция переписки */
.crm-ai-page .crm-ai-chat-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    overflow: hidden;
    background: var(--crm-card-bg);
}

.crm-ai-page .crm-ai-chat-messages {
    min-height: 200px;
    max-height: 55vh;
    padding: 16px;
}

.crm-ai-page .crm-ai-chat-form {
    padding: 16px;
}

.crm-ai-page .crm-ai-chat-input {
    padding: 10px 14px;
    font-size: 15px;
}

/* ===== Настройки: Синхронизация 1С ===== */
.crm-settings-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

/* Карточки на странице настроек — блочный layout, полная ширина */
.crm-sync-card,
.crm-sync-log-card {
    display: block !important;
    padding: 28px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.crm-sync-log-card {
    padding: 24px;
}

/* Форма внутри карточки настроек — не ограничиваем ширину */
.crm-sync-form.crm-form {
    max-width: 100%;
}

.crm-sync-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-sync-icon {
    font-size: 2rem;
    color: var(--crm-accent);
    flex-shrink: 0;
    margin-top: 2px;
}

.crm-sync-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--crm-text);
    margin-bottom: 4px;
}

.crm-sync-desc {
    font-size: 13px;
    color: var(--crm-text-muted);
    line-height: 1.5;
}

.crm-sync-objects {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.crm-sync-object-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 14px;
    border-radius: var(--crm-radius);
    transition: background 0.12s;
}

.crm-sync-object-row-disabled {
    opacity: 0.6;
}

.crm-sync-object-icon {
    font-size: 1.2rem;
    color: var(--crm-text-muted);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    margin-top: 2px;
}

.crm-sync-object-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.crm-sync-object-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--crm-text);
}

.crm-sync-object-hint {
    font-size: 12px;
    color: var(--crm-text-muted);
    line-height: 1.5;
    word-break: break-word;
}

.crm-badge-muted {
    background: rgba(255, 255, 255, 0.07);
    color: var(--crm-text-muted);
    border: 1px solid var(--crm-border);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

.crm-sync-notice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(99, 179, 237, 0.08);
    border: 1px solid rgba(99, 179, 237, 0.2);
    border-radius: var(--crm-radius);
    font-size: 13px;
    color: var(--crm-text-muted);
    line-height: 1.5;
    margin-top: 8px;
}

.crm-sync-notice-icon {
    font-size: 1rem;
    color: #63b3ed;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Блок инструкции «Как подключить» */
.crm-sync-howto {
    background: rgba(99, 179, 237, 0.06);
    border: 1px solid rgba(99, 179, 237, 0.2);
    border-radius: var(--crm-radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 13px;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: break-word;
}
.crm-sync-howto-title {
    font-weight: 600;
    color: var(--crm-text);
    margin-bottom: 10px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.crm-sync-howto-steps {
    margin: 0;
    padding-left: 20px;
    color: var(--crm-text-muted);
}
.crm-sync-howto-steps li {
    margin-bottom: 8px;
}
.crm-sync-howto-steps li:last-child {
    margin-bottom: 0;
}
.crm-sync-howto-steps code {
    background: rgba(255,255,255,0.08);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    color: var(--crm-text);
}
.crm-sync-howto-steps strong {
    color: var(--crm-text);
}
.crm-sync-howto-tip {
    display: block;
    margin-top: 4px;
    color: var(--crm-text-muted);
    font-size: 12px;
}

/* Тест подключения */
.crm-sync-test-result {
    margin: 12px 0 0;
    padding: 12px 16px;
    border-radius: var(--crm-radius);
    font-size: 13px;
    line-height: 1.5;
}
.crm-sync-test-ok {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid rgba(72, 187, 120, 0.3);
    color: #68d391;
}
.crm-sync-test-error {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
    color: #fc8181;
}

/* Последняя проверка */
.crm-sync-last-test {
    margin-top: 16px;
    padding: 10px 14px;
    background: var(--crm-sidebar-bg);
    border-radius: var(--crm-radius);
    font-size: 12px;
    color: var(--crm-text-muted);
}

/* Журнал синхронизации */
.crm-sync-log-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--crm-border);
}
.crm-sync-log-hint {
    font-size: 12px;
    margin-left: auto;
}
.crm-sync-log-msg {
    font-size: 12px;
    font-family: monospace;
    max-width: 400px;
    word-break: break-all;
}
.crm-sync-log-empty {
    padding: 16px 0;
    font-size: 13px;
}
.crm-table-wrap {
    overflow-x: auto;
}

/* Toggle переключатель */
.crm-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.crm-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.crm-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.crm-toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--crm-border);
    border-radius: 22px;
    transition: background 0.2s;
}
.crm-toggle-slider::before {
    content: "";
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: transform 0.2s;
}
.crm-toggle input:checked + .crm-toggle-slider {
    background: var(--crm-accent);
}
.crm-toggle input:checked + .crm-toggle-slider::before {
    transform: translateX(18px);
}
.crm-toggle-label {
    font-size: 13px;
    color: var(--crm-text-muted);
}

/* Ширина поля таймаута */
.crm-form-group-narrow {
    max-width: 160px;
}

/* Превью синхронизации клубов */
.crm-sync-preview-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.crm-sync-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 28px;
    background: var(--crm-card-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    min-width: 120px;
}
.crm-sync-stat-ok { border-color: rgba(72,187,120,0.3); }
.crm-sync-stat-warn { border-color: rgba(246,173,85,0.3); }
.crm-sync-stat-num {
    font-size: 28px;
    font-weight: 700;
    color: var(--crm-text);
    line-height: 1;
}
.crm-sync-stat-label {
    font-size: 11px;
    color: var(--crm-text-muted);
    margin-top: 6px;
    text-align: center;
}
.crm-sync-preview-note {
    font-size: 13px;
    margin-bottom: 20px;
}
.crm-sync-preview-card {
    padding: 0;
    overflow: hidden;
    margin-bottom: 20px;
}
.crm-sync-preview-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--crm-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--crm-text);
}
.crm-sync-check-all {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: var(--crm-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}
.crm-sync-fields-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.crm-sync-field-badge {
    font-size: 10px;
    padding: 2px 6px;
}
.crm-sync-preview-values {
    font-size: 12px;
    color: var(--crm-text-muted);
    line-height: 1.7;
}
.crm-sync-preview-values b {
    color: var(--crm-text);
}
.crm-sync-preview-actions {
    margin: 20px 0;
}
.crm-sync-nomatch-card {
    background: transparent;
    border: 1px dashed var(--crm-border);
}
.crm-sync-nomatch-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 20px 16px;
}
.crm-sync-new-hint {
    padding: 8px 20px 12px;
    font-size: 13px;
    color: var(--crm-text-muted);
    margin: 0;
}
.crm-sync-new-name {
    font-weight: 600;
    color: var(--crm-text);
}
.crm-text-warn {
    color: #e67e22;
}

/* Цвета текста */
.crm-text-ok { color: #68d391; }
.crm-text-danger { color: #fc8181; }

/* ===== Счета и Акты ===== */
.crm-page-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.crm-page-header-row .crm-page-title {
    margin-bottom: 0;
}

.crm-filter-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 14px 16px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
}

.crm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.crm-select-sm {
    min-width: 120px;
}

.crm-th-num,
.crm-td-num {
    text-align: right;
    white-space: nowrap;
}

.crm-td-strong {
    font-weight: 600;
}

.crm-td-warn {
    color: #f6c90e;
}

.crm-td-danger {
    color: #fc5c65;
}

.crm-td-hint {
    margin-left: 4px;
    opacity: 0.6;
    cursor: default;
}

.crm-td-actions {
    display: flex;
    gap: 4px;
    white-space: nowrap;
}

.crm-inline-form {
    display: inline;
}

.crm-btn-xs {
    padding: 3px 8px;
    font-size: 12px;
}

.crm-invoice-row.crm-invoice-status-paid td {
    opacity: 0.65;
}

.crm-invoice-row.crm-invoice-status-overdue .crm-td-num {
    color: #fc5c65;
}

.crm-badge-ok {
    background: rgba(72, 199, 142, 0.15);
    color: #48c78e;
    border: 1px solid rgba(72, 199, 142, 0.3);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

.crm-badge-warn {
    background: rgba(246, 201, 14, 0.12);
    color: #f6c90e;
    border: 1px solid rgba(246, 201, 14, 0.25);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

.crm-badge-info {
    background: rgba(99, 179, 237, 0.12);
    color: #63b3ed;
    border: 1px solid rgba(99, 179, 237, 0.25);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

.crm-badge-danger {
    background: rgba(252, 92, 101, 0.12);
    color: #fc5c65;
    border: 1px solid rgba(252, 92, 101, 0.25);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}

.crm-invoices-missing {
    margin-top: 28px;
    padding: 16px 20px;
    background: rgba(246, 201, 14, 0.05);
    border: 1px solid rgba(246, 201, 14, 0.2);
    border-radius: var(--crm-radius);
}

.crm-invoices-missing-title {
    font-size: 13px;
    font-weight: 600;
    color: #f6c90e;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-invoices-missing-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.crm-invoice-missing-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    text-decoration: none;
    transition: background 0.12s;
}

.crm-invoice-missing-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.crm-invoice-missing-name {
    flex: 1;
    font-size: 13px;
    color: var(--crm-text);
    font-weight: 500;
}

.crm-invoice-missing-rate {
    font-size: 13px;
    color: var(--crm-text-muted);
}

.crm-invoice-edit-meta {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--crm-text-muted);
}

.crm-invoice-total-display {
    padding: 8px 12px;
    background: rgba(72, 199, 142, 0.08);
    border: 1px solid rgba(72, 199, 142, 0.2);
    border-radius: var(--crm-radius);
    font-size: 16px;
    font-weight: 600;
    color: #48c78e;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.crm-invoice-total-display.crm-invoice-total-warn {
    background: rgba(252, 92, 101, 0.08);
    border-color: rgba(252, 92, 101, 0.2);
    color: #fc5c65;
}

/* ========== Основной контент ========== */
.crm-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px;
    box-sizing: border-box;
}

.crm-dashboard-content {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    padding: 24px;
}

.crm-page-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 600;
}

/* ????????? ???????? ? ?????? (??????? + ??????) ? ???? ?????? */
.crm-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 12px;
}

.crm-page-header .crm-page-title {
    margin: 0;
}

.crm-page-toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px 16px;
}

.crm-page-toolbar .crm-print-actions {
    margin: 0;
}

.crm-page-header-orgs .crm-print-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.crm-page-header-orgs .crm-orgs-sync-dadata-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.crm-page-toolbar-form {
    margin-bottom: 0;
}

.crm-page-header .crm-filter-bar {
    margin-bottom: 0;
}

.crm-lead {
    margin: 0 0 24px;
    color: var(--crm-text-muted);
}

.crm-link {
    color: var(--crm-accent);
}

.crm-link:hover {
    text-decoration: underline;
}

.crm-table-link {
    color: var(--crm-text);
    font-weight: 600;
    text-decoration: none;
}

.crm-table-link:hover {
    color: var(--crm-accent);
    text-decoration: underline;
}

.crm-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin: 0 0 16px;
    font-size: 13px;
    color: var(--crm-text-muted);
}

.crm-breadcrumb-link {
    color: var(--crm-accent);
    text-decoration: none;
}

.crm-breadcrumb-link:hover {
    text-decoration: underline;
}

.crm-breadcrumb-icon {
    margin-right: 4px;
    vertical-align: -0.1em;
}

.crm-breadcrumb-sep {
    color: var(--crm-border);
}

.crm-breadcrumb-current {
    color: var(--crm-text);
}

.crm-dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 24px;
    margin: 0 0 24px;
    font-size: 14px;
}

.crm-dl dt {
    color: var(--crm-text-muted);
    font-weight: 500;
}

.crm-dl dd {
    margin: 0;
}

.crm-card-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--crm-border);
}

.crm-card-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}

/* Карточка организации: сворачиваемые блоки реквизитов */
.crm-org-sections-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.crm-org-sections-grid .crm-org-section-details,
.crm-club-top-summary-grid .crm-org-section-details,
.crm-club-subgrid .crm-org-section-details {
    margin-top: 0;
    padding: 14px 16px 16px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    align-self: start;
    min-width: 0;
}

.crm-club-api-details {
    margin-top: 16px;
    padding: 14px 16px 16px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    min-width: 0;
}

@media (max-width: 1100px) {
    .crm-org-sections-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.crm-org-sections-grid .crm-org-section-panel,
.crm-club-top-summary-grid .crm-org-section-panel,
.crm-club-subgrid .crm-org-section-panel,
.crm-club-api-details .crm-org-section-panel {
    overflow-x: auto;
}

/* Карточка клиента (клуб): компактная шапка и сетки блоков */
.crm-club-top-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 12px;
    align-items: start;
}

.crm-club-top-summary-grid > .crm-club-info-block:only-child {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .crm-club-top-summary-grid {
        grid-template-columns: 1fr;
    }
}

.crm-club-info-block--compact {
    margin: 0;
    padding: 10px 14px 12px;
}

.crm-club-subgrid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px 16px 16px;
}

@media (max-width: 900px) {
    .crm-club-subgrid {
        grid-template-columns: 1fr;
    }
}

.crm-club-subgrid--stack {
    grid-template-columns: 1fr;
}

.crm-club-subgrid--supply {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 1000px) {
    .crm-club-subgrid--supply {
        grid-template-columns: 1fr;
    }
}

.crm-club-subgrid--supply > .crm-org-section-details:only-child {
    grid-column: 1 / -1;
}

.crm-club-span-2 {
    grid-column: 1 / -1;
}

.crm-club-details-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.crm-requisites-grid--in-details {
    padding: 0;
}

.crm-org-api-intro {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--crm-text-muted);
    line-height: 1.45;
}

.crm-org-api-dl dd {
    margin-bottom: 10px;
}

.crm-org-api-dl dd:last-child {
    margin-bottom: 0;
}

.crm-code-inline {
    font-family: "Consolas", "Monaco", monospace;
    font-size: 0.88em;
    padding: 1px 6px;
    border-radius: 4px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
}

.crm-org-section-details > summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}

.crm-org-section-details > summary::-webkit-details-marker {
    display: none;
}

.crm-org-section-details > summary .crm-card-section-title {
    margin: 0;
}

.crm-org-section-details[open] > summary {
    margin-bottom: 12px;
}

.crm-org-section-details .crm-org-section-chevron {
    font-size: 0.9em;
    opacity: 0.75;
    transition: transform 0.15s ease;
    flex-shrink: 0;
}

.crm-org-section-details[open] .crm-org-section-chevron {
    transform: rotate(90deg);
}

.crm-org-bank-dadata-form {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--crm-border);
}

.crm-org-bank-dadata-legend {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--crm-text-muted);
}

.crm-org-bank-dadata-form .crm-form-row-inline {
    align-items: flex-end;
    flex-wrap: wrap;
}

.crm-org-bank-dadata-form .crm-input-bik {
    max-width: 140px;
}

/* ??????? ??????????: ?????, ???????? */
.crm-material-form .crm-form-group {
    margin-bottom: 16px;
}
.crm-material-form .crm-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--crm-text);
}
.crm-material-form .crm-required {
    color: var(--crm-error);
}
.crm-material-form .crm-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.crm-material-form .crm-form-hint {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--crm-text-muted);
}
.crm-material-thumb {
    max-width: 80px;
    max-height: 60px;
    vertical-align: middle;
    margin-right: 8px;
}
.crm-material-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border);
}
.crm-inline-form {
    display: inline;
}
.crm-inline-form button:not(.crm-action-link):not([class*="crm-action-link"]) {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    cursor: pointer;
    color: inherit;
}
.crm-inline-label {
    font-weight: normal;
    cursor: pointer;
    margin-left: 8px;
}

/* ??????? ????????: ???????? ????????? ???? ???????? (?? ?.17) */
.crm-delivery-planned-edit {
    margin-bottom: 24px;
    padding: 16px;
    background: var(--crm-surface);
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border);
}
.crm-delivery-planned-edit .crm-subtitle {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
}
.crm-delivery-planned-edit .crm-form.crm-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 8px;
}
.crm-delivery-planned-edit .crm-form-group-inline {
    margin-bottom: 0;
}
.crm-delivery-planned-edit .crm-form-group-inline .crm-input {
    min-width: 200px;
}
.crm-delivery-planned-edit .crm-form-actions-inline {
    margin-bottom: 0;
}
.crm-delivery-planned-edit .crm-text-small {
    font-size: 0.875rem;
}

/* ?????? ?? ?????: ????? ?????????????? */
.crm-timesheet-edit-form .crm-form-group {
    margin-bottom: 16px;
}
.crm-timesheet-edit-form .crm-timesheet-rate {
    margin-bottom: 20px;
}
.crm-timesheet-edit-form .crm-timesheet-rate .crm-input {
    max-width: 160px;
}
.crm-timesheet-table {
    margin-top: 16px;
}
.crm-timesheet-table .crm-input-inline {
    width: 100%;
    min-width: 120px;
}

/* История табелей: фильтры в одну строку (на узком экране — перенос) */
.crm-timesheet-history-form.crm-form {
    max-width: none;
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

.crm-page-header .crm-timesheet-history-form {
    justify-content: flex-end;
}

.crm-timesheet-history-form {
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-end;
    gap: 10px 16px;
    margin-bottom: 0;
}

.crm-timesheet-history-form .crm-form-group {
    margin-bottom: 0;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 8px;
    flex: 0 1 auto;
    min-width: 0;
}

.crm-timesheet-history-form .crm-form-group .crm-label {
    display: inline-block;
    margin-bottom: 0;
    white-space: nowrap;
    flex-shrink: 0;
}

.crm-timesheet-history-form .crm-form-group .crm-select {
    min-width: 7.5rem;
    max-width: 14rem;
    flex: 1 1 auto;
}

.crm-timesheet-history-form .crm-form-group:nth-child(2) .crm-select {
    max-width: 18rem;
}

.crm-timesheet-history-form .crm-form-actions {
    margin-bottom: 0;
    flex-shrink: 0;
}
.crm-timesheet-history-export {
    margin-bottom: 16px;
}
.crm-timesheet-history-export .crm-subtitle {
    margin: 0 0 8px 0;
    font-size: 1rem;
    font-weight: 600;
}
.crm-timesheet-history-export .crm-export-link {
    width: auto;
    height: auto;
    padding: 2px 8px;
    margin-right: 8px;
}

.crm-form-row-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 8px;
}
.crm-form-row-inline .crm-input {
    min-width: 180px;
}
.crm-timesheet-add-freelancer {
    margin-top: 24px;
}
.crm-timesheet-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.crm-timesheet-row-freelancer td:first-child {
    background: var(--crm-surface);
}

/* ???????????? ?????? ????????? ? ????? ?????? */
.crm-freelancer-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.crm-freelancer-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.crm-freelancer-row-num {
    min-width: 20px;
    font-size: 0.85rem;
    color: var(--crm-muted);
    text-align: right;
    user-select: none;
}
.crm-freelancer-name-input {
    flex: 0 0 240px;
    min-width: 0;
}
.crm-freelancer-fin-row .crm-freelancer-salary-input,
.crm-freelancer-fin-row .crm-freelancer-salary-fixed {
    flex: 0 0 110px;
    min-width: 0;
    box-sizing: border-box;
}
.crm-freelancer-fin-row .crm-freelancer-salary-fixed {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius, 6px);
    background: var(--crm-sidebar-bg, rgba(0, 0, 0, 0.04));
    font-variant-numeric: tabular-nums;
}
.crm-freelancer-fin-row .crm-freelancer-days-input,
.crm-freelancer-fin-row .crm-freelancer-shifts-input {
    flex: 0 0 76px;
    min-width: 0;
}
.crm-ts-freelancer-salary-readonly {
    display: inline-block;
    min-height: 34px;
    padding: 6px 8px;
    font-variant-numeric: tabular-nums;
    color: var(--crm-text-muted);
}
.crm-freelancer-comment-input {
    flex: 1 1 auto;
    min-width: 0;
}
.crm-freelancer-remove-hidden {
    visibility: hidden;
    pointer-events: none;
}
.crm-freelancer-add-btn {
    margin-top: 4px;
}
@media (max-width: 600px) {
    .crm-freelancer-row {
        flex-wrap: wrap;
    }
    .crm-freelancer-name-input {
        flex: 1 1 100%;
    }
    .crm-freelancer-comment-input {
        flex: 1 1 100%;
    }
}

/* ???????? ?????: ???????? ? ?????? */
.crm-table-compact th,
.crm-table-compact td {
    padding: 8px 12px;
}
.crm-club-salary-form .crm-input-numeric,
.crm-club-advance-form .crm-input-numeric {
    max-width: 140px;
}
.crm-club-form-actions {
    margin-top: 12px;
}
.crm-club-advance-form .crm-form-row-inline {
    margin-bottom: 16px;
}
.crm-club-advance-form .crm-label {
    margin-right: 4px;
}

.crm-period-close-form {
    margin-top: 12px;
}

.crm-period-patch-form .crm-input-numeric {
    max-width: 140px;
}

.crm-textarea {
    resize: vertical;
    min-height: 60px;
}

.crm-club-normatives-form .crm-input-numeric {
    max-width: 120px;
}

.crm-club-normatives-form .crm-input-days {
    max-width: 72px;
}

.crm-normative-new-row td {
    background: var(--crm-surface);
}

/* ===== ???????? ???????: ????? ? ??????? ???? ===== */
.crm-club-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.crm-club-header-main {
    flex: 1 1 240px;
    min-width: 0;
}

.crm-club-header-topline {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 28px;
    row-gap: 8px;
    margin-bottom: 10px;
}

.crm-club-header-topline .crm-club-name {
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
}

.crm-club-header-org-inline {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px 12px;
    font-size: 0.88rem;
    line-height: 1.35;
}

.crm-club-header-org-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-text-muted);
    white-space: nowrap;
}

.crm-club-header-org-name {
    font-weight: 600;
}

.crm-club-header-dropdowns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.crm-club-popover-details {
    position: relative;
    display: inline-block;
    vertical-align: top;
}

.crm-club-popover-summary {
    list-style: none;
}

.crm-club-popover-summary::-webkit-details-marker {
    display: none;
}

.crm-club-popover-summary::marker {
    content: none;
}

.crm-club-popover-panel {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 200;
    min-width: min(100vw - 32px, 280px);
    max-width: min(94vw, 520px);
    max-height: min(72vh, 480px);
    overflow-y: auto;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.crm-club-popover-panel--address {
    padding: 12px 14px;
    min-width: min(100vw - 32px, 240px);
    max-width: min(94vw, 420px);
}

.crm-club-popover-address-text {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.45;
}

/* Широкая выпадашка: таблица клиентов, форма выписки (карточка организации) */
.crm-club-popover-panel--wide {
    min-width: min(100vw - 32px, 320px);
    max-width: min(94vw, 720px);
    max-height: min(78vh, 560px);
}

.crm-org-popover-panel--pad {
    padding: 12px 14px 14px;
}

.crm-org-popover-panel--pad > .crm-dl-two-col:first-child {
    margin-top: 0;
}

.crm-org-detail-header {
    margin-bottom: 16px;
}

.crm-org-tochka-intro {
    margin-top: 0;
}

.crm-org-bank-dadata-form--popover {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--crm-border);
}

.crm-finance-stmt-row--popover {
    flex-wrap: wrap;
}

.crm-org-clients-table-wrap {
    overflow-x: auto;
    margin: 0 -2px;
}

.crm-requisites-grid--popover {
    padding: 12px 14px 14px;
    gap: 14px;
    grid-template-columns: 1fr;
}

.crm-club-header .crm-club-header-actions {
    flex: 0 0 auto;
    align-self: flex-start;
}

.crm-club-name {
    margin-bottom: 0;
}
.crm-club-info-block {
    margin: 12px 0 20px;
    padding: 14px 18px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
}
.crm-club-info-block .crm-dl-two-col {
    margin: 0;
}

/* ===== ????????? ?????: ?????? ? ???????????? ===== */
.crm-system-block {
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.crm-system-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--crm-border);
}
.crm-requisites-grid {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.crm-requisites-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-requisites-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--crm-text-muted);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-monospace {
    font-family: "Consolas", "Monaco", monospace;
    font-size: 12px;
    letter-spacing: 0.03em;
}

.crm-system-finance-payouts > .crm-system-header {
    background: rgba(234, 179, 8, 0.12);
    color: #ca8a04;
}
.crm-club-finance-base-dl {
    margin-top: 4px;
}
.crm-system-timesheet > .crm-system-header {
    background: rgba(74, 158, 255, 0.1);
    color: var(--crm-accent);
}

.crm-club-ts-export-current {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-club-ts-export-current-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-text-muted);
    margin-bottom: 4px;
}

.crm-club-ts-export-current-period {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.crm-club-ts-export-current-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 0 0 8px;
}

.crm-club-ts-export-hint {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.45;
}

.crm-club-ts-history-title {
    display: block;
    margin-bottom: 8px;
    font-size: 0.82rem;
}

.crm-club-ts-history-wrap {
    margin-bottom: 8px;
}

.crm-club-ts-history-table .crm-club-ts-history-actions {
    white-space: nowrap;
}

.crm-club-ts-history-table .crm-club-ts-history-actions .crm-action-link {
    margin-right: 8px;
}

.crm-club-ts-history-full {
    margin: 10px 0 0;
    font-size: 0.8rem;
}

/* Финансы: канбан-карточки клиентов */
.crm-finance-kanban-lead {
    max-width: 52rem;
}

/* Канбан: шапка — слева заголовок и текст, справа фильтры */
.crm-fk-header-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px 28px;
    margin-bottom: 14px;
}

.crm-fk-header-left {
    flex: 1 1 16rem;
    min-width: 0;
}

.crm-fk-header-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 6px;
}

.crm-fk-header-title-row .crm-fk-page-title {
    margin-bottom: 0;
}

.crm-fk-header-lead {
    margin: 0;
    max-width: 36rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--crm-text-muted, #94a3b8);
}

.crm-fk-header-right {
    flex: 0 1 auto;
    min-width: min(100%, 17.5rem);
    max-width: 100%;
}

.crm-finance-kanban-filter-row--compact {
    gap: 10px 12px;
    align-items: flex-end;
}

.crm-finance-kanban-filter-form--compact .crm-label {
    font-size: 0.7rem;
    margin-bottom: 3px;
    letter-spacing: 0.02em;
}

.crm-finance-kanban-filter-form--compact .crm-finance-kanban-filter-row .crm-form-group {
    min-width: 0;
    margin-bottom: 0;
}

.crm-fk-filter-group-period {
    flex: 0 1 7.5rem;
}

.crm-fk-filter-group-org {
    flex: 1 1 9rem;
    min-width: 7rem;
}

.crm-fk-filter-select {
    font-size: 0.8rem;
    padding-top: 5px;
    padding-bottom: 5px;
}

.crm-fk-filter-hint {
    margin: 8px 0 0;
    font-size: 0.68rem;
    line-height: 1.35;
    max-width: 22rem;
    margin-left: auto;
    text-align: right;
}

@media (max-width: 720px) {
    .crm-fk-filter-hint {
        margin-left: 0;
        text-align: left;
        max-width: none;
    }
}
.crm-finance-kanban-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 18px;
}
.crm-finance-kanban-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface, rgba(255, 255, 255, 0.03));
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.crm-finance-kanban-card:hover {
    border-color: var(--crm-accent, #4a9eff);
    background: rgba(74, 158, 255, 0.06);
}
.crm-finance-kanban-card-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.35;
}
.crm-finance-kanban-card-meta {
    font-size: 0.8rem;
    color: var(--crm-text-muted);
}
.crm-finance-kanban-card-badge {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--crm-text-muted);
    margin-top: 4px;
}
.crm-finance-kanban-filter-form {
    margin: 18px 0 8px;
    padding: 14px 16px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: rgba(0, 0, 0, 0.15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.crm-finance-kanban-filter-form.crm-finance-kanban-filter-form--compact {
    margin: 0;
    padding: 10px 12px;
    box-shadow: none;
    background: rgba(0, 0, 0, 0.12);
}
.crm-finance-kanban-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}
.crm-finance-kanban-filter-row .crm-form-group {
    margin-bottom: 0;
    min-width: 160px;
}
.crm-finance-kanban-filter-submit .crm-label-placeholder {
    visibility: hidden;
}
.crm-finance-kanban-period-caption {
    margin: 12px 0 8px;
    font-size: 0.9rem;
}

.crm-fk-page-title {
    margin-bottom: 0;
}

.crm-fk-settings-link {
    flex-shrink: 0;
}

.crm-fk-settings-section {
    margin-top: 28px;
    padding-top: 8px;
    border-top: 1px solid var(--crm-border);
}

.crm-fk-settings-subtitle {
    margin: 20px 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--crm-text-muted);
}

.crm-fk-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px 18px;
    margin-top: 12px;
}

.crm-fk-settings-field .crm-label {
    font-size: 0.82rem;
}

.crm-fk-autotask-table-wrap {
    margin: 12px 0 20px;
}

.crm-fk-autotask-table {
    font-size: 0.85rem;
}

.crm-fk-autotask-add-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px 18px;
    margin-top: 8px;
}

.crm-fk-autotask-field--wide {
    grid-column: 1 / -1;
}

.crm-fk-current-badge {
    font-size: 0.8rem;
    color: #ca8a04;
    font-weight: 600;
}

.crm-fk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    list-style: none;
    padding: 0;
    margin: 12px 0 4px;
    font-size: 0.78rem;
    color: var(--crm-text-muted);
}

.crm-fk-legend-day {
    display: inline-block;
    min-width: 1.4rem;
    font-weight: 700;
    color: var(--crm-text-muted);
}

.crm-fk-legend-day--accent {
    color: #60a5fa;
}

.crm-fk-legend-day--gold {
    color: #eab308;
}

.crm-fk-legend-day--coral {
    color: #fb7185;
}

.crm-fk-legend-day--mint {
    color: #34d399;
}

.crm-fk-legend-day--violet {
    color: #a78bfa;
}

.crm-fk-legend-day--slate {
    color: #94a3b8;
}

.crm-fk-timeline-wrap {
    position: relative;
    margin-top: 12px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    overflow: hidden;
}

.crm-fk-timeline-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}

.crm-fk-day-columns {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    min-height: 220px;
    position: relative;
    z-index: 2;
    padding: 4px 0 20px;
}

.crm-fk-day-col {
    flex: 0 0 152px;
    min-width: 152px;
    border-right: 1px solid var(--crm-border);
    position: relative;
    z-index: 1;
}

.crm-fk-day-col:last-child {
    border-right: none;
}

.crm-fk-day-head {
    text-align: center;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 8px 4px;
    border-bottom: 1px solid var(--crm-border);
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.crm-fk-day-head--mark {
    font-weight: 700;
}

.crm-fk-day-head--mark.crm-fk-day-head--accent {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.2);
    border-bottom-color: rgba(59, 130, 246, 0.45);
}

.crm-fk-day-head--mark.crm-fk-day-head--gold {
    color: #fde047;
    background: rgba(234, 179, 8, 0.18);
    border-bottom-color: rgba(234, 179, 8, 0.4);
}

.crm-fk-day-head--mark.crm-fk-day-head--coral {
    color: #fecdd3;
    background: rgba(244, 63, 94, 0.2);
    border-bottom-color: rgba(244, 63, 94, 0.4);
}

.crm-fk-day-head--mark.crm-fk-day-head--mint {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.18);
    border-bottom-color: rgba(16, 185, 129, 0.4);
}

.crm-fk-day-head--mark.crm-fk-day-head--violet {
    color: #ddd6fe;
    background: rgba(139, 92, 246, 0.2);
    border-bottom-color: rgba(139, 92, 246, 0.4);
}

.crm-fk-day-head--mark.crm-fk-day-head--slate {
    color: #cbd5e1;
    background: rgba(100, 116, 139, 0.25);
    border-bottom-color: rgba(100, 116, 139, 0.45);
}

.crm-fk-day-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 6px;
    min-height: 48px;
}

.crm-fk-card {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px 8px 8px;
    border-radius: 6px;
    border: 1px solid var(--crm-border);
    background: rgba(255, 255, 255, 0.035);
    text-decoration: none;
    color: inherit;
    font-size: 0.68rem;
    line-height: 1.3;
}

.crm-fk-card:hover {
    border-color: var(--crm-accent, #4a9eff);
    background: rgba(74, 158, 255, 0.07);
}

.crm-fk-card-title {
    font-weight: 600;
    font-size: 0.76rem;
}

.crm-fk-card-org {
    color: var(--crm-text-muted);
    font-size: 0.68rem;
}

.crm-fk-card-debt {
    font-weight: 500;
    font-size: 0.68rem;
}

.crm-fk-card-line {
    font-size: 0.62rem;
    line-height: 1.28;
}

.crm-fk-ok {
    color: #16a34a;
}

.crm-fk-bad {
    color: #dc2626;
}

.crm-fk-card-done {
    opacity: 0.88;
    border-color: rgba(22, 163, 74, 0.35);
}

.crm-fk-card-overdue {
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.35);
    background: rgba(220, 38, 38, 0.07);
}

.crm-fk-past-shade {
    display: none;
}

.crm-fk-has-current-month .crm-fk-past-shade {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: calc(var(--fk-now-pct, 0) * 100%);
    background: rgba(0, 0, 0, 0.32);
    pointer-events: none;
    z-index: 0;
}

.crm-fk-now-line {
    display: none;
}

.crm-fk-has-current-month .crm-fk-now-line {
    display: block;
    position: absolute;
    left: calc(var(--fk-now-pct, 0.45) * 100%);
    top: 0;
    bottom: 0;
    width: 3px;
    margin-left: -1px;
    background: #dc2626;
    z-index: 4;
    pointer-events: none;
}

.crm-fk-period-info {
    margin: 10px 0 6px;
}

.crm-fk-board {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.08) 100%);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.crm-fk-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.crm-club-period-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border);
    background: rgba(0, 0, 0, 0.12);
    font-size: 0.88rem;
}

.crm-fin-chart-system-header {
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px 20px;
}

.crm-fin-chart-system-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: min(100%, 12rem);
}

.crm-fin-chart-system-header-period {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
}

.crm-fin-chart-system-header-period-label {
    color: var(--crm-text-muted);
    font-weight: 600;
    white-space: nowrap;
}

.crm-fin-chart-period-links {
    line-height: 1.5;
}

.crm-club-period-strip-label {
    color: var(--crm-text-muted);
    font-weight: 600;
}

.crm-system-finance-chart .crm-fin-chart-inner {
    padding: 0 4px 6px;
}

.crm-fin-chart-hint-details {
    margin: 0 0 8px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: rgba(0, 0, 0, 0.1);
}

.crm-fin-chart-hint-summary {
    padding: 6px 10px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--crm-text-muted);
    cursor: pointer;
    list-style: none;
}

.crm-fin-chart-hint-summary::-webkit-details-marker {
    display: none;
}

.crm-fin-chart-hint-details .crm-fin-chart-hint {
    margin: 0;
    padding: 0 10px 8px;
    font-size: 0.72rem;
    line-height: 1.45;
}

.crm-fin-chart-main {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 14px;
    margin-bottom: 8px;
}

.crm-fin-chart-sidebar {
    flex: 0 0 auto;
    width: min(200px, 100%);
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: rgba(0, 0, 0, 0.18);
    box-sizing: border-box;
}

.crm-fin-chart-stats {
    margin: 0;
    padding: 0;
}

.crm-fin-chart-stat-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    align-items: baseline;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.72rem;
    line-height: 1.25;
}

.crm-fin-chart-stat-row:last-of-type {
    border-bottom: none;
    padding-bottom: 2px;
}

.crm-fin-chart-stat-row dt {
    margin: 0;
    font-weight: 500;
    color: var(--crm-text-muted);
}

.crm-fin-chart-stat-row dd {
    margin: 0;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.78rem;
    white-space: nowrap;
}

.crm-fin-chart-profit-compact {
    margin: 6px 0 0;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--crm-text-muted);
}

.crm-fin-chart-profit-compact strong {
    font-size: 0.88rem;
}

.crm-fin-chart-plot {
    flex: 1 1 260px;
    min-width: 0;
}

.crm-fin-chart-plot-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    margin-bottom: 6px;
}

.crm-fin-chart-scale {
    margin: 0;
    font-size: 0.68rem;
    color: var(--crm-text-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.crm-fin-chart-scale-label {
    font-weight: 600;
    margin-right: 4px;
}

.crm-fin-chart-scale-val {
    font-weight: 600;
    color: var(--crm-text, #e8eaed);
}

.crm-fin-chart-plot .crm-fin-chart-svg-wrap {
    margin-top: 0;
    margin-bottom: 0;
}

.crm-fin-chart-svg-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    margin: 0;
    padding: 4px 6px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: rgba(0, 0, 0, 0.2);
}

.crm-fin-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 112px;
    vertical-align: top;
}

.crm-fin-chart-axis {
    stroke: var(--crm-border);
    stroke-width: 1;
}

.crm-fin-chart-line {
    fill: none;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.crm-fin-chart-line--forecast {
    stroke: rgba(147, 197, 253, 0.95);
    stroke-dasharray: 6 4;
}

.crm-fin-chart-line--actual {
    stroke: #22c55e;
}

.crm-fin-chart-line--expense {
    stroke: #f97316;
}

.crm-fin-chart-line--net {
    stroke: #a78bfa;
    stroke-width: 1.85;
}

.crm-fin-chart-legend {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 0.68rem;
    color: var(--crm-text-muted);
}

.crm-fin-chart-plot .crm-fin-chart-legend {
    margin-bottom: 0;
}

.crm-fin-chart-legend li {
    display: flex;
    align-items: center;
    gap: 5px;
}

.crm-fin-chart-swatch {
    display: inline-block;
    width: 12px;
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

.crm-fin-chart-swatch--forecast {
    background: repeating-linear-gradient(
        90deg,
        rgba(147, 197, 253, 0.95) 0 4px,
        transparent 4px 8px
    );
    min-width: 18px;
    height: 3px;
}

.crm-fin-chart-swatch--actual {
    background: #22c55e;
}

.crm-fin-chart-swatch--expense {
    background: #f97316;
}

.crm-fin-chart-swatch--net {
    background: #a78bfa;
}

.crm-fin-chart-profit-pos {
    color: #4ade80;
}

.crm-fin-chart-profit-neg {
    color: #f87171;
}

.crm-fin-chart-cat-block {
    margin-top: 8px;
}

.crm-fin-chart-cat-title {
    display: block;
    margin-bottom: 8px;
}

@media (max-width: 560px) {
    .crm-fin-chart-main {
        flex-direction: column;
    }

    .crm-fin-chart-sidebar {
        width: 100%;
    }
}

.crm-timesheet-rate-readonly {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border);
    background: rgba(0, 0, 0, 0.12);
}

.crm-club-finance-track-list {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
}

.crm-form-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.crm-label-inline {
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.crm-ts-status-panel {
    margin-bottom: 18px;
    padding: 12px 16px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: rgba(74, 158, 255, 0.06);
}
.crm-ts-status-panel-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.crm-ts-status-line {
    margin: 0;
    font-size: 0.9rem;
}
.crm-ts-status-label {
    color: var(--crm-text-muted);
    margin-right: 8px;
}
.crm-ts-status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.crm-club-ts-status-line {
    margin-top: 8px;
}
.crm-system-supply > .crm-system-header {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}
.crm-card-section-inner {
    padding: 16px 18px;
    border-bottom: 1px solid var(--crm-border);
}
.crm-card-section-inner:last-child {
    border-bottom: none;
}
.crm-section-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.crm-section-row-header .crm-card-section-title {
    margin-bottom: 0;
}
.crm-period-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.82rem;
}
.crm-message-compact {
    margin: 8px 0;
    padding: 6px 12px;
    font-size: 0.85rem;
}
.crm-text-muted-sm {
    font-size: 0.85rem;
    margin: 4px 0 0;
}

.crm-row-overdue td {
    background: rgba(255, 69, 58, 0.08);
}

.crm-order-send-section {
    margin-top: 24px;
}

.crm-order-send-form .crm-form-row-inline {
    align-items: flex-end;
}

.crm-lead-small {
    margin: 0 0 12px;
    font-size: 13px;
}

.crm-fot-dl {
    margin-bottom: 12px;
}

.crm-fot-over {
    color: var(--crm-error);
    font-weight: 600;
}

.crm-api-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crm-api-links a {
    display: inline-block;
}

/* ??????????? ??????? (?????? ?) */
.crm-help {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    color: var(--crm-text-muted);
    cursor: help;
    font-size: 0.95rem;
}

.crm-help:hover {
    color: var(--crm-accent);
}

/* ????????-??? ??? */
.crm-fot-progress {
    height: 8px;
    background: var(--crm-bg);
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0;
    border: 1px solid var(--crm-border);
}

.crm-fot-progress-bar {
    height: 100%;
    border-radius: 999px;
    background: var(--crm-success);
    transition: width 0.2s ease;
}

.crm-fot-progress-bar.crm-fot-progress-over {
    background: var(--crm-error);
}

.crm-fot-pct-0 { width: 0%; }
.crm-fot-pct-10 { width: 10%; }
.crm-fot-pct-20 { width: 20%; }
.crm-fot-pct-30 { width: 30%; }
.crm-fot-pct-40 { width: 40%; }
.crm-fot-pct-50 { width: 50%; }
.crm-fot-pct-60 { width: 60%; }
.crm-fot-pct-70 { width: 70%; }
.crm-fot-pct-80 { width: 80%; }
.crm-fot-pct-90 { width: 90%; }
.crm-fot-pct-100 { width: 100%; }

/* ????????? ????? ???????? ? ?????? ?????? */
.crm-remainder-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.crm-remainder-dot-ok {
    background: var(--crm-success);
}

.crm-remainder-dot-missing {
    background: var(--crm-error);
}

/* ?????????? ????????? ? ?????? ???????? */
.crm-table tbody tr.crm-row-inactive {
    opacity: 0.65;
}

.crm-table tbody tr.crm-row-inactive td {
    color: var(--crm-text-muted);
}

.crm-icon-inactive {
    margin-left: 6px;
    font-size: 0.9rem;
    color: var(--crm-text-muted);
}

/* ?????? ??????????? ? ????? */
.crm-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    margin-left: 4px;
    border: none;
    background: transparent;
    color: var(--crm-text-muted);
    border-radius: var(--crm-radius);
    cursor: pointer;
}

.crm-copy-btn:hover {
    color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.12);
}

.crm-dashboard-widget {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
}

.crm-widget-salary-debt-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.crm-widget-salary-debt-icon {
    color: var(--crm-accent);
}

.crm-widget-salary-debt-value {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--crm-text);
}

.crm-widget-salary-debt-link {
    font-size: 13px;
    color: var(--crm-accent);
}

.crm-widget-salary-debt-link:hover {
    text-decoration: underline;
}

.crm-director-stats {
    margin-bottom: 24px;
}

.crm-director-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.crm-director-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    text-decoration: none;
    color: var(--crm-text);
    transition: border-color 0.2s, background 0.2s;
}

.crm-director-stat-card:hover {
    border-color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.08);
}

.crm-director-stat-value {
    display: block;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--crm-text);
}

.crm-director-stat-label {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--crm-text-muted);
}

.crm-dashboard-section-title {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--crm-text);
}

.crm-dashboard-section-title-compact {
    font-size: 0.88rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crm-dashboard-intro {
    font-size: 0.85rem;
    margin-bottom: 14px;
    color: var(--crm-text-muted);
}

.crm-lead-compact {
    font-size: 0.82rem;
    line-height: 1.4;
    margin: 8px 0 12px;
    color: var(--crm-text-muted);
}

.crm-role-cabinet {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-role-cabinet-inline {
    padding: 10px 14px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: rgba(0, 0, 0, 0.12);
}

.crm-role-inline-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--crm-accent, #4a9eff);
    text-decoration: none;
}

.crm-role-inline-link:hover {
    text-decoration: underline;
}

.crm-role-ops-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 12px;
}

.crm-role-ops-strip-director {
    margin-bottom: 10px;
}

.crm-manager-cabinet-orgs {
    margin-top: 4px;
}

.crm-role-ops-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    min-height: 40px;
    box-sizing: border-box;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--crm-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--crm-border);
    transition: border-color 0.15s, background 0.15s;
}

.crm-role-ops-chip:hover {
    border-color: var(--crm-accent, #4a9eff);
    color: var(--crm-text);
}

.crm-role-ops-chip-accent {
    border-color: rgba(74, 158, 255, 0.45);
    color: var(--crm-accent, #4a9eff);
}

.crm-role-ops-chip-warn {
    border-color: rgba(234, 179, 8, 0.5);
    color: #eab308;
}

.crm-role-ops-chip-danger {
    border-color: rgba(220, 38, 38, 0.45);
    color: #f87171;
}

/* Подпись без ссылки (нет доступа к карточке организации) */
.crm-role-ops-chip.crm-role-ops-chip-text {
    cursor: default;
    opacity: 0.88;
}

.crm-role-ops-chip.crm-role-ops-chip-text:hover {
    border-color: var(--crm-border);
    color: var(--crm-text-muted);
}

.crm-role-ops-meta {
    font-size: 0.72rem;
    color: var(--crm-text-muted);
    margin-left: 4px;
}

.crm-role-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.crm-director-stats-grid-compact .crm-director-stat-card {
    padding: 12px 14px;
}

.crm-director-stats-grid-compact .crm-director-stat-value {
    font-size: 1.35rem;
}

.crm-director-stats-grid-compact .crm-director-stat-label {
    font-size: 0.72rem;
}

.crm-quicklinks-grid-dense {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 8px;
}

.crm-quicklinks-grid-dense .crm-quicklink-card {
    padding: 12px 8px;
    font-size: 0.78rem;
    gap: 6px;
}

.crm-quicklinks-grid-dense .crm-quicklink-icon {
    font-size: 1.15rem;
}

.crm-ts-draft-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: var(--crm-radius);
    border: 1px solid rgba(234, 179, 8, 0.4);
    background: rgba(234, 179, 8, 0.1);
}

.crm-ts-draft-banner[hidden] {
    display: none !important;
}

.crm-ts-draft-banner-text {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
    flex: 1 1 12rem;
}

.crm-ts-autosave-hint {
    margin: 0 0 10px;
    font-size: 0.72rem;
    line-height: 1.35;
    color: var(--crm-text-muted);
}

.crm-page-header-compact .crm-page-title {
    font-size: 1rem;
}

.crm-filter-bar-compact {
    gap: 6px 10px;
}

.crm-filter-bar-compact .crm-filter-link {
    padding: 5px 9px;
    font-size: 0.78rem;
}

.crm-dashboard-quicklinks {
    margin-bottom: 24px;
}

.crm-quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.crm-quicklink-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    text-decoration: none;
    color: var(--crm-text);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s;
}

.crm-quicklink-card:hover {
    border-color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.08);
}

.crm-quicklink-card.crm-quicklink-active {
    border-color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.12);
    color: var(--crm-accent);
}

.crm-quicklink-icon {
    font-size: 24px;
    color: var(--crm-text-muted);
}

.crm-quicklink-card.crm-quicklink-active .crm-quicklink-icon {
    color: var(--crm-accent);
}

.crm-dashboard-customize {
    margin-top: 16px;
    margin-bottom: 0;
}

.crm-widget-customize-actions {
    margin-bottom: 10px;
}

.crm-search-results {
    margin-top: 20px;
}

.crm-search-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 16px 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.crm-search-section-title:first-child {
    margin-top: 0;
}

.crm-search-section-icon {
    color: var(--crm-accent);
}

.crm-search-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crm-search-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--crm-border);
}

.crm-search-list li:last-child {
    border-bottom: none;
}

.crm-search-link {
    color: var(--crm-accent);
}

.crm-search-link:hover {
    text-decoration: underline;
}

.crm-search-material {
    color: var(--crm-text);
}

.crm-search-edit {
    margin-left: 8px;
    font-size: 13px;
}

.crm-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.crm-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    font-size: 13px;
}

.crm-card-icon {
    flex-shrink: 0;
    font-size: 1.15rem;
    color: var(--crm-accent);
    margin-top: 1px;
}

.crm-btn-small {
    padding: 4px 10px;
    font-size: 12px;
}

.crm-notifications {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--crm-border);
}

.crm-notifications-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.crm-notifications-title-icon {
    font-size: 1.1rem;
    color: var(--crm-accent);
}

.crm-notifications-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.crm-notification-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--crm-bg);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    margin-bottom: 8px;
    font-size: 13px;
}

.crm-notification-unread {
    border-left: 3px solid var(--crm-accent);
}

.crm-notification-item-title {
    flex: 1 1 100%;
}

.crm-notification-date {
    color: var(--crm-text-muted);
    font-size: 12px;
}

.crm-notification-form {
    margin: 0;
    margin-left: auto;
}

.crm-nav-link-active {
    color: var(--crm-accent);
}

.crm-text-muted {
    color: var(--crm-text-muted);
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    overflow: hidden;
}

.crm-table th,
.crm-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--crm-border);
}

.crm-table th {
    background: var(--crm-bg);
    font-weight: 600;
    font-size: 12px;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.crm-table tbody tr:last-child td {
    border-bottom: none;
}

.crm-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.15);
}

.crm-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.crm-table tbody tr:nth-child(even):hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ?????????? ???????? (?? 3.6: ?????????? ? ???????, ? ?????? ? ??????, ????????? ? ???????) */
.crm-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.crm-status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.crm-status-draft {
    color: var(--crm-text-muted);
    background: rgba(156, 163, 173, 0.2);
}

.crm-status-draft::before {
    background: var(--crm-text-muted);
}

.crm-status-sent {
    color: #eab308;
    background: rgba(234, 179, 8, 0.15);
}

.crm-status-sent::before {
    background: #eab308;
}

.crm-status-in_delivery {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.crm-status-in_delivery::before {
    background: #f59e0b;
}

.crm-status-current {
    color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.15);
}

.crm-status-current::before {
    background: var(--crm-accent);
}

.crm-sessions-actions {
    margin-top: 16px;
}

.crm-compare-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
    margin-bottom: 20px;
}

.crm-compare-form {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 24px;
}

.crm-compare-form .crm-filter-field .crm-label {
    margin-bottom: 0;
    white-space: nowrap;
}

.crm-compare-form .crm-label {
    display: inline;
    margin-bottom: 0;
}

.crm-help-sections {
    margin-top: 24px;
}

.crm-help-section-title {
    margin: 16px 0 8px;
    font-size: 15px;
    font-weight: 600;
}

.crm-help-section-title:first-child {
    margin-top: 0;
}

.crm-help-list {
    margin: 0 0 12px;
    padding-left: 20px;
}

.crm-help-list li {
    margin-bottom: 8px;
}

.crm-help-api {
    margin-top: 24px;
}

.crm-print-actions {
    margin-bottom: 12px;
}

.crm-list-hint {
    margin-top: 12px;
}

@media print {
    .crm-header,
    .crm-footer,
    .crm-breadcrumb,
    .crm-lead,
    .crm-print-actions,
    .crm-filter-bar,
    .crm-cell-actions,
    .crm-nav-toggle,
        .crm-no-print,
    form.crm-no-print {
        display: none !important;
    }
    .crm-body {
        background: #fff;
    }
    .crm-main {
        max-width: none;
    }
    .crm-table {
        border: 1px solid #333;
    }
    .crm-table th,
    .crm-table td {
        color: #000;
        border-color: #333;
    }
}

.crm-status-closed {
    color: var(--crm-success);
    background: rgba(52, 199, 89, 0.15);
}

.crm-status-closed::before {
    background: var(--crm-success);
}

.crm-status-partial {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

.crm-status-partial::before {
    background: #f59e0b;
}

.crm-status-received {
    color: var(--crm-success);
    background: rgba(52, 199, 89, 0.15);
}

.crm-status-received::before {
    background: var(--crm-success);
}

.crm-status-critical {
    color: var(--crm-error);
}
.crm-status-critical::before {
    background: var(--crm-error);
}

/* ??????: ?????? ???? ??? (?? ?.1.3.2) */
.crm-order-row-below-nso td {
    background: rgba(239, 68, 68, 0.08);
}
.crm-cell-critical {
    white-space: nowrap;
}

/* ??? ??????? (?? ?.25): ???? ??????????????? ? ??????? ????????? */
.crm-my-profile-zones,
.crm-my-profile-misses {
    margin-bottom: 28px;
}
.crm-my-profile-zones .crm-subtitle,
.crm-my-profile-misses .crm-subtitle {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
}
.crm-my-profile-club-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.crm-my-profile-club {
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--crm-border);
}
.crm-my-profile-club:last-child {
    border-bottom: none;
}
.crm-my-profile-employees {
    list-style: none;
    padding-left: 20px;
    margin: 8px 0 0 0;
    font-size: 0.9375rem;
}
.crm-my-profile-employees li {
    margin-bottom: 4px;
}

/* ?????? ???????? ? ????? ???????? (?????? ? ?.?.) */
.crm-export-links {
    margin-left: 12px;
}
.crm-export-links .crm-action-link {
    width: auto;
    min-width: auto;
    height: auto;
    padding: 4px 10px;
}

/* ????????????: ?????? ??????????????/???????????? ? ? ????? ????? ? ?????????? ?????????? */
.crm-user-toggle-active-form {
    display: inline;
    margin-left: 8px;
}
.crm-user-toggle-active-form .crm-action-link-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--crm-text);
    background: rgba(230, 232, 235, 0.12);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.crm-user-toggle-active-form .crm-action-link-toggle:hover {
    color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.15);
    border-color: rgba(74, 158, 255, 0.4);
}
.crm-user-toggle-active-form .crm-action-link-toggle i {
    margin-right: 5px;
}

.crm-user-edit-dd-section {
    margin-top: 1.25rem;
}

.crm-user-create-role-panel--hidden {
    display: none;
}

.crm-dd-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 8px 12px;
    margin-top: 0.5rem;
}

.crm-dd-pick-label {
    align-items: flex-start;
}

/* ??????? ???????? ? ??????? ? ?????? ???????? ?????? ????? ?? ?????? ???? */
.crm-cell-actions {
    white-space: nowrap;
    min-width: 140px;
}

.crm-cell-actions .crm-action-link,
.crm-cell-actions .crm-action-link-primary,
.crm-cell-actions .crm-action-link-success,
.crm-cell-actions .crm-action-link-toggle,
.crm-cell-actions button.crm-action-link {
    margin: 0 3px;
    vertical-align: middle;
}

.crm-cell-actions form.crm-inline-form {
    display: inline;
}

.crm-action-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    margin: 0 2px;
    color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.15);
    border: 1px solid rgba(74, 158, 255, 0.35);
    border-radius: var(--crm-radius);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.crm-action-link:hover {
    color: #fff;
    background: var(--crm-accent);
    border-color: var(--crm-accent);
}

.crm-action-link i {
    font-size: 1.1rem;
}

.crm-action-link-primary {
    width: auto;
    min-width: auto;
    padding: 4px 12px;
    color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.2);
    border-color: rgba(74, 158, 255, 0.4);
}

.crm-action-link-primary:hover {
    color: #fff;
    background: var(--crm-accent);
    border-color: var(--crm-accent);
}

.crm-action-link-primary i {
    margin-right: 5px;
}

/* ??????? ???????? (? ????? ? ?.?.) ? ??????? ??????, ?????????????? ??????? ?????? */
.crm-action-link-danger {
    color: var(--crm-error);
    background: rgba(255, 69, 58, 0.2);
    border-color: rgba(255, 69, 58, 0.5);
}
.crm-action-link-danger:hover {
    color: #fff;
    background: var(--crm-error);
    border-color: var(--crm-error);
}

.crm-action-link-success {
    color: var(--crm-success);
    background: rgba(52, 199, 89, 0.18);
    border-color: rgba(52, 199, 89, 0.45);
}

.crm-action-link-success:hover {
    color: #fff;
    background: var(--crm-success);
    border-color: var(--crm-success);
}

/* ??????-?????? ? ???????? (button-????????, ?????? .crm-action-link) */
.crm-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    margin: 0 2px;
    background: rgba(74, 158, 255, 0.15);
    color: var(--crm-accent);
    border: 1px solid rgba(74, 158, 255, 0.35);
    border-radius: var(--crm-radius);
    font-size: 1.05rem;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
    vertical-align: middle;
}
.crm-action-btn:hover {
    color: #fff;
    background: var(--crm-accent);
    border-color: var(--crm-accent);
}
.crm-action-btn-warn {
    color: #d97706;
    background: rgba(217, 119, 6, 0.15);
    border-color: rgba(217, 119, 6, 0.4);
}
.crm-action-btn-warn:hover {
    color: #fff;
    background: #d97706;
    border-color: #d97706;
}
.crm-action-btn-success {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.15);
    border-color: rgba(22, 163, 74, 0.4);
}
.crm-action-btn-success:hover {
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}
.crm-action-btn-danger {
    color: var(--crm-error);
    background: rgba(255, 69, 58, 0.15);
    border-color: rgba(255, 69, 58, 0.4);
}
.crm-action-btn-danger:hover {
    color: #fff;
    background: var(--crm-error);
    border-color: var(--crm-error);
}

/* ?????? ?????? ? ??????? (??? ??????????) */
.crm-link-strong {
    color: var(--crm-text);
    font-weight: 600;
    text-decoration: none;
}
.crm-link-strong:hover {
    color: var(--crm-accent);
    text-decoration: underline;
}

/* ???????? crm-btn ??? ???????/???????????????/???????? ???????? */
.crm-btn-warn {
    color: #d97706;
    border-color: rgba(217, 119, 6, 0.5);
    background: rgba(217, 119, 6, 0.1);
}
.crm-btn-warn:hover {
    color: #fff;
    background: #d97706;
    border-color: #d97706;
}
.crm-btn-success {
    color: #16a34a;
    border-color: rgba(22, 163, 74, 0.5);
    background: rgba(22, 163, 74, 0.1);
}
.crm-btn-success:hover {
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}
.crm-btn-danger {
    color: var(--crm-error);
    border-color: rgba(255, 69, 58, 0.5);
    background: rgba(255, 69, 58, 0.1);
}
.crm-btn-danger:hover {
    color: #fff;
    background: var(--crm-error);
    border-color: var(--crm-error);
}

/* ?????? ?????? ???????? ??? ??????? ?????? */
.crm-card-section-first {
    border-top: none;
    padding-top: 0;
}

/* ?????? ?? ??????? (??????, ???????, ?????? ??????????, ?????? ????????) ? ? ???? ?????? */
.crm-filter-bar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px 16px;
    margin-bottom: 20px;
}

.crm-filter-label {
    color: var(--crm-text-muted);
    font-size: 13px;
}

.crm-filter-link {
    color: var(--crm-text);
    text-decoration: none;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: var(--crm-radius);
}

.crm-filter-link:hover {
    color: var(--crm-accent);
    background: rgba(74, 158, 255, 0.1);
}

.crm-filter-link-active {
    color: var(--crm-accent);
    font-weight: 600;
    background: rgba(74, 158, 255, 0.15);
}

/* ?????? ?? ???????? ????? */
.crm-login-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crm-login-title-icon {
    font-size: 1.5rem;
    color: var(--crm-accent);
}

/* ????????? ??????: ??????? ???? ? ???? ???????, ??????? ?? ??? ?????? */
@media (max-width: 768px) {
    .crm-app-content {
        margin-left: 0 !important;
    }

    .crm-sidebar {
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    }

    body.crm-sidebar-closed .crm-sidebar {
        transform: translateX(-100%);
        width: 0;
        overflow: hidden;
    }

    body.crm-sidebar-closed .crm-app-content {
        margin-left: 0;
    }

    body.crm-sidebar-closed .crm-sidebar-group-title {
        display: block;
    }

    body.crm-sidebar-closed .crm-sidebar-link-label {
        display: inline;
    }

    body.crm-sidebar-closed .crm-sidebar-link {
        padding: 6px 16px;
        justify-content: flex-start;
    }

    body.crm-sidebar-closed .crm-sidebar-icon {
        margin-right: 8px;
        font-size: 1.05rem;
    }

    body.crm-sidebar-closed .crm-sidebar-group {
        margin-bottom: 12px;
    }

    .crm-header-inner {
        flex-wrap: wrap;
        align-items: center;
        padding: 8px 10px;
        gap: 8px;
        row-gap: 6px;
    }

    .crm-sidebar-toggle {
        order: 0;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .crm-logo {
        order: 1;
        font-size: 15px;
        gap: 6px;
        flex-shrink: 0;
    }

    .crm-logo-icon {
        font-size: 1.1em;
    }

    /* Верхнее меню: одна компактная строка со скроллом, подписи скрыты — только иконки */
    .crm-nav-top {
        order: 2;
        flex: 1 1 100%;
        min-width: 0;
        max-width: 100%;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 4px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 2px;
    }

    .crm-nav-top::-webkit-scrollbar {
        height: 4px;
    }

    .crm-nav-top::-webkit-scrollbar-thumb {
        background: var(--crm-border);
        border-radius: 4px;
    }

    .crm-nav-top .crm-nav-link,
    .crm-nav-top .crm-nav-dropdown-trigger {
        flex-shrink: 0;
        padding: 6px 8px;
        font-size: 0;
        line-height: 0;
        gap: 0;
        white-space: nowrap;
    }

    .crm-nav-top .crm-nav-link .crm-nav-icon,
    .crm-nav-top .crm-nav-dropdown-trigger-icon {
        margin-right: 0;
        font-size: 1.05rem;
        line-height: 1;
        opacity: 1;
        vertical-align: middle;
    }

    .crm-nav-top .crm-nav-dropdown-trigger {
        gap: 2px;
    }

    .crm-nav-top .crm-nav-dropdown-chevron {
        font-size: 0.65rem;
        line-height: 1;
        margin-left: 1px;
    }

    .crm-nav-top .crm-nav-dropdown-wrap {
        flex-shrink: 0;
    }

    .crm-header-user {
        order: 3;
        margin-left: auto;
        flex-shrink: 0;
        gap: 6px;
        flex-wrap: nowrap;
        align-items: center;
        max-width: 100%;
    }

    /* Кнопки «Мой профиль», «Выход», AI — только иконка */
    .crm-header-user .crm-btn-ghost {
        padding: 6px 8px;
        font-size: 0;
        line-height: 0;
    }

    .crm-header-user .crm-btn-ghost .crm-btn-icon {
        margin-right: 0;
        font-size: 1.1rem;
        line-height: 1;
    }

    .crm-header-user .crm-ai-trigger {
        padding: 6px 8px;
        font-size: 0;
        line-height: 0;
    }

    .crm-header-user .crm-ai-trigger .crm-btn-icon {
        margin-right: 0;
        font-size: 1.1rem;
        line-height: 1;
    }

    .crm-header-user .crm-user-name {
        max-width: 7rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }

    .crm-header-user .crm-role-switch-trigger {
        max-width: min(9rem, 36vw);
        padding: 5px 8px;
        font-size: 11px;
    }

    .crm-main {
        padding: 16px;
    }

    .crm-dashboard-content {
        padding: 16px;
    }

    .crm-page-title {
        font-size: 16px;
    }

    .crm-dashboard-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .crm-table {
        min-width: 480px;
    }

    .crm-filter-bar {
        gap: 8px;
        flex-wrap: wrap;
    }

    .crm-filters-row,
    .crm-remainder-select-form,
    .crm-timesheet-history-form,
    .crm-compare-form {
        flex-wrap: wrap;
    }

    .crm-page-toolbar {
        flex-wrap: wrap;
    }

    .crm-filter-link {
        padding: 6px 10px;
    }

    .crm-user-role {
        display: none;
    }

    .crm-login-page {
        padding: 16px;
    }

    .crm-login-card {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .crm-header-inner {
        padding: 6px 8px;
        gap: 6px;
    }

    .crm-logo {
        font-size: 14px;
    }

    .crm-sidebar-toggle {
        width: 34px;
        height: 34px;
    }

    .crm-nav-top .crm-nav-link,
    .crm-nav-top .crm-nav-dropdown-trigger {
        padding: 5px 6px;
    }

    .crm-nav-top .crm-nav-link .crm-nav-icon,
    .crm-nav-top .crm-nav-dropdown-trigger-icon {
        font-size: 1rem;
    }

    .crm-header-user {
        gap: 4px;
    }

    .crm-header-user .crm-user-name {
        display: none;
    }

    .crm-header-user .crm-role-switch-trigger {
        max-width: min(7.5rem, 32vw);
        padding: 4px 6px;
    }

    .crm-header-user .crm-btn-ghost,
    .crm-header-user .crm-ai-trigger {
        padding: 5px 6px;
    }

    .crm-main {
        padding: 12px;
    }

    .crm-dashboard-content {
        padding: 12px;
    }

    .crm-footer-inner {
        padding: 10px 16px;
    }

    .crm-table th,
    .crm-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* === ????? ?????? (????????? ???????????) === */

/* ????????-???? ? ???????? ??????? */
.crm-manager-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.crm-manager-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.25);
    color: var(--crm-text);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 13px;
}

.crm-manager-tag-phone {
    color: var(--crm-text-muted);
    font-size: 12px;
}

/* ???? ?????????? */
.crm-employee-info-section {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.crm-employee-photo-block {
    flex-shrink: 0;
}

.crm-employee-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--crm-border);
    display: block;
}

.crm-employee-info-body {
    flex: 1;
    min-width: 0;
}

.crm-employee-photo-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.crm-employee-photo-thumb {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--crm-border);
}

.crm-employee-photo-clear {
    font-size: 13px;
    color: var(--crm-text-muted);
}

/* ???????? ???? */
.crm-input-file {
    display: block;
    padding: 6px 0;
    font-size: 14px;
    color: var(--crm-text);
}

/* ??????? ????? */
.crm-badge-danger {
    background: rgba(255, 59, 48, 0.15);
    color: #ff3b30;
}

/* ??????? */
.crm-mt-small {
    margin-top: 16px;
}

.crm-text-muted-sm {
    color: var(--crm-text-muted);
    font-size: 13px;
}

.crm-code-small {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
    word-break: break-all;
}

.crm-card-section-title-sm {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ????????? */
.crm-help-text {
    font-size: 12px;
    color: var(--crm-text-muted);
    margin-top: 4px;
}

/* ????? ??? ??????? */
.crm-table-zebra tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}

/* ?????? ???????? ? ???????? ??????? */
.crm-period-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Fieldset ????? */
.crm-fieldset {
    border: 1px solid var(--crm-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.crm-fieldset-legend {
    font-size: 13px;
    font-weight: 600;
    color: var(--crm-text-muted);
    padding: 0 8px;
}

@media (max-width: 768px) {
    .crm-employee-info-section {
        flex-direction: column;
    }
    .crm-employee-photo {
        width: 80px;
        height: 80px;
    }
}

/* ============================================================
   ???????? ?????? ? ?????????? ???????
   ============================================================ */
.crm-timesheet-scroll-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}
.crm-timesheet-fin-table {
    min-width: 1600px;
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.crm-timesheet-fin-table th,
.crm-timesheet-fin-table td {
    padding: 5px 6px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    vertical-align: middle;
    text-align: right;
}
.crm-timesheet-fin-table th {
    background: var(--bg-surface);
    font-weight: 600;
    text-align: center;
    font-size: 11px;
    line-height: 1.3;
}
.crm-ts-col-name,
.crm-timesheet-fin-table td.crm-ts-name {
    text-align: left;
    min-width: 160px;
    max-width: 200px;
    white-space: normal;
}
.crm-ts-col-num,
.crm-timesheet-fin-table td.crm-ts-num {
    width: 32px;
    text-align: center;
    color: var(--text-muted);
}
.crm-ts-col-days,
.crm-ts-col-shifts,
.crm-timesheet-fin-table td.crm-ts-int {
    width: 48px;
    text-align: center;
}
.crm-ts-int-input {
    width: 44px !important;
    text-align: center;
    padding: 2px 4px !important;
}
.crm-ts-money-input {
    width: 72px !important;
    text-align: right;
    padding: 2px 4px !important;
}
.crm-ts-name-input {
    width: 130px !important;
    padding: 2px 6px !important;
}
/* заголовок группы колонок (Удержания и подзаголовки) — в стиле CRM */
.crm-ts-group-header {
    background: var(--crm-surface) !important;
    color: var(--crm-text) !important;
    border-color: var(--crm-border) !important;
}
.crm-ts-deductions {
    background: var(--crm-surface) !important;
    color: var(--crm-text) !important;
}
.crm-ts-sub {
    background: var(--crm-surface) !important;
    color: var(--crm-text-muted) !important;
    font-size: 10px;
}
.crm-ts-deduction {
    background: rgba(36, 40, 46, 0.5) !important;
}
/* К выдаче / Остаток — акценты в тёмной теме */
.crm-ts-topay {
    background: rgba(52, 199, 89, 0.12) !important;
    font-weight: 700;
    color: var(--crm-success);
}
.crm-ts-remainder {
    background: rgba(74, 158, 255, 0.12) !important;
    font-weight: 700;
    color: var(--crm-accent);
}
.crm-ts-highlight {
    background: rgba(52, 199, 89, 0.08) !important;
}
/* штраф */
.crm-ts-fine {
    background: rgba(255, 69, 58, 0.1) !important;
}
/* ???????? ?????? */
.crm-ts-totals td {
    background: var(--bg-surface) !important;
    font-weight: 700;
    border-top: 2px solid var(--border-color);
}
.crm-ts-totals-label {
    text-align: left !important;
    font-weight: 700;
    color: var(--text-main);
    padding-left: 10px !important;
}
.crm-ts-total-val {
    color: var(--text-main);
}
/* ?????? ????? */
.crm-ts-freelancer-label {
    font-style: italic;
    color: var(--text-muted);
}
/* колонка подписи (получил/расписался) */
.crm-ts-col-sign,
.crm-ts-sign {
    min-width: 100px;
    background: var(--crm-surface);
}
/* ?????? ??????? */
.crm-timesheet-row-freelancer td {
    background: rgba(99, 102, 241, 0.04);
}
/* ????? ???????? ? ??????? ???????? */
.crm-page-header-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.crm-page-header-row .crm-page-title {
    margin-bottom: 0;
    flex: 1;
}
/* ???? ?????????? ??????? ? ?????????? ?????? */
.crm-freelancer-fin-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-color);
}
.crm-freelancer-fin-row:last-child {
    border-bottom: none;
}

/* ??? HR: ??????? ? ??????? ??????????????????????????????????????????? */
.crm-hr-dashboard {
    margin-bottom: 28px;
}

.crm-section-icon {
    margin-right: 8px;
    color: var(--crm-accent);
}

.crm-stat-card-green {
    border-left: 4px solid #2dbe6c !important;
}
.crm-stat-card-green:hover {
    background: rgba(45,190,108,0.08) !important;
}

.crm-stat-card-gray {
    border-left: 4px solid #8c9cb0 !important;
}
.crm-stat-card-gray:hover {
    background: rgba(140,156,176,0.08) !important;
}

.crm-stat-card-blue {
    border-left: 4px solid var(--crm-accent) !important;
}

.crm-hr-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ?????????? ?? ???????? ???????? */
.crm-hr-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.crm-hr-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 24px;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border);
    background: var(--crm-bg);
    min-width: 110px;
}

.crm-hr-stat-card.crm-hr-stat-active {
    border-left: 4px solid #2dbe6c;
}
.crm-hr-stat-card.crm-hr-stat-inactive {
    border-left: 4px solid #8c9cb0;
}
.crm-hr-stat-card.crm-hr-stat-total {
    border-left: 4px solid var(--crm-accent);
}

.crm-hr-stat-num {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--crm-text);
}

.crm-hr-stat-label {
    font-size: 12px;
    color: var(--crm-text-muted);
    margin-top: 4px;
    text-align: center;
}

/* строка поиска + фильтры (Профили и др.) */
.crm-search-filter-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: stretch;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
}

.crm-search-filter-row .crm-search-group {
    position: relative;
    flex: 1 1 260px;
    min-width: 0;
}

.crm-search-filter-row .crm-search-group .crm-search-input {
    padding-left: 36px;
    padding-right: 32px;
    width: 100%;
    height: 36px;
    box-sizing: border-box;
    border-color: var(--crm-border);
    background: var(--crm-bg);
}

.crm-search-filter-row .crm-search-group .crm-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crm-text-muted);
    pointer-events: none;
    font-size: 1rem;
}

.crm-search-filter-row .crm-search-group .crm-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crm-text-muted);
    text-decoration: none;
    font-size: 14px;
}

.crm-search-filter-row .crm-search-group .crm-search-clear:hover {
    color: var(--crm-error);
}

.crm-search-filter-row .crm-filter-select {
    flex: 0 1 200px;
    min-width: 160px;
    height: 36px;
    box-sizing: border-box;
    padding: 0 32px 0 12px;
    border-color: var(--crm-border);
    background: var(--crm-bg);
    color: var(--crm-text);
    font-size: 14px;
}

.crm-search-filter-row .crm-btn {
    flex-shrink: 0;
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
}

.crm-search-group {
    position: relative;
    flex: 1 1 220px;
}

.crm-search-group .crm-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crm-text-muted);
    pointer-events: none;
}

.crm-search-group .crm-search-input {
    padding-left: 32px;
    width: 100%;
}

.crm-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--crm-text-muted);
    text-decoration: none;
    font-size: 14px;
}

.crm-search-clear:hover {
    color: var(--crm-error);
}

.crm-filter-select {
    flex: 0 1 220px;
    min-width: 140px;
}

/* ??????? ??????????? */
.crm-table-meta {
    font-size: 13px;
    color: var(--crm-text-muted);
    margin-bottom: 8px;
}

/* ?????? ????????? */
.crm-empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--crm-text-muted);
}

.crm-empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

.crm-empty-state p {
    margin-bottom: 12px;
    font-size: 15px;
}

/* Финансы: кабинет организаций (сетка + метрики) */
.crm-finance-cabinet {
    margin-top: 8px;
    margin-bottom: 24px;
    padding: 16px 18px 20px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface, rgba(255, 255, 255, 0.03));
}

.crm-finance-cabinet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 10px;
}

.crm-finance-cabinet-head .crm-card-section-title {
    margin-bottom: 0;
}

.crm-finance-cabinet-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    font-size: 0.875rem;
    color: var(--crm-text-muted);
}

.crm-finance-cabinet-metric-val {
    display: inline-block;
    margin-right: 4px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--crm-text);
}

.crm-finance-cabinet-metric-label {
    font-weight: 400;
}

.crm-finance-cabinet-hint {
    margin-top: 0;
    margin-bottom: 14px;
}

.crm-finance-cabinet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.crm-finance-org-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: rgba(0, 0, 0, 0.12);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

a.crm-finance-org-card:hover {
    border-color: var(--crm-accent, #4a9eff);
    background: rgba(74, 158, 255, 0.08);
}

.crm-finance-org-card--active {
    border-color: var(--crm-accent, #4a9eff);
    box-shadow: 0 0 0 1px var(--crm-accent, #4a9eff);
    background: rgba(74, 158, 255, 0.1);
}

.crm-finance-org-card--all .crm-finance-org-card-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1rem;
}

.crm-finance-org-card-icon {
    font-size: 1.1rem;
    opacity: 0.85;
}

.crm-finance-org-card-sub {
    font-size: 0.8125rem;
    color: var(--crm-text-muted);
    line-height: 1.4;
}

.crm-finance-org-card-badge {
    align-self: flex-start;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(74, 158, 255, 0.2);
    color: var(--crm-accent, #4a9eff);
}

.crm-finance-org-card-badge--on {
    margin-top: 2px;
}

.crm-finance-org-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}

.crm-finance-org-card-title-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--crm-text);
    text-decoration: none;
}

.crm-finance-org-card-title-link:hover {
    color: var(--crm-accent, #4a9eff);
    text-decoration: underline;
}

.crm-finance-org-card-tag {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.crm-finance-org-card-tag--ok {
    background: rgba(46, 160, 67, 0.18);
    color: #6ecf8a;
}

.crm-finance-org-card-tag--off {
    background: rgba(255, 255, 255, 0.06);
    color: var(--crm-text-muted);
}

.crm-finance-org-card-dl {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8125rem;
}

.crm-finance-org-card-dl-row {
    display: grid;
    grid-template-columns: minmax(0, 42%) 1fr;
    gap: 8px 12px;
    align-items: baseline;
}

.crm-finance-org-card-dl-row dt {
    margin: 0;
    font-weight: 500;
    color: var(--crm-text-muted);
}

.crm-finance-org-card-dl-row dd {
    margin: 0;
    text-align: right;
    word-break: break-word;
}

.crm-finance-org-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--crm-border);
}

@media (max-width: 520px) {
    .crm-finance-cabinet-grid {
        grid-template-columns: 1fr;
    }

    .crm-finance-org-card-dl-row {
        grid-template-columns: 1fr;
    }

    .crm-finance-org-card-dl-row dd {
        text-align: left;
    }
}

/* Финансы: выписки и аналитика */
.crm-finance-workspace-section {
    margin-top: 20px;
    margin-bottom: 8px;
    padding-top: 0;
    padding-bottom: 4px;
}

.crm-finance-org-select-row {
    margin-bottom: 16px;
}

.crm-finance-org-select-field {
    max-width: 420px;
}

.crm-finance-org-hint {
    margin-top: 8px;
    max-width: 720px;
}

.crm-finance-workspace-panel {
    margin-top: 8px;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--crm-border);
    background: rgba(255, 255, 255, 0.03);
}

.crm-finance-workspace-panel-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--crm-border);
}

.crm-finance-workspace-title {
    margin: 0 0 8px;
    font-size: 18px;
    font-weight: 600;
}

.crm-finance-workspace-meta {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--crm-text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.crm-finance-workspace-balance {
    color: var(--crm-text);
    font-weight: 600;
}

.crm-finance-workspace-links {
    margin: 0;
    font-size: 14px;
}

.crm-finance-workspace-placeholder {
    margin: 12px 0 0;
    padding: 16px;
    border-radius: 10px;
    border: 1px dashed var(--crm-border);
}

.crm-finance-imports-details {
    margin-top: 20px;
}

.crm-finance-orgs-collapsible .crm-finance-orgs-details {
    margin-top: 0;
    padding: 14px 16px 16px;
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
}

.crm-tochka-callback-url .crm-code-block {
    display: block;
    padding: 12px 14px;
    margin: 8px 0 0;
    font-size: 13px;
    word-break: break-all;
    border-radius: 8px;
    border: 1px solid var(--crm-border);
    background: rgba(0, 0, 0, 0.2);
}

.crm-tochka-token-ta {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    width: 100%;
    max-width: 100%;
    min-height: 4rem;
}

.crm-tochka-oauth-pre {
    margin-top: 12px;
    padding: 12px;
    font-size: 12px;
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--crm-border);
    background: rgba(0, 0, 0, 0.2);
    white-space: pre-wrap;
    word-break: break-word;
}

.crm-finance-section {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--crm-border);
}

.crm-finance-section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 16px;
}

.crm-finance-refresh-form {
    margin: 12px 0 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.crm-finance-balance-wrap {
    margin-top: 8px;
}

.crm-finance-balance-chart {
    margin: 16px 0 20px;
    padding: 14px 16px;
    border-radius: var(--crm-radius);
    border: 1px solid var(--crm-border);
    background: rgba(0, 0, 0, 0.14);
}

.crm-finance-balance-chart-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--crm-text);
}

.crm-finance-balance-chart-hint {
    margin-top: 0;
    margin-bottom: 12px;
}

.crm-finance-balance-chart-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px 12px;
}

.crm-finance-balance-chart-item {
    display: grid;
    grid-template-columns: minmax(5rem, 11rem) 1fr minmax(6.5rem, auto);
    gap: 8px 12px;
    align-items: center;
}

@media (max-width: 640px) {
    .crm-finance-balance-chart-item {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .crm-finance-balance-chart-value {
        justify-self: start;
    }
}

.crm-finance-balance-chart-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--crm-accent, #4a9eff);
    text-decoration: none;
    line-height: 1.3;
    word-break: break-word;
}

.crm-finance-balance-chart-name:hover {
    text-decoration: underline;
}

.crm-finance-balance-chart-bar-wrap {
    min-width: 0;
    height: 14px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--crm-border);
    overflow: hidden;
}

.crm-finance-balance-chart-svg {
    display: block;
    width: 100%;
    height: 14px;
    vertical-align: top;
}

.crm-finance-balance-chart-rect {
    fill: rgba(74, 158, 255, 0.85);
}

.crm-finance-balance-chart-rect--neg {
    fill: rgba(248, 113, 113, 0.9);
}

.crm-finance-balance-chart-value {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    color: var(--crm-text);
}

.crm-finance-balance-amount {
    font-weight: 600;
}

.crm-finance-cell-muted {
    font-size: 12px;
    word-break: break-all;
}

.crm-finance-filter-form {
    margin: 12px 0;
}

.crm-finance-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.crm-finance-filter-submit .crm-label-spacer {
    visibility: hidden;
}

.crm-finance-period-caption {
    font-size: 14px;
    color: var(--crm-text-muted);
    margin-bottom: 16px;
}

.crm-finance-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.crm-finance-stat {
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--crm-border);
    background: rgba(255, 255, 255, 0.02);
}

.crm-finance-stat-income {
    border-color: rgba(52, 199, 89, 0.35);
}

.crm-finance-stat-income .crm-finance-stat-line {
    color: #34c759;
}

.crm-finance-stat-expense {
    border-color: rgba(255, 69, 58, 0.35);
}

.crm-finance-stat-expense .crm-finance-stat-line {
    color: #ff453a;
}

.crm-finance-stat-line {
    margin: 0 0 8px;
    font-size: 15px;
}

.crm-finance-stat-sub {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--crm-text-muted);
}

.crm-finance-details {
    margin-top: 8px;
}

.crm-finance-details-summary {
    cursor: pointer;
    font-size: 14px;
    color: var(--crm-text-muted);
    padding: 6px 0;
}

.crm-finance-cat-table th,
.crm-finance-cat-table td {
    font-size: 13px;
}

.crm-finance-tx-wrap {
    overflow-x: auto;
}

.crm-finance-tx-purpose {
    max-width: 280px;
    white-space: normal;
    word-break: break-word;
    font-size: 13px;
    line-height: 1.35;
}

.crm-finance-tx-credit {
    color: #34c759;
}

.crm-finance-tx-debit {
    color: #ff453a;
}

.crm-finance-line-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.crm-input-compact,
.crm-select-compact {
    padding: 6px 8px;
    font-size: 13px;
}

.crm-btn-tiny {
    padding: 4px 10px;
    font-size: 12px;
    align-self: flex-start;
}

.crm-finance-tx-category {
    display: block;
    font-size: 13px;
}

.crm-finance-stmt-lead {
    font-size: 15px;
    margin: 0 0 8px;
    color: var(--crm-text);
}

.crm-finance-stmt-form {
    margin-top: 12px;
}

.crm-finance-stmt-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.crm-finance-stmt-account {
    flex: 1 1 200px;
    min-width: 180px;
}

.crm-finance-stmt-submit .crm-label-spacer {
    visibility: hidden;
}

@media (max-width: 768px) {
    .crm-finance-stmt-row .crm-form-group {
        flex: 1 1 100%;
    }
}

/* Табель: подсказка об ограничении сводных сумм */
.crm-timesheet-scope-hint {
    font-size: 13px;
    margin: 0 0 16px;
    max-width: 720px;
}

/* Настройки: доступ к меню по ролям */
.crm-menu-access-intro {
    font-size: 13px;
    color: var(--crm-text-muted);
    max-width: 900px;
    margin: 0 0 20px;
    line-height: 1.5;
}
.crm-menu-access-role-card {
    margin-bottom: 24px;
    padding: 20px 22px;
}
.crm-menu-access-role-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px 14px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--crm-border);
}
.crm-menu-access-role-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
.crm-menu-access-role-code {
    font-size: 12px;
    color: var(--crm-text-muted);
}
.crm-menu-access-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 179, 237, 0.15);
    color: var(--crm-text);
}
.crm-menu-access-badge-muted {
    background: var(--crm-sidebar-bg);
    color: var(--crm-text-muted);
}
.crm-menu-access-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px 16px;
}
.crm-menu-access-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
    line-height: 1.35;
}
.crm-menu-access-check input {
    margin-top: 3px;
    flex-shrink: 0;
}
.crm-menu-access-check-label {
    color: var(--crm-text);
}
.crm-menu-access-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}
.crm-menu-access-reset-form {
    margin-top: 12px;
}
.crm-menu-access-form .crm-fieldset {
    margin-top: 0;
}

.crm-club-list-meta {
    margin-top: 4px;
    display: grid;
    gap: 2px;
}

.crm-club-list-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    line-height: 1.3;
}

.crm-club-list-meta-label {
    color: var(--crm-text-muted);
    white-space: nowrap;
}

.crm-club-list-meta-value {
    color: var(--crm-text);
    min-width: 0;
}

/* Карточка организации: сводка, оповещения, гистограммы (ширина столбиков — классы .crm-org-histo-w*) */
.crm-org-histo-w0 { width: 0%; }
.crm-org-histo-w5 { width: 5%; }
.crm-org-histo-w10 { width: 10%; }
.crm-org-histo-w15 { width: 15%; }
.crm-org-histo-w20 { width: 20%; }
.crm-org-histo-w25 { width: 25%; }
.crm-org-histo-w30 { width: 30%; }
.crm-org-histo-w35 { width: 35%; }
.crm-org-histo-w40 { width: 40%; }
.crm-org-histo-w45 { width: 45%; }
.crm-org-histo-w50 { width: 50%; }
.crm-org-histo-w55 { width: 55%; }
.crm-org-histo-w60 { width: 60%; }
.crm-org-histo-w65 { width: 65%; }
.crm-org-histo-w70 { width: 70%; }
.crm-org-histo-w75 { width: 75%; }
.crm-org-histo-w80 { width: 80%; }
.crm-org-histo-w85 { width: 85%; }
.crm-org-histo-w90 { width: 90%; }
.crm-org-histo-w95 { width: 95%; }
.crm-org-histo-w100 { width: 100%; }

.crm-org-alert-strip {
    margin: 0 0 20px;
    padding: 12px 14px;
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
}
.crm-org-alert-strip-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: stretch;
}
.crm-org-alert-chip {
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.35;
    border: 1px solid transparent;
    min-width: 0;
}
.crm-org-alert-chip-link,
.crm-org-alert-chip-static {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
    border-radius: inherit;
}
.crm-org-alert-chip-link:hover {
    text-decoration: none;
    filter: brightness(1.03);
}
.crm-org-alert-chip--danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
    color: #b91c1c;
}
.crm-org-alert-chip--warn {
    background: rgba(234, 179, 8, 0.14);
    border-color: rgba(202, 138, 4, 0.35);
    color: #a16207;
}
.crm-org-alert-chip--ok {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(22, 163, 74, 0.3);
    color: #166534;
}
.crm-org-alert-icon {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 1rem;
}

.crm-org-cabinet-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
    margin-bottom: 24px;
}
.crm-org-cabinet-block {
    margin-bottom: 0;
}
.crm-org-cabinet-block--actions,
.crm-org-cabinet-block--links {
    grid-column: 1 / -1;
}
.crm-org-cabinet-block-body {
    padding: 14px 18px 16px;
}
.crm-org-metric-table {
    width: 100%;
}
.crm-org-metric-table th,
.crm-org-metric-table td {
    vertical-align: top;
}
.crm-org-metric-detail {
    font-size: 12px;
    max-width: 420px;
}
.crm-org-forecast-line {
    margin: 14px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--crm-text);
}
.crm-org-forecast-icon {
    margin-right: 6px;
    color: var(--crm-text-muted);
}
.crm-org-meta-line {
    margin: 10px 0 0;
    font-size: 12px;
}

.crm-org-histo-title {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-text-muted);
}
.crm-org-histo-title--second {
    margin-top: 18px;
}
.crm-org-histo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.crm-org-histo-row {
    display: grid;
    grid-template-columns: minmax(72px, 88px) minmax(0, 1fr) minmax(88px, auto);
    gap: 10px 12px;
    align-items: center;
    font-size: 13px;
}
.crm-org-histo-row--dual {
    grid-template-columns: minmax(72px, 88px) minmax(0, 1fr);
    align-items: start;
}
.crm-org-histo-label {
    color: var(--crm-text-muted);
    font-size: 12px;
    word-break: break-word;
}
.crm-org-histo-label .crm-link {
    font-weight: 500;
}
.crm-org-histo-track {
    height: 10px;
    border-radius: 6px;
    background: var(--crm-sidebar-bg);
    overflow: hidden;
    min-width: 0;
}
.crm-org-histo-fill {
    display: block;
    height: 100%;
    border-radius: 6px;
    min-width: 0;
    transition: width 0.2s ease;
}
.crm-org-histo-fill--invoice {
    background: linear-gradient(90deg, #6366f1, #818cf8);
}
.crm-org-histo-fill--in {
    background: linear-gradient(90deg, #059669, #34d399);
}
.crm-org-histo-fill--out {
    background: linear-gradient(90deg, #dc2626, #f87171);
}
.crm-org-histo-fill--debt {
    background: linear-gradient(90deg, #d97706, #fbbf24);
}
.crm-org-histo-val {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    font-size: 12px;
}
.crm-org-histo-val--small {
    font-size: 11px;
    color: var(--crm-text-muted);
}

.crm-org-histo-dual-tracks {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.crm-org-histo-track-wrap {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) minmax(64px, auto);
    gap: 8px 10px;
    align-items: center;
}
.crm-org-histo-legend {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--crm-text-muted);
}
.crm-org-histo-legend--in {
    color: #059669;
}
.crm-org-histo-legend--out {
    color: #b91c1c;
}

.crm-org-progress-wrap {
    margin-top: 14px;
}
.crm-org-progress-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--crm-text-muted);
    margin-bottom: 6px;
}
.crm-org-progress-track {
    height: 8px;
    border-radius: 999px;
    background: var(--crm-sidebar-bg);
    overflow: hidden;
}
.crm-org-progress-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    min-width: 0;
}

.crm-org-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: center;
}
.crm-org-quicklinks {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 14px;
    line-height: 1.65;
}
.crm-org-quicklinks li {
    margin: 0;
}

@media (max-width: 960px) {
    .crm-org-cabinet-grid {
        grid-template-columns: 1fr;
    }
    .crm-org-histo-row {
        grid-template-columns: minmax(64px, 76px) minmax(0, 1fr);
        grid-template-rows: auto auto;
    }
    .crm-org-histo-val {
        grid-column: 1 / -1;
        text-align: left;
    }
    .crm-org-histo-track-wrap {
        grid-template-columns: 48px minmax(0, 1fr) minmax(56px, auto);
    }
}

/* Финансы: вкладочный рабочий центр */
.crm-fin-tabs {
    margin-top: 16px;
}
.crm-fin-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.crm-fin-tab-btn {
    border: 1px solid var(--crm-border);
    background: var(--crm-surface);
    color: var(--crm-text);
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.crm-fin-tab-btn.is-active {
    border-color: var(--crm-accent);
    background: rgba(99, 179, 237, 0.16);
}
.crm-fin-tab-btn i {
    opacity: 0.9;
}
.crm-fin-tabs-body {
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius);
    background: var(--crm-surface);
    padding: 14px 16px;
    position: relative;
}
.crm-fin-tabs-body.is-loading {
    opacity: 0.55;
    pointer-events: none;
}
.crm-fin-tab-panel .crm-card-section-title {
    margin-top: 0;
}
.crm-fin-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px 10px;
    margin: 10px 0 12px;
}
.crm-fin-kpi-item {
    border: 1px solid var(--crm-border);
    border-radius: 10px;
    background: var(--crm-sidebar-bg);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.crm-fin-kpi-item span {
    font-size: 11px;
    color: var(--crm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.crm-fin-kpi-item strong {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}
.crm-fin-tab-panel .crm-table-wrap {
    border: 1px solid var(--crm-border);
    border-radius: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    background: var(--crm-surface);
}
.crm-fin-tab-panel .crm-table-compact thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--crm-text-muted);
    background: rgba(255, 255, 255, 0.02);
}
.crm-fin-tab-panel .crm-table-compact tbody tr:hover {
    background: rgba(99, 179, 237, 0.08);
}
.crm-fin-tab-panel .crm-cell-actions {
    white-space: normal;
    min-width: 180px;
}
.crm-fin-tab-panel .crm-action-link,
.crm-fin-tab-panel .crm-inline-form {
    margin-right: 8px;
}
.crm-fin-tab-panel .crm-inline-form:last-child {
    margin-right: 0;
}
.crm-fin-org-group {
    margin-top: 14px;
}
.crm-fin-org-title {
    margin: 0 0 4px;
    font-size: 15px;
}
.crm-fin-org-summary {
    margin: 0 0 8px;
    color: var(--crm-text-muted);
    font-size: 13px;
}
.crm-fin-mark-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
    margin-bottom: 6px;
}
.crm-fin-mark-amount {
    width: 92px;
    min-width: 0;
    height: 30px;
    font-size: 12px;
}
.crm-fin-org-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 0 0 10px;
}
.crm-fin-bulk-form {
    margin: 0;
}
.crm-fin-penalty-form {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--crm-border);
}
.crm-fin-multiselect {
    min-height: 120px;
}
.crm-ts-penalty-bulk {
    margin: 12px 0 14px;
    padding: 14px 16px;
}
.crm-ts-penalty-bulk-head {
    margin-bottom: 10px;
}
.crm-ts-penalty-bulk-hint {
    margin: 4px 0 0;
    font-size: 12px;
}
.crm-ts-penalty-bulk-form {
    margin: 0;
}
.crm-ts-penalty-bulk-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 10px 12px;
}
.crm-ts-penalty-clubs {
    min-height: 144px;
    max-height: 220px;
}
.crm-ts-penalty-bulk-note {
    margin: 6px 0 0;
    font-size: 12px;
}
.crm-ts-penalty-bulk-actions {
    margin-top: 12px;
}
.crm-settings-guide-card {
    margin-bottom: 14px;
}
.crm-settings-guide-list {
    margin: 0;
    padding-left: 18px;
}
.crm-settings-guide-list li {
    margin: 0 0 8px;
    color: var(--crm-text);
}
@media (max-width: 900px) {
    .crm-fin-tabs-body {
        padding: 10px 10px;
    }
    .crm-fin-tab-panel .crm-table-compact th,
    .crm-fin-tab-panel .crm-table-compact td {
        padding: 6px 8px;
        font-size: 12px;
    }
    .crm-fin-mark-form {
        display: flex;
        width: 100%;
        margin-right: 0;
    }
    .crm-fin-mark-amount {
        width: 78px;
    }
    .crm-fin-kpi-strip {
        grid-template-columns: 1fr 1fr;
    }
    .crm-fin-tab-btn {
        width: 100%;
        justify-content: flex-start;
    }
    .crm-fin-tab-panel .crm-cell-actions {
        min-width: 140px;
    }
    .crm-ts-penalty-bulk {
        padding: 12px;
    }
    .crm-ts-penalty-bulk-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .crm-ts-penalty-clubs {
        min-height: 120px;
        max-height: 180px;
    }
}

/* Персональный ассистент */
.crm-assistant-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px 32px;
}
.crm-assistant-section-title {
    font-size: 1.05rem;
    margin: 0 0 12px;
    font-weight: 600;
}
.crm-assistant-chat-panel {
    background: var(--crm-surface, #1a1d24);
    border: 1px solid var(--crm-border, rgba(255, 255, 255, 0.08));
    border-radius: var(--crm-radius, 8px);
    padding: 16px;
    margin-bottom: 24px;
}
.crm-assistant-chat-log {
    min-height: 120px;
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}
.crm-assistant-chat-line {
    margin-bottom: 10px;
}
.crm-assistant-chat-role {
    display: block;
    font-size: 0.72rem;
    color: var(--crm-text-muted);
    margin-bottom: 2px;
}
.crm-assistant-chat-text {
    white-space: pre-wrap;
    line-height: 1.45;
}
.crm-assistant-chat-form .crm-assistant-chat-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.crm-assistant-chat-input {
    flex: 1;
    resize: vertical;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--crm-border);
    background: var(--crm-bg, #12141a);
    color: var(--crm-text);
}
.crm-assistant-chat-hint {
    color: var(--color-danger, #ef4444);
    font-size: 0.85rem;
    margin-top: 8px;
}
.crm-assistant-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}
@media (max-width: 960px) {
    .crm-assistant-grid {
        grid-template-columns: 1fr;
    }
}
.crm-assistant-cal-panel,
.crm-assistant-kanban-panel {
    background: var(--crm-surface, #1a1d24);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius, 8px);
    padding: 14px;
}
.crm-assistant-cal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.crm-assistant-cal-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}
.crm-assistant-cal-label {
    min-width: 140px;
    text-align: center;
    font-weight: 600;
}
.crm-assistant-cal-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    font-size: 0.72rem;
    color: var(--crm-text-muted);
    margin-bottom: 4px;
    text-align: center;
}
.crm-assistant-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.crm-assistant-cal-cell {
    min-height: 72px;
    border: 1px solid var(--crm-border);
    border-radius: 4px;
    padding: 4px;
    font-size: 0.78rem;
}
.crm-assistant-cal-cell-muted {
    opacity: 0.45;
}
.crm-assistant-cal-day {
    font-weight: 600;
    display: block;
    margin-bottom: 2px;
}
.crm-assistant-cal-dots {
    list-style: none;
    margin: 0;
    padding: 0;
}
.crm-assistant-cal-dot {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--color-primary, #6366f1);
    cursor: pointer;
    font-size: 0.68rem;
    padding: 2px 0;
}
.crm-assistant-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.crm-assistant-kanban {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 700px) {
    .crm-assistant-kanban {
        grid-template-columns: repeat(4, 1fr);
    }
}
.crm-assistant-col {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    padding: 8px;
    min-height: 120px;
}
.crm-assistant-col-title {
    font-size: 0.78rem;
    margin: 0 0 8px;
    color: var(--crm-text-muted);
    font-weight: 600;
}
.crm-assistant-task-card {
    background: var(--crm-bg, #12141a);
    border: 1px solid var(--crm-border);
    border-radius: 6px;
    padding: 8px;
    margin-bottom: 6px;
    cursor: pointer;
}
.crm-assistant-task-title {
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 4px;
}
.crm-assistant-task-meta {
    font-size: 0.72rem;
    color: var(--crm-text-muted);
}
.crm-assistant-create {
    background: var(--crm-surface);
    border: 1px solid var(--crm-border);
    border-radius: var(--crm-radius, 8px);
    padding: 16px;
    margin-bottom: 24px;
}
.crm-assistant-create-row {
    margin-bottom: 10px;
}
.crm-assistant-create-row label {
    display: block;
    font-size: 0.82rem;
    margin-bottom: 4px;
    color: var(--crm-text-muted);
}
.crm-assistant-create-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) {
    .crm-assistant-create-dates {
        grid-template-columns: 1fr;
    }
}
.crm-assistant-push-panel {
    padding: 12px 0;
}
.crm-notif-type-assistant_reminder .crm-notif-item-title,
.crm-notif-type-assistant_task_due .crm-notif-item-title {
    color: #e8c547;
}
.crm-notif-open-task {
    font-size: 0.75rem;
    color: var(--color-primary, #6366f1);
    text-decoration: none;
    margin-right: 8px;
}
.crm-notif-open-task:hover {
    text-decoration: underline;
}
.crm-notif-item-actions {
    flex-wrap: wrap;
}
