/* ═══════════════════════════════════════════════════════════════════
   global.css — AdTool by myWebhero
   ═══════════════════════════════════════════════════════════════════ */

/* ── Design tokens ───────────────────────────────────────────────── */
:root {
    /* App (dark) palette */
    --bg:               #f7f8fa;
    --bg-2:             #ffffff;
    --bg-3:             #f0f2f5;
    --bg-4:             #e8ebf0;
    --bg-5:             #dde1e8;
    --border:           #e3e6ed;
    --border-mid:       #c8cdd8;
    --border-hi:        #adb4c2;
    --text:             #1a2744;
    --text-mid:         #4a5568;
    --text-dim:         #9ca3af;

    /* Public (light) palette */
    --pub-bg:           #f7f8fa;
    --pub-bg-alt:       #ffffff;
    --pub-border:       #e3e6ed;
    --pub-border-mid:   #c8cdd8;
    --pub-text:         #1a2744;
    --pub-text-mid:     #4a5568;
    --pub-text-dim:     #9ca3af;

    /* Shared accent / semantic colours */
    --accent:           #e8821a;
    --accent-hover:     #f0941f;
    --accent-2:         #10b981;
    --accent-glow:      rgba(232,130,26,0.10);
    --accent-glow-mid:  rgba(232,130,26,0.18);
    --warning:          #f59e0b;
    --warning-bg:       rgba(245,158,11,0.08);
    --warning-border:   rgba(245,158,11,0.18);
    --success:          #10b981;
    --success-bg:       rgba(16,185,129,0.08);
    --success-border:   rgba(16,185,129,0.18);
    --danger:           #ef4444;
    --danger-bg:        rgba(239,68,68,0.08);
    --danger-border:    rgba(239,68,68,0.18);

    /* Layout */
    --sidebar-w:        256px;
    --topbar-h:         56px;
    --radius:           10px;
    --radius-lg:        16px;
    --radius-sm:        6px;
    --shadow:           0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg:        0 4px 24px rgba(0,0,0,0.10);

    /* Public shadows */
    --pub-shadow-sm:    0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
    --pub-shadow:       0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.04);
}

/* ── Reset ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ── Typography ──────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.page-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.375rem;
    letter-spacing: -0.02em;
    margin-bottom: 3px;
}

.page-subtitle {
    font-size: 0.8125rem;
    color: var(--text-mid);
    font-weight: 400;
}

.page-header {
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-header-left { flex: 1; min-width: 0; }

.section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

/* ════════════════════════════════════════════════════════════════════
   APP LAYOUT (dark, authenticated pages)
   ════════════════════════════════════════════════════════════════════ */

.app-layout {
    display: flex;
    min-height: 100vh;
}

.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.page-content {
    padding: 28px 32px;
    flex: 1;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-logo img {
    height: 28px;
    width: auto;
    object-fit: contain;
}

/* Account selector */
.account-selector {
    margin: 12px 10px;
    padding: 9px 11px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: block;
}
.account-selector:hover {
    border-color: var(--border-mid);
    background: var(--bg-4);
}

.account-selector-label {
    font-size: 0.625rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 3px;
    font-weight: 600;
}

.account-selector-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.account-selector-name span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-mid);
    font-weight: 400;
}

.account-selector-name span.connected { color: var(--text); }

.account-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.account-dot.connected    { background: var(--success); box-shadow: 0 0 6px var(--success); }
.account-dot.disconnected { background: var(--text-dim); }

/* Sidebar nav */
.sidebar-nav { flex: 1; padding: 8px 10px 16px; }
.nav-section { margin-bottom: 2px; }

.nav-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-mid);
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    gap: 8px;
}
.nav-section-header:hover { background: var(--bg-3); color: var(--text); }
.nav-section-header.active { color: var(--text); }

.nav-section-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-section-label-text { flex: 1; }

.nav-chevron {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    opacity: 0.4;
}
.nav-section.open .nav-chevron { transform: rotate(90deg); }

