/* ==========================================================================
   Linear & Raycast Inspired Minimalist Dark Theme
   ========================================================================== */

:root {
    color-scheme: dark;
    /* Surface ladder */
    --bg-canvas: #0f1013;
    --bg-sidebar: #15161b;
    --bg-surface: #1b1c23;
    --bg-surface-hover: #22242e;
    --bg-surface-active: #2a2c38;
    --bg-card: #181922;
    --bg-tertiary: #252733;
    
    /* Active Purple (From reference UI) */
    --accent-purple: #5846c2;
    --accent-purple-hover: #6652de;
    --accent-purple-border: #7562ec;
    --accent-purple-glow: rgba(88, 70, 194, 0.35);
    --accent-violet: #8b5cf6;

    /* Functional Accents */
    --accent-emerald: #10b981;
    --accent-rose: #f43f5e;
    --accent-amber: #f59e0b;
    --accent-cyan: #38bdf8;

    /* Hairline borders */
    --border-subtle: rgba(255, 255, 255, 0.07);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-highlight: rgba(255, 255, 255, 0.18);

    /* Typography - Minimalist, modern clean Inter */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;

    /* Layout metrics */
    --sidebar-width: 240px;
    --chat-sidebar-width: 310px;
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Squircle Icon sizes */
    --squircle-size: 28px;

    /* Smooth Motion */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.18s var(--ease-out-expo);
    --transition-normal: all 0.28s var(--ease-out-expo);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

input, button, textarea, select {
    font-family: var(--font-sans);
}

code, pre, .key-display, .mono-text, .crypto-address, .admin-key-cell, .token-field, #licenseKeyInput, #newIssuedKeyText {
    font-family: var(--font-sans) !important;
    letter-spacing: 0.2px;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: -0.011em;
}

/* Custom Minimalist Scrollbar */
.custom-scroll::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Base Layout */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-canvas);
}

/* ==========================================================================
   Sidebar Navigation (Refined Minimalist Style)
   ========================================================================== */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
    z-index: 20;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.sidebar::-webkit-scrollbar {
    width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.sidebar-header {
    margin-bottom: 10px;
    padding: 0 2px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.brand-icon-squircle {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #5846c2 0%, #3b82f6 100%);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(88, 70, 194, 0.4);
    flex-shrink: 0;
}

.brand-icon-squircle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.brand-title .badge-subtle {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-left: 4px;
    letter-spacing: 0.5px;
}

/* Search bar on top of sidebar (Like in reference screenshot) */
.sidebar-search {
    position: relative;
    margin-bottom: 8px;
}

.sidebar-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    pointer-events: none;
}

.sidebar-search-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.sidebar-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 6px 10px 6px 30px;
    font-size: 11.5px;
    outline: none;
    transition: var(--transition-fast);
}

.sidebar-search-input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-medium);
}

.sidebar-search-input::placeholder {
    color: var(--text-tertiary);
}

/* Sidebar Nav Items */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5.5px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    width: 100%;
    text-align: left;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

/* Active Nav Item (Reference UI Match) */
.nav-item.active {
    background: var(--accent-purple);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 14px var(--accent-purple-glow);
}

.nav-item.active .squircle-icon {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Squircle Icon Badge (Square with rounded corners + line icon) */
.squircle-icon {
    width: var(--squircle-size);
    height: var(--squircle-size);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.squircle-icon svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item:hover .squircle-icon {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.07);
}

.nav-title {
    flex: 1;
    letter-spacing: -0.1px;
}

.nav-badge {
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 600;
}

.nav-badge.glow {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}

.nav-item.active .nav-badge.glow {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.nav-badge.unread-badge {
    background: var(--accent-rose);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.nav-badge.info-badge {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-tertiary);
}

.nav-item.active .nav-badge.info-badge {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.hidden {
    display: none !important;
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}

/* User Profile Widget (Sidebar bottom) */
.user-profile-widget {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    margin-bottom: 4px;
}

.user-profile-widget:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.user-profile-widget:active {
    transform: scale(0.985);
}

.user-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.user-profile-avatar.admin {
    background: rgba(234, 179, 8, 0.15);
    border-color: rgba(234, 179, 8, 0.35);
}

.user-profile-avatar.pro {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-color: rgba(99, 102, 241, 0.4);
}

.user-profile-widget:hover .user-profile-avatar {
    border-color: rgba(99, 102, 241, 0.5);
}

.user-profile-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    gap: 1px;
}

.user-profile-top {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.user-profile-name {
    font-size: 11.5px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-profile-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-emerald);
    flex-shrink: 0;
    box-shadow: 0 0 5px var(--accent-emerald);
}

.user-profile-status-dot.expired {
    background: var(--accent-rose);
    box-shadow: 0 0 5px var(--accent-rose);
}

.user-profile-status-dot.guest {
    background: var(--accent-amber);
    box-shadow: 0 0 5px var(--accent-amber);
}

.user-profile-bottom {
    overflow: hidden;
}

.user-profile-sub {
    font-size: 9.5px;
    color: var(--text-tertiary);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: block;
}

.user-profile-action-arrow {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    transition: transform 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.user-profile-widget:hover .user-profile-action-arrow {
    color: #fff;
    transform: translateX(2px);
}

.system-status-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 10.5px;
    color: var(--text-secondary);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 6px var(--accent-emerald);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

/* ==========================================================================
   Main Area
   ========================================================================== */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-canvas);
    overflow: hidden;
}

.top-bar {
    height: 60px;
    min-height: 60px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
}

.view-heading h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.view-heading .subtitle {
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-top: 1px;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-clock {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition-fast);
}

.btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.btn-primary {
    background: var(--accent-purple);
    color: #fff;
    border-color: var(--accent-purple-border);
    box-shadow: 0 2px 8px var(--accent-purple-glow);
}

.btn-primary:hover {
    background: var(--accent-purple-hover);
    box-shadow: 0 4px 14px var(--accent-purple-glow);
}

.btn-secondary {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-ghost {
    background: transparent;
    color: var(--text-tertiary);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: var(--radius-sm);
}

/* Viewport */
.tab-viewport {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
    position: relative;
}

.tab-pane {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s var(--ease-out-expo), transform 0.25s var(--ease-out-expo);
    min-height: 100%;
}

#pane-messages.tab-pane {
    height: 100%;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Tab 1: Главная (Dashboard)
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: var(--transition-fast);
}

.stat-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-medium);
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-icon-wrap {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
}

