/* ========================================
   Ads CRM - Dark Modern Design
   Style: Discord/Figma inspired
   ======================================== */

:root {
    /* Colors */
    --bg-primary: #0f0f11;
    --bg-secondary: #1a1a1f;
    --bg-elevated: #24242b;
    --bg-hover: #2a2a33;
    --bg-active: #32323d;
    --bg-tertiary: #2a2a33;
    
    /* Accent - Indigo/Purple gradient */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-glow: rgba(99, 102, 241, 0.4);
    
    /* Status colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.15);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.15);
    
    /* Text */
    --text-primary: #f4f4f5;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px var(--accent-glow);
}

/* ========== Light Theme ========== */
body.light-theme {
    --bg-primary: #f5f6fa;
    --bg-secondary: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #eef0f5;
    --bg-active: #e4e7ef;
    --bg-tertiary: #eef0f5;
    
    --text-primary: #1a1d2e;
    --text-secondary: #4a5068;
    --text-muted: #6b7280;
    
    --border-color: rgba(0, 0, 0, 0.1);
    --border-hover: rgba(0, 0, 0, 0.18);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    
    /* Status colors - slightly adjusted for light bg */
    --success-bg: rgba(34, 197, 94, 0.12);
    --warning-bg: rgba(245, 158, 11, 0.12);
    --error-bg: rgba(239, 68, 68, 0.12);
    --info-bg: rgba(59, 130, 246, 0.12);
}

/* Light theme - Header bar */
body.light-theme .sidebar-header-bar {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}