.nav-children {
    display: none;
    padding: 2px 0 4px 28px;
}
.nav-section.open .nav-children { display: block; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--text-mid);
    transition: all 0.15s;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--accent-glow); color: var(--accent); font-weight: 500; }

.nav-single {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-mid);
    transition: all 0.15s;
    margin-bottom: 1px;
}
.nav-single:hover { background: var(--bg-3); color: var(--text); }
.nav-single.active { background: var(--accent-glow); color: var(--accent); }

.nav-divider { height: 1px; background: var(--border); margin: 8px 4px; }

.nav-sub-label {
    font-size: 0.625rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 10px 3px;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius);
    transition: background 0.15s;
}
.user-pill:hover { background: var(--bg-3); }

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--border-mid);
}

.user-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #fff;
    font-family: 'Raleway', sans-serif;
    flex-shrink: 0;
}

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

.user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: capitalize;
}

.sign-out-btn {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}
.sign-out-btn:hover { background: var(--bg-5); color: var(--text-mid); }

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 199;
    backdrop-filter: blur(2px);
}

/* ── Topbar ──────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: var(--bg-2);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
    gap: 12px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.hamburger {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-mid);
    transition: all 0.15s;
    flex-shrink: 0;
}
.hamburger:hover { background: var(--bg-3); color: var(--text); }

/* ════════════════════════════════════════════════════════════════════
   PUBLIC LAYOUT (light, unauthenticated pages)
   ════════════════════════════════════════════════════════════════════ */

.pub-page {
    background: var(--pub-bg);
    color: var(--pub-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Nav */
.pub-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(247,248,250,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pub-border);
}

.pub-nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.pub-nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.pub-nav-logo img { height: 26px; width: auto; }

.pub-nav-logo-text {
    font-family: 'Raleway', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--pub-text);
    letter-spacing: -0.02em;
}

.pub-nav-logo-text span { font-weight: 500; color: var(--pub-text-mid); }

.pub-nav-links {
    display: flex;
    gap: 24px;
    flex: 1;
}

.pub-nav-links a {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pub-text-mid);
    text-decoration: none;
    transition: color 0.15s;
}
.pub-nav-links a:hover { color: var(--pub-text); }

.pub-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Public buttons */
.pub-btn-login {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pub-text-mid);
    text-decoration: none;
    padding: 7px 14px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}
.pub-btn-login:hover { color: var(--pub-text); background: var(--pub-border); }

.pub-btn-cta {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    text-decoration: none;
    padding: 7px 16px;
    border-radius: 8px;
    transition: opacity 0.15s;
}
.pub-btn-cta:hover { opacity: 0.88; }

/* Public section wrapper */
.pub-section-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero */
.pub-hero {
    padding: 88px 0 72px;
    background: var(--pub-bg-alt);
    border-bottom: 1px solid var(--pub-border);
}

.pub-hero-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.pub-hero-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(232,130,26,0.07);
    border: 1px solid rgba(232,130,26,0.18);
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 28px;
}

.pub-hero-headline {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(2rem, 5vw, 2.875rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    color: var(--pub-text);
    line-height: 1.1;
    margin-bottom: 20px;
}

.pub-hero-sub {
    font-size: 1.0625rem;
    color: var(--pub-text-mid);
    max-width: 540px;
    margin: 0 auto 36px;
    line-height: 1.65;
}

.pub-hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.pub-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    text-decoration: none;
    padding: 11px 24px;
    border-radius: 9px;
    transition: opacity 0.15s, transform 0.15s;
    box-shadow: 0 2px 12px rgba(232,130,26,0.25);
}
.pub-btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.pub-btn-ghost {
    display: inline-flex;
    align-items: center;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--pub-text-mid);
    text-decoration: none;
    padding: 11px 24px;
    border-radius: 9px;
    border: 1px solid var(--pub-border);
    background: transparent;
    transition: border-color 0.15s, color 0.15s;
}
.pub-btn-ghost:hover { border-color: var(--pub-border-mid); color: var(--pub-text); }

