/* ============================================
   TELEADS.APP - Clean Professional Design
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Background - clean blue-gray */
    --bg-base: #f1f5f9;
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);

    /* Glass effects */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-blur: blur(12px);

    /* Accent - professional indigo */
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);

    /* Status colors */
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Text */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ============================================
   Header
   ============================================ */
.header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.logo-icon svg { width: 18px; height: 18px; }

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-flex;
    align-items: flex-start;
}

.logo-pro {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-left: 2px;
    margin-top: 1px;
}

/* Account Switcher */
.account-switcher-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    min-width: 240px;
    cursor: pointer;
    transition: all 0.2s;
}

.account-switcher-wrapper:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(99, 102, 241, 0.3);
}

.account-switcher-icon {
    width: 28px;
    height: 28px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.account-switcher-icon svg { width: 14px; height: 14px; }

.account-select {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    padding-right: 20px;
}

.account-switcher-arrow {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    position: absolute;
    right: 12px;
    pointer-events: none;
}

/* Account Switcher Dropdown */
.account-switcher {
    position: relative;
    margin-left: 16px;
}

.account-switcher-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 160px;
    max-width: 220px;
}

.account-switcher-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(99, 102, 241, 0.3);
}

.account-switcher.open .account-switcher-btn {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.account-switcher-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-switcher-btn .account-switcher-arrow {
    position: static;
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.account-switcher.open .account-switcher-arrow {
    transform: rotate(180deg);
}

.account-switcher-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    max-width: 280px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    overflow: hidden;
}

.account-switcher.open .account-switcher-dropdown {
    display: block;
}

.account-switcher-list {
    max-height: 240px;
    overflow-y: auto;
}

.account-switcher-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.account-switcher-item:hover {
    background: var(--primary-light);
}

.account-switcher-item.active {
    background: var(--primary-light);
}

.account-switcher-item-icon {
    width: 28px;
    height: 28px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.account-switcher-item.active .account-switcher-item-icon {
    background: var(--primary);
    color: white;
}

.account-switcher-item-info {
    flex: 1;
    min-width: 0;
}

.account-switcher-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-switcher-item-id {
    font-size: 11px;
    color: var(--text-muted);
}

.account-switcher-item-check {
    width: 16px;
    height: 16px;
    color: var(--primary);
    opacity: 0;
    flex-shrink: 0;
}

.account-switcher-item.active .account-switcher-item-check {
    opacity: 1;
}

.account-switcher-manage {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-top: 1px solid var(--border-color);
    transition: all 0.15s;
}

.account-switcher-manage:hover {
    background: var(--bg-base);
    color: var(--primary);
}

.account-switcher-manage svg {
    width: 14px;
    height: 14px;
}

/* Header Buttons */
.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    background: transparent;
}

.header-btn svg { width: 15px; height: 15px; }

.header-btn-ghost {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.03);
}

.header-btn-ghost:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.header-btn-danger {
    color: var(--text-muted);
    padding: 8px;
    border-radius: var(--radius-full);
}

.header-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.upgrade-btn {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.upgrade-btn:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.upgrade-btn.is-pro {
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.header-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 4px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: var(--radius-lg);
    transition: background 0.2s;
}

.user-menu:hover {
    background: rgba(0, 0, 0, 0.03);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
}

.user-avatar svg { width: 16px; height: 16px; }

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .header-btn-text { display: none; }
    .header-center { display: none; }
    .user-name { display: none; }
}

/* Legacy header styles */
.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-outline-danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.header-left-legacy, .header-right-legacy {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
}

.user-avatar svg { width: 14px; height: 14px; }

.user-name {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================
   Main Layout
   ============================================ */
.main-content {
    padding: 16px;
    padding-top: 24px;
    min-height: calc(100vh - 52px);
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding-top: 24px;
}

/* ============================================
   Glass Card
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg { width: 18px; height: 18px; }

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-bg); color: var(--success); }
.stat-icon.warning { background: var(--warning-bg); color: var(--warning); }
.stat-icon.info { background: var(--info-bg); color: var(--info); }

.stat-content { flex: 1; min-width: 0; }

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   Toolbar
   ============================================ */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box {
    position: relative;
    width: 220px;
}

.search-box input {
    width: 100%;
    padding: 7px 12px 7px 32px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-primary);
    transition: all 0.15s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.search-box input::placeholder { color: var(--text-muted); }

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    pointer-events: none;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn svg { width: 14px; height: 14px; }

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-ai-automode {
    background: linear-gradient(135deg, #f97316, #ef4444, #a855f7);
    color: white;
    border: none;
    transition: all 0.2s;
}
.btn-ai-automode:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
    filter: brightness(1.05);
}

.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--text-muted);
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover { background: #d97706; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--primary-light); color: var(--primary); }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
}

.btn-icon.btn-sm {
    width: 26px;
    height: 26px;
}

/* ============================================
   Table
   ============================================ */
.table-container {
    overflow: visible;
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th,
.data-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table th {
    background: rgba(241, 245, 249, 0.8);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table tbody tr {
    background: white;
    transition: background 0.1s;
}

.data-table tbody tr:hover {
    background: var(--primary-light);
}

.data-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.15);
}

/* Checkbox column */
.data-table th:first-child,
.data-table td:first-child {
    width: 36px;
    text-align: center;
    padding: 8px;
}

/* Checkbox */
.checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Campaign name cell */
.campaign-name {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.campaign-title {
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
}

.campaign-title-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-title-link {
    color: inherit;
    text-decoration: none;
}
.campaign-title-link:hover {
    color: var(--primary, #6366f1);
}
.campaign-title-link:hover .campaign-title-text {
    text-decoration: underline;
}

.promote-url {
    display: block;
    max-width: 100%;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.promote-url-wrap {
    display: block;
    margin-top: 2px;
    position: relative;
}

.promote-url-popup {
    white-space: nowrap;
    min-width: auto;
}

.campaign-id {
    font-size: 10px;
    color: var(--text-muted);
}

/* Status badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge svg { width: 10px; height: 10px; }

.status-active { background: var(--success-bg); color: var(--success); }
.status-paused { background: var(--warning-bg); color: var(--warning); }
.status-stopped, .status-declined { background: var(--danger-bg); color: var(--danger); }
.status-pending, .status-draft { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

/* Cell values */
.cell-value {
    font-weight: 500;
}

.cell-value.positive { color: var(--success); }
.cell-value.negative { color: var(--danger); }

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 4px;
}

.action-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.action-btn svg { width: 14px; height: 14px; }

.action-btn:hover { background: var(--primary-light); color: var(--primary); }
.action-btn.danger:hover { background: var(--danger-bg); color: var(--danger); }
.action-btn.success:hover { background: var(--success-bg); color: var(--success); }

/* ============================================
   Batch Actions Bar
   ============================================ */
.batch-actions {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    padding: 16px 28px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.batch-actions.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.batch-count {
    font-size: 14px;
    font-weight: 600;
    padding-right: 16px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

.batch-buttons {
    display: flex;
    gap: 8px;
}

.batch-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    color: var(--primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.batch-btn svg { width: 14px; height: 14px; }
.batch-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}
.batch-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.batch-btn.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}
.batch-btn.success:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
}

.batch-btn.danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}
.batch-btn.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.batch-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    cursor: pointer;
    margin-left: 4px;
    transition: all 0.15s;
}

.batch-close svg { width: 14px; height: 14px; }
.batch-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

/* ============================================
   Task Progress Container
   ============================================ */
.task-progress-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
}

.task-progress-item {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.task-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.task-progress-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.task-progress-title .task-icon {
    font-size: 16px;
}

.task-progress-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.15s;
}

.task-progress-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.task-progress-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #818cf8 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.task-progress-fill.completed {
    background: linear-gradient(90deg, var(--success) 0%, #34d399 100%);
}

