/* main.css - Rapira / Trade-core */

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

html, body {
    height: 100%;
}

:root {
    --rp-bg: #0d0f12;
    --rp-panel: #15181d;
    --rp-panel-2: #1b1f26;
    --rp-line: rgba(255, 255, 255, 0.07);
    --rp-text: #eef0f3;
    --rp-muted: #7c838f;
    --rp-accent: #ff7a3d;
    --rp-accent-2: #ffb387;
    --rp-mint: #46e0b0;
    --rp-danger: #ff5c72;
}

body {
    background: var(--rp-bg);
    color: var(--rp-text);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    line-height: 1.5;
    overflow: hidden;
    letter-spacing: -0.1px;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 122, 61, 0.35);
    border-radius: 50px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 122, 61, 0.6); }

/* ===== GLASS ===== */
.glass {
    background: var(--rp-panel);
    border: 1px solid var(--rp-line);
    border-radius: 16px;
}

/* ===== TEXT ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--rp-accent), var(--rp-accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

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

/* ===== LINKS ===== */
a { color: var(--rp-accent); text-decoration: none; }
a:hover { color: var(--rp-accent-2); }

/* ===== BUTTONS ===== */
.btn-primary {
    height: 52px;
    padding: 10px 24px;
    background: var(--rp-accent);
    border: none;
    border-radius: 12px;
    color: #14100c;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    letter-spacing: 0.1px;
}

.btn-primary:hover { background: var(--rp-accent-2); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    height: 52px;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--rp-line);
    border-radius: 12px;
    color: var(--rp-text);
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-secondary:hover { background: rgba(255, 122, 61, 0.08); border-color: var(--rp-accent); }

.btn-sm { height: 34px; padding: 6px 16px; font-size: 12px; }
.btn-xs { height: 28px; padding: 4px 12px; font-size: 10px; }

/* ===== INPUTS ===== */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    background: var(--rp-panel-2);
    border: 1px solid var(--rp-line);
    border-radius: 12px;
    color: var(--rp-text);
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--rp-accent);
    box-shadow: 0 0 0 3px rgba(255, 122, 61, 0.15);
}

input::placeholder, textarea::placeholder { color: var(--rp-muted); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.5; cursor: not-allowed; }

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237c838f' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
    cursor: pointer;
}

select option { background: var(--rp-panel-2); color: var(--rp-text); }
select optgroup { color: var(--rp-muted); }

textarea { height: auto; min-height: 100px; padding: 16px; resize: vertical; }

/* ===== CHECKBOX ===== */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--rp-panel-2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

input[type="checkbox"]:checked { background: var(--rp-accent); border-color: var(--rp-accent); }

input[type="checkbox"]:checked::after {
    content: "✓";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #14100c;
    font-size: 11px;
    font-weight: 800;
}

input[type="checkbox"]:hover { border-color: var(--rp-accent); }

/* ===== TUMBLER ===== */
.online-switch {
    width: 44px;
    height: 24px;
    padding: 2px;
    background: #23272f;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    transition: background 0.22s ease, border-color 0.22s ease;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    font-size: 0;
    color: transparent;
}

.online-switch::after {
    content: "";
    width: 18px;
    height: 18px;
    background: #4a4f5a;
    border-radius: 6px;
    transition: transform 0.22s cubic-bezier(.4,1.4,.6,1), background 0.22s ease;
    display: block;
}

.online-switch[data-online="1"] {
    background: rgba(70, 224, 176, 0.15);
    border-color: rgba(70, 224, 176, 0.4);
}

.online-switch[data-online="1"]::after {
    transform: translateX(20px);
    background: var(--rp-mint);
    box-shadow: 0 0 10px rgba(70, 224, 176, 0.5);
}

.online-switch.custom-switch::after { display: none; }

.online-switch.custom-switch {
    width: 40px;
    height: 22px;
    border-radius: 7px;
}

.online-switch.custom-switch div {
    width: 16px;
    height: 16px;
    background: #4a4f5a;
    border-radius: 5px;
    transition: transform 0.22s ease, background 0.22s ease;
}

.online-switch.custom-switch[data-online="0"] div { transform: translateX(0); }
.online-switch.custom-switch[data-online="1"] div { transform: translateX(18px); background: var(--rp-mint); }

.switch-dot { display: none; }