/* Features section */
.pub-features {
    padding: 80px 0;
    background: var(--pub-bg);
}

.pub-section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 10px;
}

.pub-section-title {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--pub-text);
    margin-bottom: 10px;
}

.pub-section-sub {
    font-size: 0.9375rem;
    color: var(--pub-text-mid);
    margin-bottom: 48px;
}

.pub-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.pub-feature-card {
    background: var(--pub-bg-alt);
    border: 1px solid var(--pub-border);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--pub-shadow-sm);
    transition: box-shadow 0.2s, transform 0.2s;
}
.pub-feature-card:hover {
    box-shadow: var(--pub-shadow);
    transform: translateY(-2px);
}

.pub-feature-icon {
    width: 40px;
    height: 40px;
    background: rgba(232,130,26,0.07);
    color: var(--accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.pub-feature-card h3 {
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--pub-text);
    margin-bottom: 8px;
}

.pub-feature-card p {
    font-size: 0.875rem;
    color: var(--pub-text-mid);
    line-height: 1.6;
}

/* How it works */
.pub-how {
    padding: 80px 0;
    background: var(--pub-bg-alt);
    border-top: 1px solid var(--pub-border);
    border-bottom: 1px solid var(--pub-border);
}

.pub-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 48px;
    position: relative;
}

.pub-steps::before {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    bottom: 20px;
    width: 2px;
    background: var(--pub-border);
}

.pub-step { display: flex; gap: 20px; padding-bottom: 36px; position: relative; }
.pub-step:last-child { padding-bottom: 0; }

.pub-step-num {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 1;
    position: relative;
}

.pub-step-content { padding-top: 8px; }

.pub-step-content h4 {
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--pub-text);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.pub-step-content p {
    font-size: 0.875rem;
    color: var(--pub-text-mid);
    line-height: 1.65;
    max-width: 520px;
}

/* CTA section */
.pub-cta {
    padding: 80px 0;
    background: var(--pub-bg);
    text-align: center;
}

.pub-cta h2 {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--pub-text);
    margin-bottom: 12px;
}

.pub-cta p {
    font-size: 1rem;
    color: var(--pub-text-mid);
    margin-bottom: 32px;
}

/* Footer (app + public shared) */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-2);
    padding: 40px 0 24px;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 32px;
}

.site-footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.site-footer-logo {
    height: 24px;
    width: auto;
    margin-bottom: 14px;
    opacity: 0.8;
    transition: opacity 0.15s;
}
.site-footer-logo:hover { opacity: 1; }

.site-footer-text {
    font-size: 0.8125rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 10px;
}

.site-footer-link {
    color: var(--text-dim);
    transition: color 0.15s;
}
.site-footer-link:hover { color: var(--text-mid); }

.site-footer-heading {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-mid);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.site-footer-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.site-footer-social {
    display: flex;
    gap: 14px;
    margin-top: 12px;
}

.site-footer-badge { text-align: center; }

.site-footer-partner-img {
    max-width: 140px;
    height: auto;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.site-footer-partner-img:hover { opacity: 1; }

.site-footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Help panel */
.help-panel {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    height: 100vh;
    background: var(--bg-2);
    border-left: 1px solid var(--border-mid);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
}

.help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.help-panel-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text);
}

.help-panel-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}
.help-panel-close:hover { color: var(--text-mid); }

.help-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 0.875rem;
    color: var(--text-mid);
    line-height: 1.6;
}

.help-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    backdrop-filter: blur(2px);
}