.stat-icon-wrap svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 3px;
    color: var(--text-primary);
}

.stat-value.text-sm {
    font-size: 18px;
}

.stat-desc {
    font-size: 11.5px;
    color: var(--text-tertiary);
}

/* Event Log Card */
.card-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 280px;
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.card-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title-group h3 {
    font-size: 13.5px;
    font-weight: 600;
}

.tag-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    background: rgba(88, 70, 194, 0.15);
    color: #a5b4fc;
    border-radius: 4px;
}

.activity-feed {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feed-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 12px;
}

.feed-time {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 500;
    min-width: 55px;
}

.feed-badge {
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
}

.feed-text {
    color: var(--text-primary);
    flex: 1;
}

/* ==========================================================================
   Tab 2: Сообщения (Fixed Workspace Layout - NO OVERLAPPING)
   ========================================================================== */
.chat-workspace {
    display: flex;
    flex: 1;
    min-height: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

/* Left: Dialogs Column */
.chat-sidebar {
    width: var(--chat-sidebar-width);
    min-width: var(--chat-sidebar-width);
    max-width: var(--chat-sidebar-width);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    overflow: hidden;
}

.chat-sidebar-header {
    padding: 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(0, 0, 0, 0.1);
}

/* Account Selector Widget */
.account-selector-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    position: relative;
}

.account-selector-box .squircle-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.account-info-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.account-label-micro {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

.account-select-native {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 12.5px;
    font-weight: 600;
    outline: none;
    width: 100%;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    padding: 0;
    margin-top: 1px;
}

.account-select-native option {
    background: var(--bg-surface);
    color: var(--text-primary);
}

/* Search input */
.dialog-search-wrapper {
    position: relative;
    width: 100%;
}

.dialog-search-wrapper svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    stroke: var(--text-tertiary);
    stroke-width: 2;
    fill: none;
    pointer-events: none;
}

.dialog-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 7px 10px 7px 30px;
    font-size: 12px;
    outline: none;
    transition: var(--transition-fast);
}

.dialog-search-input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-medium);
}

.dialog-search-input::placeholder {
    color: var(--text-tertiary);
}

/* Dialogs List */
.dialogs-list {
    flex: 1;
    overflow-y: auto;
}

.dialog-item {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: var(--transition-fast);
    align-items: center;
}

.dialog-item:hover {
    background: var(--bg-surface-hover);
}

.dialog-item.active {
    background: rgba(88, 70, 194, 0.14);
    border-left: 3px solid var(--accent-purple);
}

.dialog-avatar-squircle {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-active);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.dialog-item.active .dialog-avatar-squircle {
    background: var(--accent-purple);
    color: #fff;
    border-color: var(--accent-purple-border);
}

.dialog-content-info {
    flex: 1;
    min-width: 0;
}

.dialog-row-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.dialog-user-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dialog-time-label {
    font-size: 11px;
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-left: 6px;
}

.dialog-ad-caption {
    font-size: 11px;
    color: var(--accent-cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.dialog-row-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dialog-message-preview {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.dialog-unread-pill {
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--accent-purple);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-left: 6px;
    flex-shrink: 0;
}

/* Right: Chat Main View */
.chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-canvas);
    overflow: hidden;
}

.chat-empty-placeholder {
    margin: auto;
    text-align: center;
    max-width: 320px;
    color: var(--text-tertiary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.placeholder-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.placeholder-icon-wrap svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    stroke-width: 1.6;
    fill: none;
}

.chat-empty-placeholder h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.chat-empty-placeholder p {
    font-size: 12px;
    line-height: 1.6;
}

/* Chat Header Bar */
.chat-header-bar {
    height: 60px;
    min-height: 60px;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
}

.chat-header-info {
    min-width: 0;
    flex: 1;
}

.chat-header-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.chat-header-subtitle {
    font-size: 11px;
    color: var(--accent-cyan);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Text Selection Highlight */
::selection {
    background: rgba(139, 92, 246, 0.45);
    color: #ffffff;
}

/* Chat History Bubbles */
.chat-history {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    user-select: text;
    -webkit-user-select: text;
}

.bubble-row {
    display: flex;
    flex-direction: column;
    max-width: 78%;
    width: fit-content;
}

.bubble-row.me {
    align-self: flex-end;
    align-items: flex-end;
}

.bubble-row.other {
    align-self: flex-start;
    align-items: flex-start;
}

.bubble-item-wrap {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    max-width: 100%;
}

.bubble-row.me .bubble-item-wrap {
    flex-direction: row-reverse;
}

.bubble-container {
    padding: 8px 12px 6px 12px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
    width: fit-content;
    max-width: 100%;
    min-width: 60px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
    position: relative;
    display: flex;
    flex-direction: column;
    user-select: text;
    -webkit-user-select: text;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.bubble-container {
    cursor: text;
}

.bubble-container.bubble-copy-flash {
    animation: bubblePulse 0.45s ease;
}

@keyframes bubblePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.025); box-shadow: 0 0 16px rgba(139, 92, 246, 0.65); }
    100% { transform: scale(1); }
}