.task-progress-fill.failed {
    background: linear-gradient(90deg, var(--danger) 0%, #f87171 100%);
}

.task-progress-fill.cancelled {
    background: linear-gradient(90deg, #9ca3af 0%, #d1d5db 100%);
}

.task-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 12px;
}

.task-progress-status {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-weight: 500;
}

.task-progress-status.running,
.task-progress-status.pending {
    color: var(--primary);
}

.task-progress-status.completed {
    color: var(--success);
}

.task-progress-status.failed {
    color: var(--danger);
}

.task-progress-status.cancelled {
    color: var(--text-muted);
}

.task-progress-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.task-progress-count {
    color: var(--text-muted);
    font-size: 11px;
}

.task-progress-actions {
    display: flex;
    gap: 8px;
}

.task-btn-cancel,
.task-btn-dismiss,
.task-btn-pause,
.task-btn-resume,
.task-btn-retry {
    flex: 1;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}

.task-btn-cancel {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.task-btn-cancel:hover {
    background: rgba(239, 68, 68, 0.15);
}

.task-btn-pause {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.task-btn-pause:hover {
    background: rgba(249, 115, 22, 0.15);
}

.task-btn-resume {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.task-btn-resume:hover {
    background: rgba(34, 197, 94, 0.15);
}

.task-btn-retry {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.task-btn-retry:hover {
    background: rgba(59, 130, 246, 0.15);
}

.task-btn-dismiss {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.task-btn-dismiss:hover {
    background: rgba(0, 0, 0, 0.08);
}

.task-dismiss-all {
    width: 100%;
    padding: 10px 16px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-secondary);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.task-dismiss-all:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

/* ============================================
   Modal
   ============================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-backdrop.show { display: flex; }

.modal-backdrop .modal-inner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 svg { width: 16px; height: 16px; color: var(--primary); }

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.modal-close:hover { background: var(--border-light); color: var(--text-primary); }
.modal-close svg { width: 16px; height: 16px; }

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

/* Modal Overlay (alternative) */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-overlay.show { display: flex; }

.modal-overlay .modal {
    display: flex !important;
    flex-direction: column;
    position: relative;
    inset: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow: hidden;
    padding: 0;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon svg { width: 16px; height: 16px; color: var(--primary); }

.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.modal-actions .btn { flex: 1; }

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 8px 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.form-input::placeholder { color: var(--text-muted); }

.form-textarea {
    min-height: 80px;
    resize: vertical;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Input with icon */
.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.form-input.with-icon {
    padding-left: 32px;
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: 12px;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.empty-state-icon svg { width: 24px; height: 24px; }

.empty-state h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.empty-state p {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* ============================================
   Loading
   ============================================ */
.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.loading-spinner.small {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination loader & counter at bottom of campaigns table */
.pagination-loader-cell,
.pagination-counter-cell {
    text-align: center;
    padding: 16px 0;
    border: none !important;
}

.pagination-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 13px;
}

.pagination-counter {
    color: var(--text-muted);
    font-size: 12px;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   Tabs
   ============================================ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--border-light);
    padding: 3px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.tab {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.tab:hover { color: var(--text-primary); }
.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Compact tabs for modals with many options */
.tabs.tabs-compact {
    gap: 2px;
}
.tabs.tabs-compact .tab {
    padding: 6px 10px;
    font-size: 11px;
}

/* ============================================
   Filter Dropdown
   ============================================ */
.filter-dropdown {
    position: relative;
}

.filter-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 100;
    display: none;
}

.filter-menu.show { display: block; }

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.1s;
}

.filter-option:hover { background: var(--border-light); }
.filter-option.active { color: var(--primary); }

/* ============================================
   Pagination
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 12px;
}

.page-btn {
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn svg { width: 14px; height: 14px; }

/* ============================================
   Toast
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-left: 4px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast-message { font-size: 13px; font-weight: 500; color: var(--text-primary); }

.toast.toast-error {
    border-left-color: var(--danger);
    background: rgba(254, 242, 242, 0.9);
}
.toast.toast-error .toast-icon { color: var(--danger); }

.toast.toast-success {
    border-left-color: var(--success);
    background: rgba(240, 253, 244, 0.9);
}
.toast.toast-success .toast-icon { color: var(--success); }

.toast.toast-warning {
    border-left-color: #f59e0b;
    background: rgba(255, 251, 235, 0.9);
}
.toast.toast-warning .toast-icon { color: #f59e0b; }

/* ============================================
   Accounts Page
   ============================================ */
.accounts-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.account-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px;
    cursor: pointer;
    transition: all 0.15s;
}

.account-card:hover {
    border-color: var(--primary);
}

.account-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.account-card-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.account-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.account-icon svg { width: 20px; height: 20px; }

.account-details h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.account-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-item svg { width: 12px; height: 12px; }
.meta-item.balance { color: var(--primary); font-weight: 500; }

/* Cabinet type badges */
.meta-item.cabinet-type {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-item.cabinet-type-ton {
    background: linear-gradient(135deg, rgba(0, 136, 204, 0.15), rgba(0, 136, 204, 0.25));
    color: #0088cc;
    border: 1px solid rgba(0, 136, 204, 0.3);
}

.meta-item.cabinet-type-stars {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.25));
    color: #d4a106;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.meta-item.cabinet-type-euro {
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.15), rgba(0, 200, 83, 0.25));
    color: #00a854;
    border: 1px solid rgba(0, 200, 83, 0.3);
}

.active-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--success-bg);
    border-radius: var(--radius-full);
    color: var(--success);
    font-size: 11px;
    font-weight: 600;
}

.active-badge svg { width: 12px; height: 12px; }

.account-actions {
    display: flex;
    gap: 6px;
}

.add-account-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    border: 2px dashed var(--border-color);
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.add-account-card:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.add-account-icon svg { width: 20px; height: 20px; }

/* Help Card */
.help-card {
    padding: 16px;
}

.help-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.help-card-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.help-card-icon svg { width: 16px; height: 16px; }
.help-card-header h3 { font-size: 13px; font-weight: 600; }

.help-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.help-steps li {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: var(--text-secondary);
}

.step-number {
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.help-steps code {
    padding: 2px 6px;
    background: var(--primary-light);
    border-radius: 4px;
    font-size: 11px;
    color: var(--primary);
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 20px;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 18px;
    margin-bottom: 4px;
}

.page-title-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.page-title-icon svg { width: 18px; height: 18px; }
.page-subtitle { font-size: 12px; color: var(--text-muted); }

/* ============================================
   Login Page
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 380px;
}

.auth-card {
    padding: 28px;
    text-align: center;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.auth-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-logo-icon svg { width: 22px; height: 22px; }

.auth-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.auth-header { margin-bottom: 24px; }
.auth-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.auth-subtitle { font-size: 12px; color: var(--text-muted); }

.auth-tabs {
    display: flex;
    gap: 4px;
    background: var(--border-light);
    padding: 3px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}

.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.auth-form { text-align: left; display: none; }
.auth-form.active { display: block; }

.auth-form .form-group { margin-bottom: 14px; }

.auth-submit {
    width: 100%;
    padding: 10px;
    margin-top: 6px;
}

/* Auth divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* Telegram button */
.btn-telegram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn-telegram:hover {
    background: #0077b5;
    transform: translateY(-1px);
}
.btn-telegram.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
}
.btn-telegram svg {
    flex-shrink: 0;
}

/* Telegram auth status */
.telegram-auth-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    background: rgba(0, 136, 204, 0.1);
    border: 1px solid rgba(0, 136, 204, 0.3);
    border-radius: var(--radius-sm);
    color: #0088cc;
    font-size: 14px;
}

/* Optional hint */
.optional-hint {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 11px;
}
.telegram-hint {
    color: var(--text-muted);
}

.auth-error, .auth-success {
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    margin-bottom: 14px;
    display: none;
}

.auth-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.auth-success {
    background: var(--success-bg);
    color: var(--success);
}

.auth-error.show, .auth-success.show { display: block; }

/* Field hints for validation */
.field-hint {
    display: block;
    font-size: 11px;
    margin-top: 4px;
    min-height: 14px;
    color: var(--text-muted);
}
.field-hint.error { color: var(--danger); }
.field-hint.success { color: var(--success); }

/* Terms checkbox */
.terms-group {
    margin-top: 16px;
    margin-bottom: 16px;
}
.terms-group .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    user-select: none;
}
.terms-group .checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}
.terms-group .checkbox-label a {
    color: var(--primary);
    text-decoration: none;
}
.terms-group .checkbox-label a:hover {
    text-decoration: underline;
}
.terms-group .checkbox-error {
    display: none;
    font-size: 11px;
    margin-top: 4px;
    margin-left: 22px;
    color: var(--danger, #ef4444);
}
.terms-group.error .checkbox-error {
    display: block;
}
.terms-group.error .checkbox-label {
    color: var(--danger, #ef4444);
}

/* Form field error states */
.form-group.error .form-input {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}
.form-group.error label {
    color: #ef4444;
}
.field-error-message {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}
.form-group.error .field-error-message {
    display: block;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px); }
    40% { transform: translateX(3px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* Verification Code Form Styles */
.verification-icon {
    text-align: center;
    margin-bottom: 16px;
}

.verification-icon svg {
    color: var(--primary);
    opacity: 0.9;
}

.verification-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

.verification-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.verification-code-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 8px;
}

.code-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.code-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: var(--bg-secondary);
}

.code-input:not(:placeholder-shown) {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.resend-code-section {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.resend-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-link:hover:not(:disabled) {
    background: rgba(102, 126, 234, 0.1);
}

.btn-link:disabled {
    color: var(--text-muted);
    cursor: not-allowed;
}

.back-to-register {
    margin-top: 16px;
    font-size: 13px;
}

.auth-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    font-size: 11px;
    color: var(--text-muted);
}

.auth-footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 12px;
}

.auth-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.auth-footer-links .footer-divider {
    color: var(--border-color);
}

.password-field { position: relative; }

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
}