/* ════════════════════════════════════════════════════════════════════
   SHARED COMPONENTS (used in both app and public pages)
   ════════════════════════════════════════════════════════════════════ */

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-trial   { background: var(--warning-bg);  border: 1px solid var(--warning-border);  color: var(--warning); }
.badge-admin   { background: var(--accent-glow);  border: 1px solid var(--accent-glow-mid); color: var(--accent); }
.badge-success { background: var(--success-bg);   border: 1px solid var(--success-border);  color: var(--success); }
.badge-danger  { background: var(--danger-bg);    border: 1px solid var(--danger-border);   color: var(--danger); }
.badge-warning { background: var(--warning-bg);   border: 1px solid var(--warning-border);  color: var(--warning); }
.badge-mcc       { background: rgba(245,158,11,.1);  color: var(--warning);  border: 1px solid rgba(245,158,11,.2); }
.badge-working   { background: var(--accent-glow);   color: var(--accent);   border: 1px solid rgba(232,130,26,.25); }
.badge-connected { background: rgba(16,185,129,.1);  color: var(--accent-2); border: 1px solid rgba(16,185,129,.2); }
.badge-client   { background: rgba(232,130,26,0.1);  color: #60a5fa; border: 1px solid rgba(232,130,26,0.15); }
.badge-internal { background: rgba(148,163,184,0.08); color: #94a3b8; border: 1px solid rgba(148,163,184,0.12); }

/* ── Buttons (app) ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: var(--radius);
    font-family: 'Open Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 16px rgba(232,130,26,0.2);
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 24px rgba(232,130,26,0.35);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-mid);
    border: 1px solid var(--border-mid);
}
.btn-ghost:hover { background: var(--bg-3); color: var(--text); border-color: var(--border-hi); }

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid var(--danger-border);
}
.btn-danger:hover { background: rgba(239,68,68,0.14); transform: translateY(-1px); }

.btn-google {
    background: var(--bg-3);
    color: var(--text);
    border: 1px solid var(--border-mid);
}
.btn-google:hover {
    background: var(--bg-4);
    border-color: var(--border-hi);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-sm   { padding: 6px 14px; font-size: 0.8125rem; border-radius: var(--radius-sm); }
.btn-lg   { padding: 13px 30px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

.btn-sm-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-mid);
    border: 1px solid var(--border-mid);
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-sm-ghost:hover { background: var(--bg-4); color: var(--text); border-color: var(--border-hi); }

.btn-sm-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.btn-sm-primary:hover { background: var(--accent-hover); }

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.card-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.card-body   { padding: 20px; }
.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Stat cards ──────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color 0.15s;
}
.stat-card:hover { border-color: var(--border-mid); }

.stat-card-label {
    font-size: 0.6875rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: 8px;
}

.stat-card-val {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1;
}

.stat-card-val.muted {
    color: var(--text-dim);
    font-size: 0.9375rem;
    font-weight: 400;
    font-family: 'Open Sans', sans-serif;
}

.stat-card-delta { font-size: 0.75rem; margin-top: 5px; color: var(--text-dim); }
.stat-card-delta.up   { color: var(--success); }
.stat-card-delta.down { color: var(--danger); }

/* ── Banners ─────────────────────────────────────────────────────── */
.banner {
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease both;
}

.banner-welcome { background: var(--success-bg); border: 1px solid var(--success-border); }

/* Welcome action cards (dashboard ?welcome=1) */
.welcome-action-card {
    display: flex; flex-direction: column; gap: 6px;
    padding: 16px 18px; text-decoration: none;
    transition: background 0.15s;
}
.welcome-action-card:hover { background: rgba(232,130,26,0.04); }
.banner-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); }
.banner-info    { background: var(--accent-glow); border: 1px solid var(--accent-glow-mid); }
.banner-danger  { background: var(--danger-bg);  border: 1px solid var(--danger-border); }

.banner-icon  { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.banner-body  { flex: 1; min-width: 0; }

.banner-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 2px;
    color: var(--text);
}

.banner-text {
    font-size: 0.8125rem;
    color: var(--text-mid);
    line-height: 1.5;
}

.banner-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    background: var(--accent);
    color: #fff;
    transition: all 0.15s;
}
.banner-action:hover { background: var(--accent-hover); transform: translateY(-1px); }