/* ===== HEADER ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 62px;
    padding: 0 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    background: rgba(13, 15, 18, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--rp-line);
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none !important; }
.logo-text { font-size: 19px; font-weight: 800; color: var(--rp-text); letter-spacing: -0.6px; }
.logo-text .accent { color: var(--rp-accent); }

.logo-symbol {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    background: linear-gradient(140deg, var(--rp-accent), #ff5c1a);
    color: #14100c;
    font-size: 16px;
    font-weight: 900;
    box-shadow: 0 4px 18px rgba(255, 122, 61, 0.4);
}

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

.rate-pill {
    padding: 7px 12px;
    border: 1px solid rgba(255, 122, 61, 0.3);
    border-radius: 10px;
    background: rgba(255, 122, 61, 0.08);
    color: var(--rp-accent-2);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.header-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    border-left: 1px solid var(--rp-line);
    padding-left: 20px;
}

.header-balance p {
    font-family: 'JetBrains Mono', monospace;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    margin: 0;
    letter-spacing: -0.5px;
}

.header-balance p span { font-size: 13px; color: var(--rp-muted); }
.header-balance > span { font-size: 10px; color: var(--rp-muted); letter-spacing: 0.1px; }

.header-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1.5px solid var(--rp-line);
    object-fit: cover;
    flex-shrink: 0;
}

.header-email { font-size: 12px; color: var(--rp-muted); max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.profile-menu-wrap { position: relative; }
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 9px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.profile-trigger:hover, .profile-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--rp-line);
}
.profile-chevron { color: var(--rp-muted); }

.profile-dropdown {
    display: none;
    position: absolute;
    z-index: 1000;
    right: 0;
    top: calc(100% + 10px);
    width: 220px;
    padding: 7px;
    border: 1px solid var(--rp-line);
    border-radius: 14px;
    background: var(--rp-panel-2);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.profile-dropdown.open { display: flex; flex-direction: column; }

.profile-dropdown a,
.profile-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--rp-text);
    text-decoration: none;
    text-align: left;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    appearance: none;
}
.profile-dropdown a:hover, .profile-dropdown button:hover { background: rgba(255, 255, 255, 0.05); }
.profile-dropdown #profileLogout { color: var(--rp-danger); }

/* ===== SWITCH WRAPPER ===== */
.switch-wrapper { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.switch-label { font-size: 11px; color: var(--rp-muted); font-weight: 600; white-space: nowrap; letter-spacing: 0.1px; }
.switch-state { font-size: 10px; color: var(--rp-muted); }

/* ===== SIDEBAR ===== */
.app-sidebar {
    position: fixed;
    top: 62px;
    left: 0;
    width: 208px;
    height: calc(100% - 62px);
    padding: 28px 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 26px;
    background: var(--rp-panel);
    border-right: 1px solid var(--rp-line);
    overflow-y: auto;
}

.app-sidebar ul { list-style: none; }

.app-sidebar a,
.app-sidebar .nav-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #c3c7cf;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s ease, color 0.18s ease;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    font-family: 'Manrope', sans-serif;
}

.app-sidebar a:hover,
.app-sidebar .nav-toggle:hover {
    background: rgba(255, 122, 61, 0.08);
    color: var(--rp-accent-2);
}

.app-sidebar a.active,
.app-sidebar .nav-toggle.active,
.app-sidebar li.active > a,
.app-sidebar li.active > button {
    background: rgba(255, 122, 61, 0.12);
    color: var(--rp-accent);
}

.app-sidebar svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--rp-muted);
    transition: color 0.18s ease;
}

.app-sidebar a:hover svg,
.app-sidebar a.active svg,
.app-sidebar li.active > a svg { color: var(--rp-accent); }

.nav-group { display: flex; flex-direction: column; gap: 16px; }

.nav-group-title {
    font-size: 10px;
    color: #5c626d;
    font-weight: 700;
    padding-left: 12px;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.nav-group ul { display: flex; flex-direction: column; gap: 2px; }
.nav-main { margin-bottom: 4px; }
.nav-main li a { font-weight: 700; }

.nav-dot {
    display: inline-grid;
    place-items: center;
    width: 19px;
    height: 19px;
    margin-right: 4px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--rp-accent-2);
    font-size: 12px;
}
.incoming-dot:after { content: '↓'; }
.outgoing-dot:after { content: '↑'; }
.help-dot { font-weight: 700; }

.nav-bottom { margin-top: auto; border-top: 1px solid var(--rp-line); padding-top: 18px; }
.nav-bottom ul { display: flex; flex-direction: column; gap: 2px; }

.submenu {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    padding-left: 28px;
}
.submenu.open { max-height: 200px; opacity: 1; }
.submenu li a { padding: 6px 12px; font-size: 11px; color: var(--rp-muted); }
.submenu li a:hover { color: var(--rp-accent); background: rgba(255, 122, 61, 0.06); }
.submenu li.active a { color: var(--rp-accent); }

