/* =============================================================================
   ACADYEM — Styles (Sistema de usuarios + Multi-perfil + Reportes)
   ============================================================================= */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:           #0a0a0f;
    --bg-card:      #111118;
    --bg-card-hover:#16161f;
    --bg-elevated:  #1a1a25;
    --border:       #222233;
    --border-light: #2a2a3d;
    --text:         #e8e8f0;
    --text-dim:     #8888a0;
    --text-muted:   #555570;
    --blue:         #1877f2;
    --blue-glow:    rgba(24, 119, 242, 0.15);
    --blue-soft:    rgba(24, 119, 242, 0.1);
    --green:        #22c55e;
    --green-dim:    rgba(34, 197, 94, 0.15);
    --red:          #ef4444;
    --red-dim:      rgba(239, 68, 68, 0.12);
    --amber:        #f59e0b;
    --amber-dim:    rgba(245, 158, 11, 0.12);
    --purple:       #8b5cf6;
    --purple-dim:   rgba(139, 92, 246, 0.12);
    --font-body:    'DM Sans', system-ui, sans-serif;
    --font-mono:    'Space Mono', 'Fira Code', monospace;
    --radius:       10px;
    --radius-lg:    14px;
}

html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }

.bg-grid {
    position: fixed; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 60px 60px; pointer-events: none; z-index: 0;
}

/* =============================================================================
   NAV
   ============================================================================= */
.nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 0.9rem 1.5rem; border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); background: rgba(10,10,15,0.85); }
.nav__logo { font-family: var(--font-mono); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.08em; display: flex; align-items: center; gap: 0.5rem; }
.nav__icon { color: var(--blue); font-size: 1.1rem; }
.nav__actions { display: flex; align-items: center; gap: 0.6rem; }
.nav__user-name { font-size: 0.82rem; color: var(--text-dim); font-weight: 500; padding: 0.3rem 0.7rem; background: var(--bg-elevated); border-radius: 6px; border: 1px solid var(--border); }

/* =============================================================================
   HERO / LOGIN PAGE
   ============================================================================= */