.banner-dismiss {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.banner-dismiss:hover { color: var(--text-mid); }

/* ── Empty states ────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; }
.empty-icon  { font-size: 2rem; margin-bottom: 10px; opacity: 0.3; }

.empty-title {
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: var(--text-mid);
}

.empty-text {
    font-size: 0.8125rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 18px;
    max-width: 260px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Tables ──────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

thead th {
    padding: 9px 14px;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    background: var(--bg-3);
}

tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-mid);
    vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg-3); color: var(--text); }

/* ── Account tree (connected-accounts) ───────────────────────────── */
.account-tree { display: flex; flex-direction: column; gap: 4px; }

.account-node {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-3);
    font-size: 0.875rem;
    transition: border-color 0.15s;
}
.account-node:hover { border-color: var(--border-mid); }
.account-node.is-connected { border-color: rgba(16,185,129,.2); background: rgba(16,185,129,.03); }
.account-node.is-working   { border-color: var(--accent); background: var(--accent-glow); }

.account-node-children {
    margin-left: 24px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.account-name { flex: 1; font-weight: 500; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-id   { font-size: 0.725rem; color: var(--text-dim); font-family: monospace; flex-shrink: 0; }
.account-meta { font-size: 0.725rem; color: var(--text-dim); flex-shrink: 0; }

.account-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.account-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: auto; }

.limit-bar-wrap  { margin-bottom: 18px; }
.limit-bar-label { font-size: 0.775rem; color: var(--text-mid); margin-bottom: 5px; display: flex; justify-content: space-between; }
.limit-bar-bg    { height: 4px; background: var(--bg-5); border-radius: 2px; overflow: hidden; }
.limit-bar-fill  { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.4s; }
.limit-bar-fill.near { background: var(--warning); }
.limit-bar-fill.full { background: var(--danger); }

.info-banner {
    background: var(--bg-4);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.8rem;
    color: var(--text-mid);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.5;
}

/* ── Forms ───────────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-mid);
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
    width: 100%;
    padding: 9px 13px;
    background: var(--bg-3);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(232,130,26,0.1);
}

input::placeholder, textarea::placeholder { color: var(--text-dim); }
select option { background: var(--bg-3); color: var(--text); }
textarea { resize: vertical; min-height: 100px; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.alert-error   { background: var(--danger-bg);  border: 1px solid var(--danger-border);  color: #f87171; }
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success); }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning); }

/* ── Animations ──────────────────────────────────────────────────── */
@keyframes fadeUp    { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
@keyframes pulse     { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.5; transform:scale(.8); } }
@keyframes spin      { to { transform: rotate(360deg); } }

/* ── Utilities ───────────────────────────────────────────────────── */
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.text-mid     { color: var(--text-mid); }
.text-dim     { color: var(--text-dim); }
.text-right   { text-align: right; }
.text-center  { text-align: center; }
.text-sm      { font-size: 0.8125rem; }
.text-xs      { font-size: 0.75rem; }
.font-mono    { font-family: 'SF Mono', 'Fira Code', monospace; }

.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.gap-4        { gap: 4px; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full   { width: 100%; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

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

/* ── Content grid (2-col) ────────────────────────────────────────── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .stats-grid        { grid-template-columns: repeat(2, 1fr); }
    .site-footer-grid  { grid-template-columns: 1fr 1fr; }
    .pub-features-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid      { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Sidebar drawer */
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .main-wrap { margin-left: 0; }

    /* Topbar */
    .topbar { padding: 0 16px; }
    .hamburger { display: flex; }

    /* Content */
    .page-content { padding: 16px; min-width: 0; max-width: 100%; }

    /* Tab rows: scroll horizontally instead of overflowing the viewport and
       getting clipped by the layout's overflow-x:hidden. Covers connected
       accounts, search terms, and any similar tab bar. */
    .conn-tabs, .kw-tabs {
        width: auto;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    .conn-tabs::-webkit-scrollbar, .kw-tabs::-webkit-scrollbar { display: none; }
    .conn-tab, .kw-tab { white-space: nowrap; flex-shrink: 0; }

    /* Stats */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

    /* Welcome action cards */
    .welcome-actions-grid { grid-template-columns: 1fr 1fr !important; }
    .welcome-action-card { border-right: none !important; border-bottom: 1px solid rgba(0,0,0,0.06); }

    /* Cards */
    .card-body   { padding: 16px; }
    .card-header { padding: 14px 16px; }

    /* Public nav */
    .pub-nav-links { display: none; }

    /* Public sections */
    .pub-hero, .pub-features, .pub-how, .pub-cta { padding: 60px 0; }

    /* Footer */
    .site-footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .site-footer-badge { text-align: left; }
    .site-footer-inner { padding: 0 20px; }
}

@media (max-width: 480px) {
    .stats-grid        { grid-template-columns: 1fr; }
    .pub-features-grid { grid-template-columns: 1fr; }
    .topbar-title      { font-size: 0.875rem; }
    .pub-steps::before { display: none; }

    /* Welcome action cards */
    .welcome-actions-grid { grid-template-columns: 1fr !important; }
}

/* ════════════════════════════════════════════════════════════════════
   SHARED REPORT VIEW (reports/view.php — public, light theme)
   ════════════════════════════════════════════════════════════════════ */

/* ── Report page layout ──────────────────────────────────────────── */
.report-page {
    background: var(--pub-bg);
    color: var(--pub-text);
    min-height: 100vh;
    font-family: 'Open Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

.report-topbar {
    border-bottom: 1px solid var(--pub-border);
    background: var(--pub-bg-alt);
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.report-topbar-inner {
    max-width: 960px;
    margin: 0 auto;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.report-topbar-logo img {
    height: 24px;
    width: auto;
    opacity: 0.9;
}

.report-topbar-meta {
    font-size: 0.775rem;
    color: var(--pub-text-dim);
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-topbar-badge {
    background: rgba(232,130,26,0.08);
    color: var(--accent);
    border: 1px solid rgba(232,130,26,0.2);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 0.675rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.report-page-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ── Report header ───────────────────────────────────────────────── */
.report-header {
    padding: 40px 0 32px;
    border-bottom: 1px solid var(--pub-border);
    margin-bottom: 32px;
}

.report-header-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    margin-bottom: 10px;
}

.report-header-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--pub-text);
    line-height: 1.2;
    margin-bottom: 6px;
}

.report-header-period {
    font-size: 1rem;
    color: var(--pub-text-mid);
    font-weight: 400;
}

.report-header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.meta-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.775rem;
    color: var(--pub-text-dim);
}

.meta-chip i { font-size: 0.7rem; }

/* ── Report section titles ───────────────────────────────────────── */
.report-section-title {
    font-family: 'Raleway', sans-serif;
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 16px;
    margin-top: 36px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.report-section-title:first-of-type { margin-top: 0; }

.report-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--pub-border);
}

/* ── Scorecard ───────────────────────────────────────────────────── */
.scorecard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--pub-border);
    border: 1px solid var(--pub-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 28px;
    box-shadow: var(--pub-shadow-sm);
}

.score-cell {
    background: var(--pub-bg-alt);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.score-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pub-text-dim);
}

.score-value {
    font-family: 'Raleway', sans-serif;
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--pub-text);
    line-height: 1.1;
}