.bubble-row.me .bubble-container {
    background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.bubble-row.other .bubble-container {
    background: #1e202e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border-bottom-left-radius: 3px;
}

.bubble-sender {
    font-size: 11px;
    font-weight: 600;
    color: #a78bfa;
    margin-bottom: 2px;
    line-height: 1.2;
    letter-spacing: 0.2px;
    user-select: none;
    -webkit-user-select: none;
}

.bubble-text {
    white-space: pre-wrap;
    word-break: break-word;
    user-select: text;
    -webkit-user-select: text;
    cursor: text;
}

.bubble-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 3px;
    user-select: none;
    -webkit-user-select: none;
}

.bubble-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    line-height: 1.1;
    user-select: none;
    -webkit-user-select: none;
}

.bubble-row.me .bubble-time {
    color: rgba(255, 255, 255, 0.75);
}

.bubble-check-icon {
    opacity: 0.85;
    flex-shrink: 0;
    user-select: none;
    -webkit-user-select: none;
}

.bubble-copy-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #1e202e;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.15s ease, background 0.15s, color 0.15s, border-color 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    margin-top: 4px;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

.bubble-row:hover .bubble-copy-btn {
    opacity: 0.85;
    pointer-events: auto;
}

.bubble-copy-btn:hover {
    opacity: 1;
    background: var(--accent-violet);
    color: #ffffff;
    border-color: var(--accent-violet);
    transform: scale(1.1);
}

.bubble-copy-btn.copied {
    opacity: 1;
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

/* Chat Input Wrapper & Attachment Bar */
.chat-input-wrapper {
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-attached-preview-bar {
    padding: 8px 18px;
    background: rgba(139, 92, 246, 0.08);
    border-bottom: 1px solid rgba(139, 92, 246, 0.22);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeIn 0.18s ease;
}

.chat-attached-thumb-wrap {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    border: 1.5px solid var(--accent-violet);
    background: #000;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}

.chat-attached-thumb-wrap:hover {
    transform: scale(1.06);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.45);
}

.chat-attached-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-attached-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.chat-attached-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-attached-hint {
    font-size: 10.5px;
    color: var(--accent-violet);
}

.chat-attached-del-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    transition: var(--transition-fast);
}

.chat-attached-del-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Chat Input Bar */
.chat-input-bar {
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: transparent;
}

.chat-attach-clip-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.chat-attach-clip-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.chat-attach-clip-btn.has-attachment {
    background: rgba(139, 92, 246, 0.16);
    border-color: var(--accent-violet);
    color: var(--accent-violet);
}

.chat-input-field {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 13px;
    line-height: 20px;
    outline: none;
    resize: none;
    min-height: 42px;
    max-height: 140px;
    height: 42px;
    overflow-y: hidden;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.chat-input-field:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--border-medium);
}

.chat-input-field::placeholder {
    color: var(--text-tertiary);
}

.chat-input-field::-webkit-scrollbar {
    width: 4px;
}

.chat-input-field::-webkit-scrollbar-track {
    background: transparent;
}

.chat-input-field::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.chat-input-field::-webkit-scrollbar-thumb:hover {
    background: var(--accent-violet);
}

.chat-send-btn {
    height: 42px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-purple);
    border: 1px solid var(--accent-purple-border);
    color: #ffffff;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
    background: var(--accent-purple-hover);
}

.chat-send-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.chat-send-btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Картинки в пузырях чата */
.chat-bubble-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.chat-bubble-img-wrap {
    max-width: 220px;
    max-height: 180px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-medium);
    cursor: pointer;
    background: rgba(0, 0, 0, 0.4);
    transition: transform 0.18s, box-shadow 0.18s;
}

.chat-bubble-img-wrap:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.chat-bubble-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Drag & Drop для окна чата */
.chat-main.chat-drag-over {
    position: relative;
}

.chat-main.chat-drag-over::after {
    content: '📥 Отпустите фото для прикрепления к ответу';
    position: absolute;
    inset: 0;
    background: rgba(10, 13, 20, 0.88);
    border: 2px dashed var(--accent-violet);
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--accent-violet);
    backdrop-filter: blur(4px);
    z-index: 50;
    pointer-events: none;
}

/* ==========================================================================
   Tab 3: Аккаунты
   ========================================================================== */
.accounts-tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.account-card-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px;
    transition: var(--transition-fast);
    cursor: pointer;
}

.account-card-panel:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent-purple-border);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   Account Detail Modal Dialog
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.modal-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #171821;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    width: 580px;
    max-width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    transform: scale(0.96) translateY(10px);
    transition: transform 0.25s var(--ease-out-expo);
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.modal-card::-webkit-scrollbar {
    width: 4px;
}

.modal-card::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.modal-backdrop.open .modal-card {
    transform: scale(1) translateY(0);
}

.modal-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-account-ident {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-avatar-squircle {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--accent-purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 4px 14px var(--accent-purple-glow);
}

.modal-account-meta h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-account-meta p {
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.modal-close-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.modal-bento-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.modal-bento-item {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
}

.modal-bento-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-bento-val {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.modal-bento-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.modal-dialogs-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-dialog-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.modal-dialog-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 12px;
}

.modal-dialog-user {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-dialog-snippet {
    font-size: 11.5px;
    color: var(--text-tertiary);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.modal-card-lg {
    width: 660px;
    max-width: 95vw;
    max-height: 92vh;
    overflow-y: auto;
    padding: 18px 20px;
    gap: 12px;
}

/* Modal Proxy Section */
.modal-proxy-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-proxy-card {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
}

.modal-proxy-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
}

.proxy-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

.modal-proxy-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Custom Inputs & Proxy Hints */
.custom-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 12px;
    outline: none;
    transition: var(--transition-fast);
}

.custom-input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--accent-purple-border);
    box-shadow: 0 0 0 2px var(--accent-purple-glow);
}

