/* Дизайн «Индиго» — по handoff design_handoff_indigo (2026-07-10) */

* {
    box-sizing: border-box;
    margin: 0;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #eef0f8;
    min-height: 100vh;
    padding: 16px;
    color: #23264a;
}

/* Скрытый текст для скринридеров (лейблы полей без видимых подписей) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Auth ---------- */
.auth-container {
    max-width: 400px;
    margin: 2.5rem auto;
    text-align: center;
}
.auth-logo {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: #2f3c94;
    color: #fff;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(47,60,148,0.35);
}
.auth-logo.light {
    background: #e4e8ff;
    color: #2f3c94;
    box-shadow: none;
}
.auth-logo .logo-mark {
    width: 34px;
    height: 34px;
    display: block;
}
.auth-tagline {
    font-size: 12px;
    font-weight: 500;
    color: #6b6f8a;
}
.auth-container h2 {
    font-size: 20px;
    font-weight: 800;
}
.auth-container .subtitle {
    font-size: 13.5px;
    /* темнее вторичного: на тонированном фоне страницы нужен контраст ≥ 4.5 */
    color: #5f6379;
    margin: 4px 0 16px;
}
.auth-card {
    background: #fff;
    border-radius: 18px;
    padding: 18px 16px;
    box-shadow: 0 2px 10px rgba(47,60,148,0.08);
    text-align: left;
}
.auth-card.center { text-align: center; }
.auth-card.center .subtitle { margin-bottom: 14px; }
.auth-card label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #6b6f8a;
    margin: 10px 0 4px;
}
.auth-card label:first-child { margin-top: 0; }
.auth-card input { margin-bottom: 2px; }
.auth-card button { margin-top: 12px; }
.auth-container .error {
    color: #b3261e;
    background: #fdecea;
    padding: 9px 12px;
    border-radius: 12px;
    margin-top: 10px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}
.auth-container .warn {
    color: #7a4d00;
    background: #fdf1dc;
    padding: 9px 12px;
    border-radius: 12px;
    margin-top: 10px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}