.hero { position: relative; z-index: 10; max-width: 620px; margin: 0 auto; padding: 4rem 2rem 4rem; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero__badge { display: inline-block; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue); background: var(--blue-glow); border: 1px solid rgba(24,119,242,0.2); padding: 0.4rem 1rem; border-radius: 100px; margin-bottom: 2rem; }
.hero__title { font-size: clamp(2.5rem, 6vw, 3.8rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; margin-bottom: 1.5rem; }
.hero__accent { background: linear-gradient(135deg, #1877f2, #00c6ff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero__desc { font-size: 1.05rem; color: var(--text-dim); line-height: 1.7; max-width: 480px; margin-bottom: 2.5rem; }
.hero__steps { display: flex; align-items: center; gap: 1rem; margin-top: 2rem; padding: 1.5rem 2rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; }
.step { text-align: center; flex: 1; }
.step__num { font-family: var(--font-mono); font-size: 0.7rem; color: var(--blue); letter-spacing: 0.1em; margin-bottom: 0.4rem; }
.step__text { font-size: 0.8rem; color: var(--text-dim); line-height: 1.4; }
.step__divider { width: 40px; height: 1px; background: var(--border-light); flex-shrink: 0; }

/* =============================================================================
   AUTH CARD
   ============================================================================= */
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 1.75rem 2rem;
    text-align: left;
}
.auth-toggle {
    display: flex; gap: 0; margin-bottom: 1.5rem;
    background: var(--bg); border-radius: 8px; padding: 3px;
    border: 1px solid var(--border);
}
.auth-toggle__btn {
    flex: 1; padding: 0.55rem; border: none; border-radius: 6px;
    background: transparent; color: var(--text-muted); cursor: pointer;
    font-family: var(--font-body); font-size: 0.85rem; font-weight: 500;
    transition: all 0.2s;
}
.auth-toggle__btn--active { background: var(--blue); color: #fff; }
.auth-error {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 0.9rem; border-radius: 8px; margin-bottom: 1rem;
    background: var(--red-dim); border: 1px solid rgba(239,68,68,0.25);
    color: #fca5a5; font-size: 0.82rem;
}
.auth-error__icon { font-weight: 700; flex-shrink: 0; }

/* =============================================================================
   FORMS
   ============================================================================= */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.72rem; font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
.form-input {
    width: 100%; padding: 0.65rem 0.9rem;
    background: var(--bg-elevated); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
    font-family: var(--font-body); font-size: 0.88rem;
    outline: none; transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--blue); }
.form-input::placeholder { color: var(--text-muted); }
.form-input--time { width: auto; min-width: 110px; text-align: center; }
.form-hint { display: block; font-size: 0.7rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* =============================================================================
   BUTTONS
   ============================================================================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.75rem 1.5rem; font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; border-radius: var(--radius); border: none; cursor: pointer; text-decoration: none; transition: all 0.2s; }
.btn--facebook { background: var(--blue); color: #fff; font-size: 1.05rem; padding: 1rem 2.2rem; box-shadow: 0 0 30px rgba(24,119,242,0.3); }
.btn--facebook:hover { background: #1565d8; box-shadow: 0 0 50px rgba(24,119,242,0.45); transform: translateY(-2px); }
.btn__fb-icon { width: 20px; height: 20px; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: #1565d8; }
.btn--primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn--ghost:hover { color: var(--text); border-color: var(--border-light); background: var(--bg-elevated); }
.btn--ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--ghost-danger { background: transparent; color: var(--text-muted); border: 1px solid var(--border); font-size: 0.72rem; padding: 0.3rem 0.7rem; border-radius: 6px; text-decoration: none; font-family: var(--font-body); }
.btn--ghost-danger:hover { color: var(--red); border-color: rgba(239,68,68,0.3); background: var(--red-dim); }
.btn--sm { padding: 0.4rem 0.9rem; font-size: 0.78rem; }
.btn--xs { padding: 0.3rem 0.7rem; font-size: 0.72rem; }
.btn--lg { padding: 0.9rem 2rem; font-size: 1rem; }
.btn--full { width: 100%; }

/* =============================================================================
   DASHBOARD
   ============================================================================= */
.dashboard { position: relative; z-index: 10; max-width: 1360px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; }

/* --- Profiles Bar --- */
.profiles-bar {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.6rem 0; margin-bottom: 0.5rem;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.profiles-bar::-webkit-scrollbar { height: 0; }
.profiles-bar__list { display: flex; gap: 0.4rem; flex: 1; }

.profile-chip {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 0.9rem; border-radius: 10px;
    background: var(--bg-card); border: 1px solid var(--border);
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
    font-family: var(--font-body); color: var(--text-dim); font-size: 0.82rem;
}
.profile-chip:hover { border-color: var(--border-light); background: var(--bg-card-hover); }
.profile-chip--active { border-color: var(--blue); background: var(--blue-soft); color: var(--text); }
.profile-chip__avatar {
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--bg-elevated); color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.7rem; flex-shrink: 0;
    border: 1px solid var(--border);
}
.profile-chip--active .profile-chip__avatar { background: var(--blue-glow); color: var(--blue); border-color: rgba(24,119,242,0.3); }
.profile-chip__name { font-weight: 500; }
.profile-chip__accounts { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }

.profile-add {
    width: 36px; height: 36px; border-radius: 10px;
    background: var(--bg-card); border: 1px dashed var(--border-light);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 1.1rem; text-decoration: none;
    cursor: pointer; transition: all 0.2s; flex-shrink: 0;
}
.profile-add:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }

/* --- Active Profile Bar --- */
.profile-active-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.4rem 0; margin-bottom: 0.5rem;
}
.profile-active-bar__info { display: flex; align-items: center; gap: 0.5rem; }
.profile-active-bar__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

/* =============================================================================
   TOOLBAR
   ============================================================================= */
.toolbar { display: flex; align-items: flex-end; gap: 1rem; padding: 0.75rem 1.25rem; margin-bottom: 1.5rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); flex-wrap: wrap; }
.toolbar__left { flex: 1; min-width: 200px; }
.toolbar__right { min-width: 180px; }
.toolbar__label { display: block; font-size: 0.7rem; font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }

/* --- Select (native) --- */
.select {
    width: 100%; padding: 0.6rem 0.9rem;
    background: var(--bg-elevated); color: var(--text);
    border: 1px solid var(--border); border-radius: 8px;
    font-family: var(--font-body); font-size: 0.88rem;
    cursor: pointer; outline: none; transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888a0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem;
}
.select:focus { border-color: var(--blue); }
.select option { background: var(--bg-card); color: var(--text); }

/* --- Section --- */
.section-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.section-title { font-size: 1rem; font-weight: 600; }
.section-badge { font-family: var(--font-mono); font-size: 0.65rem; padding: 0.2rem 0.6rem; border-radius: 100px; background: var(--bg-elevated); color: var(--text-muted); }
.section-badge--ok { background: var(--green-dim); color: var(--green); }

/* --- Metrics Grid --- */
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 0.6rem; margin-bottom: 1.5rem; }
.metric { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; transition: border-color 0.2s; }
.metric:hover { border-color: var(--border-light); }
.metric__label { font-size: 0.65rem; font-family: var(--font-mono); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.35rem; }
.metric__value { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; }
.metric__value--primary { color: var(--blue); }
.metric--hl { border-color: rgba(24,119,242,0.25); background: var(--blue-soft); }
.metric.skeleton { animation: shimmer 1.5s infinite; }
@keyframes shimmer { 0%{opacity:0.4} 50%{opacity:0.7} 100%{opacity:0.4} }
.empty-inline { padding: 1.5rem; color: var(--text-muted); font-size: 0.9rem; text-align: center; }

/* =============================================================================
   TABS (Campaigns / AdSets / Ads / Reports)
   ============================================================================= */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 0; position: sticky; top: 52px; z-index: 40; background: var(--bg); padding-top: 0.5rem; }