.custom-input::placeholder {
    color: var(--text-tertiary);
}

/* Fix Native and Custom Selects & Options */
select,
select.custom-input {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-color: #171822 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    padding-right: 32px !important;
    cursor: pointer !important;
    color: #f8fafc !important;
}

select option,
select.custom-input option {
    background-color: #181924 !important;
    color: #f8fafc !important;
    padding: 10px 14px !important;
    font-size: 12.5px !important;
}

select option:checked,
select option:hover {
    background-color: #5846c2 !important;
    color: #ffffff !important;
}

.proxy-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    line-height: 1.4;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 26px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.015);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-purple);
    background: rgba(88, 70, 194, 0.07);
    box-shadow: 0 0 20px rgba(88, 70, 194, 0.15);
}

.dropzone-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.dropzone:hover .dropzone-icon, .dropzone.dragover .dropzone-icon {
    background: var(--accent-purple);
    color: #ffffff;
    border-color: var(--accent-purple-border);
    transform: translateY(-2px);
}

.dropzone-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.dropzone-browse-link {
    color: #818cf8;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.dropzone-sub {
    font-size: 11.5px;
    color: var(--text-tertiary);
    max-width: 460px;
    line-height: 1.4;
}

/* Import Files Section */
.import-files-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.import-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.proxy-mode-switcher {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.proxy-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.proxy-tab-btn:hover {
    color: var(--text-primary);
}

.proxy-tab-btn.active {
    background: var(--accent-purple);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--accent-purple-glow);
}

.shared-proxy-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-with-icon {
    display: flex;
    align-items: center;
    position: relative;
}

.input-with-icon svg {
    position: absolute;
    left: 12px;
    color: var(--text-tertiary);
    pointer-events: none;
}

.input-with-icon .custom-input {
    padding-left: 36px;
}

.individual-proxy-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.individual-proxy-list {
    max-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
}

.staged-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 12px;
}

.staged-file-info {
    width: 140px;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.staged-file-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.staged-file-size {
    font-size: 10.5px;
    color: var(--text-tertiary);
}

.staged-file-remove {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.staged-file-remove:hover {
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    border-color: rgba(244, 63, 94, 0.3);
}

.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
}

.status-chip.online {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-chip.error {
    background: rgba(244, 63, 94, 0.12);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.status-chip.init {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.status-chip.status-disabled {
    background: rgba(148, 163, 184, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.account-email-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.account-file-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-bottom: 14px;
}

.account-stats-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    color: var(--text-secondary);
}

/* ==========================================================================
   Tab 4: Настройки
   ========================================================================== */
.settings-wrapper {
    max-width: 620px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.settings-group-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 16px;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.settings-row-info h4 {
    font-size: 13px;
    font-weight: 600;
}

.settings-row-info p {
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .2s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .2s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-purple);
}

input:checked + .slider:before {
    transform: translateX(18px);
}

.input-num-styled {
    width: 70px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 6px 8px;
    text-align: center;
    font-size: 12px;
    outline: none;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: #1e1f28;
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    animation: toastSlide 0.25s var(--ease-out-expo);
    min-width: 260px;
}

@keyframes toastSlide {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

.empty-state {
    padding: 30px 16px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 12px;
}

/* ==========================================================================
   Sidebar Campaign Card (Рассылка)
   ========================================================================== */
.sidebar-campaign-card {
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.campaign-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.campaign-label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.campaign-title-micro {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-tertiary);
    letter-spacing: 0.5px;
}

.campaign-status-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-tertiary);
    transition: var(--transition-fast);
}

.campaign-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.btn-campaign {
    width: 100%;
    justify-content: center;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    background: var(--accent-purple);
    color: #ffffff;
    border: 1px solid var(--accent-purple-border);
    transition: var(--transition-fast);
}

.btn-campaign:hover {
    background: var(--accent-purple-hover);
    box-shadow: 0 4px 14px var(--accent-purple-glow);
}

.btn-campaign.running {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.35);
    color: #fb7185;
}

.btn-campaign.running:hover {
    background: rgba(244, 63, 94, 0.25);
    box-shadow: 0 0 14px rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   Custom Account Picker Dropdown (Chat Sidebar)
   ========================================================================== */
.custom-account-picker-wrap {
    position: relative;
    width: 100%;
}

.custom-account-picker-wrap .account-selector-box {
    cursor: pointer;
    transition: var(--transition-fast);
}

.custom-account-picker-wrap .account-selector-box:hover {
    border-color: var(--border-medium);
    background: var(--bg-surface-hover);
}

.account-current-email {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
    display: block;
}

.picker-chevron-icon {
    margin-left: auto;
    color: var(--text-tertiary);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
}

.custom-account-picker-wrap.open .picker-chevron-icon {
    transform: rotate(180deg);
}

.custom-account-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #171821;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: all 0.2s var(--ease-out-expo);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-account-picker-wrap.open .custom-account-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.account-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

.account-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.account-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.account-dropdown-item:hover {
    background: var(--bg-surface-hover);
}

.account-dropdown-item.active {
    background: rgba(88, 70, 194, 0.15);
    border-left: 3px solid var(--accent-purple);
}

.account-dropdown-avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.account-dropdown-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.account-dropdown-email {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-dropdown-meta {
    font-size: 10.5px;
    color: var(--text-tertiary);
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ==========================================================================
   Tab: Пасты (Pastes / Campaign Flow)
   ========================================================================== */
.pastes-wrapper {
    max-width: 780px;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pastes-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pastes-autosave-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    font-size: 11.5px;
    color: var(--text-tertiary);
    transition: all 0.25s ease;
    user-select: none;
}

.pastes-autosave-indicator.saved {
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.06);
}

.pastes-autosave-indicator.saving {
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.08);
}

.pastes-autosave-indicator.error {
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

.autosave-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    display: inline-block;
    transition: background 0.2s, box-shadow 0.2s;
}

.pastes-autosave-indicator.saved .autosave-dot {
    background: #34d399;
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
}

.pastes-autosave-indicator.saving .autosave-dot {
    background: #818cf8;
    box-shadow: 0 0 6px rgba(129, 140, 248, 0.6);
}

.pastes-autosave-indicator.error .autosave-dot {
    background: #f87171;
}

.pastes-scroll-area {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-right: 6px;
}

.paste-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.paste-card.active-card {
    border-color: rgba(88, 70, 194, 0.35);
}

.paste-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.paste-step-badge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.step-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.paste-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.paste-mode-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.mode-pill-btn {
    background: transparent;
    border: none;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.mode-pill-btn.active {
    background: var(--accent-purple);
    color: #ffffff;
}

.paste-cd-wrap, .paste-delay-box {
    display: flex;
    align-items: center;
    gap: 6px;
}

.paste-label-micro {
    font-size: 11px;
    color: var(--text-tertiary);
}

.paste-cd-input-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    gap: 4px;
}

.input-cd-styled {
    width: 44px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 11.5px;
    font-weight: 600;
    text-align: center;
    outline: none;
}

.cd-unit {
    font-size: 10px;
    color: var(--text-tertiary);
}

.paste-enable-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.paste-enable-label {
    font-size: 11px;
    color: var(--text-secondary);
}

.switch-sm {
    width: 34px;
    height: 18px;
}

.switch-sm .slider:before {
    width: 14px;
    height: 14px;
    left: 2px;
    bottom: 2px;
}

.switch-sm input:checked + .slider:before {
    transform: translateX(16px);
}

.paste-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 180px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 12.5px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: var(--transition-fast);
}

.paste-textarea:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent-purple-border);
    box-shadow: 0 0 0 2px var(--accent-purple-glow);
}