.arrow-icon { margin-left: auto; transition: transform 0.3s ease; font-size: 10px; color: var(--rp-muted); }
.arrow-icon.rotated { transform: rotate(90deg); }

/* ===== PAGE LAYOUT ===== */
.page-layout { display: flex; padding-top: 62px; }

.main-content {
    flex: 1;
    margin-left: 208px;
    padding: 30px 24px 24px;
    min-height: calc(100vh - 62px);
    overflow-y: auto;
    height: calc(100vh - 62px);
}

.main-content h2 {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 24px;
    color: var(--rp-text);
    letter-spacing: -1px;
}

/* ===== MOBILE MENU TOGGLE ===== */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 18px;
    left: 16px;
    z-index: 101;
    width: 30px;
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--rp-accent);
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.mobile-menu-toggle.active span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 98; }

/* ===== TOAST / NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    left: auto;
    bottom: auto;
    inset: 24px 24px auto auto;

    display: inline-flex;
    align-items: center;
    gap: 8px;

    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    max-width: min(420px, calc(100vw - 48px));
    box-sizing: border-box;

    padding: 12px 18px;
    border-radius: 12px;
    background: var(--rp-panel);
    color: var(--rp-text);
    border: 1px solid var(--rp-line);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);

    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.1px;

    z-index: 9999;
    pointer-events: none;
    overflow: hidden;
    animation: slideInRight 0.3s ease;
}

/* цвета по типу */
.notification.success {
    background: #14342a;
    color: var(--rp-mint);
    border-color: rgba(70, 224, 176, 0.3);
}
.notification.error {
    background: #3a1a20;
    color: var(--rp-danger);
    border-color: rgba(255, 92, 114, 0.35);
}
.notification.info {
    background: #2b2118;
    color: var(--rp-accent-2);
    border-color: rgba(255, 122, 61, 0.3);
}
.notification.warning {
    background: #3a3210;
    color: #ffd66b;
    border-color: rgba(255, 214, 107, 0.3);
}

/* стек: если несколько подряд — ставим друг под другом */
.notification + .notification {
    margin-top: 10px;
}

/* анимации */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}
.notification.removing {
    animation: slideOutRight 0.3s ease forwards;
}

/* адаптив: на мобилке — по центру сверху, почти на всю ширину */
@media (max-width: 560px) {
    .notification {
        top: 12px;
        right: 12px;
        left: 12px;
        inset: 12px 12px auto 12px;
        max-width: none;
        width: auto;
    }
}

/* Принудительно компактный тоаст — перебивает любые height/inset */
body > .notification {
    position: fixed !important;
    top: 24px !important;
    right: 24px !important;
    left: auto !important;
    bottom: auto !important;
    inset: 24px 24px auto auto !important;

    display: inline-flex !important;
    align-self: flex-start !important;
    align-items: center !important;

    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    width: auto !important;
    max-width: min(420px, calc(100vw - 48px)) !important;

    box-sizing: border-box !important;
    padding: 12px 18px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    z-index: 99999 !important;
    pointer-events: none !important;
}
/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.modal-overlay.active, .modal-overlay[style*="display: flex"], .modal-overlay[style*="display:flex"] { display: flex !important; }