.score-delta {
    font-size: 0.675rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}

.score-delta.up   { color: var(--success); }
.score-delta.down { color: var(--danger); }
.score-delta.flat { color: var(--pub-text-dim); }

/* ── Charts ──────────────────────────────────────────────────────── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-card {
    background: var(--pub-bg-alt);
    border: 1px solid var(--pub-border);
    border-radius: var(--radius);
    padding: 18px 20px 14px;
    box-shadow: var(--pub-shadow-sm);
}

.chart-card-title {
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--pub-text-dim);
    margin-bottom: 14px;
}

.chart-wrap { position: relative; height: 190px; }

/* ── Campaign types ──────────────────────────────────────────────── */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 32px;
}

.type-card {
    background: var(--pub-bg-alt);
    border: 1px solid var(--pub-border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--pub-shadow-sm);
}

.type-card-spend {
    font-family: 'Raleway', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--pub-text);
    margin-bottom: 4px;
}

.type-card-meta { font-size: 0.775rem; color: var(--pub-text-mid); }

.type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.type-badge.SEARCH          { background: rgba(59,130,246,0.10);  color: #2563eb; }
.type-badge.SHOPPING        { background: rgba(16,185,129,0.10);  color: #059669; }
.type-badge.PERFORMANCE_MAX { background: rgba(168,85,247,0.10);  color: #7c3aed; }
.type-badge.DISPLAY         { background: rgba(245,158,11,0.10);  color: #d97706; }
.type-badge.VIDEO           { background: rgba(239,68,68,0.10);   color: #dc2626; }
.type-badge.DEMAND_GEN      { background: rgba(20,184,166,0.10);  color: #0d9488; }
.type-badge.OTHER           { background: rgba(100,116,139,0.10); color: #475569; }

/* ── Campaign table ──────────────────────────────────────────────── */
.camp-table-wrap {
    border: 1px solid var(--pub-border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 32px;
    overflow-x: auto;
    box-shadow: var(--pub-shadow-sm);
}

.camp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    min-width: 600px;
}

.camp-table th {
    background: var(--pub-bg);
    padding: 10px 14px;
    text-align: left;
    font-size: 0.675rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--pub-text-dim);
    border-bottom: 1px solid var(--pub-border);
    white-space: nowrap;
}

.camp-table th.num { text-align: right; }

.camp-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--pub-border);
    color: var(--pub-text-mid);
    vertical-align: middle;
    background: var(--pub-bg-alt);
}

.camp-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.camp-table tr:last-child td { border-bottom: none; }
.camp-table tbody tr:hover td { background: var(--pub-bg); }

.camp-name {
    color: var(--pub-text);
    font-weight: 500;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.spend-bar-wrap { display: flex; align-items: center; gap: 8px; }
.spend-bar-bg   { flex: 1; height: 4px; background: var(--pub-border); border-radius: 2px; min-width: 50px; }
.spend-bar-fill { height: 100%; border-radius: 2px; background: var(--accent); }

/* ── Commentary ──────────────────────────────────────────────────── */
.commentary {
    background: var(--pub-bg-alt);
    border: 1px solid var(--pub-border);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 16px;
    box-shadow: var(--pub-shadow-sm);
}

.commentary h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--pub-text);
    margin: 24px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pub-border);
}

.commentary h2:first-child { margin-top: 0; }

.commentary h3 {
    font-family: 'Raleway', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--pub-text);
    margin: 18px 0 7px;
}

.commentary p  { font-size: 0.875rem; color: var(--pub-text-mid); line-height: 1.75; margin-bottom: 12px; }
.commentary ul { margin: 8px 0 14px 20px; list-style: disc; }
.commentary li { font-size: 0.875rem; color: var(--pub-text-mid); line-height: 1.65; margin-bottom: 6px; }
.commentary strong { color: var(--pub-text); font-weight: 600; }
.commentary em { color: var(--pub-text-mid); }

/* ── Next steps ──────────────────────────────────────────────────── */
.next-steps {
    background: rgba(232,130,26,0.04);
    border: 1px solid rgba(232,130,26,0.18);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 32px;
}

.next-steps h2 {
    font-family: 'Raleway', sans-serif;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--pub-text);
    margin: 0 0 14px;
}