/* ==========================================================================
   Email Alert Modal & Detected Badge
   ========================================================================== */
.email-alert-card {
    max-width: 460px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(16, 185, 129, 0.2);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.email-alert-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.email-alert-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.email-alert-badge {
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #34d399;
    margin-bottom: 2px;
}

.email-alert-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-detected-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    margin-bottom: 10px;
}

.email-detected-val {
    font-size: 14px;
    font-weight: 700;
    color: #a7f3d0;
    letter-spacing: 0.2px;
}

.email-meta-info {
    display: flex;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.email-meta-info b {
    color: var(--text-secondary);
}

.email-alert-snippet {
    font-size: 11.5px;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    line-height: 1.4;
}

.email-highlight-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
}

/* ==========================================================================
   Accounts: Bulk Actions & Checkboxes & Roles
   ========================================================================== */
.accounts-bulk-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    margin-bottom: 12px;
}

.bulk-select-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.custom-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-secondary);
    user-select: none;
}

.custom-checkbox-wrap input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-mark {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-medium);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.custom-checkbox-wrap input:checked ~ .checkbox-mark {
    background: var(--accent-purple);
    border-color: var(--accent-purple-border);
}

.custom-checkbox-wrap input:checked ~ .checkbox-mark:after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.bulk-selected-counter {
    font-size: 11.5px;
    color: var(--text-tertiary);
}

.bulk-selected-counter b {
    color: var(--accent-purple);
}

.bulk-actions-btns {
    display: flex;
    gap: 6px;
}

.account-card-panel {
    position: relative;
}

.card-checkbox-pos {
    margin-right: 4px;
}

.account-role-badge {
    font-size: 11px;
    font-weight: 600;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1;
    box-sizing: border-box;
}

.account-role-badge.campaign-active {
    background: rgba(88, 70, 194, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(88, 70, 194, 0.3);
}

.account-role-badge.campaign-passive {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-tertiary);
    border: 1px solid var(--border-subtle);
}

.btn-danger {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fb7185;
}

.btn-danger:hover:not(:disabled) {
    background: rgba(244, 63, 94, 0.25);
    border-color: #fb7185;
    color: #ffffff;
    box-shadow: 0 0 12px rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   Custom Context Menu (ПКМ)
   ========================================================================== */
.custom-context-menu {
    position: fixed;
    z-index: 1000;
    width: 210px;
    background: #171821;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 5px;
    display: none;
    flex-direction: column;
    gap: 2px;
    animation: ctxFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ctxFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.context-menu-header {
    padding: 6px 9px 4px;
}

.context-menu-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.context-menu-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 3px 0;
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 7px 9px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
}

.context-menu-item:hover {
    background: var(--bg-surface-hover);
    color: #ffffff;
}

.context-menu-item.danger {
    color: #fb7185;
}

.context-menu-item.danger:hover {
    background: rgba(244, 63, 94, 0.16);
    color: #ff8598;
}

/* ==========================================================================
   Confirm Delete Modal
   ========================================================================== */
.modal-card-sm {
    max-width: 380px;
}

.confirm-delete-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 14px;
}

.confirm-delete-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: #fb7185;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==========================================================================
   Tab: Объявления (Ads & Targets)
   ========================================================================== */
.ads-view-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.ads-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.ads-main-split {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0;
}

.ads-upload-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}

.ads-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ads-card-header h4 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.dropzone-sm {
    padding: 14px 10px;
}

.ads-textarea-wrap {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.input-micro-label {
    font-size: 11px;
    color: var(--text-tertiary);
}

.ads-textarea {
    width: 100%;
    min-height: 120px;
    flex: 1;
    resize: none;
    font-size: 12px;
    line-height: 1.5;
}

.ads-list-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ads-subtabs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.01);
}

.ads-subtab-btns {
    display: flex;
    gap: 6px;
}

