@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800&display=swap');

:root {
    --bg: #FFFFFF;
    /* Нейтрально-серый фон контента (без зелёного подтона) — белые карточки «приподняты» */
    --content-bg: #F7F7F8;
    --sidebar-bg: #F9FAFB;      /* нейтральная светлая заливка — для thead / split-list / kanban (НЕ сам сайдбар) */
    /* Брендовый зелёный — PRIMARY */
    --primary: #22C55E;
    --primary-hover: #16A34A;
    --primary-soft: #DCFCE7;        /* мягкая зелёная плашка: secondary-кнопки, KPI-иконки, активные состояния */
    --primary-soft-hover: #BBF7D0;
    --hover-bg: #F3F4F6;            /* нейтральный hover строк / ghost */
    --text: #1A1A1A;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --card-bg: #FFFFFF;
    /* Функциональная палитра статусов/акцентов (использовать вне .modal-box) */
    --info:    #3B82F6;   /* «В работе», info */
    --warning: #F59E0B;   /* «Ожидание оплаты», предупреждение */
    --purple:  #8B5CF6;   /* «Отгружена», аналитика */
    --success: #16A34A;   /* «Подписана», успех, положительные деньги/маржа */
    --danger:  #EF4444;   /* «Отменена», долги, удаление */
    /* Светлый сайдбар (белый, брендовые зелёные акценты) */
    --sb-bg:        #FFFFFF;
    --sb-hover:     #F3F4F6;
    --sb-border:    #E5E7EB;
    --sb-text:      #6B7280;
    --sb-text-dim:  #9CA3AF;
    --sb-active-bg: rgba(34,197,94,0.12);
    --sb-accent:    #16A34A;   /* тёмный зелёный: читаемый текст/иконка активного пункта на белом */
    /* Мягкие нейтральные тени — глубина «дороже» вместо цветного свечения */
    --shadow:    0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.06);
    --shadow-md: 0 4px 10px rgba(16,24,40,0.05), 0 10px 28px rgba(16,24,40,0.08);
    --shadow-lg: 0 16px 40px rgba(16,24,40,0.14);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--content-bg);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ─── SCROLLBAR ─── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ─── SIDEBAR (светлый, белый + брендовые красные акценты) ─── */
.sidebar {
    width: 260px;
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 200;
    transition: transform 0.2s ease;
}

.sidebar-logo {
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--sb-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo img {
    height: 42px;
    width: 42px;
    max-width: 42px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 800;
    color: #000;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 10px;
    overflow-y: auto;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sb-text-dim);
    padding: 10px 12px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--sb-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: var(--sb-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--sb-active-bg);
    color: var(--sb-accent);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--sb-accent);
}

.nav-item svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
    stroke-width: 1.8;
}

.nav-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--sb-border);
}

.user-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: var(--sb-hover);
}

.user-ava {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-info-text { flex: 1; overflow: hidden; }

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--sb-text-dim);
    margin-top: 1px;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: var(--sb-text);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: 0.2s ease;
    text-decoration: none;
}

.logout-btn:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.logout-btn svg { width: 16px; height: 16px; }

/* ─── MOBILE MENU ─── */
.mobile-menu-btn { display: none; }
.sidebar-overlay { display: none; }

/* ─── MAIN LAYOUT ─── */
.content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    background: var(--content-bg);
    display: flex;
    flex-direction: column;
}

.page-header {
    padding: 20px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    gap: 16px;
}

.page-header-left { display: flex; flex-direction: column; gap: 2px; }

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

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

.page-header-actions { display: flex; align-items: center; gap: 10px; }

.page-body { padding: 28px 32px; flex: 1; }

/* ─── CARDS ─── */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s ease;
}

.card:hover { box-shadow: var(--shadow-md); }

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg { width: 18px; height: 18px; color: var(--primary-hover); }

.card-body { padding: 20px; }