.password-toggle:hover { color: var(--primary); }
.password-toggle svg { width: 16px; height: 16px; }

/* ============================================
   Plans Page
   ============================================ */
.plans-page {
    padding: 24px 16px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== PLANS PAGE ===== */
.plans-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 32px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.06) 50%, rgba(245, 158, 11, 0.04) 100%);
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.08);
}

.plans-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.plans-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.current-plan-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    margin-top: 20px;
    font-size: 13px;
    font-weight: 500;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.current-plan-badge svg { width: 16px; height: 16px; color: var(--success); }
.current-plan-badge strong { color: var(--primary); font-weight: 700; }

/* Billing Toggle Wrapper — full width row inside plans-grid flex */
.billing-toggle-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}
.billing-toggle {
    display: inline-flex;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
}
.billing-toggle-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.billing-toggle-btn:hover {
    color: var(--text-primary);
}
.billing-toggle-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
.billing-toggle-badge {
    background: #22c55e;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
}
.plan-billed-yearly {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Plan Cards Grid */
.plans-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-bottom: 32px;
    align-items: flex-start;
}

@media (max-width: 900px) {
    .plans-grid { flex-direction: column; align-items: center; }
}

.plan-card {
    padding: 32px 28px;
    position: relative;
    flex: 1 1 0;
    min-width: 280px;
    border-radius: 16px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: white;
}

.plan-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

/* Featured card (Pro) */
.plan-card.featured {
    border: 2px solid var(--primary);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.12);
    z-index: 1;
}

.plan-card.featured:hover {
    box-shadow: 0 20px 48px rgba(99, 102, 241, 0.18);
}

/* Agency card */
.plan-card.agency-card {
    border: 2px solid rgba(245, 158, 11, 0.25);
}

.plan-card.agency-card:hover {
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.1);
}

/* Plan badge */
.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    padding: 5px 18px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
}

/* Plan header */
.plan-header { margin-bottom: 24px; }

.plan-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 16px;
}

.plan-card.featured .plan-icon {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.plan-card.agency-card .plan-icon {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
    color: #f59e0b;
}

.plan-icon svg { width: 24px; height: 24px; }

.plan-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; color: var(--text-primary); }
.plan-description { font-size: 13px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

/* Plan pricing */
.plan-pricing {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 2px;
}

.plan-currency { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.plan-amount { font-size: 44px; font-weight: 800; line-height: 1; color: var(--text-primary); }
.plan-period { font-size: 14px; color: var(--text-muted); margin-left: 4px; }

.plan-daily {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 12px;
    background: var(--success-bg);
    color: var(--success);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

/* Plan features */
.plan-features {
    list-style: none;
    margin-bottom: 24px;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.plan-features li svg { width: 18px; height: 18px; color: var(--success); flex-shrink: 0; }

.plan-features li.disabled {
    color: var(--text-muted);
    text-decoration: line-through;
}

.plan-features li.disabled svg { color: var(--text-muted); }

.plan-features li.highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.plan-features li.warning {
    color: var(--warning);
}

.plan-features li.warning svg {
    color: var(--warning);
}

/* Features divider (for Agency card: "All Pro features included") */
.plan-features li.features-divider {
    margin: 8px 0 4px;
    padding: 8px 0 4px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    justify-content: flex-start;
    gap: 0;
}

/* Plan CTA button */
.plan-cta {
    width: 100%;
    margin-top: auto;
    padding: 14px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.25s ease;
    letter-spacing: 0.2px;
}

.plan-cta:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn-current {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    font-weight: 600;
}

/* ===== PAYMENT INFO ===== */
.payment-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    margin-bottom: 32px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04) 0%, rgba(59, 130, 246, 0.04) 100%);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 16px;
}

.payment-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.payment-icon svg { width: 22px; height: 22px; }

.payment-content { flex: 1; }
.payment-content h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; color: var(--text-primary); }
.payment-content p { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }

.payment-methods { display: flex; gap: 8px; flex-wrap: wrap; }

.payment-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.payment-badge:hover {
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.payment-badge svg { width: 14px; height: 14px; }

/* ===== FAQ ===== */
.faq-section {
    margin-top: 40px;
    padding: 32px 0;
}

.faq-title {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 700px) {
    .faq-grid { grid-template-columns: 1fr; }
}

.faq-item {
    overflow: hidden;
    border-radius: 12px;
    transition: box-shadow 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 16px 18px;
    background: none;
    border: none;
    text-align: left;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: color 0.2s;
}

.faq-question:hover { color: var(--primary); }
.faq-question svg { width: 16px; height: 16px; color: var(--text-muted); transition: transform 0.3s ease; flex-shrink: 0; }
.faq-item.open .faq-question svg { transform: rotate(180deg); color: var(--primary); }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.faq-item.open .faq-answer { max-height: 500px; }
.faq-answer-content { padding: 0 18px 16px; font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ============================================
   Animated Background (optional)
   ============================================ */
.animated-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.3);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: rgba(99, 102, 241, 0.2);
    bottom: -100px;
    right: -100px;
}

.blob-3 {
    width: 250px;
    height: 250px;
    background: rgba(99, 102, 241, 0.15);
    top: 50%;
    right: 20%;
}

/* ============================================
   Responsive - Mobile First Fixes
   ============================================ */

/* Prevent horizontal scroll on body */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