.next-steps ul { margin: 0 0 0 20px; list-style: disc; }
.next-steps li { font-size: 0.875rem; color: var(--pub-text-mid); line-height: 1.65; margin-bottom: 9px; }
.next-steps strong { color: var(--accent); font-weight: 600; }

/* ── Report footer ───────────────────────────────────────────────── */
.report-footer {
    border-top: 1px solid var(--pub-border);
    padding: 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.report-footer-brand { display: flex; align-items: center; gap: 10px; }
.report-footer-brand img { height: 20px; opacity: 0.7; }
.report-footer-text { font-size: 0.75rem; color: var(--pub-text-dim); }

/* ── Error page ──────────────────────────────────────────────────── */
.error-page {
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    padding: 40px;
}

.error-icon  { font-size: 3rem; opacity: 0.2; }

.error-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--pub-text-mid);
}

.error-text {
    font-size: 0.875rem;
    color: var(--pub-text-dim);
    max-width: 300px;
    line-height: 1.6;
}

/* ── Report responsive ───────────────────────────────────────────── */
@media (max-width: 700px) {
    .scorecard     { grid-template-columns: repeat(2, 1fr); }
    .charts-row    { grid-template-columns: 1fr; }
    .type-grid     { grid-template-columns: repeat(2, 1fr); }
    .report-topbar-meta span:last-child { display: none; }
}

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

