:root {
    --primary: #f97316;
    --primary-light: rgba(249, 115, 22, 0.15);
    --primary-glow: rgba(249, 115, 22, 0.25);
    --secondary: #6366f1;
    --bg: #060a14;
    --bg-elevated: #111827;
    --card-bg: rgba(15, 20, 35, 0.82);
    --card-bg-hover: rgba(22, 31, 48, 0.9);
    --text: #f1f5f9;
    --text-muted: #8b95a8;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --glass-blur: 20px;
    --green: #34d399;
    --blue: #818cf8;
    --yellow: #fbbf24;
    --red: #fb7185;
    --orange: #fdba74;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
}

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

/* ── Animated Background System ── */
body {
    font-family: 'Inter', 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 1.25rem 1.5rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Dot grid pattern overlay */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* Aurora gradient sweep */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 80% 50% at 15% 15%, rgba(249, 115, 22, 0.22) 0%, transparent 55%),
        radial-gradient(ellipse 60% 60% at 85% 85%, rgba(99, 102, 241, 0.20) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(52, 211, 153, 0.08) 0%, transparent 50%);
    animation: aurora-drift 12s ease-in-out infinite alternate;
}

@keyframes aurora-drift {
    0%   { opacity: 0.8; transform: scale(1) translate(0, 0); }
    50%  { opacity: 1;   transform: scale(1.05) translate(-15px, 10px); }
    100% { opacity: 0.9; transform: scale(1.02) translate(15px, -10px); }
}

/* Floating gradient orbs */
.bg-orbs {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    animation: orb-float 18s ease-in-out infinite;
}

