/* style.css — DEEP OCEAN THEME (Global & Fixed Mail & Badges) */

:root {
    --bg-body: #0f172a;       
    --bg-sidebar: #1e293b;    
    --bg-header: #1e293b;     
    --bg-hover: #334155;      
    --bg-active: #1e293b;     
    --bg-chat-pattern: #0f172a; 
    --bg-msg-in: #334155;     
    --bg-msg-out: #0284c7;    
    --text-primary: #f1f5f9;  
    --text-secondary: #94a3b8; 
    --text-muted: #64748b;    
    --accent-blue: #38bdf8;   
    --accent-hover: #0ea5e9;  
    --border-light: #334155;  
    --border-color: #334155;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --input-bg: #020617;      
    --input-border: #475569;
    --layout-left-min: 220px;
    --layout-center-min: 460px;
    --layout-right-min: 220px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    height: 100vh;
    display: grid;
    grid-template-columns:
        minmax(var(--layout-left-min), 25%)
        minmax(var(--layout-center-min), 50%)
        minmax(var(--layout-right-min), 25%);
    grid-template-rows: 60px 1fr;
    width: 100vw;
    max-width: 100vw;
    overflow: hidden;
}

* { box-sizing: border-box; }

.heart-loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 18px;
    vertical-align: middle;
}

.heart-loader span {
    width: 8px;
    height: 8px;
    display: block;
    position: relative;
    background: #f472b6;
    transform: rotate(45deg) scale(0.82);
    border-radius: 2px;
    animation: heartLoaderBeat 0.86s infinite ease-in-out;
    box-shadow: 0 0 8px rgba(244, 114, 182, 0.38);
}

.heart-loader span::before,
.heart-loader span::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 8px;
    background: inherit;
    border-radius: 50%;
}

.heart-loader span::before { left: -4px; top: 0; }
.heart-loader span::after { left: 0; top: -4px; }
.heart-loader span:nth-child(2) { animation-delay: 0.12s; background: #fb7185; }
.heart-loader span:nth-child(3) { animation-delay: 0.24s; background: #f9a8d4; }

@keyframes heartLoaderBeat {
    0%, 80%, 100% { opacity: 0.48; transform: rotate(45deg) scale(0.72) translateY(0); }
    40% { opacity: 1; transform: rotate(45deg) scale(1) translateY(-2px); }
}

body > #toast-container {
    position: fixed;
    top: 128px !important;
    right: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 9000 !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 32px));
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(30, 41, 59, 0.96);
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.45);
    color: var(--text-primary);
    animation: toastIn 0.18s ease-out;
}

.app-toast.danger .app-toast-icon {
    color: #f87171;
}

.app-toast.success {
    border-color: rgba(34, 197, 94, 0.32);
}

.app-toast.success .app-toast-icon {
    color: #4ade80;
}

.app-toast-icon {
    width: 18px;
    flex: 0 0 18px;
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

.app-toast-body {
    flex: 1 1 auto;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-primary);
}

.app-toast-close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}

.app-toast.hide {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- GLOBAL HEADER --- */
header {
    grid-column: 1 / -1;
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; z-index: 50; box-shadow: 0 1px 5px rgba(0,0,0,0.2);
}

.header-brand-wrap {
    display: flex;
    align-items: center;
    min-width: 0;
}

.header-brand-wordmark {
    color: var(--text-primary);
    font-family: "Orbitron", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    transform: skewX(-7deg);
    text-shadow: 0 0 18px rgba(56, 189, 248, 0.22);
    white-space: nowrap;
}

/* --- COLUMNS --- */
.col {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex; flex-direction: column;
    height: 100%; overflow: hidden; position: relative; min-width: 0;
}
.col-chat { min-width: 0; }
.col-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px; font-size: 11px; color: var(--text-secondary);
    font-weight: 800; text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid var(--border-light); background: var(--bg-sidebar);
    flex-shrink: 0; z-index: 5;
}
.col-right { border-left: 1px solid var(--border-light); border-right: none; background-color: var(--bg-body); }

@media (max-width: 1480px) {
    body {
        grid-template-columns:
            minmax(210px, 24%)
            minmax(430px, 52%)
            minmax(210px, 24%);
    }
}

@media (max-width: 1280px) {
    body {
        grid-template-columns:
            minmax(190px, 23%)
            minmax(380px, 54%)
            minmax(190px, 23%);
    }
}