/* ════════════════════════════════════════════════════════════════════
   AI HUB PAGES (campaigns/, products/)
   ════════════════════════════════════════════════════════════════════ */

.hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.hub-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color .15s, box-shadow .15s, transform .15s;
    color: inherit;
}
.hub-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
    transform: translateY(-1px);
}

.hub-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-glow);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.hub-card-title {
    font-family: 'Raleway', sans-serif;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.hub-card-desc {
    font-size: 0.8125rem;
    color: var(--text-mid);
    line-height: 1.55;
}

.hub-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-glow);
    border: 1px solid var(--accent-glow-mid);
    padding: 2px 8px;
    border-radius: 100px;
    width: fit-content;
}

.hub-section-intro {
    font-size: 0.9375rem;
    color: var(--text-mid);
    line-height: 1.65;
    max-width: 600px;
    margin-bottom: 28px;
}

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



/* Connected accounts */
.conn-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
    width: fit-content;
}
.conn-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-mid);
    text-decoration: none;
    transition: all .15s;
    white-space: nowrap;
}
.conn-tab:hover  { background: var(--bg-2); color: var(--text); }
.conn-tab.active { background: var(--bg-2); color: var(--text); box-shadow: var(--shadow); }
.conn-tab-badge {
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid var(--accent-glow-mid);
    border-radius: 100px;
    font-size: .65rem;
    font-weight: 700;
    padding: 1px 6px;
    line-height: 1.4;
}
.conn-tab-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.conn-empty-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 56px 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.conn-empty-card .empty-icon  { font-size: 2.25rem; opacity: .25; }
.conn-empty-card .empty-title { font-family: 'Raleway',sans-serif; font-weight: 700; font-size: 1rem; color: var(--text-mid); }
.conn-empty-card .empty-text  { font-size: .8125rem; color: var(--text-dim); max-width: 320px; line-height: 1.6; }



/* ── Account switcher dropdown ─────────────────────────── */
.account-selector-dropdown { position: relative; }
.account-switcher-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--bg-2);
    border: 1px solid var(--border-hi);
    border-radius: var(--radius-sm);
    overflow: hidden;
    z-index: 300;
    box-shadow: var(--shadow-lg);
}
.account-switcher-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    font-size: .8125rem;
    color: var(--text-mid);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: background .12s, color .12s;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}
.account-switcher-item:hover { background: var(--bg-3); color: var(--text); }
.account-switcher-item.active { color: var(--text); font-weight: 600; background: var(--accent-glow); }
.account-switcher-divider { height: 1px; background: var(--border); margin: 2px 0; }
.account-switcher-manage {
    display: block;
    padding: 8px 12px;
    font-size: .75rem;
    color: var(--accent);
    text-decoration: none;
    transition: background .12s;
}
.account-switcher-manage:hover { background: var(--bg-3); }

/* ── Account-gated section label ───────────────────────── */
.nav-account-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 12px 10px 4px;
}

/* ── No-account nudge ──────────────────────────────────── */
.nav-no-account {
    margin: 8px 10px;
    padding: 10px 12px;
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.775rem;
    color: var(--text-dim);
    line-height: 1.5;
}
.nav-no-account a {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}
.nav-no-account a:hover { text-decoration: underline; }