.ads-subtab-btn {
    background: transparent;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.ads-subtab-btn.active {
    background: rgba(88, 70, 194, 0.15);
    color: #a5b4fc;
}

.ads-subtab-actions {
    display: flex;
    gap: 6px;
}

.ads-queue-pane, .ads-emails-pane {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ad-queue-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    transition: var(--transition-fast);
}

.ad-queue-row:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-medium);
}

.ad-row-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.ad-row-title {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-row-meta {
    font-size: 10.5px;
    color: var(--text-tertiary);
    display: flex;
    gap: 8px;
}

.ad-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
}

.ad-remove-btn:hover {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.15);
}

.email-lead-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    transition: var(--transition-fast);
}

.email-lead-row:hover {
    background: rgba(16, 185, 129, 0.1);
}

.email-lead-val {
    font-size: 13px;
    font-weight: 700;
    color: #a7f3d0;
}

.email-lead-sub {
    font-size: 10.5px;
    color: var(--text-tertiary);
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

/* --- Global Number Input Fix (Hide browser native spinners) --- */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* --- Sleek Linear/Raycast Stepper Controls for Delay & Cooldown --- */
.paste-cd-wrap, .paste-delay-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.paste-label-micro {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-tertiary);
    user-select: none;
    white-space: nowrap;
}

.paste-cd-input-box {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2px 6px;
    gap: 2px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: var(--transition-fast);
}

.paste-cd-input-box:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(99, 102, 241, 0.35);
}

.paste-cd-input-box:focus-within {
    background: rgba(255, 255, 255, 0.07);
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.stepper-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    padding: 0;
    user-select: none;
}

.stepper-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.stepper-btn:active {
    transform: scale(0.92);
}

.input-cd-styled {
    width: 34px;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 700;
    font-family: var(--font-sans);
    text-align: center;
    padding: 0;
}

.cd-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-right: 2px;
    user-select: none;
}

/* --- Disabled Account Styling --- */
.account-card.account-disabled,
.account-card-panel.account-disabled {
    opacity: 0.65;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.015);
    filter: grayscale(0.2);
    transition: var(--transition-normal);
}

.account-card.account-disabled:hover,
.account-card-panel.account-disabled:hover {
    opacity: 0.9;
    border-color: rgba(255, 255, 255, 0.25);
}

.status-badge.status-disabled,
.status-chip.status-disabled {
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: #94a3b8;
    cursor: pointer;
}

.status-chip.status-disabled:hover {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
}

.status-chip.online {
    cursor: pointer;
}

.status-badge.status-disabled .status-dot {
    background: #64748b;
    box-shadow: none;
}

.account-role-badge {
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
}

.account-role-badge:hover {
    transform: translateY(-1px);
    filter: brightness(1.15);
}

.account-role-badge.role-disabled {
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.account-footer-disabled {
    color: #64748b !important;
}

.btn-card-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    transition: all 0.15s ease;
    flex-shrink: 0;
    outline: none;
    user-select: none;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.btn-card-toggle:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
    color: var(--text-primary);
}

.btn-card-toggle.btn-card-play {
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.12);
}

.btn-card-toggle.btn-card-play:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.55);
    color: #6ee7b7;
    transform: translateY(-1px);
}

.btn-card-toggle.btn-card-pause {
    color: var(--text-tertiary);
}

.btn-card-toggle.btn-card-pause:hover {
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.35);
    background: rgba(244, 63, 94, 0.1);
    transform: translateY(-1px);
}

.account-card-unread-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 7px;
    border-radius: 6px;
    background: rgba(88, 70, 194, 0.18);
    border: 1px solid rgba(88, 70, 194, 0.35);
    color: #c7d2fe;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
    box-sizing: border-box;
}


/* ==========================================================================
   API Tab
   ========================================================================== */
.api-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 16px;
    padding-bottom: 40px;
}

.api-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: min-content;
    gap: 16px;
    padding: 0;
}

.api-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    min-height: fit-content;
    height: auto;
}

.api-card-full {
    grid-column: 1 / -1;
}

.api-hint-card {
    background: rgba(88, 70, 194, 0.04);
    border-color: rgba(88, 70, 194, 0.15);
}

.api-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    gap: 10px;
    flex-shrink: 0;
}

.api-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.api-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

@media (max-width: 1024px) {
    .api-cards-grid {
        grid-template-columns: 1fr;
    }
}

.api-field-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.api-field-label {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.api-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.api-field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.api-mode-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.api-mode-toggle {
    display: flex;
    gap: 6px;
}

.api-auto-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    font-style: italic;
}

.api-manual-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.api-rand-btn {
    flex-shrink: 0;
    font-size: 15px;
    padding: 0 8px;
    height: 34px;
    line-height: 1;
}

.api-test-result {
    margin-top: 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.api-result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-subtle);
}

.api-result-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 5px;
}

.api-result-badge.success {
    background: rgba(16,185,129,0.15);
    color: #34d399;
    border: 1px solid rgba(16,185,129,0.25);
}

.api-result-badge.error {
    background: rgba(244,63,94,0.12);
    color: #fb7185;
    border: 1px solid rgba(244,63,94,0.25);
}

.api-result-url {
    font-size: 12px;
    color: var(--accent-cyan);
    word-break: break-all;
    text-decoration: underline;
    cursor: pointer;
}

.api-result-raw {
    padding: 10px 12px;
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 140px;
    overflow-y: auto;
    background: transparent;
}

.api-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.api-placeholder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
}

.api-placeholder-item code {
    font-size: 12px;
    font-weight: 600;
    color: #a78bfa;
    background: rgba(88,70,194,0.1);
    padding: 2px 7px;
    border-radius: 4px;
    flex-shrink: 0;
}

.api-placeholder-item span {
    font-size: 11.5px;
    color: var(--text-tertiary);
}