.tab { padding: 0.7rem 1.25rem; background: none; border: none; color: var(--text-muted); font-family: var(--font-body); font-size: 0.88rem; font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; display: flex; align-items: center; gap: 0.5rem; }
.tab:hover { color: var(--text-dim); }
.tab--active { color: var(--text); border-bottom-color: var(--blue); }
.tab--reports.tab--active { border-bottom-color: var(--purple); }
.tab--auto.tab--active { border-bottom-color: var(--green); }
.tab__count { font-family: var(--font-mono); font-size: 0.7rem; background: var(--bg-elevated); color: var(--text-dim); padding: 0.15rem 0.5rem; border-radius: 100px; min-width: 1.5rem; text-align: center; }
.tab--active .tab__count { background: var(--blue-glow); color: var(--blue); }

/* --- Tab Content --- */
.tab-content { display: none; padding-top: 1rem; }
.tab-content--active { display: block; }

/* =============================================================================
   TABLES
   ============================================================================= */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; white-space: nowrap; }
.data-table thead { position: sticky; top: 0; z-index: 5; }
.data-table th { padding: 0.7rem 0.9rem; text-align: left; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); background: var(--bg-elevated); border-bottom: 1px solid var(--border); }
.data-table td { padding: 0.65rem 0.9rem; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: middle; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.td-name { max-width: 260px; }
.td-name--ad { display: flex; align-items: center; gap: 0.6rem; }
.td-name__text { font-weight: 500; color: var(--text); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.td-name__id { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); display: block; }
.td-num { text-align: right; font-variant-numeric: tabular-nums; }
.td-money { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.td-sub { font-size: 0.78rem; color: var(--text-muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.td-obj { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; }
.td-empty { text-align: center; padding: 3rem 1rem !important; color: var(--text-muted); font-size: 0.88rem; white-space: normal; }
.td-error { color: #fca5a5; }
.td-loading { text-align: center; padding: 2rem 1rem !important; }
.td-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.td-thumb-empty { width: 40px; height: 40px; border-radius: 6px; flex-shrink: 0; background: var(--bg-elevated); border: 1px solid var(--border); }
.td-targeting { white-space: normal; max-width: 220px; }
.tag { display: inline-block; margin: 0.1rem 0.2rem; padding: 0.15rem 0.45rem; border-radius: 5px; font-size: 0.7rem; background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-dim); }

/* --- Badges --- */
.badge { display: inline-block; font-size: 0.68rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 100px; text-transform: uppercase; letter-spacing: 0.04em; }
.badge--green { color: var(--green); background: var(--green-dim); }
.badge--amber { color: var(--amber); background: var(--amber-dim); }
.badge--gray { color: var(--text-muted); background: var(--bg-elevated); }

/* --- Loading --- */
.loading { display: flex; align-items: center; justify-content: center; gap: 0.75rem; color: var(--text-dim); font-size: 0.88rem; padding: 0.5rem 0; }
.loading__spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--blue); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Ads View Toggle --- */
.ads-view-toggle { display: flex; gap: 0.35rem; margin-bottom: 0.75rem; }
.view-btn { padding: 0.4rem 0.8rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); font-family: var(--font-body); font-size: 0.78rem; cursor: pointer; transition: all 0.15s; }
.view-btn:hover { color: var(--text-dim); border-color: var(--border-light); }
.view-btn--active { color: var(--text); background: var(--bg-elevated); border-color: var(--blue); }

/* --- Ad Cards --- */
.ads-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.ad-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color 0.2s, transform 0.2s; }
.ad-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.ad-card__img-wrap { width: 100%; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-elevated); }
.ad-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-card__no-img { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 0.82rem; }
.ad-card__body { padding: 1rem 1.1rem; }
.ad-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.4rem; }
.ad-card__name { font-weight: 600; font-size: 0.88rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ad-card__title { font-size: 0.82rem; font-weight: 500; color: var(--text-dim); margin-bottom: 0.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-card__text { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0.5rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-card__meta { margin-bottom: 0.75rem; }
.ad-card__camp { font-size: 0.7rem; font-family: var(--font-mono); color: var(--text-muted); background: var(--bg-elevated); padding: 0.15rem 0.5rem; border-radius: 4px; }
.ad-card__metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.4rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
.ad-card__metric { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0.5rem; border-radius: 6px; background: var(--bg); }
.ad-card__metric span { font-size: 0.68rem; color: var(--text-muted); }
.ad-card__metric strong { font-size: 0.78rem; color: var(--text); font-weight: 600; }
.ad-card__metric--hl { background: var(--blue-soft); }
.ad-card__metric--hl span { color: rgba(24,119,242,0.7); }
.ad-card__metric--hl strong { color: var(--blue); }

/* =============================================================================
   REPORTS PANEL
   ============================================================================= */
.reports-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 2rem;
}
.reports-panel__header { margin-bottom: 1.5rem; }
.reports-panel__desc { font-size: 0.88rem; color: var(--text-dim); margin-top: 0.4rem; line-height: 1.6; }

.report-toggle-master {
    padding: 1rem 1.25rem; border-radius: var(--radius);
    background: var(--bg-elevated); border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

/* --- Toggle Switch --- */
.toggle-label { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; user-select: none; }
.toggle-label--sm { gap: 0.5rem; }
.toggle-input { display: none; }
.toggle-switch {
    position: relative; width: 44px; height: 24px; border-radius: 100px;
    background: var(--border); transition: background 0.25s; flex-shrink: 0;
}
.toggle-switch::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--text-muted); transition: all 0.25s;
}
.toggle-input:checked + .toggle-switch { background: var(--green); }
.toggle-input:checked + .toggle-switch::after { left: 23px; background: #fff; }

.toggle-switch--sm { width: 36px; height: 20px; }
.toggle-switch--sm::after { width: 14px; height: 14px; }
.toggle-input:checked + .toggle-switch--sm::after { left: 19px; }

.toggle-text { font-size: 0.9rem; color: var(--text-dim); }
.toggle-text strong { color: var(--text); }

/* --- Report Config --- */
.report-config {
    padding: 1.25rem; border-radius: var(--radius);
    background: var(--bg); border: 1px solid var(--border);
    margin-bottom: 1rem;
}
.report-config__title { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.report-config__desc { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 1rem; line-height: 1.5; }
.report-config__badge {
    font-size: 0.6rem; font-family: var(--font-mono); font-weight: 600;
    padding: 0.15rem 0.5rem; border-radius: 100px;
    background: var(--purple-dim); color: var(--purple);
    text-transform: uppercase; letter-spacing: 0.06em;
}

/* --- Chat Mode Toggle --- */
.chat-mode-toggle {
    display: flex; gap: 0; margin-bottom: 1rem;
    background: var(--bg-elevated); border-radius: 8px; padding: 3px;
    border: 1px solid var(--border);
}
.chat-mode-btn {
    flex: 1; padding: 0.45rem 0.75rem; border: none; border-radius: 6px;
    background: transparent; color: var(--text-muted); cursor: pointer;
    font-family: var(--font-body); font-size: 0.8rem; font-weight: 500;
    transition: all 0.2s;
}
.chat-mode-btn:hover { color: var(--text-dim); }
.chat-mode-btn--active { background: var(--blue); color: #fff; }

/* --- Chat Select Row --- */
.chat-select-row {
    display: flex; gap: 0.5rem; align-items: stretch;
}
.chat-select-row .select { flex: 1; }
.chat-select-row .btn { white-space: nowrap; flex-shrink: 0; }

/* --- Chat Current Display --- */
.chat-current {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    margin-top: 0.75rem; padding: 0.6rem 0.9rem;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: 8px;
}
.chat-current__label {
    font-size: 0.72rem; font-family: var(--font-mono); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
}
.chat-current__id {
    font-family: var(--font-mono); font-size: 0.78rem; color: var(--green);
    background: var(--green-dim); padding: 0.2rem 0.6rem; border-radius: 6px;
    word-break: break-all;
}
.chat-current__save { margin-left: auto; }
.chat-current__saved {
    font-size: 0.78rem; color: var(--green); font-weight: 600;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- Report Hours --- */
.report-hours { display: flex; flex-direction: column; gap: 0.6rem; }
.report-hour {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.9rem; border-radius: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
}
.report-hour__label { font-size: 0.78rem; color: var(--text-muted); margin-left: auto; }

/* --- Report Actions --- */
.report-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* --- Report Status --- */
.report-status {
    margin-top: 1rem; padding: 0.75rem 1rem; border-radius: 8px;
    font-size: 0.85rem; font-weight: 500;
}
.report-status--ok { background: var(--green-dim); color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.report-status--error { background: var(--red-dim); color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }

/* --- Accounts Summary (global tab) --- */
.accounts-summary__list { display: flex; flex-direction: column; gap: 0.4rem; }
.accounts-summary__item {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.6rem 0.9rem; border-radius: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    font-size: 0.85rem; opacity: 0.55; transition: opacity 0.2s;
}
.accounts-summary__item--on { opacity: 1; }
.accounts-summary__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--text-muted); flex-shrink: 0;
}
.accounts-summary__dot--on { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.accounts-summary__name { font-weight: 500; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.accounts-summary__status { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.accounts-summary__item--on .accounts-summary__status { color: var(--green); }
.accounts-summary__chat {
    font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim);
    background: var(--bg-card); padding: 0.15rem 0.45rem; border-radius: 4px;
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.accounts-summary__chat--none { color: var(--text-muted); font-style: italic; font-family: var(--font-body); }
.accounts-summary__footer {
    margin-top: 0.65rem; font-size: 0.78rem; color: var(--text-muted);
    padding-top: 0.6rem; border-top: 1px solid var(--border);
}
.accounts-summary__empty { font-size: 0.85rem; color: var(--text-muted); padding: 1rem 0; }

/* =============================================================================
   EMPTY STATE
   ============================================================================= */
.empty-state {
    text-align: center; padding: 4rem 2rem;
    background: var(--bg-card); border: 1px dashed var(--border-light);
    border-radius: var(--radius-lg); margin-top: 1rem;
}
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state__title { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; }
.empty-state__desc { font-size: 0.9rem; color: var(--text-dim); max-width: 420px; margin: 0 auto 1.5rem; line-height: 1.6; }

/* --- Pulse animation --- */
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* =============================================================================
   PDF REPORTS
   ============================================================================= */
.tab--pdf.tab--active { border-bottom-color: #f97316; }

/* --- PDF generation options --- */
.pdf-gen-options { margin-bottom: 0.75rem; }
.toggle-radio { margin-right: 0.5rem; accent-color: var(--blue); }
.radio-label { font-size: 0.88rem; color: var(--text-dim); cursor: pointer; }

/* --- PDF campaign selection --- */
.pdf-campaign-list {
    max-height: 300px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg-elevated);
}
.pdf-campaign-list::-webkit-scrollbar { width: 4px; }
.pdf-campaign-list::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.pdf-campaign-list__empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.pdf-campaign-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--border);
    cursor: pointer; transition: background 0.15s;
}
.pdf-campaign-item:last-child { border-bottom: none; }
.pdf-campaign-item:hover { background: var(--bg-card-hover); }
.pdf-campaign-item input[type="checkbox"] { accent-color: var(--blue); flex-shrink: 0; }
.pdf-campaign-item__name { flex: 1; font-size: 0.85rem; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-campaign-item__spend { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); }

/* --- PDF results list --- */
.pdf-results-list { display: flex; flex-direction: column; gap: 0.4rem; }
.pdf-result-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.65rem 0.9rem; border-radius: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    font-size: 0.85rem;
}
.pdf-result-item--error { border-color: rgba(239,68,68,0.25); background: var(--red-dim); }
.pdf-result-item__name { flex: 1; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-result-item__size { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); }
.pdf-result-item__error { font-size: 0.78rem; color: #fca5a5; }

/* --- Logo upload --- */
.logo-upload-area { display: flex; align-items: center; gap: 1rem; }
.logo-preview {
    width: 120px; height: 60px; border-radius: 8px;
    background: var(--bg-elevated); border: 1px dashed var(--border-light);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0;
}
.logo-preview__empty { font-size: 0.72rem; color: var(--text-muted); }
.logo-preview__img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-actions { display: flex; flex-direction: column; gap: 0.4rem; }

/* --- PDF fields config --- */
.pdf-fields-list { display: flex; flex-direction: column; gap: 0.35rem; }
.pdf-field-item {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.5rem 0.8rem; border-radius: 8px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    transition: border-color 0.15s; cursor: grab;
}
.pdf-field-item:hover { border-color: var(--border-light); }
.pdf-field-item--dragover { border-color: var(--primary); background: rgba(24,119,242,0.08); }
.pdf-field-drag {
    cursor: grab; color: var(--text-muted); font-size: 0.9rem;
    user-select: none; opacity: 0.5; transition: opacity 0.15s;
}
.pdf-field-item:hover .pdf-field-drag { opacity: 1; }
.pdf-field-label { flex: 1; font-size: 0.85rem; font-weight: 500; color: var(--text); }
.pdf-field-label-input {
    flex: 1; font-size: 0.82rem; font-weight: 500; color: var(--text);
    background: transparent; border: 1px solid transparent; border-radius: 4px;
    padding: 0.2rem 0.4rem; outline: none; transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}
.pdf-field-label-input:hover { border-color: var(--border); background: var(--bg-card); }
.pdf-field-label-input:focus { border-color: var(--primary); background: var(--bg-card); }
.pdf-field-key { font-family: var(--font-mono); font-size: 0.68rem; color: var(--text-muted); background: var(--bg-card); padding: 0.15rem 0.4rem; border-radius: 4px; }

/* --- Client message preview --- */
.client-msg-preview {
    display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
    margin-top: 0.5rem; padding: 0.6rem 0.9rem;
    background: var(--green-dim); border: 1px solid rgba(34,197,94,0.2);
    border-radius: 8px; font-size: 0.82rem; color: var(--green);
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
    .toolbar { flex-direction: column; }
    .toolbar__left, .toolbar__right { width: 100%; min-width: 0; }
    .metrics-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard { padding: 0.75rem 0.75rem 2rem; }
    .nav { padding: 0.75rem 1rem; }
    .tabs { overflow-x: auto; }
    .hero { padding: 3rem 1.25rem 2rem; }
    .hero__steps { flex-direction: column; gap: 0.75rem; }
    .step__divider { width: 1px; height: 20px; }
    .ads-cards-grid { grid-template-columns: 1fr; }
    .profile-active-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .form-row { grid-template-columns: 1fr; }
    .report-actions { flex-direction: column; }
    .report-actions .btn { width: 100%; }
    .reports-panel { padding: 1.25rem; }
    .chat-select-row { flex-direction: column; }
    .chat-current { flex-direction: column; align-items: flex-start; }
    .chat-current__save { margin-left: 0; width: 100%; }
}
@media (max-width: 480px) {
    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .data-table { font-size: 0.75rem; }
    .data-table th, .data-table td { padding: 0.5rem 0.6rem; }
    .ad-card__metrics { grid-template-columns: 1fr; }
    .auth-card { padding: 1.25rem 1.25rem; }
    .nav__actions { gap: 0.35rem; }
    .nav__user-name { display: none; }
}