@media (max-width: 768px) {
    /* ===== GLOBAL MOBILE FIXES ===== */
    html {
        font-size: 14px;
    }

    body {
        -webkit-text-size-adjust: 100%;
    }

    .header {
        padding: 0 12px;
        height: 48px;
    }

    /* ===== DASHBOARD LAYOUT ===== */
    .dashboard-layout {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for mobile */
    }

    .main-content {
        min-width: 0; /* Allow flex child to shrink */
        width: 100%;
    }

    .content-area {
        padding: 12px !important;
        overflow-x: hidden;
    }

    /* ===== TOP BAR ===== */
    .top-bar {
        padding: 0 12px !important;
        gap: 8px;
    }

    .top-bar-left {
        gap: 8px;
        min-width: 0;
        flex: 1;
    }

    .page-title {
        font-size: 16px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Account switcher on mobile */
    .account-switcher {
        margin-left: 8px !important;
        max-width: 140px;
    }

    .account-switcher-btn {
        padding: 6px 8px !important;
    }

    .account-switcher-name {
        max-width: 80px;
        font-size: 12px !important;
    }

    /* ===== STATS GRID ===== */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 11px;
    }

    /* ===== ACTION BAR ===== */
    .action-bar {
        flex-direction: column;
        gap: 8px;
        width: 100%;
        margin: 0 0 12px 0;
        padding: 0;
    }

    .action-bar-left,
    .action-bar-right {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 6px;
    }

    .action-bar .search-box {
        width: 100%;
        max-width: none;
    }

    .action-bar .search-input {
        font-size: 14px;
    }

    /* Period buttons */
    .period-btns {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .period-btns::-webkit-scrollbar {
        display: none;
    }

    .period-btn {
        flex-shrink: 0;
        font-size: 11px;
        padding: 6px 10px;
    }

    /* ===== TABLE CONTAINER ===== */
    .table-container {
        margin: 0 -12px;
        padding: 0;
        overflow: visible;
    }

    .table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 12px;
        margin: 0;
    }

    /* Campaigns table minimum width for horizontal scroll */
    .campaigns-table {
        min-width: 900px;
        font-size: 10px;
    }

    .campaigns-table th,
    .campaigns-table td {
        padding: 6px 4px;
    }

    /* ===== TOOLBAR ===== */
    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .toolbar-left, .toolbar-right {
        flex-wrap: wrap;
        gap: 6px;
    }

    .search-box {
        width: 100%;
    }

    /* ===== BATCH ACTIONS ===== */
    .batch-actions {
        left: 8px;
        right: 8px;
        bottom: 8px;
        transform: translateY(100px);
        width: auto;
        padding: 10px;
        border-radius: 12px;
    }

    .batch-actions.show {
        transform: translateY(0);
    }

    .batch-actions-left {
        gap: 6px;
        flex-wrap: wrap;
    }

    .batch-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* ===== MODALS ===== */
    .modal-overlay {
        padding: 8px;
        align-items: flex-end;
    }

    .modal,
    .modal-content,
    .glass-card.modal {
        max-width: 100% !important;
        max-height: 90vh !important;
        max-height: 90dvh !important;
        width: 100% !important;
        margin: 0;
        border-radius: 16px 16px 0 0;
    }

    .modal-header {
        padding: 12px 14px;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .modal-body {
        padding: 12px 14px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer,
    .modal-actions {
        padding: 10px 14px;
        position: sticky;
        bottom: 0;
        background: white;
        border-top: 1px solid var(--border-color);
    }

    /* ===== FORMS ===== */
    .form-group {
        margin-bottom: 14px;
    }

    .form-input,
    .form-select,
    .form-textarea,
    select,
    input[type="text"],
    input[type="number"],
    input[type="email"],
    textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
        padding: 10px 12px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    /* ===== BUTTONS ===== */
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* ===== CARDS ===== */
    .account-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }

    .account-actions {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    /* ===== PAYMENT ===== */
    .payment-info {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .payment-methods {
        justify-content: center;
    }

    /* ===== PLANS ===== */
    .plans-header {
        padding: 24px 16px;
        margin-bottom: 28px;
    }

    .plans-title {
        font-size: 24px;
    }

    .plans-subtitle {
        font-size: 13px;
    }

    .plan-card {
        flex: 0 0 auto;
        width: 100%;
        max-width: 360px;
        padding: 24px 20px;
    }

    /* ===== CREATE CAMPAIGN MODAL ===== */
    .tg-form-group {
        margin-bottom: 12px;
    }

    .tg-form-row {
        flex-direction: column;
        gap: 12px;
    }

    .tg-form-row > .tg-form-group {
        width: 100%;
    }

    /* Channel selector */
    .tg-channel-selector {
        min-height: 40px;
    }

    .tg-channel-input {
        font-size: 16px !important;
    }

    /* Preview panel */
    .telegram-preview-panel {
        margin-top: 16px;
    }

    /* ===== DROPDOWNS ===== */
    .account-switcher-dropdown {
        max-width: calc(100vw - 24px);
        right: auto;
        left: 0;
    }

    .filter-dropdown-content {
        max-width: calc(100vw - 24px);
    }

    /* ===== POPUPS ===== */
    .text-popup,
    .channels-popup,
    .action-popup {
        max-width: calc(100vw - 32px);
        font-size: 12px;
    }

    /* ===== HIDE LESS IMPORTANT ELEMENTS ON MOBILE ===== */
    .hide-mobile {
        display: none !important;
    }

    /* ===== TOP BAR MOBILE LAYOUT ===== */
    .top-bar-left {
        flex-wrap: wrap;
        max-width: calc(100vw - 80px);
    }

    /* Account switcher and group filter - icon only on mobile */
    .account-switcher,
    .group-filter {
        margin-left: 6px !important;
    }

    .account-switcher-btn,
    .group-filter-btn {
        padding: 8px !important;
        gap: 0 !important;
        min-width: 36px;
        justify-content: center;
    }

    /* Hide text and arrows on mobile - show only icons */
    .account-switcher-name,
    .group-filter-name,
    .account-switcher-arrow,
    .group-filter-arrow {
        display: none !important;
    }

    .account-switcher-icon,
    .group-filter-btn svg:first-child {
        width: 18px !important;
        height: 18px !important;
    }

    /* Stats header on mobile */
    .stats-header {
        flex-direction: column;
        gap: 8px;
    }

    .stats-header .stat-card {
        width: 100%;
    }

    /* Action bar groups */
    .action-bar-group {
        flex-wrap: wrap;
        gap: 6px;
    }
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Legacy Index Page Styles (campaigns table)
   ============================================ */

/* Header logo - old structure */
.header .logo h1 {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin: 0;
}

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

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s;
}

.nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-link svg { width: 16px; height: 16px; }

.logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.logout-btn:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

.logout-btn svg { width: 14px; height: 14px; }

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-email {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Stats Header */
.stats-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

.stats-header .stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-card-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.stat-card-icon svg { width: 16px; height: 16px; }

.stat-card-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-card-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-card-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-sparkline {
    margin-left: auto;
    opacity: 0.7;
}

/* Status badges in stat card */
.stat-card-statuses { min-width: 180px; }
.status-badges-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.status-mini-badge {
    display: none;
    align-items: center;
    padding: 1px 6px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.status-mini-badge.visible { display: inline-flex; }
.status-mini-active { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.status-mini-declined { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.status-mini-review { background: rgba(148, 163, 184, 0.15); color: #64748b; }
.status-mini-stopped { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.status-mini-hold { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

/* Action Bar */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

.action-bar-left, .action-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sync-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.sync-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.sync-btn svg { width: 14px; height: 14px; }

.sync-btn.syncing svg {
    animation: spin 1s linear infinite;
}

.last-sync-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

.last-sync-time:not(:empty)::before {
    content: "•";
    margin-right: 4px;
}

.campaign-count {
    font-size: 12px;
    color: var(--text-muted);
}

.campaign-count strong {
    color: var(--text-primary);
}

.reset-filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    vertical-align: middle;
}

.reset-filters-btn:hover {
    background: rgba(99, 102, 241, 0.15);
    border-color: var(--primary);
}

.reset-filters-btn svg {
    flex-shrink: 0;
}

/* Period Selector */
.period-selector {
    display: flex;
    gap: 2px;
    background: var(--border-light);
    padding: 2px;
    border-radius: var(--radius-sm);
}

.period-btn {
    padding: 5px 10px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.period-btn:hover { color: var(--text-primary); }

.period-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.period-custom {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}

.period-custom input[type="number"] {
    width: 40px;
    height: 27px;
    padding: 0 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 11px;
    text-align: center;
    background: white;
}

.period-custom input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
}

/* Hide arrows in number input */
.period-custom input[type="number"]::-webkit-inner-spin-button,
.period-custom input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.period-custom input[type="number"] {
    -moz-appearance: textfield;
}

.period-unit-toggle {
    display: flex;
    gap: 1px;
    background: var(--border-light);
    padding: 1px;
    border-radius: var(--radius-sm);
}

.unit-btn {
    padding: 4px 8px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    min-width: 20px;
}

.unit-btn:hover {
    color: var(--text-primary);
}

.unit-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Alert */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 12px;
    margin-bottom: 12px;
}

.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-content { flex: 1; }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
}

.loading-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: 16px;
}

/* Table container - popup wrapper */
.table-container {
    position: relative;
    margin: 0 -16px;
    padding: 0 16px;
}

/* Inner scroll container */
.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    max-width: 100%;
}

.table-scroll::-webkit-scrollbar {
    height: 6px;
}

.table-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.table-scroll::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.table-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Campaigns Table */
.campaigns-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 11px;
}

.campaigns-table th,
.campaigns-table td {
    padding: 4px 5px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    vertical-align: middle;
}

.campaigns-table th {
    background: #ffffff;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Title column */
.campaigns-table td:nth-child(3) {
    max-width: 150px;
    position: relative;
}

/* Text column */
.campaigns-table td:nth-child(14) {
    max-width: 140px;
}

/* Target column */
.campaigns-table td:nth-child(15) {
    max-width: 140px;
}

/* Preview wrapper containers - constrain content without hiding popup */
.text-preview-wrap,
.channels-preview-wrap {
    position: relative;
    display: block;
    width: 100%;
    max-width: calc(100% - 8px);
}

/* Truncate the text span inside preview wrappers */
.campaigns-table td .text-preview-wrap > span:first-child,
.campaigns-table td .channels-preview-wrap > span:first-child {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaigns-table tbody tr {
    background: white;
    transition: background 0.1s;
}

/* Group rows styling */
.campaigns-table tbody tr.group-row {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(139, 92, 246, 0.02) 100%);
}

.campaigns-table tbody tr.group-row:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(139, 92, 246, 0.06) 100%);
}

.campaigns-table tbody tr.group-row td {
    vertical-align: middle;
}

.campaigns-table tbody tr:hover {
    background: var(--primary-light);
}

.campaigns-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.12);
}

.checkbox-cell {
    width: 32px;
    text-align: center !important;
}

.row-checkbox {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Sortable headers */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: var(--primary);
}

.sort-arrow {
    display: inline-block;
    margin-left: 2px;
    font-size: 8px;
    opacity: 0;
    color: var(--primary);
}

.filter-icon {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: var(--text-muted);
    opacity: 0.5;
    transition: opacity 0.15s;
    vertical-align: middle;
    margin-left: 2px;
}

.filter-icon:hover { opacity: 1; color: var(--primary); }
.filter-icon.active { opacity: 1; color: var(--primary); }

/* Filter popup */
.filter-popup {
    position: fixed;
    z-index: 9000;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 12px;
    min-width: 200px;
    max-width: 280px;
}

.filter-popup-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.filter-popup select,
.filter-popup input[type="text"],
.filter-popup input[type="number"] {
    width: 100%;
    padding: 6px 10px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: white;
}

.filter-popup select:focus,
.filter-popup input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-popup .filter-actions,
.filter-popup .filter-buttons {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.filter-popup .filter-actions button,
.filter-popup .filter-buttons button,
.filter-popup .filter-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-popup .filter-actions .apply-btn,
.filter-popup .filter-btn-apply {
    background: var(--primary);
    color: white;
    border: none;
}

.filter-popup .filter-actions .apply-btn:hover,
.filter-popup .filter-btn-apply:hover {
    background: var(--primary-hover);
}

.filter-popup .filter-actions .clear-btn,
.filter-popup .filter-btn-clear {
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.filter-popup .filter-actions .clear-btn:hover,
.filter-popup .filter-btn-clear:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* Filter checkbox list (for multiselect status) */
.filter-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
}

.filter-checkbox-item:hover {
    background: var(--bg-secondary);
}

.filter-checkbox-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--primary);
}

