:root {
    --bg: #f4f5f7;
    --card: #ffffff;
    --text: #1f2430;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --good: #16a34a;
    --good-bg: #dcfce7;
    --blue: #4338ca;
    --blue-bg: #e0e7ff;
    --border: #e5e7eb;
    --thumb-size: 52px;
    --thumb-hover-size: 220px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
}

.page {
    max-width: none;
    margin: 0;
    padding: 0 20px 70px;
}

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

header h1 { font-size: 18px; margin: 0; }

.header-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.logout {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 10px;
}

.flash {
    margin: 10px 0 0;
    padding: 10px 14px;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 8px;
    font-size: 14px;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 12px 0;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    border: none;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-dark); }
.btn.primary:disabled { opacity: 0.6; }

.sync-status {
    color: var(--muted);
    font-size: 12px;
}

/* ============ ОСНОВНАЯ РАСКЛАДКА: контент слева, приоритеты справа ============ */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    align-items: start;
}

.main-content {
    min-width: 0; /* чтобы таблица могла сжиматься/скроллиться внутри колонки */
}

.sidebar {
    position: sticky;
    top: 12px;
}

/* ============ КАТЕГОРИИ (всегда развёрнуты) ============ */
.category-block {
    background: transparent;
    margin-bottom: 8px;
}

.category-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 14px;
    padding: 9px 14px;
    background: var(--card);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 700;
}

.category-title { font-size: 15px; }

