/* ============================================
   TELADS.PRO - 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;
}

/* 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-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-x: auto;
    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);
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.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 {
    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-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);
}

/* ============================================
   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); }
}

.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);
}

/* ============================================
   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; }

.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;
    background: var(--primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.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-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; }

.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);
}

.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: 900px;
    margin: 0 auto;
}

.plans-header {
    text-align: center;
    margin-bottom: 32px;
}

.plans-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.plans-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 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: 8px 16px;
    margin-top: 16px;
    font-size: 12px;
}

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

.plans-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

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

.plan-card {
    padding: 24px;
    position: relative;
}

.plan-card.featured {
    border-color: var(--primary);
}

.plan-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.plan-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-header { margin-bottom: 20px; }

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

.plan-card.featured .plan-icon {
    background: var(--primary);
    color: white;
}

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

.plan-name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.plan-description { font-size: 12px; color: var(--text-muted); }

.plan-pricing {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.plan-currency { font-size: 18px; font-weight: 600; }
.plan-amount { font-size: 40px; font-weight: 800; line-height: 1; }
.plan-period { font-size: 13px; color: var(--text-muted); margin-left: 4px; }

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

.plan-features {
    list-style: none;
    margin-bottom: 20px;
}

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

.plan-features li svg { width: 16px; height: 16px; 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: 500;
}

.plan-cta { width: 100%; }

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

/* Payment Info */
.payment-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-bottom: 24px;
}

.payment-icon {
    width: 40px;
    height: 40px;
    background: var(--success-bg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--success);
    flex-shrink: 0;
}

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

.payment-content { flex: 1; }
.payment-content h3 { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.payment-content p { font-size: 11px; color: var(--text-muted); }

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

.payment-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

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

/* FAQ */
.faq-section { margin-top: 32px; }
.faq-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 16px; }

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

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

.faq-item { overflow: hidden; }

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.faq-question:hover { color: var(--primary); }
.faq-question svg { width: 14px; height: 14px; color: var(--text-muted); transition: transform 0.2s; }
.faq-item.open .faq-question svg { transform: rotate(180deg); }

.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 14px 12px; font-size: 12px; 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
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 0 12px;
        height: 48px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .search-box {
        width: 100%;
    }

    .batch-actions {
        left: 16px;
        right: 16px;
        transform: translateY(100px);
        width: auto;
    }

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

    .account-card {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

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

    .payment-info {
        flex-direction: column;
        text-align: center;
    }

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

@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;
}

/* 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;
}

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

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

/* 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);
}

/* 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 - horizontal scroll */
.table-container {
    overflow: visible;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

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

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

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

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

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

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

.campaigns-table th {
    background: #ffffff;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    position: sticky;
    top: 60px;
    z-index: 100;
    vertical-align: middle;
}

/* Title column */
.campaigns-table td:nth-child(3) {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 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;
}

.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: absolute;
    top: 100%;
    left: 0;
    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 {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.filter-popup .filter-actions button {
    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 {
    background: var(--primary);
    color: white;
    border: none;
}

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

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

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

/* 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);
}

/* 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; }

.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: 20px;
}

.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 */
.text-preview-popup,
.media-preview-popup,
.stats-preview-popup,
.action-preview-popup,
.channels-preview-popup {
    display: none;
    position: absolute;
    z-index: 99999;
    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-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 12px 14px;
    font-size: 12px;
    color: var(--text-primary);
    white-space: normal;
    min-width: 200px;
    max-width: 350px;
    pointer-events: auto;
}

/* 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 {
    display: block;
}

/* Text preview popup */
.text-preview-popup {
    left: 0;
    top: 100%;
    margin-top: 4px;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Media preview popup */
.media-preview-popup {
    left: 0;
    top: 100%;
    margin-top: 4px;
    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 {
    left: 50%;
    transform: translateX(-50%);
    top: 100%;
    margin-top: 4px;
    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 {
    left: auto;
    right: 0;
    top: 100%;
    margin-top: 4px;
    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 {
    left: 0;
    top: 100%;
    margin-top: 4px;
    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;
}

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

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

/* 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 {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

/* ===== 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;
}
