/* ============================================================
   1. ПЕРЕМЕННЫЕ И СБРОС СТИЛЕЙ
   ============================================================ */

:root {
    --bg-main: #0f172a;
    --bg-side: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-input: #0f172a;

    --accent: #00adb5;
    --accent-hover: #00c2cb;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --green: #10b981;
    --red: #ef4444;
    --border: rgba(255, 255, 255, 0.08);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-main: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ============================================================
   2. НАВИГАЦИЯ (SIDEBAR)
   ============================================================ */

.nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background-color: var(--bg-side);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 36px;
    padding: 0 8px;
}

.logo-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.03em;
}

#version-text {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.04);
}

.nav-btn.nav-active {
    color: var(--text-main);
    background-color: var(--accent);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 173, 181, 0.3);
}

.nav-icon {
    font-size: 16px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ============================================================
   3. ОСНОВНАЯ ОБЛАСТЬ (MAIN)
   ============================================================ */

main {
    margin-left: 240px;
    width: calc(100% - 240px);
    padding: 32px 40px;
    max-width: 1400px;
    box-sizing: border-box;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.header-section h2,
.page-header h2,
.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.tabs {
    display: none;
}

.tabs.tab-active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-main);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 16px;
    text-align: center;
}

#okno-main {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 24px;
}

/* ✅ Исправлено: убран дубль, сохранён min-width: 0 */
#okno-1,
#okno-2 {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.capital-card {
    background: linear-gradient(135deg, var(--accent) 0%, #007a80 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.card-label {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

#total_balance {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.badge {
    align-self: flex-start;
    background-color: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.summary-stats {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background-color: var(--border);
}

.chart-wrapper {
    position: relative;
    height: 140px;
    width: 100%;
}

.chatr-cont {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 8px 0;
}

.canvas-container {
    position: relative;
    width: 220px;
    height: 220px;
    flex-shrink: 0;
}

/* ============================================================
   4. КНОПКИ И ПОЛЯ ВВОДА (UI KIT)
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
}

.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(0, 173, 181, 0.3);
}

.btn-secondary {
    background-color: var(--bg-card-hover);
    color: var(--text-main);
    min-width: 180px;
    max-width: 220px;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: var(--red);
    color: #ffffff;
    min-width: 180px;
    max-width: 220px;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
}

.btn-danger-outline:hover {
    background-color: rgba(239, 68, 68, 0.1);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.input-field {
    width: 100%;
    padding: 10px 14px;
    background-color: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    /* ✅ Исправлено: убран !important */
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--accent);
}

