/* ==========================================================================
   1. CORE LAYOUT & GLOBAL MODALS
   ========================================================================== */
.admin-panel {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: var(--bg-body); z-index: 5000; display: none;
    flex-direction: row; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- CONFIRM MODAL (Global) --- */
.confirm-overlay, .custom-confirm-overlay { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.85); z-index: 10001; 
    justify-content: center; align-items: center; backdrop-filter: blur(4px); 
}
.custom-confirm-overlay { z-index: 20000; background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(5px); }

.confirm-box, .custom-confirm-box { 
    background: #1e293b; border: 1px solid #ef4444; width: 320px; 
    border-radius: 12px; padding: 25px; text-align: center; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.8); 
}
.custom-confirm-box { border: 1px solid #334155; box-shadow: 0 0 0 1px #0f172a, 0 20px 50px rgba(0,0,0,0.7); width: 340px; animation: popIn 0.2s ease-out; }

.confirm-title, .cc-title { color: #ef4444; font-weight: 900; font-size: 16px; margin-bottom: 10px; text-transform: uppercase; }
.cc-title { color: #f1f5f9; letter-spacing: 1px; margin-bottom: 8px; }

.confirm-text, .cc-text { color: #cbd5e1; font-size: 13px; margin-bottom: 20px; line-height: 1.4; }
.cc-text { color: #94a3b8; margin-bottom: 25px; line-height: 1.5; }

.confirm-actions, .cc-actions { display: flex; gap: 10px; }

.confirm-btn-yes, .cc-btn-yes { flex: 1; background: #ef4444; color: #fff; border: none; padding: 10px; border-radius: 6px; font-weight: 800; cursor: pointer; font-size: 12px; }
.cc-btn-yes { background: #0ea5e9; padding: 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; transition: 0.2s; box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2); }
.cc-btn-yes:hover { background: #0284c7; transform: translateY(-1px); }
.cc-btn-yes.danger { background: #ef4444; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.22); }
.cc-btn-yes.danger:hover { background: #dc2626; }

.confirm-btn-no, .cc-btn-no { flex: 1; background: transparent; border: 1px solid #475569; color: #fff; padding: 10px; border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 12px; }
.cc-btn-no { border: 1px solid #334155; color: #cbd5e1; padding: 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; transition: 0.2s; }
.cc-btn-no:hover { background: #334155; color: white; }

.cc-icon { font-size: 32px; color: #38bdf8; margin-bottom: 15px; }
.cc-icon.danger { color: #ef4444; }
.work-takeover-box { width: min(420px, calc(100vw - 32px)); }
.work-takeover-box .cc-text strong { color: #f8fafc; }
.takeover-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: -8px 0 22px;
    text-align: left;
}
.takeover-meta div {
    display: grid;
    grid-template-columns: 74px 1fr;
    gap: 10px;
    align-items: start;
    padding: 9px 10px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.62);
}
.takeover-meta span {
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.takeover-meta b {
    min-width: 0;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}
@keyframes popIn { from{transform:scale(0.95); opacity:0;} to{transform:scale(1); opacity:1;} }

/* --- TOAST NOTIFICATION --- */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 10002; pointer-events: none; }
.toast-msg { 
    background: rgba(15, 23, 42, 0.95); color: white; padding: 10px 20px; 
    border-radius: 8px; font-weight: 700; font-size: 12px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-transform: uppercase; 
    animation: slideDown 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    margin-bottom: 10px; text-align: center; border: 1px solid rgba(255,255,255,0.1); 
}
@keyframes slideDown { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }


/* ==========================================================================
   2. ADMIN SIDEBAR & NAVIGATION
   ========================================================================== */
.admin-sidebar {
    width: 220px; background: #0f172a; border-right: 1px solid var(--border-light);
    display: flex; flex-direction: column; padding: 20px 0; transition: width 0.3s ease;
    flex-shrink: 0; z-index: 5001; overflow-x: hidden;
}
.admin-sidebar.collapsed { width: 60px; }

.admin-logo { 
    padding: 0 0 30px 0; text-align: center; color: #fff; font-family: 'Orbitron', sans-serif;
    font-weight: 900; letter-spacing: 2px; white-space: nowrap; transition: 0.3s;
    display: flex; justify-content: center; align-items: center; height: 30px;
}
.logo-full { font-size: 20px; text-shadow: 0 0 10px rgba(56, 189, 248, 0.5); display: block; }
.logo-short { font-size: 22px; color: var(--accent-blue); display: none; }
.admin-sidebar.collapsed .logo-full { display: none; }
.admin-sidebar.collapsed .logo-short { display: block; }

.admin-nav-item {
    padding: 12px 20px; cursor: pointer; color: var(--text-secondary); font-size: 13px; font-weight: 600; 
    display: flex; align-items: center; gap: 10px; border-left: 3px solid transparent; transition: 0.2s; white-space: nowrap;
}
.admin-nav-item:hover, .admin-nav-item.active { background: rgba(255,255,255,0.03); color: var(--accent-blue); border-left-color: var(--accent-blue); }
.admin-sidebar.collapsed .admin-nav-item { justify-content: center; padding: 12px 0; gap: 0; font-size: 0; }
.admin-sidebar.collapsed .admin-nav-item i { font-size: 18px; margin: 0; }

.admin-nav-bottom { margin-top: auto; padding: 20px; cursor: pointer; color: #ef4444; font-weight: 700; font-size: 13px; white-space: nowrap; }
.admin-sidebar.collapsed .admin-nav-bottom { font-size: 0; text-align: center; padding: 20px 0; }
.admin-sidebar.collapsed .admin-nav-bottom i { font-size: 18px; }

.sidebar-toggle-btn { padding: 12px; text-align: center; cursor: pointer; color: #64748b; border-top: 1px solid #334155; margin-top: 10px; transition: 0.2s; }
.sidebar-toggle-btn:hover { color: #fff; background: #334155; }

/* Global Trigger Button (Outside Panel) */
.admin-trigger {
    width: 36px; height: 36px; background: rgba(255,255,255,0.05);
    border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--accent-blue); border: 1px solid var(--border-light); margin-left: 12px; transition: 0.2s;
}
.admin-trigger:hover { background: var(--accent-blue); color: #000; }




/* ==========================================================================
   4. TAB: TEAMS
   ========================================================================== */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.team-card { background: #0f172a; border: 1px solid var(--border-light); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.create-card { border: 2px dashed var(--border-light); background: rgba(15, 23, 42, 0.5); }

.tc-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 6px; }
.tc-header-create { font-size: 11px; font-weight: 800; color: var(--accent-blue); text-transform: uppercase; }
.tc-name { font-weight: 700; color: #fff; font-size: 14px; }
.tc-role { font-size: 10px; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; color: #fff; font-weight: bold; }

.tc-body { display: flex; flex-direction: column; gap: 4px; font-size: 12px; margin-top: 6px; }
.tc-row { display: flex; justify-content: space-between; color: var(--text-secondary); }
.tc-val { color: var(--text-primary); font-family: monospace; }
.tc-form-row { display: flex; gap: 8px; margin-bottom: 4px; }
.commission-row { align-items: center; }
.commission-select {
    max-width: 96px;
    min-width: 80px;
    text-align: center;
    font-weight: 800;
    color-scheme: dark;
}
.commission-label {
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 800;
}

.perm-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-top: 5px; }
.perm-btn { background: #1e293b; border: 1px solid var(--border-light); color: #64748b; padding: 4px; font-size: 10px; font-weight: 700; text-align: center; border-radius: 4px; cursor: pointer; transition: 0.2s; text-transform: uppercase; }
.perm-btn.active { background: rgba(56, 189, 248, 0.15); color: var(--accent-blue); border-color: var(--accent-blue); }

.tc-actions { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.05); display: flex; gap: 8px; }
.btn-card { flex: 1; background: #334155; border: none; color: #ccc; font-size: 11px; padding: 5px; border-radius: 4px; cursor: pointer; font-weight: 600; }
.btn-card:hover { background: #475569; color: white; }
.btn-card.delete:hover { background: #ef4444; }
.btn-create-card { margin-top: 8px; background: var(--accent-blue); color: #000; border: none; padding: 8px; border-radius: 4px; font-weight: 700; cursor: pointer; font-size: 11px; width: 100%; }

.team-user-card {
    position: relative;
    overflow: hidden;
    padding: 14px 14px 12px;
    padding-top: 20px;
    gap: 8px;
}

.team-user-card.role-manager {
    border-color: rgba(245, 158, 11, 0.55);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
}

.team-user-card.role-operator {
    border-color: rgba(100, 116, 139, 0.65);
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.08);
}

.team-user-card.is-stopped {
    opacity: 0.88;
}

.team-role-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 6px 10px 5px;
    border-left: 1px solid;
    border-bottom: 1px solid;
    border-bottom-left-radius: 8px;
    background: rgba(15, 23, 42, 0.92);
}

.team-user-header {
    padding-bottom: 4px;
    margin-right: 100px;
}

.team-stop-badge {
    font-size: 10px;
    font-weight: 800;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.08);
    padding: 2px 6px;
    border-radius: 999px;
}

.team-user-body {
    gap: 6px;
    margin-top: 1px;
}

.tc-row.compact {
    gap: 8px;
    justify-content: flex-start;
    align-items: center;
    white-space: nowrap;
    font-size: 12px;
}

.team-password-text {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-inline-values {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    min-width: 0;
}

.team-copy-value {
    display: block;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: 0.18s ease;
}

.team-copy-value:hover {
    border-color: rgba(56, 189, 248, 0.45);
    color: #fff;
    background: rgba(30, 41, 59, 0.96);
}

.team-mini-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.team-perm-box {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 24px;
}

.team-perm-box .perm-btn {
    cursor: default;
    pointer-events: none;
    padding: 4px 7px;
    font-size: 9px;
}

.team-perm-empty {
    font-size: 11px;
    color: #64748b;
}

.team-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    margin-top: 4px;
}

.btn-card.active {
    background: rgba(34, 197, 94, 0.14);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.26);
}

.btn-card.active:hover {
    background: rgba(34, 197, 94, 0.24);
    color: #fff;
}

.btn-card.deactive {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.24);
}

.btn-card.deactive:hover {
    background: rgba(239, 68, 68, 0.24);
    color: #fff;
}



/* ==========================================================================
   3. CONTENT LAYOUT (COMMON)
   ========================================================================== */
.admin-content { 
    flex: 1; 
    background: #0f172a; /* Глубокий темный фон страницы */
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
    position: relative; 
}

.admin-view { 
    display: none; 
    flex-direction: column; 
    height: 100%; 
    padding: 20px; 
    overflow-y: auto; 
    background: #0f172a; /* Гарантируем фон для всех вкладок */
}
.admin-view.active { display: flex; animation: fadeIn 0.3s; }

.admin-header { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 20px; flex-shrink: 0; 
}
.admin-header h2 { margin: 0; color: #fff; font-size: 20px; letter-spacing: 1px; }

/* Common Inputs (Dark Style) */
.card-input, .card-select { 
    width: 100%; 
    background: #1e293b; /* Фон инпутов чуть светлее фона страницы */
    border: 1px solid #334155; 
    color: #fff; 
    padding: 8px 12px; 
    border-radius: 6px; 
    font-size: 13px; outline: none; 
}
.card-input:focus, .card-select:focus { border-color: #38bdf8; }

.compact-input { 
    background: #1e293b; 
    border: 1px solid #334155; 
    color: #fff; 
    padding: 8px 12px; 
    border-radius: 6px; 
    font-size: 13px; outline: none; width: 100%; 
}
.compact-input:focus { border-color: #38bdf8; }


/* ==========================================================================
   5. TAB: ACCOUNTS
   ========================================================================== */
/* Верхняя панель управления */
.account-compact-bar { 
    display: flex; align-items: center; gap: 12px; 
    background: #1e293b; /* Контрастная плашка на темном фоне */
    border: 1px solid #334155; 
    border-radius: 12px; /* Аккуратное скругление */
    padding: 10px 15px; 
    margin-bottom: 20px; 
    height: 60px; /* Чуть выше для удобства */
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.account-health-summary {
    display: grid;
    grid-template-columns: 150px 260px 1fr;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 14px;
}

.health-score-card {
    border: 1px solid #334155;
    border-radius: 8px;
    background: #172033;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.health-score-card.ok { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.08); }
.health-score-card.warning { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.health-score-main { font-size: 22px; font-weight: 900; color: #fff; line-height: 1; }
.health-score-label { font-size: 10px; color: #94a3b8; text-transform: uppercase; font-weight: 800; margin-top: 5px; }

.health-metrics {
    border: 1px solid #334155;
    border-radius: 8px;
    background: #172033;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 8px;
    padding: 10px;
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
}

.health-metrics b { color: #e2e8f0; }
.health-problem-list {
    min-width: 0;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #172033;
    padding: 9px;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
}

.health-problem-chip,
.health-clean-chip,
.health-more-chip {
    white-space: nowrap;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 800;
}

.health-problem-chip.warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.health-problem-chip.critical { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.health-clean-chip { color: #22c55e; background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.25); }
.health-more-chip { color: #94a3b8; background: rgba(148, 163, 184, 0.08); border: 1px solid rgba(148, 163, 184, 0.18); }

.vertical-sep { width: 1px; height: 24px; background: #334155; margin: 0 5px; }

.ac-group { display: flex; align-items: center; gap: 8px; }

/* Круглые кнопки действий */
.icon-btn { 
    width: 32px; height: 32px; 
    border-radius: 8px; /* Мягкий квадрат */
    background: rgba(255,255,255,0.05); 
    border: 1px solid #334155;
    color: #94a3b8; 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; transition: 0.2s; flex-shrink: 0; 
}
.icon-btn:hover { background: #334155; color: #fff; border-color: #64748b; }

.add-cab-btn { border: 1px dashed #475569; color: #38bdf8; background: transparent; }
.add-cab-btn:hover { border-color: #38bdf8; background: rgba(56, 189, 248, 0.1); color: #38bdf8; }

.del-cab-btn { border: 1px dashed rgba(239, 68, 68, 0.5); color: #ef4444; background: transparent; margin-left: 5px; }
.del-cab-btn:hover { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; color: #fff; }

/* Меню удаления */
.manage-cab-group { position: relative; }
.cab-delete-dropdown { 
    display: none; position: absolute; top: 45px; left: 0; 
    background: #1e293b; border: 1px solid #ef4444; 
    border-radius: 8px; width: 220px; z-index: 100; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    flex-direction: column; overflow: hidden; 
}
.cab-delete-dropdown.show { display: flex; }
.cab-del-header { padding: 10px; font-size: 11px; font-weight: 800; color: #ef4444; background: rgba(239, 68, 68, 0.1); text-transform: uppercase; }
.cab-del-list { max-height: 200px; overflow-y: auto; }
.cab-del-item { padding: 10px 12px; font-size: 13px; color: #cbd5e1; cursor: pointer; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); }
.cab-del-item:hover { background: #ef4444; color: #fff; }

/* Инпуты в баре */
.expandable-input { width: 0; padding: 0; border: none; background: transparent; transition: 0.3s; opacity: 0; color: #fff; outline: none; }
.expandable-input.open { width: 120px; padding: 5px; opacity: 1; border-bottom: 1px solid #38bdf8; }

.hidden-input-wrapper { display: flex; align-items: center; gap: 5px; width: 0; overflow: hidden; transition: 0.3s; }
.hidden-input-wrapper.open { width: 150px; }

.mini-input { 
    background: #0f172a; /* Темный инпут на светлом баре */
    border: 1px solid #334155; 
    color: #fff; width: 110px; 
    font-size: 12px; padding: 6px 10px; 
    border-radius: 6px; outline: none; 
}
.mini-input:focus { border-color: #38bdf8; }

.confirm-btn { cursor: pointer; color: #22c55e; font-size: 16px; padding: 5px; transition: 0.2s; }
.confirm-btn:hover { transform: scale(1.1); }

/* Чипсы кабинетов */
.cab-chips-scroll { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; align-items: center; padding-bottom: 4px; }
.cab-chip { 
    padding: 6px 14px; 
    background: #0f172a; 
    border: 1px solid #334155; 
    border-radius: 12px; 
    color: #94a3b8; font-size: 12px; 
    cursor: pointer; white-space: nowrap; transition: 0.2s; font-weight: 600; 
}
.cab-chip:hover { color: #fff; border-color: #64748b; }
.cab-chip.active { 
    background: rgba(56, 189, 248, 0.1); 
    color: #38bdf8; 
    border-color: #38bdf8; 
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.1);
}

.selected-cab-label { 
    font-size: 11px; font-weight: 800; color: #38bdf8; 
    text-transform: uppercase; background: rgba(56, 189, 248, 0.1); 
    padding: 6px 10px; border-radius: 6px; max-width: 100px; 
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 
    border: 1px solid rgba(56, 189, 248, 0.2); 
}

.pass-compact-wrapper { position: relative; width: 120px; }
.pass-compact-wrapper input { 
    width: 100%; 
    padding: 8px 30px 8px 12px !important; /* Отступ справа для глазика, остальное как у логина */
    background: #1e293b; /* Цвет как у логина */
    border: 1px solid #334155; 
    color: #fff; 
    border-radius: 6px; 
    font-size: 13px; /* Размер как у логина */
    outline: none;
}
.pass-compact-wrapper input:focus { border-color: #38bdf8; }
.pass-toggle-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 14px; color: #64748b; cursor: pointer; transition: 0.2s; }
.pass-toggle-icon:hover { color: #38bdf8; }
.btn-icon-submit { 
    width: 32px; height: 32px; border-radius: 8px; border: none; 
    background: #38bdf8; color: #000; 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; transition: 0.2s; flex-shrink: 0; 
}
.btn-icon-submit:hover { background: #0ea5e9; transform: translateY(-1px); }

/* --- Bot Table --- */
.bot-table-container { 
    flex: 1; overflow: hidden; 
    border: 1px solid #334155; 
    border-radius: 12px; 
    background: #1e293b; /* Фон контейнера таблицы */
    display: flex; flex-direction: column; 
}

.bot-table-header, .bot-row { 
    display: grid; 
    grid-template-columns: 30px 40px 40px minmax(120px, 1fr) minmax(150px, 1.1fr) minmax(210px, 1.15fr) minmax(230px, 1.15fr) 120px 40px; 
    gap: 10px; align-items: center; padding: 12px 15px; 
}

.bot-table-header { 
    background: #111827; /* Темная шапка */
    color: #94a3b8; font-size: 11px; font-weight: 700; text-transform: uppercase; 
}

.bot-row { 
    background: #1e293b; /* Фон строки */
    border-radius: 12px;
margin-bottom: 2px;
    border-bottom: 1px solid #39bdf87d; 
    color: #cbd5e1; font-size: 13px; transition: 0.2s; 
}
.bot-row:last-child { border-bottom: none; }
.bot-row:hover { background: #263346; } /* Подсветка при наведении */
.bot-row.health-critical { border-left: 3px solid #ef4444; }
.bot-row.health-warning { border-left: 3px solid #f59e0b; }
.bot-row.health-ok { border-left: 3px solid transparent; }

.br-cell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 10px; }
.br-id { font-family: 'Menlo', monospace; color: #64748b; font-size: 11px; }

.pass-cell { display: flex; justify-content: center; align-items: center; position: relative; height: 100%; }
.pass-only-eye { color: #64748b; cursor: pointer; font-size: 14px; transition: 0.2s; }
.pass-only-eye:hover { color: #38bdf8; }
.pass-revealed { 
    background: rgba(0,0,0,0.2); border: none; color: #fff; 
    font-family: monospace; font-size: 12px; width: 100%; min-width: 0;
    text-align: center; outline: none; border-radius: 4px; padding: 2px;
}

.bot-health-cell {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.health-badge-row,
.health-problems-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.health-mini,
.health-problem-pill,
.health-ok-state {
    border-radius: 5px;
    padding: 2px 5px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1.2;
}

.health-mini.ok { background: rgba(34, 197, 94, 0.12); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.25); }
.health-mini.bad { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.health-problem-pill.warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.25); }
.health-problem-pill.critical { background: rgba(239, 68, 68, 0.12); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.25); }
.health-ok-state {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
    background: rgba(34, 197, 94, 0.09);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.18);
}
.health-worker,
.health-updated {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.health-worker { color: #cbd5e1; font-size: 11px; font-weight: 700; }
.health-updated { color: #64748b; font-size: 10px; }

.mini-cab-select { 
    background: #0f172a; /* Темный фон селекта */
    color: #fff; border: 1px solid #334155; 
    font-size: 12px; padding: 4px 8px; 
    border-radius: 6px; width: 100%; 
    outline: none; cursor: pointer; 
}
.mini-cab-select:focus { border-color: #38bdf8; }
.mini-cab-select option { background: #0f172a; color: #fff; }

.status-indicator { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
.status-indicator.online { background: #22c55e; box-shadow: 0 0 5px rgba(34, 197, 94, 0.4); }
.status-indicator.warning { background: #f59e0b; box-shadow: 0 0 5px rgba(245, 158, 11, 0.35); }
.status-indicator.critical { background: #ef4444; box-shadow: 0 0 5px rgba(239, 68, 68, 0.35); }

.btn-del { 
    color: #64748b; cursor: pointer; transition: 0.2s; 
    font-size: 14px; text-align: center; justify-self: end;
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; 
    border-radius: 6px;
}
.btn-del:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* ==========================================================================
   TAB: DATAME INTEGRATION (UNIVERSAL DARK THEME FIX)
   ========================================================================== */

#tab-datame { 
    padding: 0 !important; 
    overflow: hidden !important; 
    display: none; 
    flex-direction: column; 
}
#tab-datame.active { display: flex; }

.datame-container {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.datame-add-row {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(210px, 1fr) 150px 92px;
    gap: 10px;
    align-items: center;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
}

.datame-input {
    min-width: 0;
    height: 38px;
    background: #0f172a;
    border: 1px solid #334155;
    color: #fff;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

.datame-input.name { border-color: rgba(56, 189, 248, 0.45); }
.datame-input:focus { border-color: #38bdf8; background: #111c2d; }
.datame-input::placeholder { color: #64748b; opacity: 1; }

.datame-add-btn {
    height: 38px;
    border: none;
    border-radius: 6px;
    background: #38bdf8;
    color: #07111f;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: 0.2s;
}

.datame-add-btn:hover { background: #0ea5e9; transform: translateY(-1px); }
.datame-add-btn:disabled { opacity: 0.65; cursor: wait; transform: none; }

.datame-row {
    display: grid;
    grid-template-columns: 120px 170px minmax(240px, 1fr) 110px 108px;
    gap: 14px;
    align-items: center;
    background: #1e293b;
    border: 1px solid #334155;
    border-left: 3px solid rgba(56, 189, 248, 0.55);
    border-radius: 8px;
    padding: 12px 14px;
    color: #cbd5e1;
    font-size: 13px;
}

.datame-row:hover { background: #263346; }
.datame-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.datame-status span { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.datame-status.ok { color: #4ade80; }
.datame-status.ok span { background: #22c55e; box-shadow: 0 0 6px rgba(34, 197, 94, 0.45); }
.datame-status.bad { color: #f87171; }
.datame-status.bad span { background: #ef4444; }
.datame-name { font-weight: 800; color: #f8fafc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datame-email { color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.datame-agency { font-family: Menlo, monospace; color: #38bdf8; font-size: 12px; }
.datame-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.datame-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    border: 1px solid #334155;
    background: #0f172a;
    color: #94a3b8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.datame-icon-btn.refresh:hover { color: #38bdf8; border-color: rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.08); }
.datame-icon-btn.delete:hover { color: #ef4444; border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.08); }
.datame-empty {
    border: 1px dashed #334155;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}


/* ==========================================================================
   5. TAB: WORK SCHEDULE (REDESIGN)
   ========================================================================== */

/* 1. Глобальный фон вкладки */
#tab-schedule {
    background: #0f172a !important; /* Глубокий темный фон */
    padding: 20px;
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

/* 2. Сетка или Контейнер для карточек */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

/* 3. Карточка расписания (Контраст к фону) */
.ws-card {
    background: #1e293b; /* Светлее фона страницы */
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
    transition: 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.ws-card:hover {
    border-color: #475569;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.3);
}

/* Заголовок карточки (День недели или имя) */
.ws-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.ws-title {
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex; align-items: center; gap: 8px;
}

.ws-subtitle {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
}

/* 4. Внутренние блоки / Строки */
.ws-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ws-label {
    font-size: 11px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
}

/* 5. Инпуты и Селекты (Темные, как в N.F) */
.ws-card input,
.ws-card select,
.ws-input {
    width: 100%;
    background: #0f172a !important;       /* Темный фон внутри карточки */
    border: 1px solid #334155 !important; /* Рамка */
    color: #fff !important;               /* Белый текст */
    padding: 10px 12px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    outline: none !important;
    height: 40px;
    transition: 0.2s;
    font-family: inherit;
}

.ws-card input:focus,
.ws-card select:focus {
    border-color: #38bdf8 !important; /* Синяя подсветка */
    background: #111827 !important;
}

/* Чекбоксы (Кастомные, если есть) */
.ws-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    cursor: pointer;
}
.ws-checkbox-row:hover {
    border-color: #64748b;
}
.ws-checkbox-text {
    font-size: 13px;
    color: #cbd5e1;
    font-weight: 500;
}

/* 6. Кнопки действий */
.ws-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.ws-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    cursor: pointer;
    border: none;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* Кнопка Save (Синяя) */
.ws-btn-save {
    background: #38bdf8;
    color: #0f172a;
}
.ws-btn-save:hover {
    background: #0ea5e9;
    transform: translateY(-1px);
}

/* Кнопка Delete (Прозрачная красная) */
.ws-btn-del {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.ws-btn-del:hover {
    background: #ef4444;
    color: white;
}



/* ==========================================================================
   6. TAB: SCHEDULE & STATS
   ========================================================================== */
.sched-container { display: flex; gap: 20px; height: 100%; overflow: hidden; }
.sched-main { flex: 1; overflow-y: auto; padding-right: 10px; }
.sched-sidebar { width: 350px; background: #1e293b; border: 1px solid var(--border-light); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }

/* Stats */
.stat-header { padding: 15px; background: rgba(255,255,255,0.03); border-bottom: 1px solid var(--border-light); font-size: 14px; font-weight: 800; color: #fff; letter-spacing: 1px; text-transform: uppercase; text-align: center; }
.stat-grid-header { display: grid; grid-template-columns: 1fr 70px 70px; gap: 10px; padding: 10px 15px; background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--border-light); font-size: 10px; font-weight: 700; color: #64748b; text-transform: uppercase; }
.stat-grid-header div:not(:first-child) { text-align: center; }
.stat-list-scroll { flex: 1; overflow-y: auto; }
.stat-grid-row { display: grid; grid-template-columns: 1fr 70px 70px; gap: 10px; padding: 10px 15px; border-bottom: 1px solid rgba(255,255,255,0.03); align-items: center; transition: 0.2s; }
.stat-grid-row:hover { background: rgba(255,255,255,0.02); }
.stat-name { font-size: 13px; font-weight: 600; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-val { font-family: monospace; font-size: 13px; color: #fff; text-align: center; }
.stat-val.active { color: #22c55e; font-weight: bold; }
.stat-total { padding: 15px; background: rgba(56, 189, 248, 0.05); border-top: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center; }
.stat-total span { font-weight: 800; color: var(--accent-blue); }

/* Schedule Slots */
.sched-row { display: flex; align-items: center; gap: 15px; padding: 15px; margin-bottom: 10px; background: #1e293b; border: 1px solid var(--border-light); border-radius: 10px; }
.sched-icon { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; color: #64748b; font-size: 16px; flex-shrink: 0; }
.sched-info { width: 140px; display: flex; flex-direction: column; justify-content: center; }
.sched-name { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.2; }
.sched-sub { font-size: 11px; color: #64748b; margin-top: 2px; }
.slots-wrapper { flex: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cab-slot { height: 28px; padding: 0 10px; border-radius: 6px; background: rgba(0,0,0,0.3); border: 1px dashed #475569; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #64748b; cursor: pointer; transition: 0.2s; white-space: nowrap; }
.cab-slot:hover { border-color: var(--accent-blue); color: #fff; }
.cab-slot.filled { background: rgba(56, 189, 248, 0.15); border: 1px solid rgba(56, 189, 248, 0.3); color: var(--accent-blue); font-weight: 700; }
.cab-slot.filled:hover { background: rgba(239, 68, 68, 0.15); border-color: #ef4444; color: #ef4444; }
.cab-slot.filled:hover span { display: none; }
.cab-slot.filled:hover::after { content: 'REMOVE'; font-size: 9px; font-weight: 800; }
.slot-controls { display: flex; gap: 2px; margin-left: 10px; border-left: 1px solid #334155; padding-left: 10px; }
.slot-ctrl-btn { width: 24px; height: 24px; border-radius: 4px; background: rgba(255,255,255,0.05); color: #94a3b8; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; transition: 0.2s; font-weight: bold; }
.slot-ctrl-btn:hover { background: var(--accent-blue); color: #000; }
.cab-popover { display: none; position: absolute; background: #0f172a; border: 1px solid var(--accent-blue); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.7); z-index: 9999; width: 200px; max-height: 250px; overflow-y: auto; padding: 5px; animation: fadeIn 0.1s; }
.cab-popover.show { display: block; }
.popover-item { padding: 8px 12px; border-radius: 4px; cursor: pointer; color: #cbd5e1; font-size: 11px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.03); }
.popover-item:hover { background: var(--accent-blue); color: #000; }





/* ==========================================================================
   7. TAB: NEWS FEED (N.F) - STYLED & ROUNDED
   ========================================================================== */
#tab-nf { padding: 0 !important; overflow: hidden !important; }
#tab-nf .admin-header { display: none; } /* Скрываем стандартный заголовок, у нас свой лайаут */

.nf-container { 
    display: flex; 
    width: 100%; height: 100%; 
    background: #0f172a; 
    overflow: hidden; 
}

/* --- LEFT SIDEBAR (BOTS) --- */
.nf-sidebar { 
    width: 280px; 
    background: #0f172a; 
    border-right: 1px solid #1e293b; 
    display: flex; flex-direction: column; flex-shrink: 0; 
    z-index: 20;
}

/* Красивый поиск */
.nf-search-box { 
    padding: 15px; 
    border-bottom: 1px solid #1e293b; 
    background: #111827;
}
.nf-search-inner {
    display: flex; align-items: center; gap: 10px;
    background: #1f2937; 
    padding: 8px 12px; 
    border-radius: 10px; /* Сильное скругление */
    border: 1px solid #374151;
    transition: 0.2s;
}
.nf-search-inner:focus-within {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.1);
}
.nf-search-inner i { color: #9ca3af; font-size: 13px; }
.nf-search-inner input { 
    border: none; background: transparent; outline: none; 
    color: white; width: 100%; font-size: 13px; font-weight: 500;
}

/* Список ботов */
.nf-bot-list { 
    flex: 1; overflow-y: auto; 
    padding: 10px; 
    display: flex; flex-direction: column; gap: 4px;
}

/* Карточка бота в списке (Скругленная) */
.nf-bot-item { 
    padding: 8px 12px; 
    display: flex; align-items: center; gap: 12px; 
    cursor: pointer; transition: all 0.2s ease; 
    border-radius: 10px; /* Скругление */
    border: 1px solid transparent;
    color: #94a3b8;
}
.nf-bot-item:hover { 
    background: #1f2937; 
    color: #f1f5f9; 
}
.nf-bot-item.active { 
    background: rgba(56, 189, 248, 0.1); 
    color: white; 
    border-color: rgba(56, 189, 248, 0.2); 
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.nf-bot-ava { 
    width: 42px; height: 42px; 
    border-radius: 20%; object-fit: cover; 
    border: 1px solid #374151; flex-shrink: 0;
}
.nf-bot-info { flex: 1; overflow: hidden; }
.nf-bot-name { 
    font-size: 14px; font-weight: 700; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}
.nf-bot-login { font-size: 11px; opacity: 0.6; }


/* --- RIGHT MAIN AREA (COLUMNS) --- */
.nf-main { 
    flex: 1; 
    display: flex; 
    overflow-x: auto; 
    padding: 20px; gap: 15px; 
    background: #0f172a;
}

/* Колонка */
.nf-col { 
    flex: 1; min-width: 320px; max-width: 450px;
    background: #1e293b; 
    border-radius: 12px; /* Скругление колонки */
    border: 1px solid #334155; 
    display: flex; flex-direction: column; 
    overflow: hidden; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Шапка колонки */
.nf-col-header { 
    padding: 15px; 
    font-size: 12px; font-weight: 800; 
    text-transform: uppercase; letter-spacing: 1px; 
    background: rgba(0,0,0,0.2); 
    display: flex; justify-content: space-between; align-items: center; 
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Цветные индикаторы сверху */
.nf-col-header.mod { border-top: 3px solid #eab308; color: #fde047; } /* Yellow */
.nf-col-header.appr { border-top: 3px solid #22c55e; color: #86efac; } /* Green */
.nf-col-header.sent { border-top: 3px solid #38bdf8; color: #7dd3fc; } /* Blue */

.nf-count-badge {
    background: rgba(255,255,255,0.1); 
    padding: 2px 8px; border-radius: 10px; 
    color: #fff; font-size: 11px;
}

/* Тело колонки */
.nf-col-body { 
    flex: 1; overflow-y: auto; 
    padding: 15px; 
    display: flex; flex-direction: column; gap: 2px; 
}

#tab-datame .admin-header {
    padding: 20px 20px 0 20px; /* 20px сверху и по бокам */
    margin-bottom: 10px;       /* Отступ снизу до контента */
}

/* --- POST CARDS (Карточки внутри) --- */
.nf-create-card, .nf-post-item { 
    background: #0f172a; 
    border: 1px solid #334155; 
    border-radius: 10px; /* Скругление карточек */
    padding: 15px; 
    display: flex; flex-direction: column; gap: 10px;
    transition: transform 0.2s;
}
.nf-post-item:hover { transform: translateY(-2px); border-color: #475569; }

/* Форма создания */
.nf-create-card { border: 1px dashed #38bdf8; background: rgba(56, 189, 248, 0.02); }
.nf-textarea { 
    width: 100%; height: 80px; 
    background: rgba(0,0,0,0.2); 
    border: 1px solid #334155; 
    color: #e2e8f0; padding: 10px; 
    border-radius: 8px; resize: none; 
    font-size: 13px; outline: none; 
}
.nf-textarea:focus { border-color: #38bdf8; }

.nf-attach-area { display: flex; gap: 8px; margin-top: 5px; }
.nf-btn-add { 
    width: 40px; height: 40px; 
    border: 1px dashed #475569; border-radius: 8px; 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; color: #94a3b8; transition: 0.2s;
}
.nf-btn-add:hover { border-color: #38bdf8; color: #38bdf8; background: rgba(56, 189, 248, 0.1); }

.nf-send-btn { 
    background: #38bdf8; color: #0f172a; 
    border: none; padding: 8px; border-radius: 6px; 
    font-weight: 700; cursor: pointer; font-size: 11px; 
    text-transform: uppercase; margin-top: 5px;
    transition: 0.2s;
}
.nf-send-btn:hover { background: #0ea5e9; }

/* Контент поста */
.nf-post-text { 
    font-size: 13px; color: #cbd5e1; 
    line-height: 1.4; white-space: pre-wrap; word-break: break-word; 
}
.nf-post-imgs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.nf-post-img { 
    width: 70px; height: 70px; object-fit: cover; 
    border-radius: 6px; border: 1px solid #334155; cursor: pointer; 
}
.nf-post-footer { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-top: 5px; padding-top: 8px; 
    border-top: 1px solid rgba(255,255,255,0.05); 
}
.nf-post-date { font-size: 10px; color: #64748b; font-weight: 600; }

/* Кнопки действий */
.nf-actions { display: flex; gap: 6px; }
.nf-btn-act { 
    padding: 5px 10px; border-radius: 6px; 
    font-size: 10px; font-weight: 700; cursor: pointer; 
    border: 1px solid transparent; text-transform: uppercase; 
    transition: 0.2s;
}
.nf-btn-pub { background: rgba(34, 197, 94, 0.1); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }
.nf-btn-pub:hover { background: #22c55e; color: #000; }

.nf-btn-del { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.nf-btn-del:hover { background: #ef4444; color: #fff; }


/* --- FIX: Прямая стилизация инпута поиска в N.F --- */
#tab-nf .nf-search-box input,
#nf-bot-search {
    width: 100%;
    background: #1f2937;          /* Темный фон поля */
    border: 1px solid #374151;    /* Рамка */
    border-radius: 8px;           /* Скругление */
    padding: 8px 12px;            /* Отступы внутри */
    color: #f1f5f9;               /* Белый текст */
    font-size: 13px;
    outline: none;
    transition: 0.2s;
}

#tab-nf .nf-search-box input:focus,
#nf-bot-search:focus {
    border-color: #38bdf8;        /* Синяя рамка при клике */
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.1);
}

/* Скрываем иконку, если она мешает или сломана в этой структуре */
#tab-nf .nf-search-box i {
    display: none; 
}

/* ==========================================================================
   8. TAB: SENDER (MODULE V3)
   ========================================================================== */

/* --- Layout & Container --- */
#tab-sender { 
    padding: 0 !important; 
    overflow: hidden !important; 
    background: #0f172a; 
    height: 100%; 
    display: none; 
    flex-direction: column; 
    width: 100%;
}
#tab-sender.active { display: flex; }

.snd-layout { 
    display: flex; 
    height: 100%; 
    width: 100%; 
    overflow: hidden; 
}

/* --- Sidebar --- */
.snd-sidebar { 
    width: 280px; 
    background: #0f172a; 
    border-right: 1px solid #1e293b; 
    display: flex; 
    flex-direction: column; 
    flex-shrink: 0; 
    height: 100%; 
    z-index: 20;
}
.snd-sb-header { padding: 15px; border-bottom: 1px solid #1e293b; display: flex; gap: 10px; align-items: center; background: #111827; }
.snd-search-box { flex: 1; display: flex; align-items: center; gap: 8px; background: #1f2937; padding: 6px 10px; border-radius: 6px; border: 1px solid #374151; }
.snd-search-box input { border: none; background: transparent; outline: none; color: white; width: 100%; font-size: 12px; }
.snd-search-box i { color: #9ca3af; font-size: 12px; }
.snd-list { flex: 1; overflow-y: auto; padding-bottom: 20px; }

/* Items in Sidebar */

/* --- SENDER BOT ITEM (С ОБВОДКОЙ КАК В N.F.) --- */
.snd-item {
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 8px 12px; 
    margin: 4px 8px; /* Отступы чтобы карточки не слипались */
    border-radius: 8px; 
    cursor: pointer; 
    transition: 0.2s;
    
    /* Добавленная стилизация */
    border: 1px solid #334155; 
    background: rgba(30, 41, 59, 0.3); 
    color: #94a3b8;
}

/* При наведении */
.snd-item:hover {
    background: #1f2937;
    border-color: #475569;
    color: #f3f4f6;
}

/* Активная анкета */
.snd-item.active {
    background: #1e293b;
    border-color: #38bdf8; /* Синяя рамка */
    color: #fff;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.1); /* Легкое свечение */
}
.snd-item.is-selected { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.2); }
.snd-item.is-viewing { background: #1e293b; border-color: var(--accent-blue); }

.snd-ava { width: 36px; height: 36px; border-radius: 20%; object-fit: cover; border: 1px solid #374151; flex-shrink: 0; }
.snd-info { flex: 1; overflow: hidden; display: flex; flex-direction: column; justify-content: center; }
.snd-name { font-size: 13px; font-weight: 700; color: #f3f4f6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snd-login { font-size: 11px; color: #9ca3af; }

/* Sidebar Meta */
.snd-sb-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.snd-sb-meta-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.snd-sb-target { font-size: 9px; opacity: 0.8; }
.snd-sb-row { display: flex; align-items: center; gap: 8px; }
.snd-sb-status-btn { color: #64748b; cursor: pointer; transition: 0.2s; font-size: 14px; }
.snd-sb-status-btn.active { color: #4ade80; text-shadow: 0 0 5px rgba(74, 222, 128, 0.5); }

/* Custom Checkboxes */
.sender-bot-checkbox, .snd-checkbox-all { 
    appearance: none; -webkit-appearance: none; width: 22px; height: 22px; 
    border-radius: 20%; border: 1px solid #475569; background: rgba(0, 0, 0, 0.2); 
    cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; 
    transition: all 0.2s ease; 
}
.sender-bot-checkbox:checked, .snd-checkbox-all:checked { 
    background: var(--accent-blue); border-color: var(--accent-blue); 
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4); 
}
.sender-bot-checkbox:checked::after, .snd-checkbox-all:checked::after { 
    content: '\f00c'; font-family: "Font Awesome 6 Free"; font-weight: 900; color: #000; font-size: 12px; 
}

/* --- Main Content Area --- */
.snd-main {
    flex: 1; 
    min-width: 0; 
    width: 0; 
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden; 
}

.snd-empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #64748b; }
.snd-details-view { display: none; flex-direction: column; height: 100%; }

/* Toolbar */
.snd-toolbar { 
    padding: 0 20px; height: 60px; flex-shrink: 0;
    border-bottom: 1px solid #1e293b; background: #111827; 
    display: flex; justify-content: space-between; align-items: center; 
}
.snd-view-title { font-size: 14px; font-weight: 800; color: #fff; text-transform: uppercase; letter-spacing: 1px; }
.snd-stats-summary { font-size: 11px; color: #94a3b8; margin-left: 10px; font-weight: 600; }

.snd-actions { display: flex; gap: 10px; }
.snd-btn { 
    padding: 0 16px; height: 32px; border-radius: 6px; 
    font-weight: 800; font-size: 11px; cursor: pointer; border: none; 
    display: flex; align-items: center; gap: 6px; transition: 0.2s; text-transform: uppercase; 
}
.snd-btn-add { background: var(--accent-blue); color: #000; }
.snd-btn-add:hover { background: #38bdf8; transform: translateY(-1px); }
.snd-btn-del { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.snd-btn-del:hover { background: #ef4444; color: white; }

/* --- 6.4 DATA TABLE (FIXED WIDTHS & NO TRUNCATE) --- */
.snd-table-wrap {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: auto; /* Включает скролл, если таблица не влезает */
    background: #0f172a;
}

.snd-table { 
    width: 100%; 
    min-width: 0;
    border-collapse: collapse; 
    table-layout: fixed; 
}

/* --- НАСТРОЙКА ШИРИНЫ СТОЛБЦОВ --- */

/* 1. № (Узкий) */
.snd-table th:nth-child(1) { width: 45px; } 

/* 2. Message (РЕЗИНОВЫЙ - ЗАБИРАЕТ ОСТАТОК МЕСТА) */
.snd-table th:nth-child(2) { width: auto; } 

/* 3. Target (Расширили для ON + OFF) */
.snd-table th:nth-child(3) { width: 84px; text-align: center; } 

/* 4. Speed */
.snd-table th:nth-child(4) { width: 62px; } 

/* 5. Interval countdown */
.snd-table th:nth-child(5) { width: 92px; text-align: center; } 

/* 6-8. Stats (Sent/Fail/Scs) */
.snd-table th:nth-child(6) { width: 48px; text-align: center; } 
.snd-table th:nth-child(7) { width: 48px; text-align: center; } 
.snd-table th:nth-child(8) { width: 52px; text-align: center; } 

/* 9. Status */
.snd-table th:nth-child(9) { width: 84px; text-align: center; } 

/* 10. Actions */
.snd-table th:nth-child(10){ width: 74px; text-align: center; }


/* --- СТИЛИ ЗАГОЛОВКОВ --- */
.snd-table th { 
    background: #162032; 
    color: #94a3b8; 
    font-size: 10px; 
    font-weight: 700; 
    text-transform: uppercase; 
    padding: 12px 8px; 
    text-align: left; 
    border-bottom: 1px solid #1e293b; 
    position: sticky; top: 0; z-index: 5; 
    white-space: nowrap; 
}

/* --- СТИЛИ ЯЧЕЕК --- */
.snd-table td { 
    padding: 12px 6px; 
    border-bottom: 1px solid #1e293b; 
    color: #cbd5e1; 
    font-size: 12px; 
    vertical-align: middle; 
    
    /* Базовые настройки: текст в одну строку */
    white-space: nowrap; 
}

/* --- ВАЖНО: УБИРАЕМ ТРОЕТОЧИЕ (...) ДЛЯ ВСЕХ, КРОМЕ СООБЩЕНИЯ --- */
/* Мы явно разрешаем тексту показываться полностью в этих колонках */
.snd-table td:nth-child(3), /* Target */
.snd-table td:nth-child(4), /* Speed */
.snd-table td:nth-child(5), /* Interval */
.snd-table td:nth-child(6), /* Sent */
.snd-table td:nth-child(7), /* Fail */
.snd-table td:nth-child(8), /* Scs */
.snd-table td:nth-child(9), /* Status */
.snd-table td:nth-child(10) /* Actions */
{
    overflow: visible;      
    text-overflow: clip;    /* Никаких многоточий! */
}

/* Только для Message оставляем обрезку с троеточием */
.snd-table td:nth-child(2) {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snd-table tr:hover { background: #131c2e; }

/* Блок текста сообщения */
.st-msg {
    display: block;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis; /* Тут точки нужны, если текст длинный */
    color: #fff;
    cursor: default;
}

/* Status Badges */
.st-status { font-size: 10px; font-weight: 800; text-transform: uppercase; padding: 4px 8px; border-radius: 4px; }
.st-status.running { background: rgba(34, 197, 94, 0.1); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.2); }
.st-status.stopped { background: rgba(245, 158, 11, 0.1); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.st-status.error { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.28); }

/* Target Badges */
.st-badge { 
    font-size: 9px; padding: 3px 5px; border-radius: 4px; font-weight: 800; 
    text-transform: uppercase; display: inline-block; text-align: center; min-width: 30px; letter-spacing: 0.4px;
}
.st-online { background: rgba(14, 165, 233, 0.15); color: #38bdf8; border: 1px solid rgba(14, 165, 233, 0.3); }
.st-offline { background: rgba(71, 85, 105, 0.3); color: #94a3b8; border: 1px solid rgba(71, 85, 105, 0.5); }
.st-any { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); } /* ON + OFF */
.st-target-any { background: rgba(139, 92, 246, 0.15); color: #a78bfa; border: 1px solid rgba(139, 92, 246, 0.3); } /* Legacy support */

/* Truncation helper */
.st-msg { width: 100%; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; cursor: default; }

/* --- Sender Modal --- */
.snd-modal-overlay { 
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.9); backdrop-filter: blur(8px); z-index: 9999; 
    justify-content: center; align-items: center; 
}
.snd-modal { 
    width: 95vw; height: 90vh; background: #0f172a; 
    border: 1px solid #334155; border-radius: 12px; display: flex; flex-direction: column; 
    box-shadow: 0 25px 50px rgba(0,0,0,0.7); overflow: hidden; 
}

.snd-modal-header { padding: 16px 22px; border-bottom: 1px solid #1e293b; background: #111827; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.snd-modal-title-wrap { display: flex; flex-direction: row; gap: 12px; align-items: center; min-width: 0; flex-wrap: wrap; }
.snd-modal-title { font-size: 15px; font-weight: 900; color: #fff; letter-spacing: 0.9px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.snd-modal-context { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 28px; }
.snd-info-badge { font-size: 11px; color: var(--accent-blue); background: rgba(56, 189, 248, 0.1); padding: 6px 10px; border-radius: 999px; font-weight: 700; border: 1px solid rgba(56, 189, 248, 0.18); }
.snd-bot-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 11px 4px 5px; border-radius: 999px; background: rgba(30, 41, 59, 0.9); border: 1px solid rgba(71, 85, 105, 0.9); color: #f8fafc; font-size: 12px; font-weight: 700; white-space: nowrap; }
.snd-bot-pill-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(56,189,248,0.45); }
.snd-bot-pill-name { white-space: nowrap; }
.snd-dup-badge { display: none; font-size: 11px; color: #ef4444; background: rgba(239, 68, 68, 0.1); padding: 4px 8px; border-radius: 4px; font-weight: 700; border: 1px solid rgba(239, 68, 68, 0.3); }
.snd-dup-badge.show { display: inline-block; }

.snd-close { cursor: pointer; color: #64748b; font-size: 24px; transition: 0.2s; }
.snd-close:hover { color: #fff; }

.snd-modal-body { flex: 1; padding: 0; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.snd-smart-area { flex: 1; display: flex; background: #1e293b; position: relative; overflow: hidden; }


/* Editor Gutter (Левая колонка с анкетами) */
.snd-gutter { width: 200px; background: #111827; border-right: 1px solid #334155; overflow: hidden; user-select: none; position: relative; padding-top: 15px; }

/* Высота строки анкеты (строго 32px) */
.snd-gutter-row { height: 32px; display: flex; align-items: center; padding: 0 10px; font-family: 'Menlo', monospace; font-size: 11px; color: #64748b; position: relative; box-sizing: border-box; border-bottom: 1px solid rgba(255,255,255,0.02); }
.snd-gutter-row.has-bot { background: rgba(56, 189, 248, 0.08); color: #fff; border-bottom: 1px solid rgba(56, 189, 248, 0.2); }
.snd-g-num { width: 30px; text-align: right; margin-right: 10px; opacity: 0.5; }
.snd-g-bot { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }
.snd-g-ava { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(56,189,248,0.5); }
.snd-g-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; color: var(--accent-blue); }

/* Само поле ввода текста (Без полосок, высота совпадает с анкетами) */
.snd-textarea { 
    flex: 1; background: #1e293b !important; background-image: none !important; border: none; color: #e2e8f0; 
    padding: 15px; font-family: 'Menlo', 'Monaco', monospace; font-size: 13px; line-height: 32px !important; 
    resize: none; outline: none; white-space: pre; overflow-y: scroll; overflow-x: auto;
}


/* Modal Controls */
.snd-controls {
    padding: 12px 18px;
    background: #111827;
    border-top: 1px solid #334155;
    display: grid;
    grid-template-columns: minmax(170px, 220px) 112px 112px minmax(160px, auto);
    gap: 12px;
    align-items: center;
}
.snd-ctrl-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
}
.snd-target-group { max-width: 220px; }
.snd-label { font-size: 9px; font-weight: 800; color: #64748b; text-transform: uppercase; letter-spacing: 0.7px; white-space: nowrap; margin-bottom: 0; }
.snd-select { width: 100%; height: 38px; background: #0f172a; border: 1px solid #334155; color: #fff; padding: 0 12px; border-radius: 8px; font-size: 12px; outline: none; cursor: pointer; text-overflow: ellipsis; font-weight: 800; }
.snd-target-select {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
.snd-select:focus { border-color: var(--accent-blue); }

.snd-num-wrap { display: flex; height: 38px; background: #0f172a; border: 1px solid #334155; border-radius: 8px; overflow: hidden; width: 100%; }
.snd-num-btn { width: 34px; min-width: 34px; display: flex; align-items: center; justify-content: center; background: #1e293b; cursor: pointer; color: #38bdf8; font-weight: 900; transition: 0.2s; user-select: none; font-size: 16px; line-height: 1; flex-shrink: 0; border-left: 1px solid #334155; border-right: 1px solid #334155; }
.snd-num-btn:first-child { border-left: none; }
.snd-num-btn:last-child { border-right: none; }
.snd-num-btn:hover { background: #334155; color: #fff; }
.snd-num-input { flex: 1; min-width: 38px; background: transparent; border: none; text-align: center; color: #fff; font-family: -apple-system, sans-serif; font-size: 14px; font-weight: 800; outline: none; padding: 0; appearance: textfield; -moz-appearance: textfield; }

/* Жестко убиваем нативные стрелки браузера в инпутах Interval и Speed */
input[type="number"].snd-num-input::-webkit-outer-spin-button, 
input[type="number"].snd-num-input::-webkit-inner-spin-button { 
    -webkit-appearance: none !important; 
    margin: 0 !important; 
}
input[type="number"].snd-num-input {
    -moz-appearance: textfield !important;
    appearance: none !important;
}

.snd-actions-group { display: flex; gap: 8px; height: 38px; min-width: 160px; justify-self: end; align-self: end; align-items: stretch; }
.snd-btn-save { flex: 1; height: 100%; background: #0f172a; border: 1px solid #475569; color: #cbd5e1; border-radius: 8px; font-weight: 800; cursor: pointer; font-size: 10px; text-transform: uppercase; padding: 0 10px; }
.snd-btn-save:hover { border-color: #fff; color: #fff; }
.snd-btn-start { flex: 1.2; height: 100%; background: var(--accent-blue); border: none; color: #000; border-radius: 8px; font-weight: 900; cursor: pointer; font-size: 10px; display: flex; align-items: center; justify-content: center; gap: 5px; text-transform: uppercase; padding: 0 12px; }
.snd-btn-start:hover { box-shadow: 0 0 10px rgba(56, 189, 248, 0.4); transform: translateY(-1px); }

.snd-table td:nth-child(10) {
    text-align: center;
}

.snd-table td:nth-child(10) .snd-actions-group {
    min-width: 0;
    width: 100%;
    height: auto;
    justify-content: center !important;
    gap: 6px;
}

.btn-icon-sm {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: rgba(30, 41, 59, 0.95);
    color: #67d4ff;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-icon-sm:hover {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.42);
    color: #e0f2fe;
    transform: translateY(-1px);
}

.btn-icon-sm.del {
    border-color: rgba(239, 68, 68, 0.22);
    color: #fda4af;
}

.btn-icon-sm.del:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.42);
    color: #ffe4e6;
}

/* --- СТАТУС ЗАВЕРШЕНО (FINISHED) --- */
.st-status.finished { 
    background: rgba(148, 163, 184, 0.15); 
    color: #94a3b8; /* Серый цвет */
    border: 1px solid rgba(148, 163, 184, 0.3); 
}


/* ==========================================
   ВКЛАДКА INCOME
   ========================================== */
.income-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.income-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.income-summary-card {
    min-height: 74px;
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.income-summary-card.primary {
    border-color: rgba(56, 189, 248, 0.28);
    background: #111827;
}

.income-summary-card.muted {
    border-color: rgba(148, 163, 184, 0.18);
}

.income-summary-card span {
    color: #64748b;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.7px;
    text-transform: uppercase;
}

.income-summary-card strong {
    color: #f8fafc;
    font-size: 20px;
    font-weight: 900;
}

.income-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.income-card {
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.income-card:hover {
    border-color: rgba(56, 189, 248, 0.34);
    background: #121c2c;
    transform: translateY(-1px);
}

.income-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.62);
}

.inc-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.inc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(56, 189, 248, 0.13);
    border: 1px solid rgba(56, 189, 248, 0.22);
    color: #7dd3fc;
    font-weight: 900;
}

.inc-name {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 850;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.inc-status {
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.10);
    color: #64748b;
    border: 1px solid rgba(148, 163, 184, 0.14);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.6px;
}

.inc-status.active {
    color: #86efac;
    background: rgba(34, 197, 94, 0.10);
    border-color: rgba(34, 197, 94, 0.20);
}

.inc-sub {
    margin-top: 4px;
    color: #64748b;
    font-size: 11px;
    font-weight: 650;
}

.inc-total {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.inc-total-box {
    min-width: 106px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.15);
    text-align: right;
}

.inc-total-box.secondary {
    min-width: 84px;
    background: rgba(56, 189, 248, 0.07);
    border-color: rgba(56, 189, 248, 0.16);
}

.inc-total-box span {
    display: block;
    margin-bottom: 2px;
    color: #64748b;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.inc-total-box strong {
    color: #86efac;
    font-size: 16px;
    font-weight: 900;
}

.inc-total-box.secondary strong {
    color: #7dd3fc;
}

.inc-arrow {
    color: #94a3b8;
    transition: transform 0.3s ease;
    margin-left: 2px;
}

.income-details {
    background: #0b1120;
    border-top: 1px solid #1e293b;
    padding: 8px 10px;
}

.income-day-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    font-size: 13px;
}
.income-day-row:last-child { border-bottom: none; }

.inc-date { color: #cbd5e1; font-weight: 500; }
.inc-date i { margin-right: 6px; color: #64748b; }

.inc-amounts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.inc-amt {
    padding: 5px 8px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 11px;
}
.inc-amt { color: #86efac; background: rgba(34, 197, 94, 0.08); }
.inc-amt.muted { color: #93c5fd; background: rgba(59, 130, 246, 0.08); }

.income-empty,
.income-no-days {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    padding: 18px;
}

@media (max-width: 980px) {
    .income-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .income-header { align-items: flex-start; flex-direction: column; }
    .inc-total { width: 100%; justify-content: space-between; }
    .inc-total-box { flex: 1; }
}


/* ==========================================
   СТИЛИ ДЛЯ ВЫБОРА МЕСЯЦА (INCOME TAB) - ФИНАЛ
   ========================================== */
.income-month-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 158px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.92));
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 8px;
    padding: 0 14px;
    height: 40px;
    color: #f1f5f9;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s;
    box-shadow: 0 4px 12px rgba(2, 6, 23, 0.28);
    overflow: visible;
    user-select: none;
}

.income-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.income-sort-toggle {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 4px;
    gap: 4px;
    border-radius: 8px;
    background: #0f172a;
    border: 1px solid #334155;
}

.income-sort-btn {
    height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s, color 0.2s;
}

.income-sort-btn:hover {
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.08);
}

.income-sort-btn.active {
    color: #0f172a;
    background: #38bdf8;
}

.income-month-wrapper:hover {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.16), 0 8px 18px rgba(2, 6, 23, 0.32);
    background: linear-gradient(180deg, rgba(15, 23, 42, 1), rgba(30, 41, 59, 0.96));
    transform: translateY(-1px);
}

.income-month-wrapper i {
    color: #38bdf8;
    font-size: 16px;
    pointer-events: none;
    z-index: 2;
}

#income-month-label {
    position: relative;
    z-index: 2;
    color: #f1f5f9;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

#income-month-picker {
    display: none;
}

.income-month-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 236px;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    background: #111827;
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.03);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.16s, transform 0.16s, visibility 0.16s;
    z-index: 3000;
}

.income-month-wrapper.open .income-month-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.income-month-dd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.income-month-dd-head strong {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 900;
}

.income-month-nav {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.78);
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.16s, color 0.16s, border-color 0.16s;
}

.income-month-nav:hover {
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.38);
    background: rgba(56, 189, 248, 0.08);
}

.income-month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.income-month-option {
    height: 34px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.56);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.16s;
}

.income-month-option:hover {
    color: #f8fafc;
    border-color: rgba(56, 189, 248, 0.34);
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-1px);
}

.income-month-option.active {
    color: #0f172a;
    border-color: #38bdf8;
    background: #38bdf8;
}