.bg-orb:nth-child(1) {
    width: 550px; height: 550px;
    background: radial-gradient(circle, #f97316 0%, transparent 70%);
    top: -12%; left: -10%;
    animation-duration: 20s;
}
.bg-orb:nth-child(2) {
    width: 450px; height: 450px;
    background: radial-gradient(circle, #6366f1 0%, transparent 70%);
    bottom: -8%; right: -8%;
    animation-duration: 24s;
    animation-delay: -4s;
}
.bg-orb:nth-child(3) {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
    top: 45%; left: 35%;
    animation-duration: 22s;
    animation-delay: -8s;
    opacity: 0.20;
}
.bg-orb:nth-child(4) {
    width: 350px; height: 350px;
    background: radial-gradient(circle, #ec4899 0%, transparent 70%);
    top: 10%; right: 15%;
    animation-duration: 26s;
    animation-delay: -12s;
    opacity: 0.15;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%      { transform: translate(40px, -30px) scale(1.08); }
    50%      { transform: translate(-20px, 40px) scale(0.95); }
    75%      { transform: translate(30px, 20px) scale(1.04); }
}

/* Ensure all content sits above the background effects */
.container, header, .main-layout {
    position: relative;
    z-index: 1;
}

.container { max-width: 1600px; margin: 0 auto; }

/* ── Header ── */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

h1 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #94a3b8 60%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.header-sub { color: var(--text-muted); font-size: 0.78rem; margin-top: 3px; letter-spacing: 0.01em; }

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

.search-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 0.5rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    width: 240px;
    outline: none;
    font-size: 0.82rem;
    font-weight: 400;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.search-box::placeholder { color: var(--text-muted); }
.search-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background: rgba(255, 255, 255, 0.06);
}

select.search-box {
    cursor: pointer;
    appearance: auto;
    background: rgba(10, 14, 26, 0.9);
}
select.search-box option {
    background: var(--bg-elevated);
    color: var(--text);
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
.btn-primary:hover { box-shadow: 0 4px 16px rgba(249, 115, 22, 0.4); }
.btn-green { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.btn-green:hover { box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4); }
#download-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 7px;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.30);
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.2s, filter 0.15s;
}
#download-btn:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4); }
#download-btn:active { transform: translateY(0); }
#download-btn svg { flex: 0 0 auto; }

/* ── KPI Stats ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (max-width: 1200px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    border: 1px solid var(--border);
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5),
                0 6px 20px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), #06b6d4);
    background-size: 200% 100%;
    opacity: 0;
    transition: opacity 0.3s;
    animation: shimmer-bar 3s linear infinite;
}
@keyframes shimmer-bar {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.stat-card:hover {
    transform: translateY(-4px);
    border-color: rgba(249, 115, 22, 0.2);
    box-shadow: 0 34px 78px rgba(0, 0, 0, 0.55),
                0 8px 24px rgba(0, 0, 0, 0.35),
                0 0 30px rgba(249, 115, 22, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.stat-card:hover::before { opacity: 1; }

.stat-label {
    color: var(--text-muted);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-weight: 500;
    margin-bottom: 0.3rem;
}
.stat-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Analytics Row (bar chart + slot table) ── */
.analytics-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ── Secondary Row (donut + top products) ── */
.secondary-row {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* ── Cards ── */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5),
                0 6px 20px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 34px 78px rgba(0, 0, 0, 0.55),
                0 8px 24px rgba(0, 0, 0, 0.35),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

/* ── Chart containers ── */
.chart-wrap { position: relative; height: 220px; }
.chart-wrap-sm { position: relative; height: 200px; }

/* ── Rating Slots Table ── */
.slot-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.slot-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.slot-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.slot-table tr:last-child td { border-bottom: none; }
.slot-table tr:hover td { background: rgba(255,255,255,0.02); }

.slot-bar-wrap { width: 90px; background: rgba(255,255,255,0.06); border-radius: 99px; height: 7px; }
.slot-bar { height: 7px; border-radius: 99px; transition: width 0.4s; }

.badge-slot {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ── Product Catalog (paginated) ── */
.catalog-card { margin-bottom: 1rem; }

.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 8px;
}

.sort-controls { display: flex; gap: 6px; }
.sort-btn {
    padding: 0.35rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    transition: all 0.2s;
}
.sort-btn:hover, .sort-btn.active { background: rgba(251,146,60,0.15); border-color: var(--primary); color: var(--primary); }

.table-info { font-size: 0.78rem; color: var(--text-muted); }

/* Main product table */
.table-container { overflow-x: auto; position: relative; }

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

th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

td { padding: 0.6rem 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.875rem; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.rating-badge {
    background: rgba(251,146,60,0.2);
    color: #fdba74;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-weight: 600;
    font-size: 0.78rem;
}

.status-ok    { color: var(--green); font-size: 0.78rem; font-weight: 600; }
.status-error { color: var(--red);   font-size: 0.78rem; font-weight: 600; }
.status-empty { color: var(--yellow); font-size: 0.78rem; font-weight: 600; }

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.page-btn {
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
    transition: all 0.2s;
    min-width: 36px;
    text-align: center;
}
.page-btn:hover { background: rgba(251,146,60,0.15); border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: 0.35; cursor: default; }

.page-info { font-size: 0.78rem; color: var(--text-muted); padding: 0 4px; }

/* ── Top products table inside card ── */
.top-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.top-table th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.45rem 0.7rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.top-table td { padding: 0.45rem 0.7rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.top-table tr:last-child td { border-bottom: none; }
.top-table tr:hover td { background: rgba(255,255,255,0.02); }
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px; height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(251,146,60,0.2);
    color: var(--primary);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ════════════════════════════════════════════════════════════ */
/*  TAB BAR                                                    */
/* ════════════════════════════════════════════════════════════ */
/* ── Layout ── */
.main-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    min-height: calc(100vh - 120px);
}

.content-area {
    flex: 1;
    min-width: 0; /* flexbox fix for overflow content */
}

/* ── Sidebar Navigation ── */
.side-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(10, 15, 28, 0.72);
    backdrop-filter: blur(24px) saturate(1.6);
    -webkit-backdrop-filter: blur(24px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 14px 12px;
    position: sticky;
    top: 1.25rem;
    align-self: flex-start;
    z-index: 100;
    width: 210px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5),
                0 6px 20px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

/* Brand mark + name at the top of the sidebar */
.side-nav::before {
    content: 'Dentalkart · Amazon';
    display: flex;
    align-items: center;
    padding: 18px 14px 20px 52px;
    margin: 0 -2px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: -0.005em;
    line-height: 1.15;
    background:
      url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='%23fdba74' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9' fill='%23fdba74' fill-opacity='0.18'/><path d='M9 7h4a3 3 0 0 1 3 3v4a3 3 0 0 1-3 3H9z' fill='%23fdba74' fill-opacity='0.35'/></svg>")
      14px center / 26px 26px no-repeat;
}

.nav-btn {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    width: 100%;
    position: relative;
}

.nav-icon {
    font-size: 1.05rem;
    width: 20px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
}
.nav-icon svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.9;
}

.nav-label {
    font-size: 14.5px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.95;
    text-align: left;
}

/* Hide old hover-expand text (keeping for backward compat) */
.nav-text {
    display: none;
}

.nav-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn.active {
    background: linear-gradient(135deg,
      var(--primary-light),
      rgba(249, 115, 22, 0.06));
    color: #fff;
    box-shadow: inset 0 0 0 1px var(--primary-glow),
                0 8px 22px rgba(249, 115, 22, 0.18);
}
.nav-btn.active .nav-icon {
    color: var(--primary);
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

/* Compact mode on mobile — fall back to the icon-only column */
@media (max-width: 900px) {
    .side-nav {
        width: 72px;
        padding: 8px;
        border-radius: 18px;
    }
    .side-nav::before { display: none; }
    .nav-btn {
        flex-direction: column;
        gap: 2px;
        padding: 10px 4px;
        justify-content: center;
    }
    .nav-label {
        font-size: 9.5px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }
}

/* ── Reports tab chrome ─────────────────────────────────────── */
.reports-pdf-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary), #ea580c);
    color: #0a0d14;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 6px 18px var(--primary-glow),
                inset 0 1px 0 rgba(255,255,255,0.3);
    transition: filter 0.15s, box-shadow 0.15s;
}
.reports-pdf-btn:hover { filter: brightness(1.06); }

.reports-frame-wrap {
    position: relative;
    margin-top: 14px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--card-bg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
    min-height: calc(100vh - 240px);
}
#reports-frame {
    width: 100%;
    height: calc(100vh - 240px);
    border: 0;
    display: block;
    background: var(--bg-elevated);
}
.reports-empty {
    position: absolute; inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 40px 32px;
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}
.reports-empty-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--primary);
    background: var(--primary-light);
    border: 1px solid rgba(249, 115, 22, 0.28);
    margin-bottom: 6px;
}
.reports-empty h3 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 600; font-size: 18px;
    color: var(--text);
    margin: 4px 0 0;
}
.reports-empty p {
    font-size: 14px; color: var(--text-muted);
    max-width: 480px; line-height: 1.55;
}
.reports-empty code {
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 12.5px;
    padding: 10px 14px;
    background: rgba(6, 10, 20, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    user-select: all;
}
.reports-empty-foot {
    font-size: 12px !important;
    color: var(--text-muted);
    opacity: 0.8;
    margin-top: 2px;
}

/* ── Sidebar modules (sync status / quick actions / footer) ── */
.side-module {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 10px;
    margin: 10px -2px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.side-module-label {
    display: flex; align-items: center; gap: 7px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}
.pulse-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: side-pulse 1.8s ease-in-out infinite;
}
.pulse-dot.stale { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
@keyframes side-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.side-sync-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.72rem;
    padding: 4px 0;
}
.side-sync-row > span:first-child { color: var(--text-muted); }
.side-sync-row > span:last-child  { color: var(--text); font-variant-numeric: tabular-nums; }

.side-action-btn, .side-foot-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.side-action-btn:hover, .side-foot-btn:hover {
    background: rgba(255,255,255,0.07);
    border-color: var(--border-hover);
    color: var(--text);
}
.side-action-btn svg, .side-foot-btn svg { flex: 0 0 auto; color: var(--text-muted); }
.side-action-btn:hover svg, .side-foot-btn:hover svg { color: var(--primary); }

.side-foot { margin-top: auto; }

/* Compact mode (narrow sidebar / mobile) */
@media (max-width: 900px) {
    .side-module { display: none; }
}

/* ── Top-right user widget (every logged-in user) ───────────── */
.user-widget {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}
.user-widget .uw-icon-btn {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(15, 20, 35, 0.72);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.user-widget .uw-icon-btn:hover {
    color: var(--text);
    background: var(--card-bg-hover);
    border-color: var(--border-hover);
}
.user-widget .uw-icon-btn svg { width: 16px; height: 16px; }
.user-widget .uw-icon-btn--danger { color: #f87171; border-color: rgba(248,113,113,0.3); }
.user-widget .uw-icon-btn--danger:hover {
    color: #fff; background: rgba(248,113,113,0.18);
    border-color: rgba(248,113,113,0.55);
}
.user-widget .uw-user {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 5px 14px 5px 5px;
    background: rgba(15, 20, 35, 0.72);
    border: 1px solid var(--border);
    border-radius: 999px;
    margin-left: 2px;
}
.user-widget .uw-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--primary), #ea580c);
    color: #0a0d14;
    font-family: 'Outfit', sans-serif;
    font-weight: 700; font-size: 15px;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px var(--primary-glow),
                inset 0 1px 0 rgba(255,255,255,0.3);
    flex-shrink: 0;
}
.user-widget .uw-meta { line-height: 1.15; min-width: 0; }
.user-widget .uw-name {
    font-size: 0.78rem; font-weight: 600; color: var(--text);
    white-space: nowrap;
}
.user-widget .uw-role {
    font-size: 0.6rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--primary);
    padding: 1px 6px;
    background: var(--primary-light);
    border-radius: 999px;
    margin-left: 4px;
    vertical-align: middle;
}
.user-widget .uw-email {
    font-size: 0.68rem; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 180px;
}
@media (max-width: 900px) {
    .user-widget .uw-meta { display: none; }
    .user-widget .uw-user { padding: 3px; }
}