.select-field {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.select-field option {
    background-color: var(--bg-side);
    color: var(--text-main);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.checkbox-container input {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============================================================
   13. ЛИМИТЫ КАТЕГОРИЙ
   ============================================================ */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-subtitle {
    font-size: 11px;
    color: var(--text-muted);
}

.limits-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    padding: 12px 0;
}

.limit-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.limit-item:last-child {
    border-bottom: none;
}

.limit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.limit-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.limit-values {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

.limit-values.is-over {
    color: var(--red);
    font-weight: 600;
}

.limit-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.limit-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

.limit-bar-fill.status-ok {
    background: #10b981;
}

.limit-bar-fill.status-warning {
    background: #f59e0b;
}

.limit-bar-fill.status-danger {
    background: #f97316;
}

.limit-bar-fill.status-over {
    background: #ef4444;
}

.limit-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.limit-percent {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.limit-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
}

.limit-badge.status-ok {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.limit-badge.status-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.limit-badge.status-danger {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.limit-badge.status-over {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Поле лимита в менеджере категорий */
.category-limit-input {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 12px;
    padding: 3px 8px;
    width: 110px;
    text-align: right;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.category-limit-input:focus {
    outline: none;
    border-color: var(--accent);
    color: var(--text-main);
}

.category-limit-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.category-item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   5. МЕСЯЦЫ И ФИЛЬТРЫ
   ============================================================ */

.month-tabs-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
}

.months-element,
.filter-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.months-element:hover,
.filter-btn:hover {
    color: var(--text-main);
    border-color: var(--accent);
}

.months-active,
.filter-active {
    background-color: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    font-weight: 600;
}

.filter-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 16px;
}

/* ✅ Исправлено: объединены два дублирующих блока .stat-pill в один */
.stat-pill {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
}

.filter-toolbar select,
.filter-toolbar .btn,
.filter-toolbar input {
    height: 100%;
    box-sizing: border-box;
}

.filter-group {
    display: flex;
    gap: 6px;
}

.toolbar-stats {
    display: flex;
    gap: 12px;
}

/* ============================================================
   6. КАРТОЧКИ СЧЕТОВ (GRID)
   ============================================================ */

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.account-card {
    position: relative;
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 140px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.account-card.is-goal {
    justify-content: space-between;
}

.account-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.account-type {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.account-name {
    font-size: 18px;
    font-weight: 600;
}

.account-balance {
    font-size: 22px;
    font-weight: 700;
}

.acc-positive {
    color: var(--green);
}

.acc-negative {
    color: var(--red);
}

.archived-card {
    opacity: 0.5;
    background-color: rgba(30, 41, 59, 0.5);
}

.account-currency-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-main);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid var(--border);
}

.account-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.account-card.is-goal .account-card-middle {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.account-card.is-goal .account-name {
    font-size: 14px;
    /* компактнее обычного */
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.account-card.is-goal .account-balance {
    font-size: 15px;
    /* компактнее обычного */
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Нижняя зона: прогресс-бар — занимает оставшееся место */
.goal-progress-block {
    flex-shrink: 0;
}

.goal-progress-bar-bg {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.goal-progress-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}

/* Нижняя строка: процент + бейдж */
.goal-progress-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}

.goal-progress-percent {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 600;
}

/* Бейдж — компактный, в одну строку */
.goal-badge {
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.goal-badge--completed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.goal-badge--overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.goal-badge--lastday {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.goal-badge--active {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    font-weight: 400;
}

/* Обводка карточки по статусу */
.goal-status--completed {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.goal-status--overdue {
    border-color: rgba(239, 68, 68, 0.3) !important;
}

.goal-status--last-day {
    border-color: rgba(245, 158, 11, 0.3) !important;
}

/* ============================================================
   7. ТАБЛИЦА ИСТОРИИ
   ============================================================ */

#transaction-non {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

/* ✅ Исправлено: добавлен table-layout: fixed — столбцы больше не прыгают */
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    table-layout: fixed;
}

/* ✅ Фиксированные пропорции столбцов таблицы транзакций */
#history_container table th:nth-child(1) {
    width: 14%;
}

/* Сумма     */
#history_container table th:nth-child(2) {
    width: 20%;
}

/* Категория */
#history_container table th:nth-child(3) {
    width: 18%;
}

/* Счёт      */
#history_container table th:nth-child(4) {
    width: 12%;
}

/* Дата      */
#history_container table th:nth-child(5) {
    width: 29%;
}

/* Описание  */
#history_container table th:nth-child(6) {
    width: 7%;
}

/* ×         */

/* ✅ Длинный текст обрезается с многоточием */
#history_container td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

th {
    padding: 14px 16px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    background-color: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

th:hover {
    color: var(--text-main);
}

td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.remove_btn {
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    text-align: center;
    width: 40px;
}

.remove_btn:hover {
    color: var(--red);
}

.hidden-transaction {
    opacity: 0.4;
}

.table-edit-select,
.table-edit-input {
    background-color: var(--bg-input);
    color: var(--text-main);
    border: 1px solid var(--accent);
    padding: 4px 8px;
    border-radius: 4px;
}

/* ============================================================
   8. ДИАЛОГОВЫЕ И МОДАЛЬНЫЕ ОКНА
   ============================================================ */

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    background-color: var(--bg-side);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: var(--text-main);
    width: calc(100% - 32px);
    max-width: 460px;
    box-shadow: var(--shadow-main);
    max-height: 90vh;
    overflow-y: auto;
}

.modal::backdrop {
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-header.pd-0 {
    margin-bottom: 16px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
}

.close-btn:hover {
    color: var(--text-main);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.editable-title,
.editable-balance {
    border-bottom: 1px dashed var(--text-muted);
    padding: 2px 4px;
}

.editable-title:focus,
.editable-balance:focus {
    outline: none;
    border-color: var(--accent);
    background-color: var(--bg-input);
}

.balance-edit-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background-color: var(--bg-main);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.balance-input-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 24px;
    font-weight: 700;
}

.currency-select {
    width: auto;
    font-size: 14px;
}

.card-inner {
    background-color: var(--bg-main);
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.transfer-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
}

.transfer-row {
    display: grid;
    grid-template-columns: 1fr 1.2fr auto;
    gap: 8px;
}

.quick-table-header {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

#quickTableCont {
    max-height: 160px;
    overflow-y: auto;
    background-color: var(--bg-main);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 8px;
}

.add-cat-row {
    display: flex;
    gap: 8px;
}

#category_list_container {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.category-name-input {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    width: 80%;
}

.category-name-input:focus {
    outline: none;
    color: var(--accent);
}

.cat-del-btn {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
}

.cat-del-btn:hover {
    color: var(--red);
}

/* ============================================================
   9. НАСТРОЙКИ
   ============================================================ */

.data-actions-btns {
    display: flex;
    gap: 8px;
}

.data-actions-btns .btn {
    min-width: auto;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
}

.settings-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-item .select-field {
    width: auto;
    min-width: 180px;
    max-width: 220px;
    flex-shrink: 0;
}

.settings-label {
    font-size: 14px;
    font-weight: 600;
}

.settings-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.editable-username {
    font-size: 16px;
    font-weight: 500;
    color: var(--accent);
    cursor: pointer;
}

.danger-zone {
    border-color: rgba(239, 68, 68, 0.3);
}

.text-danger {
    color: var(--red);
}

/* ============================================================
   10. ЛЕГЕНДА ГРАФИКОВ
   ============================================================ */

.custom-chart-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 6px;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.legend-item:hover {
    background-color: var(--bg-card-hover);
    border-color: var(--accent);
}

.legend-left {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
    font-weight: 500;
}

.legend-color-box {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-value {
    font-weight: 600;
    color: var(--text-main);
}

.legend-percent {
    color: var(--text-muted);
    font-size: 11px;
    background-color: var(--bg-main);
    padding: 2px 6px;
    border-radius: 4px;
}

.legend-item.hidden-segment {
    opacity: 0.3;
}

/* ✅ Исправлено: хардкод цветов заменён на переменные */
.currency-badge-static {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--bg-card-hover);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid var(--border);
    cursor: default;
    user-select: none;
}

/* ============================================================
   11. МИНИ-ТАБЛИЦА В ПОПАПЕ СЧЕТА
   ============================================================ */

.mini-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mini-history-table th {
    padding: 8px 12px;
    font-size: 11px;
}

.mini-history-table td {
    padding: 8px 12px;
    font-size: 13px;
}

.hidden-card {
    border: 1px solid #94a3b8;
}

.hidden-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #475569;
    color: #cbd5e1;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#quick_description {
    margin-bottom: 20px;
}

/* ============================================================
   14. МАССОВОЕ РЕДАКТИРОВАНИЕ (BULK ACTIONS)
   ============================================================ */

.toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background-color: var(--bg-side);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.bulk-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    margin-right: 4px;
}

.bulk-select {
    width: auto;
    min-width: 180px;
    max-width: 220px;
    flex-shrink: 0;
    font-size: 13px;
    padding: 8px 32px 8px 12px;
}

.btn-bulk-action {
    background-color: var(--bg-card-hover);
    color: var(--text-main);
    font-size: 13px;
    padding: 8px 14px;
    white-space: nowrap;
}

.btn-bulk-action:hover {
    background-color: #475569;
}

.btn-bulk-delete {
    background-color: rgba(239, 68, 68, 0.15);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-bulk-delete:hover {
    background-color: rgba(239, 68, 68, 0.25);
}

.btn-bulk-cancel {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-bulk-cancel:hover {
    color: var(--text-main);
    border-color: var(--text-muted);
}

/* Чекбокс-столбец в таблице */
.bulk-checkbox-cell {
    width: 40px !important;
    text-align: center;
    padding: 14px 8px !important;
}

.bulk-checkbox-cell input[type="checkbox"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Выделенная строка */
tr.bulk-selected td {
    background-color: rgba(0, 173, 181, 0.08) !important;
}

/* ================= UPGRADE MODAL ================= */
/* ═══════════════════════════════════════════
   UPGRADE MODAL
═══════════════════════════════════════════ */

#upgradeModal {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 600px;
    width: 92vw;
    overflow: visible;
}

#upgradeModal::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.upgrade-modal-content {
    background: #131c2e;
    border: 1px solid #1e2d45;
    border-radius: 20px;
    padding: 32px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

/* Крестик */
.upgrade-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #1e2d45;
    border: none;
    color: #64748b;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
}

.upgrade-close-btn:hover {
    background: #2d3f58;
    color: #e2e8f0;
}

/* Героя */
.upgrade-hero {
    text-align: center;
    padding: 0 32px;
}

.upgrade-hero-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.upgrade-hero-title {
    font-size: 22px;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 8px;
}

.upgrade-hero-sub {
    font-size: 14px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.upgrade-hero-sub b {
    color: #94a3b8;
}

/* Две колонки */
.upgrade-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Карточка плана */
.upgrade-plan-card {
    border-radius: 14px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upgrade-plan-free {
    background: #0f1520;
    border: 1px solid #1e2a3a;
}

.upgrade-plan-premium {
    background: linear-gradient(160deg, #1a2540, #0f1c35);
    border: 1px solid #2563eb55;
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.08);
}

.upgrade-plan-name {
    font-size: 14px;
    font-weight: 700;
    color: #94a3b8;
    padding-bottom: 10px;
    border-bottom: 1px solid #1e2a3a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.upgrade-plan-premium .upgrade-plan-name {
    color: #f59e0b;
    border-bottom-color: #2563eb33;
}

.upgrade-star {
    font-size: 15px;
}

/* Список фич */
.upgrade-plan-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.upgrade-plan-list li {
    font-size: 13px;
    padding-left: 20px;
    position: relative;
    line-height: 1.4;
}

.upgrade-plan-list li.has {
    color: #cbd5e1;
}

.upgrade-plan-list li.has::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #22c55e;
    font-weight: 700;
    font-size: 12px;
}

.upgrade-plan-list li.no {
    color: #334155;
}

.upgrade-plan-list li.no::before {
    content: '✕';
    position: absolute;
    left: 0;
    color: #334155;
    font-size: 11px;
}

.upgrade-plan-premium .upgrade-plan-list li.has {
    color: #e2e8f0;
}

/* Кнопки */
.upgrade-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 4px;
}

.btn-upgrade {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.btn-upgrade:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Мобилки */
@media (max-width: 480px) {
    .upgrade-columns {
        grid-template-columns: 1fr;
    }

    .upgrade-plan-free {
        display: none;
    }

    .upgrade-modal-content {
        padding: 24px 18px 20px;
    }
}

/* ================= SUBSCRIPTION STATUS ================= */

.sub-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 8px;
}

.sub-free {
    background: #252d3d;
    border: 1px solid #393e46;
}

.sub-premium {
    background: linear-gradient(135deg, #1a2a2a, #1e3a3a);
    border: 1px solid #00adb5;
}

.sub-badge {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
}

.sub-expiry {
    font-size: 12px;
    color: #94a3b8;
}

.sub-upgrade-btn {
    margin-left: auto;
    padding: 6px 14px;
    border-radius: 6px;
    border: none;
    background: linear-gradient(135deg, #00adb5, #0077b6);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.sub-upgrade-btn:hover {
    opacity: 0.85;
}

#upgradeModal {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 720px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;

    /* ← вот это центрирует */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;               /* ← убираем дефолтный margin: auto у dialog */
}

#upgradeModal::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.upgrade-modal-content {
    background: #131c2e;
    border: 1px solid #1e2d45;
    border-radius: 20px;
    padding: 32px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    min-width: 0;            /* ← добавь, фикс для grid внутри flex */
}

.upgrade-modal-icon {
    font-size: 48px;
}

.upgrade-modal-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.upgrade-modal-desc {
    color: #94a3b8;
    margin: 0;
}

.upgrade-modal-limits {
    width: 100%;
    background: #262d3a;
    border-radius: 10px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upgrade-limit-row {
    display: flex;
    justify-content: space-between;
    color: #cbd5e1;
    font-size: 14px;
}

.upgrade-modal-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    margin-top: 8px;
}

.upgrade-modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
}

@media (max-width: 480px) {
    #upgradeModal {
        width: 100vw;            /* ← на мобилке на всю ширину */
        max-height: 95vh;        /* ← чуть больше места */
        border-radius: 16px;
    }

    .upgrade-columns {
        grid-template-columns: 1fr;
    }

    .upgrade-plan-free {
        display: none;
    }

    .upgrade-modal-content {
        padding: 24px 18px 20px;
    }
}