/* CONTROLS */
.header-center-controls {
    position: absolute; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; gap: 15px;
    min-width: 0; max-width: min(56vw, 760px);
}
.session-problem-indicator {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.34);
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: help;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.45);
    animation: sessionProblemPulse 1.35s infinite;
}
.page-reload-indicator {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.38);
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    cursor: help;
    box-shadow: 0 0 0 rgba(239, 68, 68, 0.4);
    animation: pageReloadPulse 1s infinite;
}
@keyframes pageReloadPulse {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { transform: scale(1.08); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}
@keyframes sessionProblemPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.btn-work {
    padding: 8px 30px; border-radius: 8px; /* <--- Заменили на 8px */
    border: none; font-weight: 800; font-size: 13px;
    cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2); letter-spacing: 1px;
    flex: 0 0 auto; white-space: nowrap;
}
.btn-work.start { background: #22c55e; color: #000; }
.btn-work.start:hover { background: #16a34a; }
.btn-work.stop { background: #ef4444; color: #fff; animation: pulseRed 2s infinite; }

.stats-trigger {
    background: #1e293b; padding: 6px 14px; border-radius: 8px;
    border: 1px solid #334155;
    cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: #94a3b8;
    flex: 0 0 auto; white-space: nowrap;
    transition: 0.2s;
}
.stats-trigger:hover {
    background: #243244;
    border-color: #475569;
}
.header-balance { color: #22c55e; font-size: 14px; }







/* =========================================================================
   STATISTICS & CALENDAR POPUP (ELEGANT & WIDE)
   ========================================================================= */
.stats-popup {
    position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
    width: 780px;
    background: #1e293b;
    border: 1px solid #334155; border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7);
    display: none; flex-direction: column; overflow: hidden;
    z-index: 2500;
}
.stats-popup.show { display: flex; animation: slideDownSmooth 0.2s ease-out forwards; }

.stats-header { 
    padding: 16px 24px; background: #0f172a; color: #f1f5f9;
    display: flex; justify-content: space-between; align-items: center; 
    border-bottom: 1px solid #334155;
}
.stats-heading { display: flex; align-items: center; }
.sh-title { font-size: 13px; font-weight: 800; letter-spacing: 1.1px; display: flex; align-items: center; gap: 8px; color: #cbd5e1; }
.sh-title i { color: #38bdf8; font-size: 14px; }
.stats-header .close-btn { cursor: pointer; color: #64748b; font-size: 18px; transition: 0.2s; }
.stats-header .close-btn:hover { color: #ef4444; }

.calendar-wrapper { padding: 16px 20px 18px; background: #1e293b; }

.stats-overview {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 14px;
}

.stats-kpi {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.stats-kpi-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: #94a3b8;
}

.stats-kpi-value {
    font-size: 26px;
    line-height: 1;
    font-weight: 800;
    color: #22c55e;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.calendar-controls { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 20px; }

.year-selector { 
    display: flex; align-items: center; gap: 15px; 
    font-weight: 800; color: #f1f5f9; font-size: 18px; 
    background: #0f172a; padding: 6px 16px; border-radius: 8px; border: 1px solid #334155;
}
.year-selector i { cursor: pointer; color: #94a3b8; transition: 0.2s; font-size: 14px; }
.year-selector i:hover { color: #38bdf8; }

.month-strip { 
    display: flex; gap: 4px; flex: 1; 
    background: #0f172a; padding: 4px; border-radius: 8px; border: 1px solid #334155;
}
.month-item {
    cursor: pointer; font-size: 11px; font-weight: 700; color: #64748b;
    padding: 8px 0; border-radius: 6px; transition: all 0.2s ease; flex: 1; text-align: center;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.month-item:hover { color: #e2e8f0; background: #334155; }
.month-item.active { color: #fff; background: #0284c7; box-shadow: none; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }

.cal-day {
    background: #0f172a; border-radius: 8px; border: 1px solid #334155;
    min-height: 64px;
    display: flex; flex-direction: column; padding: 8px;
    transition: 0.2s; justify-content: space-between;
}
.cal-day:hover { background: #131c2e; border-color: #475569; transform: translateY(-1px); }
.cd-num { font-size: 12px; font-weight: 800; color: #64748b; align-self: flex-start; line-height: 1; }

.cd-income-wrap {
    display: flex;
    align-items: flex-end;
    margin-top: auto;
}

.cd-income-val {
    font-size: 15px;
    font-weight: 800;
    color: #22c55e;
    line-height: 1.1;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.cal-day.has-money {
    background: rgba(34, 197, 94, 0.03);
    border-color: rgba(34, 197, 94, 0.22);
}
.cal-day.has-money .cd-income-val { color: #22c55e; }
.cal-day.has-money .cd-num { color: #94a3b8; }

.stats-footer {
    background: #0f172a; border-top: 1px solid #334155;
    padding: 8px 24px;
}
.stats-footer-spacer { height: 1px; }



/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: #475569; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* PHOTO PREVIEW BTN */
.attach-item { position: relative !important; overflow: hidden; }
.gallery-preview-btn-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 8px 0;
    background: rgba(15, 23, 42, 0.85); color: #cbd5e1;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 10px; font-weight: 800; text-transform: uppercase; text-align: center; letter-spacing: 1px;
    cursor: pointer; z-index: 10;
    transform: translateY(100%); transition: transform 0.2s ease-in-out;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.attach-item:hover .gallery-preview-btn-overlay { transform: translateY(0); }
.gallery-preview-btn-overlay:hover { background: var(--accent-blue); color: #fff; }


/* =========================================================================
   FIXED MAIL MODAL STYLES (Z-INDEX 1200 + COMPACT TEXT + BADGES)
   ========================================================================= */

/* 1. СЛОЙ-ПОДЛОЖКА (Z-INDEX 1200) */
#mail-layer {
    position: fixed !important;
    top: 0 !important; left: 0 !important;
    width: 100vw !important; height: 100vh !important;
    background: rgba(0,0,0,0.85) !important;
    display: none;
    align-items: center; justify-content: center;
    z-index: 1200 !important; /* <--- Меньше, чем у галереи */
    backdrop-filter: blur(5px);
}
#mail-layer.show { display: flex !important; }

/* 2. САМО ОКНО */
.modal-mail-wide {
    width: 1100px !important;
    height: 85vh !important; max-height: 800px; min-height: 500px; max-width: 95vw;
    display: flex; flex-direction: column;
    background: var(--bg-sidebar);
    border-radius: 12px; border: 1px solid var(--border-light);
    box-shadow: 0 30px 80px rgba(0,0,0,0.8);
    overflow: hidden;
}

.modal-mail-wide .post-header { flex-shrink: 0; height: 50px; }

/* 3. СЕТКА */
.mail-grid-layout {
    display: grid; grid-template-columns: 1.3fr 1fr;
    flex: 1; overflow: hidden; height: calc(100% - 50px);
}

/* ЛЕВАЯ КОЛОНКА */
.mail-col-history {
    border-right: 1px solid var(--border-light); background: #0f172a;
    display: flex; flex-direction: column; height: 100%; overflow: hidden; min-width: 0;
}
.mail-history-scroll {
    flex: 1; overflow-y: auto; padding: 15px;
    display: flex; flex-direction: column; gap: 15px; min-height: 0;
}
.mail-pagination-bar {
    height: 50px; flex-shrink: 0; border-top: 1px solid var(--border-light);
    display: flex; align-items: center; justify-content: center; gap: 15px; background: var(--bg-sidebar); z-index: 5;
}

/* ПРАВАЯ КОЛОНКА */
.mail-col-form {
    display: flex; flex-direction: column; padding: 20px; background: var(--bg-sidebar); height: 100%; overflow-y: auto;
}
#mail-body { flex: 1; min-height: 150px; max-height: 400px; margin-bottom: 15px; }

/* КНОПКИ ПАГИНАЦИИ */
.page-btn {
    background: var(--bg-hover); border: 1px solid var(--border-light);
    color: var(--text-primary); width: 32px; height: 32px; border-radius: 6px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 12px; transition: 0.2s;
}
.page-btn:hover { background: var(--accent-blue); color: #000; }
.page-btn.active { background: var(--accent-blue); color: #000; font-weight: bold; }
.page-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

/* КАРТОЧКА ПИСЬМА */
.mail-card {
    background: var(--bg-sidebar); border: 1px solid var(--border-light);
    border-radius: 8px; padding: 12px; position: relative; flex-shrink: 0;
}
.mail-card.incoming { border-left: 4px solid #e91e63; }
.mail-card.outgoing { border-left: 4px solid #38bdf8; }

.mc-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mc-info { font-size: 11px; color: var(--text-muted); }

/* --- СТАТУСЫ ПИСЕМ (RESD / UNREAD) --- */
.mc-status { font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; }

/* ЗЕЛЕНЫЙ (RESD / SEEN) */
.mc-status.seen { 
    background: rgba(74, 222, 128, 0.15); 
    color: #4ade80; 
    border: 1px solid rgba(74, 222, 128, 0.3); 
}

/* КРАСНЫЙ (UNREAD / UNSEEN) */
.mc-status.unseen { 
    background: rgba(248, 113, 113, 0.15); 
    color: #f87171; 
    border: 1px solid rgba(248, 113, 113, 0.3); 
}

/* ПОЛНЫЙ ТЕКСТ */
.mc-full-content {
    margin-top: 4px; padding: 8px; font-size: 13px; line-height: 1.4; 
    color: #cbd5e1; 

}

/* ФОТО В РЯД + БЕЙДЖИ */
.mc-gallery { display: flex; gap: 8px; margin-bottom: 8px; overflow-x: auto; padding-bottom: 4px; }

/* Обертка для фото, чтобы позиционировать бейдж */
.mc-thumb-wrap { position: relative; flex-shrink: 0; }

.mc-thumb { 
    width: 60px; height: 60px; object-fit: cover; border-radius: 6px; 
    border: 1px solid rgba(255,255,255,0.1); cursor: pointer; display: block;
}
.mc-thumb:hover { border-color: var(--accent-blue); transform: scale(1.05); }

.mail-video-play-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.68);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    pointer-events: none;
    z-index: 35;
}

.media-status-badge {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 50 !important; /* ВАЖНО: Чтобы текст был ПОВЕРХ картинки */

    font-size: 7px !important;   /* Читаемый минимум */
    line-height: 1.1 !important; /* Плотная строка */
    font-weight: 800 !important;
    
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 0 !important;

    border-radius: 0 0 6px 6px;
    pointer-events: none; /* Чтобы клик проходил сквозь надпись на фото */
}
.media-status-badge.seen { background: rgba(74, 222, 128, 0.9); color: #000; }
.media-status-badge.unseen { background: rgba(248, 113, 113, 0.9); color: #fff; }



.btn-req-send {
    background: transparent;
    border: 1px solid #334155;
    color: var(--accent-blue);
    width: 28px; height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center;
}
.btn-req-send:hover {
    background: var(--accent-blue);
    color: #0f172a;
}
.btn-req-send.sent {
    border-color: #4ade80;
    color: #4ade80;
    cursor: default;
}


/* =========================================================================
   REVENUE TICKER (HEADER WIDGET)
   ========================================================================= */
.revenue-ticker-wrapper { position: relative; flex: 1 1 auto; min-width: 0; }

.revenue-ticker {
    display: flex; align-items: center; gap: 8px;
    background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3);
    padding: 4px 14px; border-radius: 8px; /* <--- Заменили на 8px */
    cursor: pointer;
    transition: all 0.3s ease; height: 34px; min-width: 0; width: 100%; justify-content: center;
    overflow: hidden;
}
.revenue-ticker:hover { background: rgba(34, 197, 94, 0.2); transform: translateY(-1px); }

.rt-icon { color: #22c55e; font-size: 14px; display: flex; align-items: center; }
.rt-text { 
    color: #f1f5f9; font-size: 12px; font-weight: 700; 
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
    min-width: 0; overflow: hidden; text-overflow: ellipsis;
}
.rt-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1px solid #22c55e; }
.rt-amount { color: #4ade80; font-weight: 900; }

@media (max-width: 1380px) {
    .header-center-controls { max-width: min(52vw, 640px); gap: 10px; }
    .btn-work { padding: 8px 20px; }
    .stats-trigger { padding: 6px 10px; }
}

@media (max-width: 1240px) {
    .header-center-controls { max-width: min(48vw, 520px); gap: 8px; }
    .btn-work { padding: 8px 16px; font-size: 12px; }
    .stats-trigger { padding: 6px 9px; font-size: 11px; }
    .revenue-ticker { padding: 4px 10px; }
}

@media (max-width: 1120px) {
    .rt-text span:first-child,
    .rt-text img,
    .rt-text .rt-amount + * { max-width: none; }
}

@media (max-width: 1080px) {
    .revenue-ticker-wrapper { max-width: 180px; }
}

@media (max-width: 980px) {
    .revenue-ticker-wrapper { display: none; }
}

/* Анимация при новом доходе */
.rt-flash { animation: flashGreenTicker 1s ease-out; }
@keyframes flashGreenTicker { 
    0% { background: rgba(34, 197, 94, 0.8); box-shadow: 0 0 15px rgba(34, 197, 94, 0.5); } 
    100% { background: rgba(34, 197, 94, 0.1); box-shadow: none; } 
}

/* Выпадающий список истории */
.revenue-dropdown {
    position: absolute; top: 48px; left: 50%; transform: translateX(-50%);
    width: 340px; background: #1e293b; border: 1px solid #334155;
    border-radius: 8px; box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    display: none; flex-direction: column; z-index: 2000; overflow: hidden;
}
.revenue-dropdown.show { 
    display: flex; 
    /* Используем плавную кривую для дорогого эффекта появления */
    animation: slideDownSmooth 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
}

/* 🔥 ИДЕАЛЬНАЯ АНИМАЦИЯ БЕЗ РЫВКОВ (работает через margin, не сбивает центрирование) */
@keyframes slideDownSmooth { 
    from { opacity: 0; margin-top: -15px; } 
    to { opacity: 1; margin-top: 0; } 
}
.rd-header {
    padding: 12px 15px; font-size: 11px; font-weight: 800; color: #94a3b8;
    text-transform: uppercase; border-bottom: 1px solid #334155; letter-spacing: 1px;
    display: flex; justify-content: space-between; align-items: center; background: #0f172a;
}
.rd-header-actions { display: flex; align-items: center; gap: 8px; }
.rd-icon-btn {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent;
    background: transparent; color: #94a3b8; cursor: pointer; display: inline-flex;
    align-items: center; justify-content: center; transition: 0.2s ease;
}
.rd-icon-btn:hover { background: rgba(148, 163, 184, 0.12); color: #f1f5f9; border-color: rgba(148, 163, 184, 0.18); }
.revenue-settings-panel {
    display: none; padding: 12px 14px; background: #111827; border-bottom: 1px solid #334155;
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px;
}
.revenue-settings-panel.show { display: grid; }
.revenue-filter-item {
    display: flex; align-items: center; gap: 8px; font-size: 12px; color: #cbd5e1;
    min-width: 0; user-select: none;
}
.revenue-filter-item input { accent-color: #22c55e; cursor: pointer; }
.revenue-filter-label {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rd-list { max-height: 400px; overflow-y: auto; display: flex; flex-direction: column; }

.rd-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 15px; border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: 0.2s;
}
.rd-item:hover { background: rgba(255,255,255,0.05); }

.rd-left { display: flex; align-items: center; gap: 12px; }
.rd-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(255,255,255,0.1); }
.rd-info { display: flex; flex-direction: column; gap: 2px; }
.rd-name { font-size: 13px; font-weight: 700; color: #f1f5f9; }
.rd-action { font-size: 11px; color: #94a3b8; display: flex; align-items: center; gap: 5px; }

.rd-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.rd-val { font-size: 14px; font-weight: 900; color: #22c55e; }
.rd-time { font-size: 10px; color: #64748b; }



/* =========================================
   ВЫПАДАЮЩЕЕ МЕНЮ (ТРИ ТОЧКИ В ЧАТЕ)
   ========================================= */
.chat-dropdown-menu {
    position: absolute; top: 40px; right: 0;
    width: 160px; background: #1e293b; border: 1px solid #334155;
    border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; opacity: 0; pointer-events: none;
    transform: translateY(-10px); transition: all 0.2s ease; z-index: 100; overflow: hidden;
}
.chat-dropdown-menu.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

.cdm-item {
    padding: 10px 15px; font-size: 12px; font-weight: 600; color: #cbd5e1;
    cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.2s;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
.cdm-item:hover { background: #334155; color: #fff; }
.cdm-item:last-child { border-bottom: none; }

@media (max-width: 900px) {
    .stats-popup {
        width: min(94vw, 780px);
    }

    .stats-overview {
        justify-content: flex-start;
    }

    .calendar-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