/* ════════════════════════════════════════════════════════════ */
/*  ADS DASHBOARD                                              */
/* ════════════════════════════════════════════════════════════ */

/* Section headings */
.ads-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    margin: 1.5rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.ads-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(251,146,60,0.2);
}
.ads-period-badge {
    background: rgba(251,146,60,0.15);
    color: var(--primary);
    border: 1px solid rgba(251,146,60,0.3);
    border-radius: 99px;
    padding: 0.15rem 0.65rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Date range picker (next to LAYER 1 heading) */
.ads-date-picker {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: none;
    letter-spacing: normal;
}
.ads-date-picker label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
}
.ads-date-picker select {
    background: rgba(15, 23, 42, 0.85);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 0.78rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ads-date-picker select:hover { border-color: var(--primary); }
.ads-date-picker select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(251,146,60,0.15);
}
.ads-date-picker select option {
    background: #0f172a;
    color: var(--text);
}
.ads-date-range-info {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-style: italic;
}
.ads-coverage-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 99px;
    letter-spacing: 0.02em;
    cursor: help;
    text-transform: none;
}
.ads-coverage-badge.cov-partial {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.35);
}
.ads-coverage-badge.cov-empty {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.35);
}
.ads-date-picker optgroup {
    color: var(--primary);
    font-style: normal;
    font-weight: 600;
}
.ads-date-picker option {
    color: var(--text);
    font-style: normal;
}