/* ═══════════════════════════════════════════
   PROMO MODAL
═══════════════════════════════════════════ */

#promoPopup {
    background: transparent;
    border: none;
    padding: 0;
    max-width: 720px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

#promoPopup::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

@media (max-width: 480px) {
    #promoPopup {
        width: 100vw;
        max-height: 95vh;
        border-radius: 16px;
    }
}

.promo-modal-content {
    background: #131c2e;
    border: 1px solid #1e2d45;
    border-radius: 20px;
    padding: 32px 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
    min-width: 0;
}

/* Статус-карточка */
.promo-status-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 12px;
}

.promo-status-card.sub-free {
    background: #0f1520;
    border: 1px solid #1e2a3a;
}

.promo-status-card.sub-premium {
    background: linear-gradient(135deg, #0f1c1c, #0a1a2a);
    border: 1px solid #00adb555;
    box-shadow: 0 0 20px rgba(0, 173, 181, 0.06);
}

.promo-status-icon {
    font-size: 28px;
    flex-shrink: 0;
    line-height: 1;
}

.promo-status-name {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
}

.promo-status-hint {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

/* Сетка фич */
.promo-features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.promo-feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #0f1520;
    border: 1px solid #1e2a3a;
    border-radius: 10px;
    padding: 10px 12px;
}

.promo-feature-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.promo-feature-text {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.3;
}

/* Поле промокода */
.promo-input-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-code-input {
    width: 100%;
    padding: 12px 16px;
    background: #0f1520;
    border: 1px solid #1e2a3a;
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.promo-code-input::placeholder {
    color: #334155;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}

.promo-code-input:focus {
    border-color: #3b82f6;
}

/* Сообщения */
.promo-message {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 500;
}

.promo-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.promo-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* Мобилки */
@media (max-width: 480px) {
    #promoPopup {
        width: 100vw;
        max-height: 95vh;
        border-radius: 16px;
    }

    .promo-features-grid {
        grid-template-columns: 1fr;
    }

    .promo-modal-content {
        padding: 24px 18px 20px;
    }
}

/* ═══════════════════════════════════════════════════════════
   РАСШИРЕННАЯ ФИЛЬТРАЦИЯ
═══════════════════════════════════════════════════════════ */

/* ── Строка с кнопкой и тегами ───────────────────────────── */
.filter-meta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 8px;
}

/* ── Кнопка "Фильтры" ────────────────────────────────────── */
.advanced-filter-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.advanced-filter-btn:hover {
    color: var(--text-main);
    border-color: var(--accent);
}

.advanced-filter-btn.filter-btn-active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    font-weight: 600;
}