.filter-checkbox-item .status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 500;
}

.filter-checkbox-item .status-badge.status-active { background: var(--success-bg); color: var(--success); }
.filter-checkbox-item .status-badge.status-on-hold { background: var(--warning-bg); color: var(--warning); }
.filter-checkbox-item .status-badge.status-stopped { background: var(--danger-bg); color: var(--danger); }
.filter-checkbox-item .status-badge.status-declined { background: var(--danger-bg); color: var(--danger); }
.filter-checkbox-item .status-badge.status-in-review { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.filter-checkbox-item .status-badge.status-deleted { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

/* Date filter quick buttons */
.filter-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.filter-quick-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
}

.filter-quick-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.filter-quick-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Date filter custom period */
.filter-custom-period {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
}

.filter-custom-period input[type="number"] {
    flex: 0 0 80px;
}

.filter-custom-period select {
    flex: 0 0 100px;
}

/* Status badges for table */
.status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active, .status-Active { background: var(--success-bg); color: var(--success); }
.status-on_hold, .status-OnHold { background: var(--warning-bg); color: var(--warning); }
.status-stopped, .status-Stopped { background: var(--danger-bg); color: var(--danger); }
.status-declined, .status-Declined { background: var(--danger-bg); color: var(--danger); }
.status-pending, .status-Pending, .status-in_review, .status-InReview {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}
.status-draft, .status-Draft { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

/* Table media cell */
.media-preview {
    width: 36px;
    height: 24px;
    object-fit: cover;
    border-radius: 4px;
}

/* Table action buttons */
.table-actions {
    display: flex;
    gap: 3px;
    align-items: center;
}

.table-action-btn {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.table-action-btn svg { width: 13px; height: 13px; }

.table-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.15);
}

.table-action-btn.danger:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.15);
}

.table-action-btn.success:hover {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.15);
}

.table-action-btn.warning:hover {
    background: var(--warning-bg);
    border-color: var(--warning);
    color: var(--warning);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.15);
}

/* Actions Menu Dropdown */
.actions-menu-wrap {
    position: relative;
    display: inline-block;
}

.actions-menu-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.actions-menu-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.actions-menu-btn svg {
    width: 14px;
    height: 14px;
}

.actions-menu-popup {
    display: none;
    position: fixed;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    min-width: 160px;
    padding: 6px 0;
    pointer-events: auto;
}

/* Bridge to prevent hover gap with fixed positioning */
.actions-menu-popup::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -30px;
    right: -30px;
    height: 20px;
}

.actions-menu-wrap:hover .actions-menu-popup,
.actions-menu-popup.show {
    display: block;
}

.actions-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.actions-menu-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.actions-menu-item.actions-menu-danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.actions-menu-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

/* Automation badge */
.automation-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
}

.automation-badge:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.automation-badge svg { width: 13px; height: 13px; }

/* No automation placeholder */
.no-automation {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--border-light);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.15s;
}

.no-automation:hover {
    opacity: 1;
    border-style: solid;
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.no-automation svg { width: 11px; height: 11px; }

/* Batch actions for old structure */
.batch-actions-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    padding-right: 16px;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

.batch-actions-label .count {
    font-weight: 700;
    color: var(--primary);
}

.batch-actions-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.batch-btn.success { background: rgba(16, 185, 129, 0.25); }
.batch-btn.success:hover { background: rgba(16, 185, 129, 0.35); }
.batch-btn.danger { background: rgba(239, 68, 68, 0.25); }
.batch-btn.danger:hover { background: rgba(239, 68, 68, 0.35); }

/* Modal legacy structure */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.show { display: flex; }

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-content.modal-lg { max-width: 600px; }
.modal-content.modal-xl { max-width: 800px; }

/* Global Rules List */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.rules-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 12px;
}

.rule-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.rule-item.inactive {
    opacity: 0.6;
}

.rule-info {
    flex: 1;
    min-width: 0;
}

.rule-name {
    font-weight: 500;
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.rule-description {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rule-stats {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.rule-actions {
    display: flex;
    gap: 4px;
    margin-left: 12px;
}

.rule-actions button {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    transition: all 0.15s;
}

.rule-actions button:hover {
    background: var(--primary);
    color: white;
}

.rule-actions button.btn-danger:hover {
    background: var(--danger);
}

/* Conditions list for multiple conditions */
.conditions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.condition-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.condition-row select,
.condition-row input {
    flex: 1;
    min-width: 0;
}

.condition-row .condition-source {
    flex: 0 0 90px;
    font-size: 11px;
}

.condition-row .btn-remove-condition {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    transition: all 0.15s;
}

.condition-row .btn-remove-condition:hover {
    background: var(--danger);
    color: white;
}

.condition-row:only-child .btn-remove-condition {
    visibility: hidden;
}

.check-interval-input {
    display: flex;
    align-items: center;
    gap: 8px;
}

.check-interval-input span {
    font-size: 12px;
    color: var(--text-secondary);
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 11px;
}

.mt-1 {
    margin-top: 8px;
}

.rule-form-section {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 8px;
}

.form-section-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.checkbox-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.modal-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

/* Form controls legacy */
.form-label {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-checkbox input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary);
}

/* Tabs legacy */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--border-light);
    padding: 2px;
    border-radius: var(--radius-sm);
}