/* Prevent child elements from intercepting clicks on toggle buttons */
.btn-card-toggle svg, .btn-card-toggle polygon, .btn-card-toggle rect, .btn-card-toggle span {
    pointer-events: none;
}

.modal-toggle-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}
.modal-toggle-status-btn.enable {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34d399;
}
.modal-toggle-status-btn.enable:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.6);
    color: #6ee7b7;
}
.modal-toggle-status-btn.disable {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: #fb7185;
}
.modal-toggle-status-btn.disable:hover {
    background: rgba(244, 63, 94, 0.22);
    border-color: rgba(244, 63, 94, 0.55);
    color: #fda4af;
}


/* ===== МЕЙЛЕР: Выбор аккаунтов для отправки писем ===== */
.mailer-account-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mailer-acc-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
    position: relative;
}
.mailer-acc-row:hover {
    border-color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.06);
}
.mailer-acc-row.selected {
    border-color: var(--accent-violet);
    background: rgba(139, 92, 246, 0.12);
}
.mailer-acc-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.mailer-acc-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-violet);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mailer-acc-info {
    flex: 1;
    min-width: 0;
}
.mailer-acc-email {
    display: block;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mailer-acc-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}
.mailer-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.mailer-status-dot.online { background: var(--accent-emerald); }
.mailer-status-dot.offline { background: var(--accent-rose); }

.mailer-acc-check-icon {
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-violet);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.api-mailer-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* ===== ДИАЛОГ: непрочитанный ===== */
.dialog-item.dialog-unread .dialog-user-name {
    font-weight: 700;
    color: var(--text-primary);
}
.dialog-item.dialog-unread .dialog-message-preview {
    color: var(--text-secondary);
    font-weight: 500;
}
.dialog-item.dialog-unread {
    border-left: 3px solid var(--accent-violet);
}

/* ===== ЧАТ: разделитель непрочитанных ===== */
.chat-unread-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 8px;
    color: var(--accent-violet);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.chat-unread-divider::before,
.chat-unread-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(139, 92, 246, 0.3);
}

/* ===== ЧАТ: системное уведомление платформы ===== */
.chat-system-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 0 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
}
.chat-system-divider span {
    background: rgba(255, 255, 255, 0.05);
    padding: 3px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.chat-system-divider::before,
.chat-system-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* ===== ЧАТ: пузырь непрочитанного сообщения ===== */
.bubble-row.bubble-unread .bubble-container {
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.15);
}

/* ===== МЕЙЛЕР v2: переключатель + SMTP поля ===== */
.mailer-acc-row {
    border-radius: 10px;
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color 0.15s;
    margin-bottom: 6px;
}
.mailer-acc-row.selected {
    border-color: var(--accent-violet);
}
.mailer-acc-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    gap: 12px;
}
.mailer-acc-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}
/* Toggle switch for mailer */
.mailer-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}
.mailer-switch input { opacity: 0; width: 0; height: 0; }
.mailer-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-tertiary);
    border-radius: 22px;
    transition: background 0.2s;
    border: 1px solid var(--border-subtle);
}
.mailer-slider::before {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    left: 2px; bottom: 2px;
    background: var(--text-tertiary);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.mailer-switch input:checked + .mailer-slider {
    background: var(--accent-violet);
    border-color: var(--accent-violet);
}
.mailer-switch input:checked + .mailer-slider::before {
    transform: translateX(16px);
    background: #fff;
}

/* SMTP fields grid */
.mailer-smtp-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 14px 12px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 0;
    background: rgba(139,92,246,0.04);
}
.mailer-smtp-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.mailer-smtp-field.mailer-smtp-field-sm {
    /* small fields take half of their column */
}
.mailer-smtp-field label {
    font-size: 10.5px;
    color: var(--text-tertiary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 8px;
}

/* ===== ВЛОЖЕНИЯ ФОТО В ПАСТАХ ===== */
.paste-attach-bar {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
}
.btn-attach-photo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed var(--border-subtle);
    border-radius: 7px;
    padding: 6px 12px;
    color: var(--text-secondary);
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-attach-photo:hover {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-violet);
    color: #fff;
}
.btn-attach-photo svg {
    color: var(--accent-violet);
}

.paste-attach-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 6px 10px;
}
.paste-attach-thumb-wrap {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 1.5px solid var(--accent-violet);
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, box-shadow 0.15s;
}
.paste-attach-thumb-wrap:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}
.paste-attach-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.paste-attach-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.paste-attach-name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}
.paste-attach-tag {
    font-size: 10px;
    color: var(--accent-violet);
    font-weight: 500;
}
.paste-attach-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.paste-attach-toggle-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}
.paste-attach-toggle-text {
    font-size: 11.5px;
    color: var(--text-secondary);
}
.paste-attach-toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.paste-attach-toggle-switch {
    position: relative;
    width: 32px;
    height: 18px;
    background: var(--bg-tertiary);
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    transition: background 0.2s;
    display: inline-block;
}
.paste-attach-toggle-switch::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    left: 2px;
    bottom: 2px;
    background: var(--text-tertiary);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.paste-attach-toggle-label input:checked + .paste-attach-toggle-switch {
    background: var(--accent-violet);
    border-color: var(--accent-violet);
}
.paste-attach-toggle-label input:checked + .paste-attach-toggle-switch::before {
    transform: translateX(14px);
    background: #fff;
}
.paste-attach-del-btn {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.paste-attach-del-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Modal lightbox для фото */
.modal-card-image-preview {
    max-width: 720px;
    width: 92vw;
    background: #171821;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    transform: scale(0.96) translateY(10px);
    transition: transform 0.25s var(--ease-out-expo);
}
.modal-backdrop.open .modal-card-image-preview {
    transform: scale(1) translateY(0);
}
.image-preview-body {
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 200px;
}
.image-preview-body img {
    max-width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    display: block;
    user-select: none;
}

/* Drag & Drop подсветка для карточки пасты */
.paste-card.paste-drag-over {
    border-color: var(--accent-violet) !important;
    background: rgba(139, 92, 246, 0.08) !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.25) !important;
    position: relative;
}
.paste-card.paste-drag-over::after {
    content: '📥 Отпустите фото для прикрепления';
    position: absolute;
    inset: 0;
    background: rgba(10, 13, 20, 0.85);
    border: 2px dashed var(--accent-violet);
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-violet);
    backdrop-filter: blur(2px);
    z-index: 10;
    pointer-events: none;
}

