/* =========================================================
   Дизайн-токены. Стиль в духе Аспро.Cloud:
   светлая чистая палитра, мягкие тени, много воздуха.
   ========================================================= */
:root {
    /* Цвета поверхностей */
    --bg-page: #f6f8fb;
    --bg-surface: #ffffff;
    --bg-sidebar: #1e2536;
    --bg-sidebar-hover: #2a3145;
    --bg-sidebar-active: #3b82f6;

    /* Текст */
    --text-primary: #1a1f2e;
    --text-secondary: #5a6478;
    --text-muted: #98a2b3;
    --text-on-dark: #d6deec;
    --text-on-accent: #ffffff;

    /* Бренд / акценты */
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-soft: #e8f0fe;

    /* Статусы */
    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --danger: #ef4444;
    --danger-soft: #fee2e2;
    --info: #06b6d4;
    --info-soft: #cffafe;

    /* Границы и тени */
    --border: #e5e9f0;
    --border-strong: #cdd5e0;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.10);

    /* Размеры */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --sidebar-w: 240px;
    --topbar-h: 60px;

    /* Типографика */
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* =========================================================
   Базовый ресет
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* Фокус для доступности */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* =========================================================
   Каркас: sidebar + topbar + main
   ========================================================= */
.layout {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas:
        "sidebar topbar"
        "sidebar main";
    min-height: 100vh;
}

/* ----- Sidebar ----- */
.sidebar {
    grid-area: sidebar;
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: inherit;
    transition: opacity 0.15s ease;
}

.sidebar__brand:hover {
    opacity: 0.85;
}

.sidebar__brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.sidebar__brand-name {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar__group {
    /* details-элемент: убираем дефолтные отступы */
}

.sidebar__group-title {
    /* summary-элемент: заголовок-кнопка */
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    color: var(--text-muted);
    padding: 12px 8px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: color 0.12s ease;
}

.sidebar__group-title::-webkit-details-marker { display: none; }
.sidebar__group-title::marker { content: ""; }

.sidebar__group-title:hover {
    color: #fff;
}

.sidebar__chevron {
    width: 12px;
    height: 12px;
    opacity: 0.6;
    transition: transform 0.18s ease;
}

.sidebar__group[open] > .sidebar__group-title .sidebar__chevron {
    transform: rotate(180deg);
}

.sidebar__group-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 2px;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-on-dark);
    font-size: 14px;
    transition: background 0.12s ease, color 0.12s ease;
}

.sidebar__link:hover {
    background: var(--bg-sidebar-hover);
    color: #fff;
}

.sidebar__link--active {
    background: var(--bg-sidebar-active);
    color: #fff;
}

.sidebar__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.9;
}