.auth-container .info {
    color: #1b5e20;
    background: #e8f0e9;
    padding: 9px 12px;
    border-radius: 12px;
    margin-top: 10px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
}
.auth-container p {
    font-size: 13.5px;
    margin-top: 12px;
}
.auth-container p a {
    /* достаточная площадь тапа (a11y target-size) */
    display: inline-block;
    padding: 4px 2px;
    color: #3949ab;
    font-weight: 600;
}
.auth-container .hint {
    color: #6b6f8a;
    font-size: 12px;
    margin: 4px 0 6px;
    font-weight: 400;
}
.auth-container .hint a { font-weight: 400; }
.auth-container .consent {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 12.5px;
    color: #565a75;
    margin: 12px 0 2px;
    text-align: left;
}
.auth-container .consent input {
    width: 18px;
    height: 18px;
    accent-color: #3949ab;
    margin: 1px 0 0;
    flex-shrink: 0;
}
.auth-container .consent a { color: #3949ab; }
/* Поле кода подтверждения */
.code-input {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.35em;
    text-align: center;
    border-color: #3949ab;
    color: #23264a;
}
.code-input.loose { letter-spacing: 0.2em; font-size: 18px; }

/* Страница политики — текстовая карточка */
.auth-container.legal {
    max-width: 640px;
    background: #fff;
    border-radius: 18px;
    padding: 24px 22px;
    box-shadow: 0 2px 10px rgba(47,60,148,0.08);
    font-size: 0.95rem;
    line-height: 1.55;
    text-align: left;
}
.auth-container.legal h3 { margin: 1.2em 0 0.4em; }
.auth-container.legal ul { padding-left: 1.2em; }
.auth-container.legal .hint { text-align: left; }

/* Ссылка в виде кнопки (offline-страница: без JS из-за CSP) */
.btn-link {
    display: block;
    text-align: center;
    padding: 12px;
    border-radius: 40px;
    background: #3949ab;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
}
.link-btn {
    background: none;
    color: #3949ab;
    box-shadow: none;
    padding: 6px;
    font-size: 13.5px;
    font-weight: 600;
    width: auto;
    margin: 8px auto 0;
}
.link-btn:hover { box-shadow: none; text-decoration: underline; background: none; filter: none; }

/* ---------- Container ---------- */
.container {
    max-width: 700px;
    margin: 0 auto;
}

/* ---------- Header ---------- */
header {
    background: #2f3c94;
    color: white;
    border-radius: 20px;
    padding: 20px 20px 40px;
    margin-bottom: 0;
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.header-title {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-title h1 {
    font-size: 16px;
    font-weight: 700;
    color: white;
}
.header-icon {
    font-size: 20px;
    color: #aab6ff;
}
.header-logo {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.header-tagline {
    font-size: 11px;
    font-weight: 500;
    color: #aab6ff;
    align-self: flex-end;
    padding-bottom: 1px;
}
.user-block { display: flex; gap: 8px; align-items: center; }
.user-name {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.92);
    background: rgba(255,255,255,0.14);
    padding: 5px 12px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 5px;
    /* это кнопка (открывает настройки) — гасим глобальные стили button */
    width: auto;
    border: none;
    font-weight: 500;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s;
}
.user-name:hover { background: rgba(255,255,255,0.28); filter: none; box-shadow: none; transform: none; }
.user-name #userNameText {
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.logout {
    text-decoration: none;
    background: rgba(255,255,255,0.14);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.logout:hover { background: rgba(255,255,255,0.28); }
.header-month {
    text-align: center;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.header-month-center { min-width: 0; }
.month-nav {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    background: rgba(255,255,255,0.14);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.2s, opacity 0.2s;
}
.month-nav:hover { background: rgba(255,255,255,0.28); filter: none; box-shadow: none; transform: none; }
.month-nav:disabled { opacity: 0.35; cursor: default; background: rgba(255,255,255,0.14); }
.chart-btn { margin-left: 6px; }

/* ---------- Настройки аккаунта ---------- */
.settings-since {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #6b6f8a;
}
.settings-since[hidden] { display: none; }
.settings-section {
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid #e3e5f2;
}
.settings-section h4 {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #3949ab;
    margin-bottom: 2px;
}
.settings-save {
    margin-top: 12px;
    padding: 10px;
    font-size: 14px;
}

/* ---------- Диаграмма месяца ---------- */
.chart-donut {
    display: block;
    width: 200px;
    height: 200px;
    margin: 6px auto 14px;
}
.chart-total {
    font-size: 14px;
    font-weight: 800;
    fill: #23264a;
    font-family: inherit;
}
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 38vh;
    overflow-y: auto;
}
.legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: #23264a;
}
.legend-amount {
    font-weight: 700;
    color: #23264a;
    white-space: nowrap;
}
.legend-pct {
    color: #6b6f8a;
    width: 38px;
    text-align: right;
    white-space: nowrap;
    font-size: 12.5px;
}
.chart-empty {
    text-align: center;
    color: #6b6f8a;
    padding: 14px 0;
}
.chart-tabs {
    display: flex;
    gap: 6px;
    background: #eef0f8;
    border-radius: 12px;
    padding: 4px;
    margin: 4px 0 12px;
}
.chart-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 10px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 700;
    color: #6b6f8a;
    cursor: pointer;
}
.chart-tab.is-active {
    background: #fff;
    color: #23264a;
    box-shadow: 0 1px 3px rgba(35, 38, 74, .12);
}
.chart-sum {
    text-align: center;
    color: #6b6f8a;
    font-size: 13px;
    margin-bottom: 12px;
}
.chart-sum b { color: #23264a; }
.chart-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 46vh;
    overflow-y: auto;
}
.bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.bar-label {
    width: 62px;
    flex-shrink: 0;
    color: #23264a;
    font-weight: 600;
    white-space: nowrap;
}
.bar-track {
    flex: 1;
    min-width: 0;
    height: 8px;
    background: #eef0f8;
    border-radius: 5px;
    overflow: hidden;
}
.bar-fill {
    display: block;
    height: 100%;
    background: #3949ab;
    border-radius: 5px;
}
.bar-amount {
    font-weight: 700;
    color: #23264a;
    white-space: nowrap;
}
.bar-pct {
    color: #6b6f8a;
    width: 34px;
    text-align: right;
    white-space: nowrap;
    font-size: 12.5px;
}
.header-month-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #aab6ff;
    font-weight: 600;
}
.header-month-value {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

/* ---------- Offline banner ---------- */
.offline-banner[hidden] { display: none; }
.offline-banner {
    background: #fdf1dc;
    color: #7a4d00;
    padding: 10px 14px;
    border-radius: 12px;
    text-align: center;
    margin: 12px 0 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ---------- Stats ---------- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: -22px 0 14px;
    position: relative;
}
.stat-card {
    background: white;
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: 0 4px 14px rgba(47,60,148,0.14);
}
.stat-label {
    font-size: 11px;
    color: #6b6f8a;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}
.stat-label i { color: #3949ab; font-size: 13px; }
.stat-value {
    font-size: 15px;
    font-weight: 800;
    color: #23264a;
    white-space: nowrap;
}

/* ---------- Card ---------- */
.card {
    background: white;
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 2px 10px rgba(47,60,148,0.08);
    margin-bottom: 12px;
}

/* ---------- Form ---------- */
.add-form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; gap: 8px; }
.form-row input { flex: 1; min-width: 0; }
.form-row .date-field { flex: 0 0 138px; }
.form-row .form-col { flex: 1; min-width: 0; }
.form-row .form-col input { width: 100%; }

/* Сегменты способа оплаты (radio group без JS-хаков) */
.segmented {
    display: flex;
    gap: 6px;
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}
.segmented label {
    flex: 1;
    position: relative;
    display: block;
}
.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.segmented span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 40px;
    background: #f1f2f8;
    color: #565a75;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.segmented input:checked + span {
    background: #e4e8ff;
    color: #2f3c94;
    font-weight: 700;
}
.segmented input:focus-visible + span {
    box-shadow: 0 0 0 3px rgba(57,73,171,0.25);
}
.segmented span:hover { background: #e4e8ff; }

input, select {
    width: 100%;
    padding: 11px 14px;
    /* не меньше 16px: мельче — iOS Safari зумит страницу при фокусе */
    font-size: 16px;
    border-radius: 12px;
    border: 1.5px solid #e3e5f2;
    background: #f8f9fd;
    font-family: inherit;
    color: #23264a;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input::placeholder { color: #9aa0bd; }
input:focus, select:focus {
    outline: none;
    border-color: #3949ab;
    box-shadow: 0 0 0 3px rgba(57,73,171,0.15);
    background: white;
}
.input-error {
    border-color: #d98a80;
    background: #fdf3f2;
}

button {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    border-radius: 40px;
    border: none;
    background: #3949ab;
    color: white;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
button:hover { filter: brightness(0.95); }
button:active { transform: scale(0.97); }

#saveBtn {
    margin-top: 2px;
    font-size: 15px;
    padding: 13px;
}

.voice-row { display: flex; gap: 8px; }
.voice-row input { flex: 1; min-width: 0; }
.voice-btn {
    width: 46px;
    height: 46px;
    padding: 0;
    background: #3949ab;
    border: none;
    cursor: pointer;
    font-size: 20px;
    color: #fff;
    margin-top: 0;
    border-radius: 12px;
    flex-shrink: 0;
    box-shadow: none;
}
.voice-btn:hover { filter: brightness(0.95); }

/* Чип-предпросмотр нормализованной категории */
.category-preview {
    font-size: 12.5px;
    color: #5f6379;
    background: #f1f2f8;
    border-radius: 40px;
    padding: 6px 14px;
    align-self: flex-start;
    margin-top: -4px;
    /* это кнопка (открывает выбор категории) — гасим глобальные стили button */
    width: auto;
    border: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    box-shadow: none;
    transition: background 0.15s;
}
.category-preview:hover { background: #e4e8ff; filter: none; box-shadow: none; transform: none; }
.category-preview[hidden] { display: none; }
.category-preview b { color: #2f3c94; }
.category-preview i { color: #9aa0bd; font-size: 13px; }
.modal-content .category-preview { margin-top: 8px; }

/* ---------- Status ---------- */
.status {
    padding: 9px 14px;
    border-radius: 12px;
    margin: 8px 0;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.status:empty { display: none; }
.status.ok   { background: #e8f0e9; color: #1b5e20; }
.status.err  { background: #fdecea; color: #b3261e; }
.status.warn { background: #fdf1dc; color: #7a4d00; }

/* ---------- Export row ---------- */
.export-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 4px 0 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.export-row h2 {
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #23264a;
    font-weight: 700;
}
.export-buttons { display: flex; gap: 8px; }
.export-btn {
    text-decoration: none;
    background: #e4e8ff;
    color: #2f3c94;
    padding: 7px 14px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: filter 0.15s;
}
.export-btn:hover { filter: brightness(0.96); }
.export-btn.xlsx { background: #e4e8ff; color: #2f3c94; }

/* ---------- Date group ---------- */
.expenses-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.date-group { margin-bottom: 10px; }
.date-group-header {
    font-size: 12px;
    font-weight: 700;
    /* темнее вторичного #6b6f8a: фон страницы тонированный, нужен контраст ≥ 4.5 */
    color: #5f6379;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 14px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.date-group-total {
    font-size: 12px;
    color: #5f6379;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}
.group-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(47,60,148,0.08);
}

/* ---------- Expenses list ---------- */
.expense-item {
    padding: 9px 14px;
    border-bottom: 1px solid #f1f2f8;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s;
}
.expense-item:hover { background: #f8f9fd; }
.expense-item:last-child { border-bottom: none; }

.category-dot {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    font-weight: 700;
    user-select: none;
}

.expense-left { flex: 1; min-width: 0; }
.expense-left .desc {
    font-weight: 600;
    word-break: break-word;
    font-size: 14.5px;
}
.expense-left .meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 2px;
    font-size: 12px;
    align-items: center;
    color: #6b6f8a;
}
.meta-payment { color: #6b6f8a; }

.expense-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.expense-amount {
    font-weight: 800;
    font-size: 14.5px;
    color: #23264a;
    white-space: nowrap;
}
.expense-actions { display: flex; gap: 2px; }
.action-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    color: #9aa0bd;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    transition: background 0.15s, color 0.15s;
}
.action-btn:hover { box-shadow: none; transform: none; filter: none; background: #e4e8ff; }
.action-btn.delete:hover { background: #fdecea; color: #b3261e; }
.action-btn.edit:hover   { background: #e4e8ff; color: #2f3c94; }

.expense-item.pending { opacity: 0.6; }

/* Нераспознанная категория: пунктирный «?» и ссылка ручного выбора */
.category-dot.uncat {
    border: 2px dashed #b4b9d6;
    color: #6b6f8a;
    background: transparent;
}
.pick-link {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
    width: auto;
    font-size: 12px;
    font-weight: 600;
    color: #3949ab;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pick-link:hover { text-decoration: underline; box-shadow: none; transform: none; filter: none; }

.pick-modal-text {
    font-weight: 600;
    color: #23264a !important;
    word-break: break-word;
}
.pick-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    max-height: 50vh;
    overflow-y: auto;
}
.pick-chip {
    background: #f1f2f8;
    color: #23264a;
    border: none;
    border-radius: 40px;
    padding: 8px 14px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    margin: 0;
    width: auto;
    transition: background 0.15s;
}
.pick-chip:hover { background: #e4e8ff; box-shadow: none; transform: none; filter: none; }
.meta-pending {
    color: #b26a00;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Пустые/служебные состояния ---------- */
.empty-state {
    text-align: center;
    padding: 32px 20px;
    color: #6b6f8a;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(47,60,148,0.08);
}
.empty-state .state-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: #e4e8ff;
    color: #3949ab;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.empty-state .state-title {
    font-size: 15px;
    font-weight: 700;
    color: #23264a;
}
.empty-state small { font-size: 13px; color: #6b6f8a; }

.loading-state {
    text-align: center;
    padding: 14px;
    color: #6b6f8a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    background: white;
    border-radius: 40px;
    box-shadow: 0 2px 10px rgba(47,60,148,0.08);
}
.loading-state i { color: #3949ab; }

/* ---------- Modal ---------- */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(35,38,74,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 100;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.modal[hidden] { display: none; }
.modal-content {
    background: white;
    border-radius: 20px;
    padding: 20px 18px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 60px rgba(20,22,50,0.4);
}
.modal-header { margin-bottom: 10px; }
.modal-content h3 {
    font-size: 17px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-content h3 i { color: #3949ab; }
.modal-content h3.danger,
.modal-content h3.danger i { color: #b3261e; }
.modal-content p {
    font-size: 13.5px;
    color: #565a75;
    margin-bottom: 4px;
}
.modal-content label {
    display: block;
    margin-top: 10px;
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #6b6f8a;
}
.modal-content .segmented { margin-bottom: 2px; }
.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}
.modal-actions button { margin-top: 0; }
.btn-secondary {
    background: #f1f2f8 !important;
    color: #565a75 !important;
}
.btn-secondary:hover { box-shadow: none !important; background: #e4e8ff !important; filter: none; }
.btn-danger {
    background: #b3261e !important;
}
.btn-danger:hover { filter: brightness(0.92); }

/* ---------- Тост обновления ---------- */
.update-toast {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: #23264a;
    color: #fff;
    padding: 8px 10px 8px 18px;
    border-radius: 40px;
    box-shadow: 0 8px 24px rgba(20,22,50,0.4);
    z-index: 1000;
    font-size: 13.5px;
    white-space: nowrap;
}
.update-toast button {
    width: auto;
    margin: 0;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 700;
    background: #aab6ff;
    color: #1c2050;
}

/* ---------- Футер ---------- */
.page-footer {
    margin: 1.5rem 0 1rem;
    text-align: center;
    font-size: 12.5px;
    color: #5f6379;
}
.page-footer a {
    color: #3949ab;
    display: inline-block;
    padding: 4px 2px;
}
.page-footer span { margin: 0 6px; }
.link-danger {
    background: none;
    border: none;
    padding: 4px 2px;
    width: auto;
    color: #a03d3d;
    font-size: 12.5px;
    cursor: pointer;
    text-decoration: underline;
    display: inline-block;
}
.link-danger:hover { filter: none; }

@media (max-width: 480px) {
    body { padding: 14px; }
    .stats-row { gap: 7px; }
    .stat-card { padding: 9px 10px; }
    .header-month-value { font-size: 34px; }
}