.modal {
    max-width: 520px;
    width: 100%;
    padding: 28px 30px 30px;
    background: var(--rp-panel-2);
    border: 1px solid var(--rp-line);
    border-radius: 16px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { color: var(--rp-text); font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -0.4px; }

.modal-close {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rp-line);
    border-radius: 10px;
    color: var(--rp-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Manrope', sans-serif;
}
.modal-close:hover { border-color: var(--rp-danger); color: var(--rp-danger); }

.modal-body { margin-bottom: 20px; }
.modal-body .form-group { margin-bottom: 16px; }
.modal-body .form-group:last-child { margin-bottom: 0; }
.modal-body .form-group label { display: block; color: var(--rp-muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
    width: 100%;
    padding: 11px 14px;
    background: var(--rp-panel);
    border: 1px solid var(--rp-line);
    border-radius: 10px;
    color: var(--rp-text);
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.modal-body .form-group input:focus,
.modal-body .form-group select:focus,
.modal-body .form-group textarea:focus {
    border-color: var(--rp-accent);
    box-shadow: 0 0 0 3px rgba(255, 122, 61, 0.12);
}

.modal-actions { display: flex; gap: 12px; margin-top: 20px; border-top: 1px solid var(--rp-line); padding-top: 20px; }
.modal-actions button {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    transition: all 0.2s ease;
}
.modal-confirm { background: var(--rp-accent); border: none; color: #14100c; }
.modal-confirm:hover { background: var(--rp-accent-2); transform: translateY(-1px); }
.modal-confirm:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.modal-cancel { background: transparent; border: 1px solid var(--rp-line); color: var(--rp-text); }
.modal-cancel:hover { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.2); }

/* ===== LIGHT THEME ===== */
.light-theme {
    --rp-bg: #f4f2ef;
    --rp-panel: #ffffff;
    --rp-panel-2: #f8f6f3;
    --rp-line: rgba(30, 25, 20, 0.1);
    --rp-text: #1a1712;
    --rp-muted: #807a72;
    background: var(--rp-bg);
    color: var(--rp-text);
}
.light-theme .app-header { background: rgba(255, 255, 255, 0.92); }
.light-theme .app-sidebar { background: #ffffff; }
.light-theme .stat-card,
.light-theme .chart-card { background: #ffffff; }
.light-theme .stat-card.featured { background: linear-gradient(145deg, #fff, #fff4ec); }
.light-theme .stat-value,
.light-theme .summary-row strong { color: #1a1712; }
.light-theme .summary-name { color: #5c5650; }
.light-theme .profile-dropdown { background: #ffffff; box-shadow: 0 18px 50px rgba(40, 35, 30, 0.15); }
.light-theme .profile-dropdown a,
.light-theme .profile-dropdown button { color: #2a2620; }
.light-theme .header-email,
.light-theme .switch-label { color: #6d6862; }
.light-theme .header-balance p { color: #1a1712; }
.light-theme .period-custom input[type=date] { background: #ffffff; color: #1a1712; }
.light-theme .period-filters { background: #f1ede8; }
.light-theme .online-switch { background: #ece8e3; }
.light-theme .online-switch::after { background: #c9c3bb; }
.light-theme .online-switch[data-online="1"] { background: rgba(70, 224, 176, 0.25); }

/* =================================================================== */
/* ===== SHARED PAGE COMPONENTS (heading, period, sections, stats) === */
/* =================================================================== */

/* ===== HEADING ===== */
.dashboard-page {
    padding: 27px 28px 36px;
    min-width: 0;
}

.dashboard-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 22px;
    margin: 0 0 26px;
}

.dashboard-heading h1 {
    margin: 4px 0 5px;
    font-size: 30px;
    letter-spacing: -1.2px;
    font-weight: 800;
    color: var(--rp-text);
}

.eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    font-weight: 800;
    color: var(--rp-accent);
    text-transform: uppercase;
}

.dashboard-subtitle,
.section-heading p,
.chart-header p {
    margin: 0;
    color: var(--rp-muted);
    font-size: 12px;
    font-weight: 500;
}

/* ===== PERIOD TOOLBAR ===== */
.period-toolbar {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 9px;
}

.period-filters {
    display: flex;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--rp-line);
    border-radius: 12px;
    background: var(--rp-panel);
}

.period-filters button {
    padding: 8px 13px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--rp-muted);
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.period-filters button.active {
    color: #14100c;
    background: var(--rp-accent);
}

.period-filters button:hover:not(.active) {
    color: var(--rp-text);
    background: rgba(255, 255, 255, 0.05);
}

.period-custom { display: flex; gap: 8px; align-items: center; }
.period-custom input[type="date"] {
    padding: 9px 10px;
    background: var(--rp-panel-2);
    border: 1px solid var(--rp-line);
    border-radius: 10px;
    color: var(--rp-text);
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    height: auto;
    width: auto;
    outline: none;
}
.period-custom input[type="date"]:focus { border-color: var(--rp-accent); }
.period-dash { opacity: 0.5; color: var(--rp-muted); }

.period-custom .apply-period {
    padding: 9px 14px;
    background: var(--rp-accent);
    border: none;
    border-radius: 10px;
    color: #14100c;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.18s ease;
}
.period-custom .apply-period:hover { background: var(--rp-accent-2); }

/* ===== SECTIONS ===== */
.overview-section { margin-bottom: 24px; }

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 12px;
}

.section-heading h2,
.chart-header h2 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--rp-text);
}

.section-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--rp-line);
    border-radius: 11px;
    font-size: 17px;
    font-weight: 700;
}
.section-mark.incoming { color: var(--rp-mint); background: rgba(70, 224, 176, 0.08); }
.section-mark.outgoing { color: var(--rp-accent); background: rgba(255, 122, 61, 0.08); }

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 11px;
    margin: 0;
}

.stat-card {
    min-width: 0;
    padding: 17px 15px 14px;
    background: var(--rp-panel);
    border: 1px solid var(--rp-line);
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 122, 61, 0.35);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.25);
}

.stat-card.featured {
    background: linear-gradient(145deg, var(--rp-panel), #1e1610);
    border-color: rgba(255, 122, 61, 0.25);
}

.stat-label {
    font-size: 10px;
    line-height: 1.4;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: var(--rp-muted);
    text-transform: uppercase;
}

.stat-number-row { display: flex; align-items: baseline; gap: 5px; }

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.8px;
    color: var(--rp-text);
    overflow-wrap: anywhere;
}

.stat-unit { font-size: 11px; color: var(--rp-muted); font-weight: 600; }

.stat-card .stat-sub {
    font-size: 10px;
    color: var(--rp-mint);
    margin-top: 2px;
    font-weight: 600;
}

/* ===== BADGES (общие статус-бейджи) ===== */
.badge,
.order-status,
.order-status-badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: nowrap;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.04);
    color: var(--rp-muted);
}

/* точка-индикатор слева */
.badge::before,
.order-status::before,
.order-status-badge::before,
.status-badge::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: 0.9;
}

/* ===== Оттенки (приглушённые, «сложные») ===== */

/* успех — шалфей / мята-олива */
.badge.green,
.order-status.green,
.order-status-badge.green,
.status-badge.green {
    background: rgba(122, 191, 160, 0.10);
    border-color: rgba(122, 191, 160, 0.28);
    color: #8fd0b3;
}

/* ошибка/отмена — терракота / пыльная роза */
.badge.red,
.order-status.red,
.order-status-badge.red,
.status-badge.red {
    background: rgba(214, 122, 122, 0.10);
    border-color: rgba(214, 122, 122, 0.28);
    color: #e29a9a;
}

/* в процессе / ожидание — янтарь / латунь */
.badge.yellow,
.order-status.yellow,
.order-status-badge.yellow,
.status-badge.yellow {
    background: rgba(214, 178, 106, 0.10);
    border-color: rgba(214, 178, 106, 0.28);
    color: #e0c07a;
}

/* чек прикреплён / инфо — индиго / пыльный синий */
.badge.blue,
.order-status.blue,
.order-status-badge.blue,
.status-badge.blue {
    background: rgba(133, 156, 214, 0.10);
    border-color: rgba(133, 156, 214, 0.28);
    color: #a3b6e0;
}

/* арбитраж — слива / приглушённый фиолет */
.badge.purple,
.order-status.purple,
.order-status-badge.purple,
.status-badge.purple {
    background: rgba(178, 132, 196, 0.10);
    border-color: rgba(178, 132, 196, 0.28);
    color: #c6a3d6;
}

/* нейтральный (без статуса) */
.badge.neutral,
.order-status.neutral,
.order-status-badge.neutral,
.status-badge.neutral {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--rp-line);
    color: var(--rp-muted);
}

/* ===== RESPONSIVE (общий каркас + структура приложения) ===== */
@media (max-width: 1250px) {
    .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .dashboard-heading { align-items: flex-start; flex-direction: column; }
    .period-toolbar { align-items: flex-start; width: 100%; }
    .period-filters { max-width: 100%; overflow-x: auto; }
    .dashboard-page { padding: 22px 16px; }
}

@media (max-width: 768px) {
    .app-header { padding: 0 14px; height: 58px; }
    .app-sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        padding: 70px 18px 20px;
        z-index: 99;
        transition: left 0.3s ease;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
    }
    .app-sidebar.open { left: 0; }
    .mobile-menu-toggle { display: flex; }
    .mobile-overlay.show { display: block; }
    .main-content { margin-left: 0; padding: 78px 14px 90px; height: calc(100vh - 58px); }
    .main-content h2 { font-size: 22px; margin-bottom: 10px; }
    .header-actions { gap: 8px; }
    .header-balance p { font-size: 15px; }
    .header-balance p span { font-size: 11px; }
    .header-balance span { font-size: 9px; }
    .lang-select-btn span, .header-email, .header-avatar { display: none; }
    .logo-text { font-size: 16px; }
    .switch-label, .switch-state { display: none; }
    .rate-pill { font-size: 10px; padding: 5px 9px; }
}

@media (max-width: 560px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .stat-card { padding: 14px 12px; }
    .stat-value { font-size: 19px; }
    .dashboard-heading h1 { font-size: 25px; }
    .period-filters button { padding: 7px 10px; }
}

@media (max-width: 480px) {
    .app-header { padding: 0 10px; }
    .header-balance { padding-left: 8px; }
    .rate-pill { display: none; }
}