/* ----- Topbar ----- */
.topbar {
    grid-area: topbar;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.topbar__title {
    font-size: 16px;
    font-weight: 600;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar__upload {
    display: inline-flex;
    margin: 0;
}

.topbar__upload .btn {
    cursor: pointer;
}

/* ----- Main content ----- */
.main {
    grid-area: main;
    padding: 24px;
    overflow-y: auto;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* =========================================================
   Карточки
   ========================================================= */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.card + .card {
    margin-top: 16px;
}

.card__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Сетка для дашборда */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.stat__label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.stat__value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat__hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* Кликабельный вариант плитки: ведёт в раздел CRM */
.stat--clickable {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.stat--clickable::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.stat--clickable:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.stat--clickable:hover::before {
    opacity: 1;
}

.stat__icon {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
}

.stat__icon svg {
    width: 16px;
    height: 16px;
}

.stat__body {
    min-width: 0;
}

/* Цветовые акценты по типу плитки */
.stat--leads     .stat__icon { background: #e8f0fe; color: #3b82f6; }
.stat--deals     .stat__icon { background: #d1fae5; color: #10b981; }
.stat--contacts  .stat__icon { background: #cffafe; color: #06b6d4; }
.stat--companies .stat__icon { background: #ede9fe; color: #8b5cf6; }
.stat--tasks     .stat__icon { background: #fef3c7; color: #f59e0b; }
.stat--won       .stat__icon { background: #fce7f3; color: #ec4899; }

.stat--leads::before     { background: #3b82f6; }
.stat--deals::before     { background: #10b981; }
.stat--contacts::before  { background: #06b6d4; }
.stat--companies::before { background: #8b5cf6; }
.stat--tasks::before     { background: #f59e0b; }
.stat--won::before       { background: #ec4899; }

/* Сетка «диаграмма + топ-список» под плитками */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 8px;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.chart-wrap {
    position: relative;
    height: 280px;
}

.chart-wrap--sm {
    height: 220px;
}

.top-list__muted {
    color: var(--text-muted);
    font-style: italic;
}

/* Топ-список компаний */
.top-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-list__row {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.top-list__row:last-child {
    border-bottom: none;
}

.top-list__rank {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-list__name {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-list__amount {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}

/* =========================================================
   Кнопки
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn--primary {
    background: var(--accent);
    color: var(--text-on-accent);
}

.btn--primary:hover {
    background: var(--accent-hover);
}

.btn--ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn--ghost:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-page);
}

/* =========================================================
   Таблицы
   ========================================================= */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table th,
.table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.table th {
    background: #fafbfd;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.table tbody tr:hover {
    background: #fafbfd;
}

.table__col-actions {
    width: 40px;
    text-align: right;
    white-space: nowrap;
}

.table__col-actions--wide {
    width: 180px;
}

.btn--sm {
    padding: 5px 10px;
    font-size: 13px;
}

/* =========================================================
   Задачи
   ========================================================= */
.section-title {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin: 24px 0 10px;
}

.section-title:first-of-type {
    margin-top: 8px;
}

.task-row__check {
    width: 44px;
}

.task-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-strong);
    border-radius: 50%;
    background: var(--bg-surface);
    color: transparent;
    display: grid;
    place-items: center;
    transition: border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.task-check:hover {
    border-color: var(--accent);
}

.task-row--done .task-check {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.task-row--done .task-row__title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-row__title {
    font-weight: 500;
}

.task-row__desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* =========================================================
   Карточка сделки на канбане — ссылка-обёртка
   ========================================================= */
.deal-card__link {
    display: block;
    color: inherit;
}

.deal-card__link:hover .deal-card__title {
    color: var(--accent);
}

/* =========================================================
   Детальная страница сделки
   ========================================================= */
.deal-detail__header {
    margin-bottom: 24px;
}

.deal-detail__amount {
    font-size: 24px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.deal-detail__stage {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.deal-detail__grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .deal-detail__grid {
        grid-template-columns: 1fr;
    }
}

/* Лента активностей */
.activity-form {
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 8px;
    margin-bottom: 16px;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.activity-list__empty {
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 0;
}

.activity {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfd;
}

.activity__icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.activity__icon--звонок   { background: var(--info-soft);    color: #0e7490; }
.activity__icon--письмо   { background: var(--accent-soft);  color: var(--accent); }
.activity__icon--встреча  { background: var(--warning-soft); color: #92400e; }
.activity__icon--заметка  { background: #eef1f6;             color: var(--text-secondary); }

.activity__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 12px;
}

.activity__kind {
    color: var(--text-secondary);
    text-transform: lowercase;
}

.activity__time {
    color: var(--text-muted);
}

.activity__text {
    font-size: 14px;
    color: var(--text-primary);
    word-wrap: break-word;
}

/* Сайдбар-аутлайн карточки сделки */
.info-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 16px;
    font-size: 14px;
}

.info-list dt {
    color: var(--text-secondary);
}

.info-list dd a {
    color: var(--accent);
}

.info-list dd a:hover {
    text-decoration: underline;
}

.info-list__hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.task-mini-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.task-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: #fafbfd;
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.task-mini--done .task-mini__title {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-mini__due {
    color: var(--text-muted);
    font-size: 12px;
}

.row-delete {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
    background: transparent;
    transition: background 0.12s ease, color 0.12s ease;
    opacity: 0;
}

.table tbody tr:hover .row-delete {
    opacity: 1;
}

.row-delete:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* =========================================================
   Бэйджи статусов
   ========================================================= */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

.badge--new {
    background: var(--info-soft);
    color: #0e7490;
}

.badge--in-work {
    background: var(--warning-soft);
    color: #92400e;
}

.badge--success {
    background: var(--success-soft);
    color: #065f46;
}

.badge--danger {
    background: var(--danger-soft);
    color: #991b1b;
}

.badge--muted {
    background: #eef1f6;
    color: var(--text-secondary);
}

/* =========================================================
   Пустое состояние
   ========================================================= */
.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

/* =========================================================
   Канбан сделок
   ========================================================= */
.kanban {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.kanban__column {
    flex: 0 0 280px;
    background: #eef1f6;
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 200px;
}

.kanban__column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.kanban__column-count {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border-radius: 999px;
    padding: 2px 8px;
}

.kanban__column--won {
    background: #dcfce7;
}

.kanban__column--lost {
    background: #fee2e2;
}

.deal-card {
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    cursor: grab;
}

.deal-card__title {
    font-weight: 500;
    margin-bottom: 6px;
    font-size: 14px;
}

.deal-card__amount {
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
}

.deal-card__meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.deal-card {
    position: relative;
}

.deal-card__delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
    background: transparent;
    transition: background 0.12s ease, color 0.12s ease;
    opacity: 0;
}

.deal-card:hover .deal-card__delete {
    opacity: 1;
}

.deal-card__delete:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* Состояния drag-n-drop из SortableJS */
.deal-card--ghost {
    opacity: 0.35;
}

.deal-card--drag {
    transform: rotate(2deg);
    box-shadow: var(--shadow-lg);
}

/* Тело колонки канбана: на нём висит SortableJS,
   нужна минимальная высота, чтобы можно было дропать в пустую колонку. */
.kanban__column-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 60px;
}

/* =========================================================
   Модалка (для форм)
   ========================================================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: grid;
    place-items: center;
    padding: 24px;
    z-index: 100;
    animation: modalFadeIn 0.15s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal__dialog {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    animation: modalSlideIn 0.18s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal__title {
    font-size: 18px;
    font-weight: 600;
}

.modal__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    transition: background 0.12s ease, color 0.12s ease;
}

.modal__close:hover {
    background: var(--bg-page);
    color: var(--text-primary);
}

/* =========================================================
   Формы
   ========================================================= */
.form {
    padding: 20px 24px 24px;
}

.form__row + .form__row,
.form__row + .form__grid,
.form__grid + .form__row {
    margin-top: 16px;
}

.form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form__label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form__input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.form__input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
}

/* =========================================================
   Лендинг (главная icax.ru)
   ========================================================= */
body.landing {
    background: radial-gradient(1200px 600px at 50% -100px, #e0eaff 0%, var(--bg-page) 60%);
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.landing__hero {
    text-align: center;
    max-width: 560px;
}

.landing__logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 40px;
}

.landing__logo-mark {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.landing__logo-name {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.landing__title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 12px;
    line-height: 1.15;
}

.landing__subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.landing__cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 18px 40px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-on-accent);
    background: var(--accent);
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(59, 130, 246, 0.30);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.landing__cta:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.35);
}

.landing__cta:active {
    transform: translateY(0);
}

.landing__hint {
    margin-top: 28px;
    font-size: 13px;
    color: var(--text-muted);
}

@media (max-width: 600px) {
    .landing__title { font-size: 28px; }
    .landing__logo-mark { width: 52px; height: 52px; border-radius: 14px; }
    .landing__logo-name { font-size: 28px; }
    .landing__cta { padding: 16px 28px; font-size: 16px; }
}


/* =========================================================
   Авторизация (login / register)
   ========================================================= */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 32px;
}

.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 24px;
}
.auth-card__logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.auth-card__title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 20px;
    color: var(--text-primary);
}

.auth-card__error {
    background: var(--danger-soft);
    color: #991b1b;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 14px;
}

.auth-card__form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-card__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-card__field span {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.auth-card__field input {
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-card__field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.auth-card__submit {
    margin-top: 8px;
    padding: 11px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--text-on-accent);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.auth-card__submit:hover { background: var(--accent-hover); }

.auth-card__hint {
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
}
.auth-card__hint a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.auth-card__hint a:hover { text-decoration: underline; }

/* =========================================================
   Блок пользователя в topbar
   ========================================================= */
.topbar__user {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 16px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}
.topbar__user-email {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.topbar__link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.topbar__link:hover { color: var(--accent); }
.topbar__link--logout:hover { color: var(--danger); }

/* =========================================================
   Бейдж "Админ" + утилитарные классы
   ========================================================= */
.badge--admin {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.muted {
    color: var(--text-muted);
    font-size: 13px;
}


/* =========================================================
   Блок с временными учётными данными (owner + admin)
   ========================================================= */
.credentials {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
}
.credentials__row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 0;
}
.credentials__row + .credentials__row {
    border-top: 1px dashed var(--border);
}
.credentials__label {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 80px;
    font-weight: 500;
}
.credentials__value {
    flex: 1;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 15px;
    color: var(--text-primary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    word-break: break-all;
}

.warning {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--warning-soft);
    color: #92400e;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
}


/* Опасные действия (удаление) */
.btn--danger {
    background: transparent;
    color: var(--danger);
    border-color: var(--danger-soft);
}
.btn--danger:hover {
    background: var(--danger-soft);
    border-color: var(--danger);
    color: #991b1b;
}


/* =========================================================
   Чекбоксы прав доступа (admin/user_new, admin/user_edit)
   ========================================================= */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.sections-block {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px 16px;
    margin-top: 4px;
    background: var(--bg-page);
    transition: opacity 0.15s;
}
.sections-block legend {
    padding: 0 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}
.sections-block.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Отдельный чекбокс, выключенный на уровне организации
   (модуль не включён в /admin/settings). Сама подсказка про это —
   в .sections-block через title и пояснение под полем. */
.checkbox-row--off {
    opacity: 0.4;
    cursor: not-allowed;
}
.checkbox-row--off input[type="checkbox"] {
    cursor: not-allowed;
}

/* ----- Навигация по месяцам в смены/финансы ----- */
.month-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
.month-nav strong {
    min-width: 180px;
    text-align: center;
    text-transform: capitalize;
    font-size: 16px;
}

/* ----- Форма «поставить на смену» — поля в строку ----- */
.shift-add-form .row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}
.shift-add-form .row > label {
    flex: 1;
    min-width: 130px;
}

/* ----- Финансы: статистика-карточки сверху ----- */
.finance-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 8px;
}
.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
}
.stat-card__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.stat-card__value {
    font-size: 20px;
    font-weight: 600;
}
.stat-card--income .stat-card__value { color: #10b981; }
.stat-card--expense .stat-card__value { color: #ef4444; }
.stat-card--salary .stat-card__value { color: #6366f1; }

@media (max-width: 900px) {
    .finance-stats { grid-template-columns: repeat(2, 1fr); }
}


/* Кликабельное название в таблицах (карточка организации, и т.п.) */
.table-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.table-link:hover {
    color: var(--accent);
    border-bottom-color: var(--accent-soft);
}

/* =========================================================
   Склад: суб-навигация в стиле МойСклад,
   плитки отчётов, утилитарные классы
   ========================================================= */

/* Горизонтальная панель вкладок раздела */
.subnav {
    display: flex;
    gap: 4px;
    margin: -8px -24px 20px;
    padding: 0 24px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.subnav__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 14px 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.12s ease, border-color 0.12s ease;
}

.subnav__link:hover {
    color: var(--text-primary);
}

.subnav__link--active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.subnav__icon {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* Хлебная крошка для отчётов */
.report-breadcrumb {
    margin-bottom: 8px;
    font-size: 13px;
}
.report-breadcrumb a {
    color: var(--text-secondary);
}
.report-breadcrumb a:hover {
    color: var(--accent);
}

/* Сетка плиток отчётов */
.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.report-tile {
    display: block;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-sm);
    color: inherit;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.report-tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}
.report-tile__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.report-tile__icon svg { width: 20px; height: 20px; }
.report-tile__icon--blue   { background: #e8f0fe; color: #3b82f6; }
.report-tile__icon--green  { background: #d1fae5; color: #10b981; }
.report-tile__icon--orange { background: #fef3c7; color: #f59e0b; }

.report-tile__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}
.report-tile__text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Тулбар над таблицей: поиск + фильтры + счётчик */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.toolbar__search {
    position: relative;
    flex: 1;
    max-width: 360px;
}
.toolbar__search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    font-size: 14px;
    font-family: inherit;
}
.toolbar__search input:focus {
    outline: none;
    border-color: var(--accent);
}
.toolbar__search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}
.toolbar__filters {
    display: flex;
    align-items: center;
    gap: 12px;
}
.toolbar__filters label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.toolbar__filters select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    font-size: 13px;
    font-family: inherit;
}
.toolbar__hint {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

/* Таблица «вплотную» к карточке (без внешних паддингов) */
.table--flush {
    margin: 0;
    border-radius: 0;
}
.table .num, .table--flush .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.table th.num {
    text-align: right;
}

/* Утилиты для строк */
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    color: var(--text-secondary);
}
.danger {
    color: var(--danger);
}
.chip {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
}
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}
.badge--in  { background: var(--success-soft); color: #047857; }
.badge--out { background: var(--danger-soft);  color: #b91c1c; }
.badge--adj { background: var(--warning-soft); color: #92400e; }
.rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

/* Меню действий в строке таблицы */
.row-menu {
    position: relative;
    display: inline-block;
}
.row-menu__btn {
    cursor: pointer;
    list-style: none;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
}
.row-menu__btn::-webkit-details-marker { display: none; }
.row-menu__btn:hover { background: var(--accent-soft); color: var(--accent); }
.row-menu__pop {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 260px;
    padding: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.row-menu__form {
    display: flex;
    align-items: end;
    gap: 6px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.row-menu__form:last-child { border-bottom: none; padding-bottom: 0; }
.row-menu__form label {
    display: flex;
    flex-direction: column;
    font-size: 11px;
    color: var(--text-secondary);
    flex: 1;
}
.row-menu__form input {
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    width: 100%;
    font-family: inherit;
}

/* Подсветка строки-ссылки */
.row-link {
    color: var(--text-primary);
    font-weight: 500;
}
.row-link:hover { color: var(--accent); }

/* Сетка для формы товара */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.form-grid__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-secondary);
}
.form-grid__field--wide { grid-column: span 2; }
.form-grid__field input,
.form-grid__field select {
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-surface);
    font-family: inherit;
}
.form-grid__field input:focus {
    outline: none;
    border-color: var(--accent);
}
.form-grid__actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

/* Пустое состояние */
.empty {
    text-align: center;
    padding: 48px 24px;
}
.empty__title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}
.empty__text {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* =========================================================
   Склад: документы поступления/отгрузки
   ========================================================= */

/* Шапка формы документа: дата + склад + контрагент + комментарий */
.doc-form__header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.doc-form__lines-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* Таблица позиций документа: компактные инпуты, выровненные числа */
.table--lines th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}
.table--lines td {
    padding: 6px 8px;
    vertical-align: middle;
}
.table--lines tfoot td {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
    background: #fafbfd;
    font-size: 15px;
}
.table--lines input,
.table--lines select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-family: inherit;
    background: var(--bg-surface);
}
.table--lines input:focus,
.table--lines select:focus {
    outline: none;
    border-color: var(--accent);
}
.doc-line__total {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.doc-line__remove {
    color: var(--text-muted);
    font-size: 14px;
    padding: 2px 8px;
}
.doc-line__remove:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

/* ===== График смен — интерактивная сетка (ростер) ===== */
.roster-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.month-nav__label { min-width: 150px; }
.roster-header__hint {
    font-size: 12.5px;
    color: var(--text-muted);
}

.roster {
    padding: 0;
    overflow: hidden;
}
.roster__scroll {
    overflow-x: auto;
    overflow-y: visible;
}
.roster__grid {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    font-size: 13px;
}
.roster__grid th,
.roster__grid td {
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
}

/* Шапка с днями месяца */
.roster__grid thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--bg-surface);
    padding: 8px 4px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}
.roster__day {
    min-width: 46px;
    line-height: 1.15;
}
.roster__day-num { display: block; font-size: 14px; color: var(--text-primary); }
.roster__day-wd  { display: block; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; }
.roster__day.is-weekend { background: #fafbfd; }
.roster__day.is-weekend .roster__day-num { color: var(--danger); }
.roster__day.is-today { background: var(--accent-soft); }
.roster__day.is-today .roster__day-num { color: var(--accent-hover); }

/* Левая колонка с сотрудником — залипает при горизонтальном скролле */
.roster__corner,
.roster__name {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--bg-surface);
    min-width: 180px;
    max-width: 180px;
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-right: 1px solid var(--border-strong);
}
.roster__corner { z-index: 4; top: 0; color: var(--text-secondary); }
.roster__name { color: var(--text-primary); font-weight: 500; }
.roster__row:hover .roster__name { background: #f9fbfe; }

/* Ячейки-дни */
.roster__cell {
    min-width: 46px;
    height: 46px;
    vertical-align: top;
    padding: 3px;
    background: var(--bg-surface);
}
.roster__cell.is-weekend { background: #fafbfd; }
.roster__cell.is-today   { background: #f1f7ff; }
.roster--editable .roster__cell { cursor: cell; }
.roster--editable .roster__cell:hover { box-shadow: inset 0 0 0 1px var(--border-strong); }
.roster__cell.is-drop {
    box-shadow: inset 0 0 0 2px var(--accent);
    background: var(--accent-soft);
}

/* Колонка с суммой часов */
.roster__sum-head,
.roster__total {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--bg-surface);
    min-width: 56px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    border-left: 1px solid var(--border-strong);
    border-right: none;
}
.roster__sum-head { z-index: 4; }
.roster__total { font-weight: 600; color: var(--text-primary); }

/* Плашка смены */
.chip {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 3px 18px 3px 6px;
    margin-bottom: 3px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    border: 1px solid #c9defc;
    color: var(--accent-hover);
    font-size: 11.5px;
    line-height: 1.25;
    position: relative;
    cursor: grab;
    user-select: none;
}
.chip:last-child { margin-bottom: 0; }
.chip--allday {
    background: var(--success-soft);
    border-color: #a7e8cf;
    color: #0f8a5f;
}
.chip__label { font-weight: 600; white-space: nowrap; }
.chip__note {
    font-size: 10.5px;
    opacity: 0.8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
}
.chip.is-dragging { opacity: 0.45; cursor: grabbing; }
.chip__x {
    position: absolute;
    top: 1px;
    right: 1px;
    width: 15px;
    height: 15px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    transition: opacity .12s;
}
.chip:hover .chip__x { opacity: 0.55; }
.chip__x:hover { opacity: 1; background: rgba(0,0,0,0.08); }

.roster__empty { padding: 16px; text-align: center; }

/* Модалка добавления смены */
.shift-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.shift-modal[hidden] { display: none; }
.shift-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}
.shift-modal__card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 20px;
}
.shift-modal__title { margin: 0 0 4px; font-size: 17px; }
.shift-modal__meta { margin: 0 0 14px; color: var(--text-secondary); font-size: 13px; }
.shift-modal__card .row { display: flex; gap: 12px; }
.shift-modal__card .row > label { flex: 1; }
.shift-modal__tip { margin: 8px 0 0; font-size: 12px; }
.shift-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

/* ===== Страница ошибки (403/404/401) ===== */
.error-card { text-align: center; }
.error-card__code {
    font-size: 56px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent);
    margin: 8px 0 4px;
}
.error-card__detail {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 22px;
}
.error-card__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
}
.error-card__actions .auth-card__submit {
    display: inline-block;
    text-align: center;
    text-decoration: none;
}
.error-card__actions .btn {
    width: 100%;
    justify-content: center;
}
.error-card__logout { margin: 0; }

/* =========================================================
   Детальная карточка компании (вкладки + раздел «Связи»)
   ========================================================= */
.company-head {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
}
.company-head__logo {
    position: relative;
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    background: #eef1f6;
    display: grid;
    place-items: center;
    color: var(--text-muted);
}
.company-head__logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}
.company-head__logo > svg { width: 44px; height: 44px; }
.company-head__upload { position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%); }
.company-head__camera {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--bg-surface);
}
.company-head__camera svg { width: 15px; height: 15px; }
.company-head__sub { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

/* Вкладки внутри карточки (используют базовый .subnav) */
.company-tabs { margin-top: 0; }
.company-tabs .subnav__link {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
}

/* Раздел «Связей»: список с инлайн-формой добавления */
.conn-count {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 10px;
}
.conn-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.conn-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fafbfd;
}
.conn-item__body { flex: 1; min-width: 0; }
.conn-item__main { font-size: 14px; color: var(--text-primary); word-break: break-word; }
.conn-item__main a { color: var(--accent); }
.conn-item__meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.conn-item__meta a { color: var(--accent); }
.conn-item__pos { color: var(--text-secondary); font-weight: 400; }
.conn-item__del {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
}
.conn-item__del:hover { background: var(--danger-soft, #fee2e2); color: var(--danger, #dc2626); }
.conn-empty { color: var(--text-muted); font-size: 13px; padding: 4px 0; }

/* Реквизиты внутри строки */
.conn-req {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 3px 12px;
    margin: 6px 0 0;
    font-size: 13px;
}
.conn-req dt { color: var(--text-secondary); }
.conn-req dd { margin: 0; color: var(--text-primary); word-break: break-word; }

/* Инлайн-форма добавления */
.conn-add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}
.conn-add .form__input { flex: 1; min-width: 140px; }
.conn-add--grid { gap: 8px; }
.conn-add--grid .form__input { flex: 1 1 150px; }
.conn-add--grid .btn { flex: 0 0 auto; }

/* Клик по строке компании в списке */
.table tbody tr.is-clickable { cursor: pointer; }
.table tbody tr.is-clickable:hover { background: var(--accent-soft); }