/* ── Layer 1: KPI Grid ── */
.ads-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}
@media (max-width:1400px) { .ads-kpi-grid { grid-template-columns: repeat(4,1fr); } }
@media (max-width:900px)  { .ads-kpi-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width:600px)  { .ads-kpi-grid { grid-template-columns: repeat(2,1fr); } }

.ads-kpi-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    border: 1px solid var(--border);
    border-left: 3px solid rgba(249, 115, 22, 0.4);
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5),
                0 6px 20px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
}
.ads-kpi-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    border-left-color: var(--primary);
    box-shadow: 0 34px 78px rgba(0, 0, 0, 0.55),
                0 8px 24px rgba(0, 0, 0, 0.35),
                0 0 30px rgba(249, 115, 22, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.ads-kpi-icon  { font-size: 1.2rem; margin-bottom: 1px; }
.ads-kpi-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 500; }
.ads-kpi-value { font-size: 1.35rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ads-kpi-suggestion {
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
    border-top: 1px solid var(--border);
    padding-top: 6px;
}

/* ── Layer 2: WoW Grid ── */
.ads-wow-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
@media (max-width:1400px) { .ads-wow-grid { grid-template-columns: repeat(4,1fr); } }
@media (max-width:700px)  { .ads-wow-grid { grid-template-columns: repeat(2,1fr); } }

.ads-wow-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.ads-wow-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.ads-wow-card.wow-card-good {
    border-color: rgba(52, 211, 153, 0.25);
    background: rgba(52, 211, 153, 0.04);
    border-left: 3px solid rgba(52, 211, 153, 0.6);
}
.ads-wow-card.wow-card-bad {
    border-color: rgba(251, 113, 133, 0.25);
    background: rgba(251, 113, 133, 0.04);
    border-left: 3px solid rgba(251, 113, 133, 0.6);
}

.wow-label     { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.wow-this-week { font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wow-vs        { font-size: 0.66rem; color: var(--text-muted); margin-top: 2px; }
.wow-delta     { margin-top: 4px; font-size: 0.78rem; font-weight: 600; }

.wow-up      { color: var(--green); }
.wow-down    { color: var(--red); }
.wow-neutral { color: var(--text-muted); }

/* ── Layer 3: Flags Summary ── */
.flags-summary-grid {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}
@media (max-width:800px) { .flags-summary-grid { grid-template-columns: repeat(2,1fr); } }

.flag-summary-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.flag-summary-card:hover { 
    transform: translateY(-4px); 
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md), 0 0 25px rgba(0, 0, 0, 0.2);
}
.flag-gem    { border-left: 3px solid #22c55e; background: rgba(34, 197, 94, 0.04); }
.flag-bomb   { border-left: 3px solid #ef4444; background: rgba(239, 68, 68, 0.04); }
.flag-zombie { border-left: 3px solid #f59e0b; background: rgba(245, 158, 11, 0.04); }
.flag-best   { border-left: 3px solid var(--primary); background: rgba(249, 115, 22, 0.04); }

.fs-icon  { font-size: 1.5rem; margin-bottom: 4px; filter: drop-shadow(0 0 8px rgba(0,0,0,0.3)); }
.fs-count { font-size: 1.85rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.fs-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 2px; }

/* ── Campaign flags ── */
.campaign-flag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    margin: 2px 4px 2px 0;
    cursor: default;
    white-space: nowrap;
    letter-spacing: 0.02em;
}
.flag-gem-tag  { background: rgba(52, 211, 153, 0.12); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.2); }
.flag-bomb-tag { background: rgba(251, 113, 133, 0.12); color: #fb7185; border: 1px solid rgba(251, 113, 133, 0.2); }

/* ── Ad type badge ── */
.adtype-badge {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.15rem 0.6rem;
    border-radius: 99px;
    font-size: 0.65rem;
    font-weight: 700;
    white-space: nowrap;
}

/* ── Cell colours ── */
.cell-green { color: #4ade80; font-weight: 600; }
.cell-amber { color: #facc15; font-weight: 600; }
.cell-red   { color: #f87171; font-weight: 600; }

/* ── Campaign status ── */
.status-paused { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; }

/* ── Sticky table headers for campaign & adtype tables ── */
#campaigns-table thead th,
#adtype-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-elevated);
    box-shadow: inset 0 -1px 0 var(--border);
}

/* ── Performance-based row coloring ── */
.row-gem td {
    background: rgba(52, 211, 153, 0.04) !important;
}
.row-gem td:first-child { box-shadow: inset 3px 0 0 #34d399; }

.row-bleeding td {
    background: rgba(251, 113, 133, 0.04) !important;
}
.row-bleeding td:first-child { box-shadow: inset 3px 0 0 #fb7185; }

.row-watch td {
    background: rgba(251, 191, 36, 0.03) !important;
}
.row-watch td:first-child { box-shadow: inset 3px 0 0 #fbbf24; }

.row-paused td {
    opacity: 0.5;
}
.row-paused td:first-child { box-shadow: inset 3px 0 0 #64748b; }

/* ── Totals row ── */
.totals-row td { font-weight: 700; background: rgba(251,146,60,0.06) !important; border-top: 1px solid rgba(251,146,60,0.2); }

/* ── Empty state ── */
.ads-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}
.ads-empty h3 { color: var(--text); font-size: 1.25rem; }

/* ── Header actions flex fix ── */
#reviews-header-actions,
#ads-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════ */
/*  #3 — KPI Trend Arrows                                     */
/* ═══════════════════════════════════════════════════════════ */
.ads-kpi-trend {
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.ads-kpi-trend.trend-up   { color: #4ade80; }
.ads-kpi-trend.trend-down { color: #f87171; }
.ads-kpi-trend.trend-flat { color: var(--text-muted); }
/* Inverse metrics (ACOS, CPC) — going up is bad */
.ads-kpi-trend.trend-up-bad   { color: #f87171; }
.ads-kpi-trend.trend-down-good { color: #4ade80; }

/* ═══════════════════════════════════════════════════════════ */
/*  #4 — Styled Tooltips (JS-positioned, see script below)     */
/* ═══════════════════════════════════════════════════════════ */
.dash-tooltip {
    position: fixed;
    z-index: 9999;
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid rgba(251, 146, 60, 0.35);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 450px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    pointer-events: none;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    line-height: 1.4;
    animation: tooltip-in 0.12s ease-out;
}
@keyframes tooltip-in {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}
[data-mode="light"] .dash-tooltip {
    background: #fff;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

/* ═══════════════════════════════════════════════════════════ */
/*  #5 — Quick-Nav Floating Menu                               */
/* ═══════════════════════════════════════════════════════════ */
.quick-nav {
    position: fixed;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: transparent;
    border: none;
    padding: 4px;
    box-shadow: none;
}
.quick-nav-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.4rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    text-align: left;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.quick-nav-btn:hover {
    background: rgba(249, 115, 22, 0.1);
    color: var(--primary);
}
.quick-nav-btn.active {
    background: rgba(249, 115, 22, 0.15);
    color: var(--primary);
    box-shadow: none;
}
@media (max-width: 1100px) { .quick-nav { display: none; } }

/* ═══════════════════════════════════════════════════════════ */
/*  #6 — Collapsible Sections                                  */
/* ═══════════════════════════════════════════════════════════ */
.section-toggle {
    cursor: pointer;
    user-select: none;
}
.section-toggle::before {
    content: '▾';
    display: inline-block;
    width: 1em;
    margin-right: 0.3rem;
    transition: transform 0.2s;
    font-size: 0.8em;
}
.section-toggle.collapsed::before {
    transform: rotate(-90deg);
}
.section-body {
    transition: max-height 0.3s ease, opacity 0.2s ease;
    overflow: hidden;
}
.section-body.collapsed {
    max-height: 0 !important;
    opacity: 0;
    margin-bottom: 0 !important;
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════ */
/*  ADS SUB-TAB BAR                                            */
/* ═══════════════════════════════════════════════════════════ */
.ads-tab-bar {
    display: flex;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin: 0 0 1.5rem;
    padding: 0;
}
.ads-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted, #94a3b8);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.75rem 1.2rem;
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s;
    white-space: nowrap;
    margin-bottom: -1px;   /* sit on the border-bottom line */
}
.ads-tab-btn:hover {
    color: var(--text, #f1f5f9);
}
.ads-tab-btn.active {
    color: var(--primary, #fb923c);
    border-bottom-color: var(--primary, #fb923c);
}
.ads-tab-pane {
    animation: tabFadeIn 0.15s ease;
    min-height: calc(100vh - 260px);
    padding-bottom: 3rem;
}
@keyframes tabFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* Date picker in tab bar — flush right */
.ads-tab-bar .ads-date-picker {
    margin-left: auto;
    padding-right: 0.25rem;
}

/* Section anchors inside Overview — styled like subtle dividers */
.ads-section-anchor {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary, #fb923c);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2rem 0 1rem;
    scroll-margin-top: 80px;
}
.ads-section-anchor::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(251,146,60,0.2);
}

/* ═══════════════════════════════════════════════════════════ */
/*  #7 — CSV Export Button                                     */
/* ═══════════════════════════════════════════════════════════ */
.csv-export-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.csv-export-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════ */
/*  #8 — Number Count-up Animation                            */
/* ═══════════════════════════════════════════════════════════ */
@keyframes kpi-pop-in {
    0%   { opacity: 0; transform: scale(0.92); }
    60%  { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}
.kpi-animated {
    animation: kpi-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ═══════════════════════════════════════════════════════════ */
/*  #9 — Light Theme                                           */
/* ═══════════════════════════════════════════════════════════ */
.theme-toggle {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: all 0.2s;
}
.theme-toggle:hover {
    border-color: var(--primary);
    color: var(--primary);
}

[data-mode="light"] {
    --bg: #f8fafc;
    --bg-elevated: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-bg-hover: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* ── Pagination Buttons ── */
.page-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.25);
}
.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

[data-mode="light"] body {
    background: var(--bg);
    background-image:
        radial-gradient(at 0% 0%, rgba(251, 146, 60, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.08) 0px, transparent 50%);
}
[data-mode="light"] body::before {
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}
[data-mode="light"] body::after {
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(249, 115, 22, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 60% at 80% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 50%);
}
[data-mode="light"] .bg-orb {
    opacity: 0.06;
}
[data-mode="light"] h1 {
    background: linear-gradient(to right, #0f172a, #475569);
    -webkit-background-clip: text;
}
[data-mode="light"] th,
[data-mode="light"] #campaigns-table thead th,
[data-mode="light"] #adtype-table thead th {
    background: #e2e8f0;
    color: #334155;
}
[data-mode="light"] .tab-btn.active {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.2), rgba(59, 130, 246, 0.15));
    color: #0f172a;
    border: 1px solid rgba(251, 146, 60, 0.35);
}
[data-mode="light"] .quick-nav {
    background: rgba(255, 255, 255, 0.92);
}
[data-mode="light"] [data-tooltip]::after {
    background: #fff;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
[data-mode="light"] .search-box {
    background: rgba(0, 0, 0, 0.04);
    color: #0f172a;
}
[data-mode="light"] select.search-box {
    background: rgba(255, 255, 255, 0.9);
}

/* ═══════════════════════════════════════════════════════════ */
/*  #10 — Prominent Last-Updated Badge                         */
/* ═══════════════════════════════════════════════════════════ */
.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 99px;
    white-space: nowrap;
}
.sync-badge-fresh {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}
.sync-badge-stale {
    background: rgba(250, 204, 21, 0.12);
    color: #facc15;
    border: 1px solid rgba(250, 204, 21, 0.3);
}
.sync-badge-old {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

/* ── Responsive Sidebar ── */
@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
    }
    .side-nav {
        width: 100% !important;
        flex-direction: row;
        position: static;
        margin-bottom: 1.5rem;
        padding: 6px;
    }
    .nav-btn {
        flex-direction: row;
        justify-content: center;
        padding: 0.5rem 0.8rem;
        gap: 6px;
    }
    .nav-label {
        font-size: 0.7rem;
    }
}

/* ── Status Indicators ── */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.status-good { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.4); }
.status-warn { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
.status-crit { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
.status-neut { background: #94a3b8; }

/* ─── ASIN Review Analyzer (Reviews sub-tab) ─────────────────────── */
.rev-step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    margin-right: 10px;
    border: 1px solid var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}
.rev-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.rev-input, .rev-select, .rev-textarea {
    width: 100%;
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 13px;
    font-family: 'Outfit', 'Inter', sans-serif;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.rev-input:focus, .rev-select:focus, .rev-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.rev-textarea {
    min-height: 110px;
    font-family: 'SF Mono', 'Menlo', monospace;
    resize: vertical;
}
.rev-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.rev-col {
    flex: 1;
    min-width: 160px;
}
.rev-note {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    margin: 12px 0;
}
.rev-note b { color: var(--primary); }
.rev-note code {
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--primary);
}
.rev-count-pill {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-top: 14px;
}
.rev-count-pill.empty {
    background: rgba(139, 149, 168, 0.08);
    color: var(--text-muted);
    border-color: var(--border);
}
.rev-btn {
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    font-family: 'Outfit', 'Inter', sans-serif;
}
.rev-btn:hover {
    background: #fb923c;
    box-shadow: 0 0 16px var(--primary-glow);
}
.rev-btn.ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.rev-btn.ghost:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: none;
}
.rev-preset {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    margin: 2px;
    transition: all 0.15s;
    font-family: 'Outfit', 'Inter', sans-serif;
}
.rev-preset:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}
.rev-preset.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.rev-snippet {
    background: #0a0f1a;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
    overflow-x: auto;
    font-size: 11px;
    max-height: 280px;
    margin-top: 12px;
    color: #d1d9e6;
    font-family: 'SF Mono', 'Menlo', monospace;
    line-height: 1.5;
}
.rev-drop {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px 20px;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.15s;
    background: rgba(255, 255, 255, 0.02);
}
.rev-drop:hover, .rev-drop.hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}
.rev-drop .rev-drop-icon {
    font-size: 36px;
    margin-bottom: 8px;
    opacity: 0.7;
}
.rev-status {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-top: 10px;
}
.rev-status.info { background: rgba(129, 140, 248, 0.08); border-left: 3px solid var(--blue); color: var(--blue); }
.rev-status.ok   { background: rgba(52, 211, 153, 0.08); border-left: 3px solid var(--green); color: var(--green); }
.rev-status.warn { background: var(--primary-light); border-left: 3px solid var(--primary); color: var(--primary); }
.rev-status.err  { background: rgba(251, 113, 133, 0.08); border-left: 3px solid var(--red); color: var(--red); }