.category-meta {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.category-meta strong { color: var(--text); font-weight: 800; }
.category-meta strong.text-danger { color: var(--danger); }

/* ============ ТАБЛИЦА ============ */
.table-card {
    margin-top: 4px;
    background: var(--card);
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
}

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

th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; background: #f7f7f9; }

tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fafafa; }
tbody tr:hover { background: #f0f5ff; }

.article-cell { font-weight: 600; }

.article-with-photo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.thumb {
    width: var(--thumb-size);
    height: var(--thumb-size);
    border-radius: 6px;
    object-fit: cover;
    background: #f0f1f4;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.thumb[src] { cursor: zoom-in; }

.thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-weight: 700;
    font-size: 14px;
}

.article-name {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 14px;
}

.qty-badge {
    display: inline-block;
    min-width: 30px;
    padding: 2px 8px;
    background: #eef2ff;
    color: var(--primary-dark);
    border-radius: 999px;
    font-weight: 700;
    text-align: center;
    font-size: 13px;
}

.have-input {
    width: 72px;
    padding: 6px 8px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 7px;
    text-align: center;
}

.have-input.saved { border-color: var(--good); background: var(--good-bg); }

.prepare-cell { font-weight: 700; }
.prepare-cell.alert { color: var(--danger); }

.empty-note { text-align: center; color: var(--muted); padding: 20px 0; font-size: 14px; }

.grand-total-card {
    position: fixed;
    left: 210px;
    right: 0;
    bottom: 0;
    z-index: 50;
    margin: 0;
    padding: 14px 20px;
    background: var(--card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}

.grand-total-card strong.alert { color: var(--danger); }

/* ============ САЙДБАР: ПРИОРИТЕТ ОТГРУЗКИ ============ */
.priority-panel {
    background: var(--card);
    border-radius: 12px;
    padding: 14px 14px 16px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.priority-panel h2 {
    font-size: 13px;
    margin: 0 0 10px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 700;
}

.overall-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}

.summary-chip {
    border-radius: 8px;
    padding: 7px 8px;
    text-align: center;
}

.summary-value { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; }
.summary-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.02em; margin-top: 1px; opacity: 0.85; }

/* Цвета приоритета: просрочено — тревога; сегодня — "зелёная зона":
   ещё успеваем отправить в срок и получить бонус/скидку; завтра — есть
   запас времени; всего — нейтральный итог. */
.chip-overdue { background: var(--danger-bg); color: var(--danger); }
.chip-today { background: var(--good-bg); color: var(--good); }
.chip-tomorrow { background: var(--blue-bg); color: var(--blue); }
.chip-total { background: #f0f1f4; color: var(--text); }

.account-priority-card {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
}

.account-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.account-name { font-weight: 700; font-size: 14px; }

.nearest-deadline {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}

.account-mini-summary { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }

.mini-chip {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.mini-overdue { background: var(--danger-bg); color: var(--danger); }
.mini-today { background: var(--good-bg); color: var(--good); }
.mini-tomorrow { background: var(--blue-bg); color: var(--blue); }
.mini-total { background: #f0f1f4; color: var(--muted); }

.priority-banner {
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.banner-today, .banner-tomorrow {
    background: var(--good-bg);
    color: #14532d;
}

.btn-labels {
    flex-shrink: 0;
    display: inline-block;
    padding: 6px 12px;
    background: #111827;
    color: #fff;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.account-priority {
    margin-top: 6px;
}

.account-priority summary {
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.account-priority summary::-webkit-details-marker { display: none; }

.priority-item {
    border-left: 3px solid var(--border);
    border-radius: 6px;
    background: #fafafa;
    padding: 6px 8px;
}

.priority-item.item-overdue { border-left-color: var(--danger); background: var(--danger-bg); }
.priority-item.item-today,
.priority-item.item-tomorrow { border-left-color: var(--good); background: var(--good-bg); }
.priority-item.item-later { border-left-color: var(--border); background: #f4f4f5; }

.priority-item-top {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.priority-item-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(0,0,0,0.06);
    color: var(--muted);
    font-weight: 600;
}

.priority-item-deadline {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.priority-item-note {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

.priority-detail-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 240px;
    overflow-y: auto;
}

.priority-article {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-weight: 700;
    font-size: 12px;
}

.text-danger { color: var(--danger); }
.text-good { color: var(--good); }

/* --- Всплывающее превью фото при наведении на миниатюру --- */
#imgPreview {
    display: none;
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.28);
}

#imgPreview img {
    display: block;
    width: var(--thumb-hover-size);
    height: var(--thumb-hover-size);
    object-fit: cover;
    border-radius: 8px;
}

/* --- Логин --- */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.login-card {
    background: var(--card);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 320px;
}

.login-card h1 { margin: 0 0 8px; font-size: 24px; text-align: center; }

.login-card input {
    padding: 14px 16px;
    font-size: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.login-card button {
    padding: 14px;
    font-size: 18px;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}

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

/* ============ ВЛАДЕЛЬЧЕСКИЙ ДАШБОРД ============ */
.owner-note {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #eef2ff;
    color: #3730a3;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.owner-section {
    margin-bottom: 32px;
}

.owner-section h2 {
    font-size: 16px;
    margin: 0 0 12px;
}

.period-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.period-card {
    background: var(--card);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.period-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
}

.metric-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
}

.metric { display: flex; flex-direction: column; }

.metric-value { font-size: 20px; font-weight: 800; line-height: 1.1; }
.metric-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.text-muted-value { color: var(--muted); font-weight: 600; font-size: 15px; }

.owner-finance-line {
    margin-top: 10px;
    font-size: 14px;
}

.owner-error {
    color: var(--danger);
    font-size: 13px;
    background: var(--danger-bg);
    padding: 8px 10px;
    border-radius: 8px;
}

.owner-articles-table { margin-top: 8px; }

.old-price {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    color: var(--muted);
    text-decoration: line-through;
}

.price-index-badge {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
}

.price-index-badge.idx-good { background: var(--good-bg); color: var(--good); }
.price-index-badge.idx-neutral { background: #fef3c7; color: #b45309; }
.price-index-badge.idx-bad { background: var(--danger-bg); color: var(--danger); }

@media (max-width: 600px) {
    :root { --thumb-size: 64px; }
    body { font-size: 14px; }
    .page { padding: 0 10px 64px; }
    .toolbar { gap: 6px; }
    th, td { font-size: 13px; padding: 7px 8px; }
    .article-name { font-size: 13px; }
    .category-title { font-size: 14px; }
    .overall-summary { grid-template-columns: repeat(4, 1fr); }
    .summary-value { font-size: 15px; }
    .summary-label { font-size: 8px; }
    .grand-total-card { font-size: 13px; padding: 10px 12px; }
    .metric-row { gap: 12px 16px; }
    .metric-value { font-size: 17px; }
}

/* ============ CRM: БОКОВОЕ МЕНЮ ============ */
.crm-body {
    display: flex;
    min-height: 100vh;
    margin: 0;
}

.crm-sidebar {
    width: 210px;
    flex-shrink: 0;
    background: #111827;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 18px 0 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.crm-brand {
    font-size: 16px;
    font-weight: 800;
    padding: 0 18px 16px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.crm-nav {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    flex: 1;
}

.crm-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-left: 3px solid transparent;
}

.crm-nav a:hover { background: rgba(255,255,255,0.05); color: #fff; }

.crm-nav a.active {
    background: rgba(37,99,235,0.18);
    color: #fff;
    border-left-color: var(--primary);
}

.nav-ico { font-size: 14px; opacity: 0.8; }

.crm-logout {
    margin: 0 18px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.crm-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.crm-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.crm-header h1 { font-size: 18px; margin: 0; flex: 1; }

.header-right { display: flex; align-items: center; gap: 12px; }

.burger {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--text);
}

.btn.ghost {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

/* ============ ЧАТЫ ============ */
.chats-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 16px;
    align-items: start;
}

.chats-list {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    overflow: hidden;
    max-height: 70vh;
    overflow-y: auto;
}

.chat-item {
    display: block;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
}

.chat-item:hover { background: #f0f5ff; }
.chat-item.active { background: #eef2ff; border-left: 3px solid var(--primary); }

.chat-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-type { font-weight: 700; font-size: 13px; }
.chat-item-id { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: Consolas, monospace; }
.chat-item-last { font-size: 12px; color: var(--muted); margin-top: 4px; }

.unread-pill {
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
}

.chat-window {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    padding: 16px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
    padding-bottom: 8px;
}

.chat-msg { max-width: 75%; padding: 8px 12px; border-radius: 12px; }

.chat-msg.from-client { background: #f1f5f9; align-self: flex-start; }
.chat-msg.from-seller { background: var(--good-bg); align-self: flex-end; }

.chat-msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.chat-msg-text { font-size: 14px; line-height: 1.45; white-space: pre-wrap; }

.chat-reply {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.chat-reply textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

@media (max-width: 900px) {
    .crm-sidebar {
        position: fixed;
        left: -220px;
        z-index: 200;
        transition: left 0.2s;
    }
    .crm-sidebar.open { left: 0; }
    .burger { display: block; }
    .grand-total-card { left: 0; }
    .chats-layout { grid-template-columns: 1fr; }
    .chats-list { max-height: 300px; }
}

/* ============ АДМИН-ПАНЕЛЬ ============ */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
    padding: 9px 16px; border: 1px solid var(--border); background: var(--card);
    border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text);
}
.tab-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; }
.settings-card { background: var(--card); border-radius: 12px; padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.settings-card h3 { margin: 0 0 12px; font-size: 16px; }
.settings-card h4 { margin: 0 0 6px; font-size: 14px; }
.settings-card label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
.settings-card input {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border);
    border-radius: 8px; font-size: 14px; font-family: inherit;
}
.settings-sep { border: none; border-top: 1px solid var(--border); margin: 16px 0 12px; }
.secret-row { display: flex; gap: 6px; }
.secret-row .secret-input { flex: 1; }
.toggle-secret { border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 0 12px; cursor: pointer; }
.hint { font-size: 12px; color: var(--muted); line-height: 1.45; margin: 8px 0 0; }

.section-sub { font-size: 15px; margin: 22px 0 10px; }
.user-form .form-row { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 12px; align-items: flex-end; }
.user-form label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; flex-direction: column; gap: 4px; }
.user-form input[type=text], .user-form select {
    padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.checkbox-label { flex-direction: row !important; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }
.form-row.perms { gap: 16px; }
.card-form { background: var(--card); border-radius: 12px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.pass-row { display: flex; gap: 6px; align-items: center; }
.btn.small { padding: 6px 10px; font-size: 12px; }
.row-actions { display: flex; gap: 6px; }
.perm-cell { display: flex; gap: 5px; flex-wrap: wrap; }
.perm-badge { background: #eef2ff; color: var(--primary-dark); font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.action-badge { background: #f0f1f4; font-size: 12px; padding: 2px 8px; border-radius: 999px; font-family: Consolas, monospace; }
.nowrap { white-space: nowrap; }
.muted-cell { color: var(--muted); font-size: 12px; }
.edit-row { background: #fafafa; }

.crm-user { padding: 12px 18px 0; border-top: 1px solid rgba(255,255,255,0.08); margin-top: 8px; }
.crm-username { color: #fff; font-weight: 700; font-size: 13px; }
.crm-role { color: #94a3b8; font-size: 11px; margin-bottom: 8px; }
.crm-user .crm-logout { margin: 0; border: none; padding: 0; display: inline-block; }

.remember { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.login-card input[type=text] { padding: 14px 16px; font-size: 18px; border: 1px solid var(--border); border-radius: 10px; }

/* ============ СБОРКА ЗАКАЗОВ ============ */
.assembly-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; background: var(--card); border-radius: 12px;
    padding: 12px 16px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.awaiting { font-size: 14px; }
.awaiting-count { font-size: 18px; }
.awaiting-count.has-items { color: var(--danger); }

.modal-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(15,17,23,0.55);
    z-index: 500; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: var(--card); border-radius: 14px; padding: 22px 24px;
    max-width: 560px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}
.modal h3 { margin: 0 0 12px; font-size: 17px; }
.modal-body { font-size: 14px; line-height: 1.55; max-height: 50vh; overflow-y: auto; }
.modal-list { margin: 8px 0; padding-left: 20px; }
.modal-list code { font-size: 12px; background: #f0f1f4; padding: 1px 5px; border-radius: 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ============ ВЫБОР ПЕРИОДА ============ */
.period-toolbar { gap: 8px; align-items: center; }
.custom-period {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 8px; background: var(--card);
    border: 1px solid var(--border); border-radius: 9px;
}
.custom-period input[type=date] {
    border: none; font-size: 13px; font-family: inherit;
    padding: 5px; background: transparent; color: var(--text);
}
.custom-period .dash { color: var(--muted); }

/* ============ СВОРАЧИВАЕМЫЕ КАБИНЕТЫ ============ */
.account-block { border: none; }
.account-summary {
    cursor: pointer; list-style: none;
    display: flex; align-items: baseline; justify-content: space-between;
    flex-wrap: wrap; gap: 6px 16px;
    padding: 12px 16px; background: var(--card); border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05); margin-bottom: 10px;
}
.account-summary::-webkit-details-marker { display: none; }
.account-summary::before {
    content: "▸"; color: var(--muted); margin-right: 8px;
    display: inline-block; transition: transform 0.15s;
}
.account-block[open] .account-summary::before { transform: rotate(90deg); }
.account-summary-title { font-size: 16px; font-weight: 700; }
.account-summary-meta { font-size: 13px; color: var(--muted); }
.account-summary-meta strong { color: var(--text); }