/* ─── METRIC CARDS ─── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    cursor: default;
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.metric-icon svg { width: 26px; height: 26px; stroke-width: 1.8; }

/* Цветовое кодирование KPI-иконок (пастельный фон + насыщенный цвет) */
.metric-icon.ic-green  { background: #DCFCE7; color: #16A34A; }
.metric-icon.ic-blue   { background: #DBEAFE; color: #2563EB; }
.metric-icon.ic-amber  { background: #FEF3C7; color: #D97706; }
.metric-icon.ic-purple { background: #EDE9FE; color: #7C3AED; }
.metric-icon.ic-red    { background: #FEE2E2; color: #DC2626; }

.metric-value {
    font-size: 29px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.6px;
    line-height: 1;
}

.metric-label {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
}

.metric-change {
    font-size: 12px;
    color: var(--success);
    margin-top: 5px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.metric-change.down { color: #EF4444; }

/* ─── BUTTONS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-sm { padding: 6px 14px; font-size: 12.5px; border-radius: 10px; }
.btn-sm svg { width: 14px; height: 14px; }

.btn-primary { background: #22C55E; color: white; }
.btn-primary:hover {
    background: #16A34A;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(34,197,94,0.32);
}

.btn-secondary { background: var(--primary-soft); color: var(--primary); }
.btn-secondary:hover { background: var(--primary-soft-hover); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--hover-bg); color: var(--text); border-color: var(--primary); }

.btn-danger { background: #FEE2E2; color: #DC2626; }
.btn-danger:hover { background: #FECACA; }

.btn-icon {
    padding: 8px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: 0.2s ease;
}

.btn-icon:hover { background: var(--hover-bg); color: var(--primary-hover); border-color: var(--primary); }
.btn-icon svg { width: 16px; height: 16px; }
.btn-icon.danger:hover { background: #FEE2E2; color: #DC2626; border-color: #FECACA; }

/* ─── FORMS ─── */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--text);
    background: var(--bg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: 'Inter', sans-serif;
    appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}

.form-control::placeholder { color: #C4C4C4; }

select.form-control { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

textarea.form-control { resize: vertical; min-height: 88px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 5px; }

/* ─── SEARCH ─── */
.search-wrap {
    position: relative;
    flex: 1;
}

.search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrap input { padding-left: 38px; }

/* ─── TABLES ─── */
.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}

table { width: 100%; border-collapse: collapse; }

thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 13px 16px;
    font-size: 13.5px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--hover-bg); cursor: pointer; }

/* ─── BADGES ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
/* Чистая цветная точка в цвет статуса — строгий «дорогой» вид вместо эмодзи */
.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.badge-green  { background: #DCFCE7; color: #15803D; }
.badge-blue   { background: #DBEAFE; color: #1D4ED8; }
.badge-yellow { background: #FEF9C3; color: #92400E; }
.badge-red    { background: #FEE2E2; color: #B91C1C; }
.badge-gray   { background: #F3F4F6; color: #6B7280; }
.badge-purple { background: #F3E8FF; color: #7C3AED; }
.badge-orange { background: #FFEDD5; color: #C2410C; }

/* ─── SPLIT LAYOUT ─── */
.split-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    height: calc(100vh - 62px);
    overflow: hidden;
}

.split-list {
    border-right: 1px solid var(--border);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.split-list-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.split-list-body { flex: 1; overflow-y: auto; }

.list-item {
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}

.list-item:hover { background: var(--hover-bg); }

.list-item.active {
    background: var(--hover-bg);
    border-left-color: var(--primary-hover);
}

.list-item-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.list-item-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 3px;
}

.split-detail {
    overflow-y: auto;
    padding: 28px 32px;
}

/* ─── EMPTY STATE ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
    gap: 12px;
}

.empty-state svg { width: 56px; height: 56px; opacity: 0.3; }
.empty-state h3 { font-size: 16px; font-weight: 700; color: var(--text); }
.empty-state p { font-size: 13px; max-width: 280px; }

/* ─── KANBAN ─── */
.kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 16px;
    align-items: flex-start;
    min-height: calc(100vh - 160px);
}

.kanban-col {
    min-width: 275px;
    max-width: 275px;
    background: var(--sidebar-bg);
    border-radius: 14px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.kanban-col-head {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kanban-col-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-col-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-count {
    font-size: 11px;
    font-weight: 700;
    background: white;
    color: var(--text-muted);
    border-radius: 20px;
    padding: 2px 8px;
    border: 1px solid var(--border);
}

.kanban-col-body { padding: 12px; display: flex; flex-direction: column; gap: 10px; }

.kanban-card {
    background: white;
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 14px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow);
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.kanban-card-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.4;
}

.kanban-card-amount {
    font-size: 17px;
    font-weight: 800;
    color: #15803D;
    letter-spacing: -0.3px;
    margin-bottom: 10px;
}

.kanban-card-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kanban-card-meta svg { width: 13px; height: 13px; }

.kanban-add-btn {
    margin: 10px 12px 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1.5px dashed var(--border);
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: 0.2s ease;
    width: calc(100% - 24px);
    justify-content: center;
}

.kanban-add-btn:hover { border-color: var(--primary); color: var(--primary-hover); background: var(--hover-bg); }
.kanban-add-btn svg { width: 14px; height: 14px; }

/* ─── TASKS ─── */
.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}

.task-item:hover { background: var(--hover-bg); }
.task-item:last-child { border-bottom: none; }

.task-check {
    width: 19px;
    height: 19px;
    border-radius: 6px;
    border: 2px solid var(--border);
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
    accent-color: var(--primary-hover);
    transition: 0.2s ease;
}

.task-body { flex: 1; min-width: 0; }

.task-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 5px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.task-meta svg { width: 13px; height: 13px; }
.task-meta span { display: flex; align-items: center; gap: 4px; }

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

.task-priority {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ─── WAREHOUSE ─── */
.category-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.cat-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.cat-tab:hover { background: var(--hover-bg); color: var(--text); border-color: var(--primary); }
.cat-tab.active { background: var(--primary); color: white; border-color: var(--primary); }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 18px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.product-params { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.product-price-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.product-sell { font-size: 17px; font-weight: 800; color: #15803D; letter-spacing: -0.3px; }
.product-buy { font-size: 11px; color: var(--text-muted); }

.product-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
}

.product-qty-val { font-size: 14px; font-weight: 700; color: var(--text); }

/* ─── CALCULATOR ─── */
.calc-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.calc-result-box {
    background: var(--primary-soft);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1.5px solid var(--primary-soft-hover);
}

.calc-result-val {
    font-size: 40px;
    font-weight: 800;
    color: #22C55E;
    letter-spacing: -1px;
}

.calc-result-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.calc-breakdown { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    background: white;
}

.calc-row-label { color: var(--text-muted); }
.calc-row-val { font-weight: 600; color: var(--text); }

.range-wrap { display: flex; align-items: center; gap: 12px; }

.range-input {
    flex: 1;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}

.range-input::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-hover);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(34,197,94,0.35);
}

.range-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-hover);
    min-width: 40px;
    text-align: right;
}

/* ─── ANALYTICS ─── */
.analytics-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-box {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 20px;
}

.chart-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.chart-area {
    height: 240px;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding-top: 10px;
}

.chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-hover) 100%);
    transition: opacity 0.2s ease;
    min-height: 4px;
}

.chart-bar:hover { opacity: 0.8; }

.chart-bar-label { font-size: 11px; color: var(--text-muted); }

.donut-wrap { display: flex; align-items: center; justify-content: center; padding: 20px 0; position: relative; }

.legend-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }

.legend-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.stat-list { display: flex; flex-direction: column; }

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.stat-row:last-child { border-bottom: none; }
.stat-row-label { color: var(--text-muted); }
.stat-row-val { font-weight: 700; color: var(--text); }

/* ─── USERS ─── */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.user-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 24px 20px;
    text-align: center;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.user-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.user-card-ava {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
    font-weight: 800;
    margin: 0 auto 14px;
    box-shadow: 0 4px 14px rgba(34,197,94,0.22);
}

.user-card-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.user-card-email { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

.user-card-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }

/* ─── MODALS (strict, no var() inside modal-box) ─── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal-box {
    background: #ffffff;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.modal-box .modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: #ffffff;
    z-index: 1;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

/* старые модалки без .modal-body */
.modal-box > .form-group,
.modal-box > .form-row {
    padding-left: 24px;
    padding-right: 24px;
}
.modal-box > .form-group:first-of-type,
.modal-box > .form-row:first-of-type {
    margin-top: 20px;
}


.modal-box .modal-head h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1A1A1A;
}

.modal-close-x {
    width: 30px;
    height: 30px;
    border: none;
    background: #F3F4F6;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #6B7280;
    transition: 0.2s ease;
    line-height: 1;
}

.modal-close-x:hover { background: #FEE2E2; color: #DC2626; }

.modal-box .modal-foot {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 24px 20px;
    border-top: 1px solid #E5E7EB;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: #ffffff;
    z-index: 1;
}

/* ─── SELECTABLE CHIPS (чипы выбора: города / категории поставщика) ─── */
.cat-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-check-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.cat-check-item:hover { border-color: #BBF7D0; background: #DCFCE7; }
/* нативный чекбокс скрыт, но остаётся в DOM и кликается через label */
.cat-check-item input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; pointer-events: none; }
/* кастомный индикатор-галочка */
.cat-check-item::before {
    content: "";
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    border: 1.5px solid #D1D5DB;
    border-radius: 6px;
    background: #ffffff center / 11px no-repeat;
    transition: border-color .15s ease, background-color .15s ease;
}
.cat-check-item:has(input:checked) {
    border-color: #22C55E;
    background: #DCFCE7;
    color: #16A34A;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(34,197,94,.22);
}
.cat-check-item:has(input:checked)::before {
    border-color: #22C55E;
    background-color: #22C55E;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
}
.cat-check-item:focus-within { border-color: #22C55E; box-shadow: 0 0 0 3px rgba(34,197,94,.25); }

/* ─── Строки справочников в управляющих модалках (города / категории) ─── */
.cat-row-m {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: background .12s ease, border-color .12s ease;
}
.cat-row-m + .cat-row-m { margin-top: 2px; }
.cat-row-m:hover { background: #F9FAFB; border-color: #E5E7EB; }
.cat-row-m .row-name { font-size: 13.5px; font-weight: 500; color: #1A1A1A; }
.btn-row-del {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #9CA3AF;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    line-height: 1;
    transition: background .12s ease, color .12s ease;
}
.btn-row-del:hover { background: #FEE2E2; color: #DC2626; }

/* строка добавления в справочник: инпут + кнопка одной высоты */
.dict-add-row { display: flex; gap: 8px; align-items: stretch; }
.dict-add-row .form-control { flex: 1; }

/* ─── LOGIN ─── */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #FFFFFF 0%, #DCFCE7 55%, #BBF7D0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(29,29,27,0.12);
    padding: 44px 44px 36px;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--border);
}

.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo img { height: 76px; width: 76px; object-fit: contain; border-radius: 14px; }

.login-logo-fallback {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary-hover);
    letter-spacing: -1px;
}

.login-title { font-size: 22px; font-weight: 800; color: var(--text); text-align: center; margin-bottom: 6px; letter-spacing: -0.4px; }
.login-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 28px; }

.login-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0; color: var(--text-muted); font-size: 12px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ─── LOGISTICS ─── */
.logistics-map {
    background: var(--sidebar-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.logistics-dots {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.logistics-stat {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 14px 18px;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ─── DETAIL CARD ─── */
.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.detail-ava {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: 800;
    flex-shrink: 0;
}

.detail-name { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 4px; letter-spacing: -0.3px; }
.detail-meta { font-size: 13px; color: var(--text-muted); }

.detail-fields { display: flex; flex-direction: column; gap: 0; }

.detail-field {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    gap: 16px;
}

.detail-field:last-child { border-bottom: none; }
.detail-field-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; min-width: 100px; }
.detail-field-val { font-size: 14px; color: var(--text); font-weight: 500; text-align: right; }

.detail-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ─── MISC ─── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-green { background: #22C55E; }
.dot-yellow { background: #F59E0B; }
.dot-red { background: #EF4444; }
.dot-blue { background: #3B82F6; }
.dot-gray { background: #D1D5DB; }
.dot-purple { background: #8B5CF6; }

.stars { color: #F59E0B; letter-spacing: 1px; }

.progress { height: 5px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 3px; }

.avatar-sm {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 700;
}

.flex-center { display: flex; align-items: center; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-muted { color: var(--text-muted); }
.text-primary { color: #22C55E; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.font-800 { font-weight: 800; }

/* ─── MONTH NAV ─── */
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav-label { font-size: 14px; font-weight: 700; color: var(--text); min-width: 130px; text-align: center; }
.month-nav-btn { width: 32px; height: 32px; border: 1.5px solid var(--border); border-radius: 8px; background: white; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 18px; line-height: 1; text-decoration: none; transition: 0.2s ease; flex-shrink: 0; }
.month-nav-btn:hover { background: var(--hover-bg); border-color: var(--primary); color: var(--primary-hover); }

/* ─── STATUS FILTER TABS ─── */
.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.status-tab { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 8px; border: 1.5px solid var(--border); background: white; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-muted); text-decoration: none; transition: 0.2s ease; white-space: nowrap; }
.status-tab:hover { background: var(--hover-bg); color: var(--text); border-color: var(--primary); }
/* цветная точка статуса перед меткой */
.status-tab::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #9CA3AF; flex-shrink: 0; }
.status-tab--all::before { display: none; }
.status-tab--active::before          { background: #3B82F6; }
.status-tab--waiting_payment::before { background: #F59E0B; }
.status-tab--shipped::before         { background: #8B5CF6; }
.status-tab--signed::before          { background: #22C55E; }
.status-tab--cancelled::before       { background: #EF4444; }
/* активная вкладка — заливка в цвет статуса */
.status-tab.active { color: white; border-color: transparent; }
.status-tab.active::before { background: rgba(255,255,255,0.9); }
.status-tab--all.active             { background: #22C55E; border-color: #22C55E; }
.status-tab--active.active          { background: #3B82F6; border-color: #3B82F6; }
.status-tab--waiting_payment.active { background: #F59E0B; border-color: #F59E0B; }
.status-tab--shipped.active         { background: #8B5CF6; border-color: #8B5CF6; }
.status-tab--signed.active          { background: #16A34A; border-color: #16A34A; }
.status-tab--cancelled.active       { background: #EF4444; border-color: #EF4444; }

/* ─── DEAL SUMMARY BAR ─── */
.deal-summary { display: flex; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.deal-summary-item { flex: 1; min-width: 130px; background: white; border-radius: 10px; border: 1px solid var(--border); padding: 14px 16px; box-shadow: var(--shadow); }
.deal-summary-item label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; }
.deal-summary-item span { font-size: 18px; font-weight: 800; color: var(--text); }
.deal-summary-item.green span { color: #15803D; }

/* ─── DEAL CARDS ─── */
.deal-card { background: #FFFFFF; border-radius: 12px; border: 1px solid #E5E7EB; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 16px; overflow: hidden; transition: box-shadow 0.2s ease; }
.deal-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.12); }
.deal-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #F3F4F6; }
.deal-card-title { font-size: 15px; font-weight: 700; color: #1A1A1A; margin-bottom: 3px; }
.deal-card-meta { font-size: 12px; color: #6B7280; }
.deal-carried { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; background: #FFEDD5; color: #C2410C; vertical-align: middle; }

/* Финансовый блок карточки */
.deal-financials { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; padding: 12px 20px; background: #F9FAFB; }
.deal-fin-item label { display: block; font-size: 11px; color: #6B7280; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 4px; }
.deal-fin-item span { font-size: 15px; font-weight: 700; color: #1A1A1A; }
.deal-fin-item.margin span { color: #15803D; }

/* Бейджи расходов */
.deal-expenses { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 20px; }
.deal-exp-badge { background: #F3F4F6; border-radius: 6px; padding: 3px 9px; font-size: 12px; color: #374151; }

.deal-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid #F3F4F6; }

/* ─── EXPENSE LIST ─── */
.expense-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.expense-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #F9FAFB; border-radius: 8px; font-size: 13px; }
.expense-row-label { flex: 1; color: #1A1A1A; }
.expense-row-amount { font-weight: 700; color: #1A1A1A; white-space: nowrap; }
.expense-del-btn { width: 24px; height: 24px; border: none; background: #FEE2E2; border-radius: 6px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: #DC2626; font-size: 14px; line-height: 1; flex-shrink: 0; transition: 0.2s ease; }
.expense-del-btn:hover { background: #FECACA; }

/* ─── ENTITY VIEW (карточки поставщика / клиента — единый паттерн) ─── */
.entity-crumbs { display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-muted); margin-bottom:18px; }
.entity-crumbs a { color:#22C55E; text-decoration:none; font-weight:500; }
.entity-crumbs a:hover { text-decoration:underline; }
.entity-crumbs .sep { color:#D1D5DB; }

.entity-header {
    display:flex; align-items:center; gap:18px;
    background:#fff; border:1px solid var(--border); border-radius:12px;
    box-shadow:var(--shadow); padding:20px 24px; margin-bottom:20px; flex-wrap:wrap;
}
.entity-ava {
    width:64px; height:64px; border-radius:16px;
    display:flex; align-items:center; justify-content:center;
    font-weight:800; font-size:26px; flex-shrink:0;
}
.entity-header-main { flex:1; min-width:200px; }
.entity-name { font-size:22px; font-weight:800; color:var(--text); letter-spacing:-0.3px; margin-bottom:4px; }
.entity-stars { line-height:1; }
.entity-stars span { font-size:17px; letter-spacing:1px; }
.entity-chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.entity-header-actions { display:flex; gap:8px; flex-shrink:0; flex-wrap:wrap; }

.chip {
    display:inline-flex; align-items:center; gap:5px;
    padding:4px 11px; border-radius:20px; font-size:12px; font-weight:600; white-space:nowrap;
}
.chip svg { width:12px; height:12px; flex-shrink:0; }
.chip-blue   { background:#DBEAFE; color:#1D4ED8; }
.chip-green  { background:#DCFCE7; color:#15803D; }
.chip-purple { background:#EDE9FE; color:#6D28D9; }
.chip-amber  { background:#FEF3C7; color:#B45309; }
.chip-gray   { background:#F3F4F6; color:#4B5563; }

.entity-grid { display:grid; grid-template-columns:360px 1fr; gap:20px; align-items:start; }

.info-card { background:#fff; border:1px solid var(--border); border-radius:12px; box-shadow:var(--shadow); overflow:hidden; margin-bottom:20px; }
.info-card:last-child { margin-bottom:0; }
.info-card-head { padding:14px 20px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:10px; }
.info-card-title { font-size:12px; font-weight:700; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.6px; display:flex; align-items:center; gap:8px; }
.info-card-title svg { width:15px; height:15px; color:#22C55E; flex-shrink:0; }
.info-card-body { padding:16px 20px; }

.contact-line { display:flex; align-items:center; gap:12px; padding:11px 0; border-bottom:1px solid #F3F4F6; }
.contact-line:first-child { padding-top:0; }
.contact-line:last-child { border-bottom:none; padding-bottom:0; }
.contact-ico { width:36px; height:36px; border-radius:10px; background:#DCFCE7; color:#22C55E; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.contact-ico svg { width:16px; height:16px; }
.contact-body { min-width:0; flex:1; }
.contact-label { font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.3px; font-weight:600; }
.contact-val { font-size:14px; color:var(--text); font-weight:500; word-break:break-word; display:block; }
a.contact-val { text-decoration:none; }
a.contact-val:hover { color:#22C55E; text-decoration:underline; }

.tag-chip { display:inline-flex; align-items:center; gap:6px; padding:5px 12px; border-radius:20px; font-size:12.5px; font-weight:500; background:#F3F4F6; color:#4B5563; border:1px solid #E5E7EB; }
.tag-chip-x { cursor:pointer; opacity:.55; font-size:15px; line-height:1; display:inline-flex; transition:opacity .15s, color .15s; }
.tag-chip-x:hover { opacity:1; color:#DC2626; }
.tags-wrap { display:flex; flex-wrap:wrap; gap:8px; }

.mgr-card { display:flex; align-items:flex-start; gap:14px; padding:14px 16px; border:1px solid var(--border); border-radius:12px; margin-bottom:10px; transition:box-shadow .15s, border-color .15s; }
.mgr-card:last-child { margin-bottom:0; }
.mgr-card:hover { box-shadow:var(--shadow); border-color:#BBF7D0; }
.mgr-card:hover .mgr-del { opacity:1; }
.mgr-ava { width:42px; height:42px; border-radius:11px; background:#DCFCE7; color:#16A34A; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:16px; flex-shrink:0; }
.mgr-info { flex:1; min-width:0; }
.mgr-name { font-weight:700; font-size:14px; color:var(--text); }
.mgr-pos { font-size:12px; color:var(--text-muted); margin-top:1px; }
.mgr-contacts { display:flex; flex-wrap:wrap; gap:16px; margin-top:8px; }
.mgr-contact { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:#374151; text-decoration:none; }
.mgr-contact svg { width:14px; height:14px; color:#22C55E; flex-shrink:0; }
.mgr-contact:hover { color:#22C55E; }
.mgr-del { flex-shrink:0; width:30px; height:30px; border:none; background:transparent; color:#9CA3AF; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; opacity:.4; transition:opacity .15s, background .15s, color .15s; }
.mgr-del svg { width:15px; height:15px; }
.mgr-del:hover { background:#FEE2E2; color:#DC2626; opacity:1; }
.mgr-actions { flex-shrink:0; display:flex; align-items:flex-start; gap:2px; }
.mgr-edit { width:30px; height:30px; border:none; background:transparent; color:#9CA3AF; border-radius:8px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; opacity:.4; transition:opacity .15s, background .15s, color .15s; }
.mgr-edit svg { width:15px; height:15px; }
.mgr-edit:hover { background:#DCFCE7; color:#16A34A; opacity:1; }
.mgr-card:hover .mgr-edit { opacity:1; }

.card-empty { display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; padding:26px 16px; color:var(--text-muted); }
.card-empty svg { width:36px; height:36px; opacity:.35; }
.card-empty p { font-size:13px; max-width:260px; }

.tag-add-row { display:flex; gap:8px; margin-top:16px; max-width:440px; }
.tag-add-row .form-control { flex:1; }

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

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .analytics-grid { grid-template-columns: 1fr; }
    .calc-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .content { margin-left: 0; }
    .split-layout { grid-template-columns: 1fr; }
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 11px;
        left: 12px;
        z-index: 300;
        width: 40px;
        height: 40px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 10px;
        color: var(--text);
        cursor: pointer;
        box-shadow: var(--shadow);
    }
    .sidebar-overlay.open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 150;
    }
    .page-header { padding-left: 64px; }
}

@media (max-width: 600px) {
    .metrics-grid { grid-template-columns: 1fr; }
    .page-body { padding: 16px; }
    .page-header { padding: 14px 16px 14px 64px; }
    .kanban-col { min-width: 240px; }
    .products-grid { grid-template-columns: 1fr; }
    .users-grid { grid-template-columns: 1fr; }
}