.tab {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.tab:hover { color: var(--text-primary); }
.tab.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* Utility classes */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.p-3 { padding: 12px; }
.w-full { width: 100%; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.badge-primary {
    background: var(--primary);
    color: white;
}

/* Progress */
.progress-container {
    margin: 12px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.progress-text {
    font-size: 11px;
    color: var(--text-muted);
}

.progress-bar {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Upgrade modal */
.upgrade-modal .modal-content {
    max-width: 400px;
    text-align: center;
}

.upgrade-modal .modal-body {
    padding: 32px 24px;
}

.upgrade-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--primary-light);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.upgrade-modal-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.upgrade-modal-feature {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 8px;
}

.upgrade-modal-text {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upgrade-modal-features {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    text-align: left;
}

.upgrade-modal-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.upgrade-modal-features li::before {
    content: '';
    width: 16px;
    height: 16px;
    background: var(--success);
    mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    flex-shrink: 0;
}

.upgrade-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Empty state in table */
.campaigns-table .empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.empty-state-icon svg { width: 24px; height: 24px; }

.empty-state-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.empty-state-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* Account switcher */
.account-switcher select {
    padding: 6px 28px 6px 10px;
    font-size: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

/* ============================================
   Table Preview Popups
   ============================================ */

/* Base popup wrapper styles */
.text-preview-wrap,
.media-preview-wrap,
.stats-preview-wrap,
.action-preview-wrap,
.channels-preview-wrap {
    position: relative;
    display: inline-block;
}

/* Base popup styles — position:fixed to escape overflow:auto on .table-scroll */
.text-preview-popup,
.media-preview-popup,
.stats-preview-popup,
.action-preview-popup,
.channels-preview-popup,
.promote-url-popup {
    display: none;
    position: fixed;
    top: -9999px;
    left: -9999px;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    padding: 12px 14px;
    font-size: 12px;
    color: var(--text-primary);
    white-space: normal;
    min-width: 200px;
    max-width: 350px;
    pointer-events: auto;
}

/* Invisible bridge between trigger and popup to prevent hover gap */
.text-preview-popup::before,
.media-preview-popup::before,
.stats-preview-popup::before,
.action-preview-popup::before,
.channels-preview-popup::before,
.promote-url-popup::before {
    content: '';
    position: absolute;
    left: -20px;
    right: -20px;
    height: 12px;
}

/* Bridge above popup (when popup is below trigger) */
.text-preview-popup::before,
.media-preview-popup::before,
.stats-preview-popup::before,
.action-preview-popup::before,
.channels-preview-popup::before,
.promote-url-popup::before {
    top: -12px;
}

/* Bridge below popup (when popup is above trigger) */
.text-preview-popup.popup-above::before,
.media-preview-popup.popup-above::before,
.stats-preview-popup.popup-above::before,
.action-preview-popup.popup-above::before,
.channels-preview-popup.popup-above::before,
.promote-url-popup.popup-above::before {
    top: auto;
    bottom: -12px;
}

/* Show popup on hover */
.text-preview-wrap:hover .text-preview-popup,
.media-preview-wrap:hover .media-preview-popup,
.stats-preview-wrap:hover .stats-preview-popup,
.action-preview-wrap:hover .action-preview-popup,
.channels-preview-wrap:hover .channels-preview-popup,
.promote-url-wrap:hover .promote-url-popup {
    display: block;
}

/* Text preview popup */
.text-preview-popup {
    word-wrap: break-word;
    line-height: 1.5;
}

/* Media preview popup */
.media-preview-popup {
    padding: 8px;
    min-width: 180px;
}

.media-preview-popup img,
.media-preview-popup video {
    max-width: 250px;
    max-height: 180px;
    border-radius: var(--radius-sm);
    display: block;
}

.media-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--border-light);
    color: var(--text-muted);
}

.media-badge.media-image { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.media-badge.media-video { background: rgba(168, 85, 247, 0.1); color: #a855f7; }
.media-badge.media-gif { background: rgba(236, 72, 153, 0.1); color: #ec4899; }

/* Stats preview popup */
.stats-preview-popup {
    min-width: 220px;
}

.stats-popup-loading,
.action-popup-loading {
    text-align: center;
    color: var(--text-muted);
    padding: 8px;
}

.stats-popup-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-popup-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
}

.stats-popup-row .label {
    color: var(--text-muted);
}

.stats-popup-row .value {
    font-weight: 600;
}

/* Action preview popup */
.action-preview-popup {
    min-width: 280px;
    max-width: 400px;
}

.action-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 9px;
    font-weight: 500;
    background: var(--border-light);
    color: var(--text-muted);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.action-popup-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-popup-item {
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
}

.action-popup-item:last-child {
    border-bottom: none;
}

.action-popup-item .action-type {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 2px;
}

.action-popup-item .action-details {
    font-size: 10px;
    color: var(--text-muted);
}

.action-popup-item .action-time {
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Action History Popup */
.action-popup-title {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.action-popup-empty,
.action-popup-error {
    text-align: center;
    color: var(--text-muted);
    font-size: 11px;
    padding: 12px 8px;
}

.action-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-history-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 11px;
}

.action-history-row .action-time {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 10px;
    min-width: 50px;
}

.action-history-row .action-type {
    flex-shrink: 0;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.action-type-edit { background: #dbeafe; color: #1d4ed8; }
.action-type-create { background: #dcfce7; color: #16a34a; }
.action-type-delete { background: #fee2e2; color: #dc2626; }
.action-type-status { background: #fef3c7; color: #d97706; }
.action-type-budget { background: #e0e7ff; color: #4f46e5; }
.action-type-cpm { background: #fae8ff; color: #a855f7; }
.action-type-default { background: var(--border-light); color: var(--text-muted); }

.action-history-row .action-values {
    flex: 1;
    font-size: 10px;
    color: var(--text-secondary);
    word-break: break-word;
}

.action-values .action-old {
    color: #dc2626;
    text-decoration: line-through;
    background: #fee2e2;
    padding: 1px 4px;
    border-radius: 2px;
}

.action-values .action-new {
    color: #16a34a;
    font-weight: 500;
    background: #dcfce7;
    padding: 1px 4px;
    border-radius: 2px;
}

.action-values .action-deleted {
    color: #dc2626;
    font-weight: 500;
    background: #fee2e2;
    padding: 1px 4px;
    border-radius: 2px;
}

/* Channels preview popup */
.channels-preview-popup {
    min-width: 250px;
    max-width: 350px;
    max-height: 300px;
    overflow-y: auto;
}

.channels-popup-title {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-light);
}

.channels-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    transition: background 0.1s;
}

.channel-item:hover {
    background: var(--primary-light);
    cursor: pointer;
}

.channel-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.channel-username {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-item a {
    color: var(--primary);
    text-decoration: none;
}

.channel-item a:hover {
    text-decoration: underline;
}

/* Keyword items for search targeting */
.keywords-list {
    gap: 6px;
}

.keyword-item {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    font-size: 12px;
    transition: background 0.1s;
}

.keyword-item:hover {
    background: var(--primary-light);
}

.keyword-text {
    color: var(--text-primary);
    font-weight: 500;
}

.channels-text-with-popup {
    cursor: pointer;
    color: var(--primary);
}

.channels-text-with-popup:hover {
    text-decoration: underline;
}

/* Target secondary info (device, platform) */
.target-secondary {
    color: var(--text-secondary);
    font-size: 0.85em;
}

/* ===== DECLINE REASON POPUP ===== */
.decline-preview-wrap {
    position: relative;
    display: inline-block;
}

.decline-preview-popup {
    display: none;
    position: fixed;
    top: -9999px;
    left: -9999px;
    z-index: 99999;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.12), 0 0 0 1px rgba(239, 68, 68, 0.08);
    padding: 14px 16px;
    font-size: 12px;
    color: var(--text-primary);
    min-width: 280px;
    max-width: 380px;
    overflow: hidden;
}

.decline-preview-popup.visible {
    display: block;
}

.status-badge.clickable {
    cursor: pointer;
    transition: all 0.15s;
}

.status-badge.clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.decline-popup-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    padding: 8px 0;
}

.decline-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.decline-header {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.decline-reason {
    font-size: 15px;
    font-weight: 600;
    color: #dc2626;
}

.decline-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.decline-link {
    font-size: 11px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.decline-link:hover {
    text-decoration: underline;
}

.decline-review-status {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
    font-size: 11px;
    font-weight: 500;
}

.decline-review-status.can-review .review-available {
    color: #16a34a;
}

.decline-review-status.no-review .review-unavailable {
    color: #94a3b8;
}

.decline-error {
    color: #dc2626;
    font-size: 12px;
}

/* Stats value in table */
.stats-value {
    cursor: default;
}

/* Upgrade button */
.upgrade-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: white;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.upgrade-btn svg {
    width: 14px;
    height: 14px;
}

/* Hide upgrade button when user has paid plan */
.upgrade-btn.hidden {
    display: none;
}

/* ===== TABLE ROW ACTION BUTTONS - MODERN DESIGN ===== */

/* Base row button style */
.row-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 10px;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.row-btn svg {
    width: 12px;
    height: 12px;
}

.row-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.row-btn:active {
    transform: translateY(0);
}

/* Primary button - Edit (blue gradient) */
.row-btn-primary {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: white;
}

.row-btn-primary:hover {
    background: linear-gradient(135deg, #5355d9 0%, #7273e5 100%);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* CPM button (purple gradient) */
.row-btn-cpm {
    background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%);
    color: white;
}

.row-btn-cpm:hover {
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
}

/* Budget button (amber/orange gradient) */
.row-btn-budget {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

.row-btn-budget:hover {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Recreate button (cyan/teal gradient) */
.row-btn-recreate {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
    color: white;
}

.row-btn-recreate:hover {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.4);
}

/* Success button - Play/Start (green gradient) */
.row-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
}

.row-btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Warning button - Pause/Stop (orange gradient) */
.row-btn-warning {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: white;
}

.row-btn-warning:hover {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

/* Danger button - Delete (red gradient) */
.row-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
}

.row-btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Row actions container */
.row-actions {
    min-width: 40px;
    vertical-align: middle;
}

/* Ensure Actions column cell has minimum width */
.campaigns-table td:last-child,
.campaigns-table th:last-child {
    min-width: 50px;
    position: relative;
    vertical-align: middle;
}

/* Fix actions menu wrap visibility */
.campaigns-table .actions-menu-wrap {
    position: relative;
    display: inline-flex;
}

/* ===== AUTOMATION BUTTON - MODERN DESIGN ===== */

.auto-btn {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 11px;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, rgba(148, 163, 184, 0.25) 100%);
    color: #64748b;
    position: relative;
    overflow: hidden;
}

.auto-btn svg {
    width: 12px;
    height: 12px;
}

.auto-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.auto-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(168, 85, 247, 0.2) 100%);
    color: #6366f1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.auto-btn:hover::before {
    opacity: 1;
}

/* Active automation state - vibrant gradient */
.auto-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.auto-btn.active:hover {
    background: linear-gradient(135deg, #5355d9 0%, #9333ea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.45);
}

/* Pulse animation for active automation */
.auto-btn.active::after {
    content: '';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    border: 1px solid white;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

/* Pro plan style for upgrade button */
.upgrade-btn.is-pro {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    cursor: default;
}

.upgrade-btn.is-pro:hover {
    transform: none;
    box-shadow: none;
}

/* Similar Channels Styles */
.similar-channels-list-wrap {
    max-height: 400px;
    overflow-y: auto;
}

.similar-channels-message {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.similar-channels-list {
    padding: 8px 0;
}

.similar-channel-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.similar-channel-item:hover {
    background: var(--bg-hover);
}

.similar-channel-checkbox {
    flex-shrink: 0;
    margin-right: 12px;
}

.similar-channel-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.similar-channel-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 12px;
    background: var(--bg-secondary);
}

.similar-channel-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.similar-channel-content {
    flex: 1;
    min-width: 0;
    margin-right: 12px;
}

.similar-channel-title {
    display: block;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.similar-channel-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.similar-channel-action {
    flex-shrink: 0;
}

.similar-channel-action a {
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.similar-channel-action a:hover {
    text-decoration: underline;
}

/* Dots animated loading */
.dots-animated::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Add Similar Channels button */
.btn-similar-channels {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--primary-color);
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-top: 8px;
}

.btn-similar-channels:hover {
    background: var(--primary-color);
    color: white;
}

.btn-similar-channels:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-similar-channels svg {
    width: 14px;
    height: 14px;
}

/* Similar Channels Toggle */
.tg-similar-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 0 2px;
}

/* Channel Size Filter Buttons */
.channel-size-filter {
    display: flex;
    gap: 8px;
    padding: 12px 16px 8px;
}

.channel-size-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 8px 8px;
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 10px;
    background: var(--bg-primary, #fff);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.channel-size-btn:hover {
    border-color: var(--primary, #6366f1);
}

.channel-size-btn.active {
    border-color: var(--primary, #6366f1);
    background: var(--primary-light, #eef2ff);
}

.channel-size-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary, #1e293b);
}

.channel-size-btn.active .channel-size-label {
    color: var(--primary, #6366f1);
}

.channel-size-sublabel {
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
}

.channel-size-btn.active .channel-size-sublabel {
    color: var(--primary, #6366f1);
    opacity: 0.8;
}

.channel-size-recommended {
    display: none;
    font-size: 10px;
    color: #10b981;
    font-weight: 500;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.channel-size-btn[data-size="small"] .channel-size-recommended {
    display: block;
}

.channel-size-note {
    padding: 4px 16px 10px;
    font-size: 11px;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

/* ============================================
   Channel Selector (like Telegram Ads)
   ============================================ */

.tg-channel-selector {
    position: relative;
    background: #fff;
    border: none;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px #d9d9d9;
    min-height: 40px;
    transition: box-shadow 0.2s ease;
}

.tg-channel-selector:focus-within {
    box-shadow: inset 0 0 0 2px #35a3f6;
}

.tg-channel-selector.is-loading {
    pointer-events: none;
}

.tg-channel-selected-items {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 5px 7px;
    min-height: 28px;
}

.tg-channel-input-wrap {
    flex: 1;
    min-width: 150px;
}

.tg-channel-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-size: 14px;
    line-height: 18px;
    color: #222;
    padding: 4px 0;
}

.tg-channel-input::placeholder {
    color: var(--text-muted);
}

/* Channel chip item */
.tg-channel-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px 5px 5px;
    background: var(--accent-color, #119af5);
    border-radius: 4px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
    color: #fff;
    max-width: 200px;
    animation: chipAppear 0.2s ease;
}

@keyframes chipAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.tg-channel-item.has-photo {
    padding-left: 0;
}

.tg-channel-item-photo {
    width: 26px;
    height: 26px;
    border-radius: 4px 0 0 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.tg-channel-item-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tg-channel-item-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.tg-channel-item-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 12px;
    line-height: 1;
    transition: background 0.15s ease;
}

.tg-channel-item-close:hover {
    background: rgba(255, 255, 255, 0.5);
}

.tg-channel-item-close::before {
    content: '×';
    font-weight: bold;
}

/* Progress indicator */
.tg-channel-progress {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: none;
}

.tg-channel-selector.is-loading .tg-channel-progress {
    display: block;
}

.tg-channel-progress::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: channelSpin 0.8s linear infinite;
}

@keyframes channelSpin {
    to { transform: rotate(360deg); }
}

/* Error state */
.tg-channel-selector.has-error {
    box-shadow: inset 0 0 0 1px #d75959;
}

.tg-channel-selector + .tg-form-error {
    color: var(--danger-color, #ef4444);
    font-size: 12px;
    margin-top: 4px;
}

/* ============================================
   LOCKED CAMPAIGNS (Over Plan Limit)
   ============================================ */

/* Locked row styling */
.row-locked {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.08) 0%, rgba(148, 163, 184, 0.15) 100%) !important;
    position: relative;
}

.row-locked td {
    color: #94a3b8 !important;
    filter: blur(1px);
    user-select: none;
}

.row-locked td:first-child,
.row-locked td:nth-child(2),
.row-locked td:nth-child(3),
.row-locked td:nth-child(4),
.row-locked td:nth-child(17),
.row-locked td:last-child {
    filter: none;
}

.row-locked .status-badge {
    opacity: 0.6;
}

.row-locked .locked-text {
    font-style: italic;
    color: #94a3b8;
    font-size: 11px;
}

.row-locked button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.row-locked input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* Upgrade overlay row - appears between visible and locked campaigns */
.upgrade-overlay-row {
    background: transparent !important;
}

.upgrade-overlay-row td {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* Campaigns limit overlay banner */
.campaigns-limit-overlay {
    padding: 12px;
}

.campaigns-limit-content {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 28px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.campaigns-limit-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
}

.campaigns-limit-icon svg {
    stroke: white;
}

.campaigns-limit-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.campaigns-limit-text strong {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.campaigns-limit-text span {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.5;
}

.campaigns-limit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: white;
    color: #6366f1;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.campaigns-limit-btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.campaigns-limit-btn svg {
    stroke: #6366f1;
}

/* Responsive overlay */
@media (max-width: 900px) {
    .campaigns-limit-content {
        flex-direction: column;
        text-align: center;
        padding: 24px;
        gap: 16px;
    }

    .campaigns-limit-text {
        align-items: center;
    }

    .campaigns-limit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   CAMPAIGN TEMPLATES PANEL
   ============================================ */

.campaign-templates-panel {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(129, 140, 248, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.templates-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.btn-template {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-template:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-template svg {
    flex-shrink: 0;
}

.btn-save-template {
    flex: 1;
}

.template-dropdown {
    position: relative;
    flex: 1;
}

.btn-load-template {
    width: 100%;
    justify-content: space-between;
}

.template-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}

.dropdown-arrow {
    flex-shrink: 0;
    transition: transform 0.2s;
}

.template-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.template-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.template-list {
    padding: 4px;
}

.template-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.template-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    gap: 10px;
}

.template-item:hover {
    background: var(--primary-light);
}

.template-item-content {
    flex: 1;
    min-width: 0;
}

.template-item-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-item-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.template-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}

.template-item:hover .template-item-actions {
    opacity: 1;
}

.template-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.template-action-btn:hover {
    background: white;
    color: var(--text-primary);
}

.template-action-btn.delete:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

.template-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.template-limit-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* Save Template Modal */
.save-template-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.save-template-modal.active {
    display: flex;
}

.save-template-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.save-template-header {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.save-template-body {
    margin-bottom: 20px;
}

.save-template-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ============================================
   Inline Editing (CPM, Budget, Status)
   ============================================ */

.editable-cell {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: inline-block;
}

.editable-cell:hover {
    background: var(--primary-bg, rgba(99, 102, 241, 0.1));
    color: var(--primary, #6366f1);
}

.inline-edit-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

.inline-edit-input {
    width: 75px;
    padding: 3px 6px;
    font-size: 12px;
    border: 1px solid var(--primary, #6366f1);
    border-radius: 4px;
    background: var(--bg-secondary, #f8fafc);
    color: var(--text-primary, #1e293b);
    outline: none;
}

.inline-edit-input:focus {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.inline-edit-input:disabled {
    opacity: 0.6;
}

.inline-edit-loading {
    display: inline-flex;
    align-items: center;
}

/* Inline edit vertical layout with slider */
.inline-edit-wrap-vertical {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 130px;
    position: relative;
    z-index: 100;
}

.inline-edit-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.inline-edit-wrap-vertical .inline-edit-input {
    width: 65px;
    flex-shrink: 0;
}

.inline-edit-apply {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: var(--primary, #6366f1);
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.inline-edit-apply:hover {
    background: var(--primary-dark, #4f46e5);
}

.inline-edit-apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Slider styles */
.inline-edit-slider-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.inline-edit-slider {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #ef4444 0%, #e2e8f0 50%, #22c55e 100%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.inline-edit-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--primary, #6366f1);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.inline-edit-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: white;
    border: 2px solid var(--primary, #6366f1);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.inline-edit-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: var(--text-muted, #94a3b8);
}

.inline-slider-value {
    font-weight: 600;
    font-size: 9px;
}

/* Status dropdown */
.status-dropdown-wrap {
    position: relative;
    display: inline-block;
}

.editable-status {
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.editable-status:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.status-dropdown-arrow {
    font-size: 8px;
    opacity: 0.6;
    transition: transform 0.15s;
}

.status-dropdown {
    position: fixed;
    top: -9999px;
    left: -9999px;
    z-index: 99999;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    display: none;
}

.status-dropdown.show {
    display: block;
}

.status-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-primary, #1e293b);
    transition: background 0.1s;
}

.status-dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.status-dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.status-dropdown-item:hover {
    background: var(--bg-hover, #f1f5f9);
}

.status-dropdown-item.active {
    background: var(--primary-bg, rgba(99, 102, 241, 0.1));
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.status-Active {
    background: #22c55e;
}

.status-dot.status-On-Hold {
    background: #f59e0b;
}

/* ============================================
   Export Modal (Apple Style)
   ============================================ */

.export-scope-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--primary-light, rgba(99, 102, 241, 0.08));
    border-radius: var(--radius-lg, 12px);
    margin-bottom: 20px;
}

.export-scope-icon {
    font-size: 20px;
}

.export-scope-text {
    font-size: 14px;
    color: var(--text-primary, #1e293b);
    font-weight: 500;
}

.export-period-wrap {
    margin-bottom: 20px;
}

.export-period-segmented {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}

.export-seg-btn {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.export-seg-btn:hover {
    color: #1e293b;
}

.export-seg-btn.active {
    background: #fff;
    color: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.export-seg-custom {
    flex: 0 0 36px;
    padding: 8px 0;
}

.export-seg-custom svg {
    opacity: 0.6;
    transition: opacity 0.15s;
}

.export-seg-custom:hover svg,
.export-seg-custom.active svg {
    opacity: 1;
    stroke: #6366f1;
}

.export-custom-dates {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    animation: slideDown 0.2s ease;
}

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

.export-date-input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
}

.export-date-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.export-date-sep {
    color: #cbd5e1;
    font-size: 14px;
    flex-shrink: 0;
}

.export-buttons-wrap {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.export-big-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 24px 16px;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 12px);
    background: var(--glass-bg, #fff);
    cursor: pointer;
    transition: all 0.2s ease;
}

.export-big-btn:hover {
    border-color: var(--primary, #6366f1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.1));
}

.export-big-btn:active {
    transform: translateY(0);
}

.export-btn-icon {
    font-size: 32px;
    line-height: 1;
}

.export-btn-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.export-btn-subtitle {
    font-size: 12px;
    color: var(--text-muted, #94a3b8);
}

.export-btn-report:hover {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-color: #ef4444;
}

.export-btn-report:hover .export-btn-title {
    color: #ef4444;
}

.export-btn-data:hover {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(34, 197, 94, 0.1) 100%);
    border-color: #22c55e;
}

.export-btn-data:hover .export-btn-title {
    color: #22c55e;
}

.export-csv-link {
    text-align: center;
}

.export-csv-link a {
    font-size: 13px;
    color: var(--text-muted, #94a3b8);
    text-decoration: none;
    transition: color 0.15s;
}

.export-csv-link a:hover {
    color: var(--primary, #6366f1);
    text-decoration: underline;
}

/* Loading state for export buttons */
.export-big-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.export-big-btn.loading .export-btn-icon {
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