/* ── Теги активных фильтров ──────────────────────────────── */
.filter-tags-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(0, 173, 181, 0.12);
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.filter-tag-remove {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s;
    margin-left: 2px;
}

.filter-tag-remove:hover {
    opacity: 1;
}

.filter-tag-clear {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-tag-clear:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ── Панель фильтров ─────────────────────────────────────── */
.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    animation: filterPanelIn 0.2s ease;
}

@keyframes filterPanelIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Сетка полей ─────────────────────────────────────────── */
.filter-panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* Поиск растягивается на 2 колонки */
.filter-full-width {
    grid-column: span 2;
}

.filter-multiselect-group {
    grid-column: span 1;
}

/* ── form-group внутри панели ────────────────────────────── */
.filter-panel .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-panel .form-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Мультиселект ────────────────────────────────────────── */
.filter-multiselect {
    resize: vertical;
    min-height: 100px;
}

.filter-multiselect option {
    padding: 4px 8px;
}

.filter-multiselect option:checked {
    background: var(--accent);
    color: #ffffff;
}

/* ── Подсказка Ctrl+клик ─────────────────────────────────── */
.filter-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.7;
}

/* ── Кнопки панели ───────────────────────────────────────── */
.filter-panel-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ── Адаптив ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    
    .filter-full-width {
        grid-column: span 1;
    }

    .filter-panel-grid {
        grid-template-columns: 1fr;
    }

    .filter-multiselect-group {
        grid-column: span 1;
    }

    .filter-panel-actions {
        flex-direction: column;
    }

    .filter-panel-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Мобильная адаптация панели */