/* Кнопка и бейдж проверки прокси */
.btn-proxy-test {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    user-select: none;
}

.btn-proxy-test:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border-color: rgba(99, 102, 241, 0.45);
    transform: translateY(-1px);
}

.btn-proxy-test:active:not(:disabled) {
    transform: translateY(0);
}

.btn-proxy-test:disabled {
    opacity: 0.65;
    cursor: wait;
}

.proxy-ping-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.3;
    animation: fadeIn 0.2s ease;
    width: fit-content;
}

.proxy-ping-badge.success {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.proxy-ping-badge.error {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.proxy-ping-badge.checking {
    background: rgba(99, 102, 241, 0.12);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Компактная кнопка проверки на карточке аккаунта */
.btn-card-proxy-ping {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-tertiary);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.18s;
    margin-left: 4px;
    flex-shrink: 0;
}

.btn-card-proxy-ping:hover {
    color: #818cf8;
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(99, 102, 241, 0.15);
    transform: scale(1.08);
}

/* --- Стили для выбора мейлеров в АПИ --- */
.mailer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.mailer-option-card {
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.mailer-option-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    background: rgba(255, 255, 255, 0.04);
}

.mailer-option-card.active {
    border-color: var(--accent-indigo);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.15);
}

.mailer-option-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mailer-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mailer-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.mailer-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.badge-at {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-pl {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.mailer-desc {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 6px;
    line-height: 1.4;
}

.mailer-supported-tag {
    font-size: 11px;
    color: var(--accent-emerald);
    font-weight: 600;
    margin-top: 6px;
}

.mailer-unsupported-tag {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.mailer-test-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px;
}

/* Responsive adjustments for lower height screens (e.g. 768px, 720p laptops) */
@media (max-height: 820px) {
    .sidebar {
        padding: 8px 6px;
    }
    .sidebar-header {
        margin-bottom: 6px;
    }
    .brand {
        margin-bottom: 4px;
    }
    .sidebar-search {
        margin-bottom: 4px;
    }
    .squircle-icon {
        width: 24px;
        height: 24px;
    }
    .squircle-icon svg {
        width: 13px;
        height: 13px;
    }
    .nav-item {
        padding: 4px 6px;
        font-size: 12px;
        gap: 6px;
    }
    .sidebar-campaign-card {
        padding: 6px 8px;
        margin-bottom: 6px;
        gap: 4px;
    }
    .btn-campaign {
        padding: 6px;
        font-size: 11px;
    }
    .sidebar-footer {
        padding-top: 6px;
    }
    .top-bar {
        height: 48px;
        min-height: 48px;
        padding: 0 16px;
    }
    .modal-card {
        padding: 16px;
        gap: 10px;
    }
    .modal-card-lg {
        padding: 14px 16px;
        gap: 10px;
    }
}

/* ==========================================================================
   Admin Panel Pro: Minimalist Redesign, Users Management & Plan Pricing
   ========================================================================== */

.admin-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.admin-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-title-group h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.025em;
}

.admin-subtabs-nav {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 4px;
    margin-bottom: 18px;
}

.admin-subtab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-subtab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.admin-subtab-btn.active {
    color: #ffffff;
    background: var(--accent-purple);
    box-shadow: 0 2px 8px var(--accent-purple-glow);
}

.admin-subpane {
    display: none;
    animation: fadeIn 0.18s var(--ease-out-expo);
}

.admin-subpane.active {
    display: block;
}

/* Admin Users Table & Toolbar */
.admin-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.admin-search-wrap {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 380px;
}

.admin-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    display: flex;
    pointer-events: none;
}

.admin-search-input {
    width: 100%;
    padding: 7px 10px 7px 32px !important;
    font-size: 12px;
}

.admin-filter-pills {
    display: flex;
    gap: 6px;
}

.admin-filter-pill {
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-filter-pill.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #fff;
}

/* User Card Cells */
.user-key-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-sans) !important;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 7px;
    border-radius: 5px;
    border: 1px solid var(--border-subtle);
}

.user-acc-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.user-spent-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}

/* Plans & Pricing Cards Grid */
.admin-plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
    width: 100%;
}

.admin-plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    transition: var(--transition-normal);
    min-width: 0;
    overflow: hidden;
}

.admin-plan-card:hover {
    border-color: var(--accent-purple-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.admin-plan-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-width: 0;
}

.admin-plan-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-plan-price-display {
    font-size: 24px;
    font-weight: 800;
    color: #6366f1;
    letter-spacing: -0.03em;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.admin-plan-price-display span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
}

.admin-plan-edit-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.admin-price-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
}

.admin-plan-price-inp {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1;
    padding: 6px 8px !important;
}

.admin-save-price-btn {
    flex-shrink: 0;
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    white-space: nowrap;
}

.admin-price-prefix {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.admin-user-row {
    cursor: pointer;
    transition: background 0.15s ease;
}

.admin-user-row:hover td {
    background: rgba(99, 102, 241, 0.08) !important;
}

/* User Details Modal */
.modal-kpi-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.modal-kpi-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
}

.modal-kpi-val {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}

.modal-kpi-lbl {
    font-size: 10.5px;
    color: var(--text-tertiary);
}