/* Light theme - Sidebar */
body.light-theme .sidebar {
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .sidebar:hover {
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

body.light-theme .sidebar .sidebar-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .sidebar .nav-item {
    color: #4a5068;
}

body.light-theme .sidebar .nav-item:hover {
    background: rgba(99, 102, 241, 0.08);
    color: #1a1d2e;
}

body.light-theme .sidebar .nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

body.light-theme .sidebar .nav-item.active .nav-item-icon {
    color: white;
}

body.light-theme .sidebar .nav-section {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

body.light-theme .sidebar .sidebar-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-theme .sidebar .api-status {
    background: #f5f6fa;
}

body.light-theme .sidebar .nav-item-icon {
    opacity: 0.6;
}

body.light-theme .sidebar .nav-item:hover .nav-item-icon,
body.light-theme .sidebar .nav-item.active .nav-item-icon {
    opacity: 1;
}

/* Light theme - Cards */
body.light-theme .stat-card,
body.light-theme .filter-card {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.light-theme .stat-card:hover,
body.light-theme .filter-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Light theme - Tables */
body.light-theme .campaigns-table th {
    background: #f0f2f7;
}

body.light-theme .campaigns-table tr:hover td {
    background: #f8f9fc;
}

/* Light theme - Inputs */
body.light-theme input,
body.light-theme select,
body.light-theme textarea {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme input:focus,
body.light-theme select:focus,
body.light-theme textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

/* Light theme - Buttons */
body.light-theme .btn-secondary {
    background: #f0f2f7;
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

body.light-theme .btn-secondary:hover {
    background: #e4e7ef;
}

body.light-theme .header-btn {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .header-btn:hover {
    background: #f0f2f7;
}

/* Theme toggle button */
.theme-toggle {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
}
.theme-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.theme-toggle svg.theme-icon-light {
    display: none !important;
}
.theme-toggle svg.theme-icon-dark {
    display: block !important;
}
body.light-theme .theme-toggle svg.theme-icon-dark {
    display: none !important;
}
body.light-theme .theme-toggle svg.theme-icon-light {
    display: block !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: scroll;
    height: 100%;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100%;
}

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

/* ========== Layout ========== */
.container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    min-height: 100vh;
    box-sizing: border-box;
}

/* ========== Sidebar Layout ========== */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* ========== Sidebar ========== */
.sidebar {
    width: 60px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 200;
    left: 0;
    top: 0;
    overflow: hidden;
    transition: width 0.2s ease;
}

.sidebar:hover {
    width: 260px;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.35);
}

.sidebar-header {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    box-sizing: border-box;
}

.sidebar:hover .sidebar-header {
    padding: 16px 20px;
    justify-content: flex-start;
}

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

.logo-icon {
    width: 34px;
    height: 34px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.logo-text {
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

/* Labels hidden when collapsed, shown on hover */
.nav-label {
    display: none;
    white-space: nowrap;
}

.sidebar:hover .nav-label {
    display: inline;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 6px;
    overflow-y: auto;
    overflow-x: hidden;
    display: block;
    align-items: initial;
    gap: initial;
    flex-wrap: initial;
}

.sidebar:hover .sidebar-nav {
    padding: 12px;
}

.nav-section {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.nav-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sidebar:hover .nav-section {
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: none;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
    opacity: 0;
    white-space: nowrap;
    transition: opacity 0.15s ease;
    height: 0;
    overflow: hidden;
    margin: 0;
}

.sidebar:hover .nav-section-title {
    opacity: 1;
    height: auto;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    justify-content: center;
}

.sidebar:hover .nav-item {
    justify-content: flex-start;
    padding: 10px 14px;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-item-icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
    flex-shrink: 0;
}

.nav-item.active .nav-item-icon {
    opacity: 1;
}

.sidebar-footer {
    padding: 10px 6px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

.sidebar:hover .sidebar-footer {
    padding: 12px;
    justify-content: stretch;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    font-size: 13px;
    justify-content: center;
    overflow: hidden;
}

.sidebar:hover .api-status {
    justify-content: flex-start;
}

.api-status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
    flex-shrink: 0;
}

.api-status-dot.warning {
    background: var(--warning);
}

.api-status-dot.error {
    background: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.api-status-text {
    color: var(--text-secondary);
}

.api-status-text strong {
    color: var(--text-primary);
}

/* ========== Main Content with Sidebar ========== */
.main-content {
    flex: 1;
    min-width: 0;
    margin-left: 60px;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* ========== Sidebar Header ========== */
.sidebar-header-bar {
    background: rgba(15, 15, 17, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin: 0;
}

.search-box {
    position: relative;
}

.search-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px 10px 42px;
    font-size: 14px;
    color: var(--text-primary);
    width: 320px;
    transition: all 0.2s ease;
    font-family: inherit;
}

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

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

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

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========== Page Content ========== */
.page-content {
    padding: 32px;
}

/* ========== Section Header ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

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

.section-actions {
    display: flex;
    gap: 12px;
}

/* ========== Stat Change Indicator ========== */
.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--error);
}

.stat-change.neutral {
    color: var(--text-muted);
}

/* ========== Mobile Sidebar Toggle ========== */
.sidebar-toggle-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 250;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: background 0.2s ease, transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.sidebar-toggle-btn:hover {
    background: var(--bg-hover);
}

.sidebar-toggle-btn:active {
    transform: scale(0.96);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.visible {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

body.light-theme .sidebar-toggle-btn {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

body.light-theme .sidebar-toggle-btn:hover {
    background: var(--bg-hover);
}

/* ========== Responsive Sidebar ========== */
@media (max-width: 1024px) {
    .sidebar-toggle-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 260px;
        z-index: 200;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* When open on mobile, show labels (no hover on touch) */
    .sidebar.open .nav-label {
        display: inline;
    }
    .sidebar.open .nav-section-title {
        opacity: 1;
        height: auto;
        margin-bottom: 8px;
    }
    .sidebar.open .nav-item {
        justify-content: flex-start;
        padding: 10px 14px;
    }
    .sidebar.open .sidebar-header {
        padding: 16px 20px;
        justify-content: flex-start;
    }
    .sidebar.open .sidebar-nav {
        padding: 12px;
    }
    .sidebar.open .sidebar-footer {
        padding: 12px;
        justify-content: stretch;
    }
    .sidebar.open .api-status {
        justify-content: flex-start;
    }
    .sidebar.open .nav-section {
        margin-bottom: 20px;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .search-input {
        width: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar-header-bar {
        padding: 10px 12px 10px 56px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .header-left {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .page-title {
        font-size: 18px;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        flex: unset;
    }
    
    .header-center .product-selector {
        width: 100%;
    }
    
    .header-center .product-selector select,
    .header-center #product-select {
        min-width: 0;
        width: 100%;
        flex: 1;
    }
    
    .header-right {
        gap: 6px;
    }
    
    .page-content {
        padding: 12px;
    }
    
    main {
        padding: 12px;
    }
    
    .search-input {
        width: 100%;
    }

    /* Touch-friendly tap targets (min 44px) */
    .sidebar .nav-item {
        min-height: 44px;
        padding: 12px 14px;
    }

    .header-btn {
        min-width: 40px;
        min-height: 40px;
    }

    .tracker-header {
        padding-left: 56px;
    }

    /* Mobile density: buttons, inputs, selects */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 15px;
    }

    input:not([type="checkbox"]):not([type="radio"]), select, textarea {
        min-height: 44px;
        font-size: 16px;
        padding: 10px 14px;
    }

    input[type="checkbox"], input[type="radio"] {
        min-height: 24px;
        min-width: 24px;
    }
    
    /* Dashboard/Campaigns page mobile layout */
    .page-content {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .stat-card, .filter-card {
        min-height: 60px;
        padding: 12px;
    }
    
    .stat-card h3 {
        font-size: 11px;
    }
    
    .stat-card .value {
        font-size: 20px;
    }
    
    .stat-card .stat-change {
        font-size: 11px;
        margin-top: 4px;
    }
    
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .section-actions {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    
    .section-actions .search-box {
        flex: 1;
        min-width: 0;
        margin-right: 0 !important;
    }
    
    .section-actions .search-input {
        width: 100% !important;
    }
    
    .page-content .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .page-content .table-container table {
        min-width: 700px;
    }
    
    .page-content th, .page-content td {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .page-content td {
        font-size: 13px;
    }
    
    .page-content .status-badge {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    /* Campaigns table: compact actions on mobile, keep single row */
    #campaigns-table th,
    #campaigns-table td {
        padding: 6px 8px;
    }
    #campaigns-table .actions-cell {
        min-width: 170px;
        white-space: nowrap;
    }
    #campaigns-table .actions-cell-inner {
        gap: 4px;
    }
    #campaigns-table .actions-cell .btn,
    #campaigns-table .actions-cell a.btn {
        padding: 5px 8px;
        font-size: 11px;
        min-height: 32px;
        line-height: 1.3;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 12px;
    }
    
    main {
        padding: 12px;
    }
    
    .sidebar-header-bar {
        padding: 12px 12px 12px 60px;
    }
    
    .tracker-header {
        padding-left: 60px;
    }
    
    .sidebar-toggle-btn {
        top: 12px;
        left: 12px;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
}

/* ========== Header ========== */
header {
    background: rgba(26, 26, 31, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
}

/* ========== Navigation ========== */
nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    padding: 10px 18px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

nav a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

nav a.active {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-glow);
}

/* ========== Main Content ========== */
main {
    padding: 32px;
}

section {
    margin-bottom: 32px;
}

section h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* ========== Stats Grid ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card, .filter-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before, .filter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover, .filter-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before, .filter-card:hover::before,
.stat-card.active::before, .filter-card.filter-active::before {
    opacity: 1;
}

.stat-card h3, .filter-card h3 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.stat-card .value, .filter-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -1px;
}

.stat-card .value.success, .filter-card .value.success { color: var(--success); }
.stat-card .value.warning, .filter-card .value.warning { color: var(--warning); }
.stat-card .value.error, .filter-card .value.error { color: var(--error); }
.stat-card .value.info, .filter-card .value.info { color: var(--info); }

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

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

.btn-success:hover {
    background: #1fb854;
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    color: #111;
}

.btn-warning:hover {
    background: #e6900a;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-danger:hover {
    background: #dc3030;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ========== Tables ========== */
.table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-elevated);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

th.sortable {
    cursor: pointer;
    transition: color 0.2s ease;
}

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

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

td {
    color: var(--text-secondary);
    font-size: 14px;
}

td.loading, td.error {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
}

/* ========== Status Badge ========== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.status-active, .status-badge.active {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.status-paused, .status-badge.paused {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-badge.status-submitted, .status-badge.submitted {
    background: var(--info-bg);
    color: var(--info);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

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

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

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

select {
    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 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========== Checkbox ========== */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    appearance: none;
    background: var(--bg-elevated);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

input[type="checkbox"]:checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* ========== Search Input ========== */
.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-container input {
    padding-left: 44px;
}

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

#search-input {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
    max-width: 400px;
}

/* ========== Product Selector ========== */
.product-selector, .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.product-selector select,
#product-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    min-width: 200px;
}

/* ========== Actions Cell ========== */
.actions-cell {
    vertical-align: middle;
}

.actions-cell-inner {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.actions-cell .btn,
.actions-cell a.btn {
    flex-shrink: 0;
    padding: 5px 10px;
    font-size: 12px;
    white-space: nowrap;
    margin: 0;
    min-height: 0;
    line-height: 1.4;
}

/* Campaigns table: compact rows, single-line actions */
#campaigns-table th,
#campaigns-table td {
    padding: 8px 12px;
    vertical-align: middle;
}

#campaigns-table th.actions-col,
#campaigns-table .actions-cell {
    min-width: 200px;
    white-space: nowrap;
}

/* ========== Loader/Spinner ========== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 17, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.form-loader {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

/* ========== Toast Notifications ========== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    animation: slideIn 0.3s ease;
}

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

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast.warning {
    border-left: 4px solid var(--warning);
}

.toast.info {
    border-left: 4px solid var(--info);
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-size: 14px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
}

.toast-close:hover {
    color: var(--text-primary);
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

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

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

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

/* ========== Confirm Dialog ========== */
.confirm-dialog {
    text-align: center;
}

.confirm-dialog h3 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.confirm-dialog p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ========== Modal Dialog Buttons ========== */
.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding: 20px 24px 0;
}

.modal-message {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    padding: 0 24px 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.modal-button {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    min-width: 100px;
}

.modal-button-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.modal-button-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
}

.modal-button-primary {
    background: var(--accent-primary);
    color: white;
}

.modal-button-primary:hover {
    background: var(--accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.modal-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* ========== Charts Section ========== */
#metrics-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.chart-wrapper {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 20px;
}

.chart-wrapper h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* ========== Bulk Actions Bar ========== */
.bulk-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.bulk-actions.hidden {
    display: none;
}

.selection-count {
    color: var(--text-secondary);
    font-size: 14px;
}

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

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 64px 32px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* ========== Country Badge ========== */
.geo-cell {
    white-space: nowrap;
}

.country-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ========== Campaign Health Score ========== */
.health-cell {
    text-align: center;
    vertical-align: middle;
}

.health-score-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.health-loading {
    color: var(--text-muted);
    font-size: 14px;
}

.health-score-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.health-score-display:hover {
    transform: scale(1.1);
}

.health-score-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid currentColor;
}

.health-good .health-score-circle {
    background: var(--success-bg);
    color: var(--success);
    border-color: var(--success);
}

.health-warning .health-score-circle {
    background: var(--warning-bg);
    color: var(--warning);
    border-color: var(--warning);
}

.health-bad .health-score-circle {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error);
}

/* Health Tooltip */
.health-tooltip {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 350px;
    color: var(--text-primary);
    font-size: 13px;
}

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

.health-tooltip-title {
    font-weight: 600;
    font-size: 14px;
}

.health-tooltip-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.health-tooltip-close:hover {
    color: var(--text-primary);
}

.health-tooltip-body {
    padding: 12px 16px;
}

.health-factors {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.health-factor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.factor-name {
    color: var(--text-secondary);
}

.factor-score {
    font-weight: 600;
    font-family: monospace;
}

.factor-score.good { color: var(--success); }
.factor-score.warning { color: var(--warning); }
.factor-score.bad { color: var(--error); }

.health-suggestions {
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.suggestions-title {
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-item {
    color: var(--warning);
    font-size: 12px;
    margin-bottom: 4px;
    line-height: 1.4;
}

/* ========== Multi-Select Component ========== */
.multi-select-wrapper {
    position: relative;
}

.multi-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    display: none;
}

.multi-select-dropdown.open {
    display: block;
}

.multi-select-search {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.multi-select-search input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
}

.multi-select-options {
    padding: 8px 0;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.multi-select-option:hover {
    background: var(--bg-hover);
}

.multi-select-option.selected {
    background: var(--accent-glow);
}

.multi-select-option-text {
    flex: 1;
}

.multi-select-option-title {
    color: var(--text-primary);
    font-weight: 500;
}

.multi-select-option-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
}

.multi-select-no-results {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
}

.multi-select-selected {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.multi-select-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-gradient);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.multi-select-chip-remove {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.multi-select-chip-remove:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-active);
    border-radius: 4px;
}

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

/* ========== Responsive ========== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    header {
        padding: 16px;
    }
    
    main {
        padding: 16px;
    }
    
    nav {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 8px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    th, td {
        padding: 12px;
    }
    
    .bulk-actions {
        flex-wrap: wrap;
    }
}

/* ========== Utility Classes ========== */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

.bg-primary { background: var(--bg-primary); }
.bg-secondary { background: var(--bg-secondary); }
.bg-elevated { background: var(--bg-elevated); }

.font-mono { font-family: 'JetBrains Mono', 'SF Mono', monospace; }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

/* ========== Products Page Specific ========== */
.products-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.products-table {
    width: 100%;
}

/* ========== Reports Page Specific ========== */
.report-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.date-range-picker {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.date-range-picker label {
    color: var(--text-secondary);
    font-size: 14px;
}

.quick-dates {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.quick-dates .btn {
    padding: 8px 14px;
    font-size: 13px;
}

.dimensions-section {
    margin-top: 20px;
}

.dimensions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.dimension-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.dimension-checkbox input {
    width: 16px;
    height: 16px;
}

.dimension-checkbox span {
    color: var(--text-secondary);
    font-size: 14px;
}

.totals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.total-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.total-card .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.total-card .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ========== Create/Edit Form Page ========== */
.form-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.form-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-row.full {
    grid-template-columns: 1fr;
}

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

/* ========== Autocomplete ========== */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.autocomplete-dropdown.open {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid var(--border-color);
}

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

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

.autocomplete-item-title {
    color: var(--text-primary);
    font-weight: 500;
}

.autocomplete-item-id {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    margin-top: 4px;
}

/* ==================== Token Expired Banner ==================== */

.token-expired-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 50%, #ef4444 100%);
    color: #fff;
    padding: 0;
    z-index: 10001;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.4);
    animation: tokenBannerSlideIn 0.35s ease-out;
}

.token-expired-banner.hiding {
    animation: tokenBannerSlideOut 0.3s ease-in forwards;
}

@keyframes tokenBannerSlideIn {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes tokenBannerSlideOut {
    from { transform: translateY(0); opacity: 1; }
    to   { transform: translateY(-100%); opacity: 0; }
}

.token-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.token-banner-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.token-banner-text {
    font-size: 14px;
    line-height: 1.4;
}

.token-banner-text a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.token-banner-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.token-banner-btn {
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.token-banner-btn.refresh {
    background: #fff;
    color: #b91c1c;
}

.token-banner-btn.refresh:hover {
    background: #fee2e2;
}

.token-banner-btn.refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.token-banner-btn.settings {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.token-banner-btn.settings:hover {
    background: rgba(255, 255, 255, 0.3);
}

.token-banner-btn.dismiss {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    padding: 4px 8px;
    line-height: 1;
}

.token-banner-btn.dismiss:hover {
    color: #fff;
}

@media (max-width: 768px) {
    .token-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    .token-banner-actions {
        justify-content: center;
    }
}