@media (max-width: 768px) {
    .toolbar-right {
        flex-direction: column;
        width: 100%;
    }

    .toolbar-right .btn {
        width: 100%;
    }

    .bulk-action-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .bulk-select {
        width: 100%;
        max-width: 100%;
        min-width: unset;
    }

    .btn-bulk-action {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ============================================================
   12. МЕДИА-ЗАПРОСЫ
   ============================================================ */

/* Планшеты (до 1024px) */
@media (max-width: 1024px) {
    #okno-main {
        grid-template-columns: 1fr;
    }

    .chatr-cont {
        flex-direction: column;
        align-items: center;
    }

    .custom-chart-legend {
        width: 100%;
        max-height: none;
    }
}

/* Смартфоны (до 768px) */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    }

    main {
        margin-left: 0;
        width: 100%;
        padding: 16px 12px;
    }

    .nav-menu {
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        height: calc(60px + env(safe-area-inset-bottom, 0px));
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-around;
        padding: 6px 8px env(safe-area-inset-bottom, 0px) 8px;
        border-right: none;
        border-top: 1px solid var(--border);
        background-color: var(--bg-side);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
        z-index: 1000;
    }

    .brand {
        display: none;
    }

    .nav-btns {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 0;
    }

    .nav-btn {
        flex-direction: column;
        gap: 3px;
        padding: 6px 4px;
        font-size: 10px;
        border-radius: var(--radius-sm);
        text-align: center;
        min-height: 48px;
        justify-content: center;
        flex: 1;
    }

    .nav-icon {
        width: 20px;
        height: 20px;
    }

    .nav-btn.nav-active {
        box-shadow: none;
        background-color: rgba(255, 255, 255, 0.05);
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-header .btn {
        width: 100%;
    }

    .filter-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .filter-group {
        display: flex;
        width: 100%;
        gap: 8px;
        overflow-x: visible;
    }

    .filter-group .btn,
    .filter-group .filter-btn,
    .filter-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        width: 100%;
        text-align: center;
        min-height: 46px;
        padding: 0 12px;
        box-sizing: border-box;
    }

    .filter-group .btn *,
    .filter-group .filter-btn *,
    .filter-btn * {
        margin: 0;
        padding: 0;
        line-height: normal;
    }

    .toolbar-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        width: 100%;
    }

    .stat-pill {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 14px 12px;
        min-height: 70px;
        border-radius: var(--radius-md);
    }

    .stat-pill span {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        font-weight: 500;
    }

    .stat-pill strong {
        font-size: 20px;
        font-weight: 700;
        line-height: 1.2;
    }

    #total_balance {
        font-size: 26px;
    }

    .summary-stats {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-evenly;
        padding: 12px 0;
        width: 100%;
    }

    .stat-box {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        flex: 1;
    }

    .stat-label {
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-muted);
        letter-spacing: 0.05em;
    }

    .stat-value {
        font-size: 16px;
        font-weight: 700;
        word-break: break-all;
        text-align: center;
    }

    .stat-divider {
        display: block;
        width: 1px;
        height: 36px;
        background-color: var(--border);
        flex-shrink: 0;
    }

    .accounts-grid {
        grid-template-columns: 1fr;
    }

    .table-card {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: var(--radius-md);
    }

    table {
        min-width: 580px;
    }

    th,
    td {
        padding: 14px 16px;
        font-size: 14px;
    }

    .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .settings-item .select-field,
    .settings-item .btn {
        width: 100%;
        max-width: 100%;
    }

    .modal {
        width: calc(100% - 24px);
        max-height: 85vh;
        overflow-y: auto;
        padding: 18px 14px;
        border-radius: var(--radius-md);
    }

    .form-row,
    .transfer-row {
        grid-template-columns: 1fr;
    }

    .modal-actions {
        grid-template-columns: 1fr;
    }

    .data-actions-btns {
        flex-direction: column;
    }

    .data-actions-btns .btn {
        width: 100%;
        max-width: 100%;
    }

    .chatr-cont {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .canvas-container {
        width: 180px;
        height: 180px;
    }

    .custom-chart-legend {
        width: 100%;
        max-height: none;
    }

    .btn-secondary,
    .btn-danger {
        min-width: auto;
        max-width: 100%;
    }
}