:root{
  --bg:#f3f1ed;
  --paper:#fffefc;
  --sidebar:#202226;
  --sidebar-2:#292c31;
  --ink:#1c2530;
  --muted:#7d8490;
  --line:#e7e3dc;
  --soft:#f8f6f2;
  --orange:#ff7417;
  --orange-soft:#fff1e7;
  --green:#2f8b62;
  --green-soft:#eaf6ef;
  --red:#b55145;
  --red-soft:#faece9;
  --amber:#b97824;
  --shadow:0 18px 45px rgba(18,24,33,.08);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink);font-size:14px}
a{color:inherit;text-decoration:none}
button,input,select{font:inherit}
img{max-width:100%;display:block}

/* shared */
.eyebrow{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--orange);font-weight:800}
.muted{color:var(--muted)}
.alert{padding:12px 14px;border-radius:8px;margin:0 0 18px;font-size:13px}
.alert-error{background:var(--red-soft);color:#8b3d34;border:1px solid #efcfc9}
.alert-success{background:var(--green-soft);color:#236b4b;border:1px solid #cce7d8}
.status-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 8px;border-radius:999px;background:#f1f3f4;color:#5c6470;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}
.status-badge.complete,.status-badge.enabled{background:var(--green-soft);color:var(--green)}
.status-badge.failed{background:var(--red-soft);color:var(--red)}
.status-badge.generating,.status-badge.pending{background:#fff5e8;color:var(--amber)}
.primary-button,.secondary-button{display:inline-flex;align-items:center;justify-content:center;height:38px;padding:0 14px;border-radius:6px;border:1px solid transparent;font-weight:750;font-size:12px;cursor:pointer;transition:.18s ease}
.primary-button{background:var(--orange);color:white}
.primary-button:hover{filter:brightness(.96)}
.secondary-button{background:#fff;border-color:#ded9d1;color:#4f5661}
.secondary-button:hover{background:#faf8f4}
.table-link{color:var(--orange);font-weight:800}

/* app shell */
.app-shell{min-height:100vh;display:flex}
.sidebar{width:210px;background:var(--sidebar);color:#dde1e6;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;border-right:1px solid #2e3136;z-index:20}
.sidebar-brand{padding:18px 16px 15px;border-bottom:1px solid #30343a}
.brand-logo{width:170px;height:auto;opacity:.98}.brand-logo-white{filter:none}
.brand-mini{display:flex;align-items:center;gap:10px}
.brand-mini img{width:27px;height:27px;object-fit:contain}
.brand-mini strong{font-size:12px;display:block;color:#fff}
.brand-mini span{font-size:10px;color:#8f969f;display:block;margin-top:2px}
.nav-section{padding:18px 14px 6px;font-size:9px;text-transform:uppercase;letter-spacing:.16em;color:#69707a;font-weight:800}
.nav{padding:0 8px}
.nav-link{display:flex;align-items:center;gap:10px;min-height:34px;padding:0 10px;margin:2px 0;border-radius:5px;color:#aeb4bc;font-size:12px;font-weight:650}
.nav-link:hover{background:#292d32;color:#fff}
.nav-link.active{background:#34383e;color:#fff}
.nav-link.active::before{content:"";width:3px;height:16px;border-radius:3px;background:var(--orange);margin-left:-5px}
.nav-link.disabled{opacity:.45;pointer-events:none}
.sidebar-bottom{margin-top:auto;padding:14px 16px;border-top:1px solid #30343a}
.signed-in span{display:block;color:#747c86;font-size:9px;text-transform:uppercase;letter-spacing:.08em}
.signed-in strong{display:block;color:#fff;margin-top:4px;font-size:12px}
.logout-button{margin-top:10px;padding:0;border:0;background:none;color:#8e959e;font-size:11px;cursor:pointer}
.logout-button:hover{color:#fff}
.main-content{margin-left:210px;min-height:100vh;padding:20px 28px 50px;width:calc(100% - 210px)}

/* topbar */
.topbar{height:44px;background:#efede9;border-bottom:1px solid #dedad3;margin:-20px -28px 18px;display:flex;align-items:center;justify-content:space-between;padding:0 18px;color:#6b717a;font-size:11px}
.topbar-left,.topbar-right{display:flex;align-items:center;gap:12px}
.topbar .crumb{font-weight:750;color:#313943}
.live-dot{display:inline-flex;align-items:center;gap:6px;color:#4e775f;background:#e9f4ed;border:1px solid #d6e7dc;border-radius:999px;padding:4px 8px}
.live-dot::before{content:"";width:5px;height:5px;background:#52a171;border-radius:50%}

/* headers */
.page-header{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:18px}
.page-header h1{margin:4px 0 5px;font-size:24px;line-height:1.15;letter-spacing:-.025em;color:#202833}
.page-header p{margin:0;color:var(--muted);font-size:12px}
.page-actions{display:flex;gap:8px;align-items:center}
.period-box{background:#fff;border:1px solid var(--line);border-radius:7px;padding:9px 12px;min-width:245px;text-align:right}
.period-box strong{display:block;font-size:11px;color:#3d4651}
.period-box span{display:block;font-size:10px;color:#959ba4;margin-top:3px}

/* dashboard metrics */
.metrics-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--paper);margin-bottom:18px}
.metric-card{padding:16px 18px;border-right:1px solid var(--line);min-height:106px}
.metric-card:nth-child(4n){border-right:0}
.metric-label{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#7e8490;font-weight:800;margin-bottom:8px}
.metric-value{font-family:Georgia,"Times New Roman",serif;font-size:24px;line-height:1;color:#1c2530;font-weight:700;margin-bottom:7px}
.metric-change{font-size:11px;font-weight:800;color:#59616c}
.metric-change span{font-weight:500;color:#a0a5ad;margin-left:4px}
.metric-change.positive{color:var(--green)}
.metric-change.negative{color:var(--red)}

/* panels */
.panel{background:var(--paper);border:1px solid var(--line);border-radius:7px;margin-top:14px}
.panel-heading{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line)}
.panel-heading h2{font-size:13px;margin:2px 0 0;color:#252e39}
.chart-container{height:300px;padding:14px 16px 18px}
.empty-state{padding:25px 16px;color:#6f7680;font-size:12px;line-height:1.55}
.empty-state strong{display:block;color:#313a45;margin-bottom:4px}

/* reports + tables */
.report-main{margin-left:210px;max-width:none}
.report-generator{display:grid;grid-template-columns:minmax(260px,1fr) 220px 170px;gap:12px;align-items:end;padding:16px}
.field{display:block;margin-bottom:14px}
.field span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:#656d77;font-weight:800;margin-bottom:6px}
.field input,.field select{width:100%;height:38px;border:1px solid #dcd8d1;border-radius:6px;background:#fff;padding:0 10px;outline:none;color:#2f3742}
.field input:focus,.field select:focus{border-color:#e9a06f;box-shadow:0 0 0 2px rgba(255,116,23,.08)}
.table-scroll{width:100%;overflow-x:auto}
.report-table{width:100%;border-collapse:collapse;font-size:10.5px;background:#fff}
.report-table th{padding:9px 10px;text-align:left;background:#faf9f6;color:#717782;border-bottom:1px solid #e5e1db;white-space:nowrap;font-size:9px;text-transform:uppercase;letter-spacing:.04em}
.report-table td{padding:9px 10px;border-bottom:1px solid #eeebe6;color:#3d4651;vertical-align:top}
.report-table tbody tr:hover{background:#fcfaf7}
.report-table td small{display:block;color:#999fa7;margin-top:3px}
.report-table td:not(:first-child){font-variant-numeric:tabular-nums}

/* report preview: document-style, inspired by uploaded reference */
.report-preview-shell{margin-left:210px;min-height:100vh;background:#e7e4df;padding:16px 24px 60px}
.report-toolbar{height:44px;background:#f3f1ed;border:1px solid #d8d4cd;border-radius:7px 7px 0 0;display:flex;align-items:center;justify-content:space-between;padding:0 12px;color:#5e6670;font-size:10px;position:sticky;top:0;z-index:10}
.report-toolbar .toolbar-actions{display:flex;gap:7px}
.report-paper{width:min(1040px,100%);margin:0 auto;background:#fff;box-shadow:var(--shadow);min-height:1200px;padding:52px 62px 36px}
.report-masthead{display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:16px;margin-bottom:18px}
.report-brand-lockup{display:flex;align-items:center;gap:10px}
.report-brand-lockup img{width:34px;height:34px;object-fit:contain}
.report-brand-lockup strong{display:block;font-size:12px;color:#202833}
.report-brand-lockup span{display:block;color:#9197a0;font-size:9px;margin-top:2px}
.report-audit-meta{text-align:right;font-size:9px;color:#8c929b;line-height:1.5}
.report-title-block{padding:16px 0 18px;border-bottom:1px solid var(--line)}
.report-title-block h1{font-size:28px;line-height:1.08;margin:6px 0 8px;letter-spacing:-.035em;color:#202833}
.report-title-block p{margin:0;color:#6f7680;font-size:11px;line-height:1.5;max-width:650px}
.report-meta-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px;padding:14px 0 4px}
.report-meta-item span{display:block;font-size:8px;text-transform:uppercase;letter-spacing:.08em;color:#9b9fa6;font-weight:800;margin-bottom:4px}
.report-meta-item strong{font-size:10px;color:#343d48}
.report-section{padding:18px 0;border-top:1px solid var(--line)}
.report-section:first-of-type{border-top:0}
.report-section-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:12px}
.report-section-head h2{font-size:12px;margin:0;color:#2b333e}
.report-section-head span{font-size:8px;text-transform:uppercase;letter-spacing:.08em;color:#a0a5ad}
.report-kpis{display:grid;grid-template-columns:repeat(4,1fr);border:1px solid var(--line);background:#fff}
.report-kpi{padding:12px 14px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.report-kpi:nth-child(4n){border-right:0}
.report-kpi:nth-last-child(-n+4){border-bottom:0}
.report-kpi-label{font-size:8px;color:#818790;text-transform:uppercase;letter-spacing:.06em;font-weight:800;margin-bottom:6px}
.report-kpi-value{font-family:Georgia,"Times New Roman",serif;font-size:18px;font-weight:700;color:#212a35}
.report-kpi-change{font-size:8px;color:#8e949d;margin-top:4px}
.report-chart-card{margin-top:12px;border:1px solid var(--line);padding:10px 12px;background:#fff}
.report-chart-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px;font-size:9px;color:#5f6670;font-weight:800}
.report-chart-wrap{height:220px}
.report-table.compact{font-size:8.7px}
.report-table.compact th{font-size:7.8px;padding:7px 6px;background:#fff;border-top:1px solid var(--line)}
.report-table.compact td{padding:7px 6px}
.report-footer{margin-top:20px;padding-top:12px;border-top:1px solid var(--line);display:flex;justify-content:space-between;color:#9da2a8;font-size:8px}

/* login - strict minimal */
.login-body{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:28px;background:#ece9e4}
.login-shell{width:100%;max-width:390px}
.login-brand{margin-bottom:12px;text-align:center}
.login-brand img{width:210px;margin:0 auto 10px}
.login-card{background:#fff;border:1px solid #dedad4;border-radius:8px;box-shadow:0 16px 36px rgba(20,27,35,.08);padding:28px}
.login-card h1{font-size:22px;margin:5px 0 8px;letter-spacing:-.02em}
.login-intro{font-size:12px;color:#7d8490;line-height:1.55;margin:0 0 20px}
.login-card .primary-button{width:100%;height:40px}

@media(max-width:1100px){
  .metrics-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.metric-card:nth-child(2n){border-right:0}.metric-card:nth-child(4n){border-right:0}
  .report-generator{grid-template-columns:1fr 1fr}.report-generate-button{grid-column:1/-1}
  .report-paper{padding:38px 30px}.report-meta-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:760px){
  .sidebar{position:static;width:100%;height:auto}.app-shell{display:block}.nav{display:flex;overflow-x:auto;padding:7px}.nav-section,.sidebar-bottom{display:none}.sidebar-brand{padding:10px 12px}.brand-logo{width:145px}
  .main-content,.report-main,.report-preview-shell{margin-left:0;width:100%}.main-content{padding:16px}.topbar{margin:-16px -16px 16px}.page-header{display:block}.page-actions,.period-box{margin-top:12px}.metrics-grid{grid-template-columns:1fr}.metric-card{border-right:0;border-bottom:1px solid var(--line)}
  .report-generator{grid-template-columns:1fr}.report-preview-shell{padding:8px}.report-paper{padding:24px 16px}.report-meta-grid,.report-kpis{grid-template-columns:1fr 1fr}.report-kpi:nth-child(2n){border-right:0}.report-title-block h1{font-size:22px}.report-toolbar{position:static;overflow:auto}.report-masthead{gap:12px}.report-chart-wrap{height:180px}
}


/* ===== Stage 2: multi-client + reporting ===== */
.compact-select{height:38px;min-width:260px;border:1px solid #dcd8d1;border-radius:6px;background:#fff;padding:0 10px;color:#2f3742;font-size:11px}
.form-panel{padding:18px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px}.form-span-2{grid-column:1/-1}.field small{display:block;margin-top:6px;color:#949aa3;font-size:10px;line-height:1.45}.check-row{display:flex;align-items:center;gap:8px;color:#4d5662;font-size:11px}.check-row input{width:15px;height:15px;accent-color:var(--orange)}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.actions-cell{white-space:nowrap}.actions-cell .table-link{margin-right:10px}
.schedule-form{padding:16px;display:grid;grid-template-columns:1fr 1fr;gap:12px 16px}.schedule-form .field{margin:0}
.report-flash{max-width:1040px;margin:10px auto}.toolbar-actions{display:flex;align-items:center;gap:7px}.toolbar-actions form{margin:0}
.report-chart-wrap.small{height:185px}.demographic-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.conversion-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.conversion-card{border:1px solid var(--line);padding:12px;background:#fff;min-height:100px}.conversion-card strong{display:block;font-size:10px;color:#313a45;margin:5px 0 3px}.conversion-card span,.conversion-card small{display:block;font-size:8px;color:#8f969f;line-height:1.45}.conversion-count{font-family:Georgia,'Times New Roman',serif;font-size:20px;font-weight:700;color:#202833}.ad-preview-list{border-top:1px solid var(--line)}.ad-preview-row{display:grid;grid-template-columns:minmax(0,1fr) 360px;gap:18px;padding:12px 0;border-bottom:1px solid var(--line)}.ad-preview-copy{font-size:10px;line-height:1.45}.ad-preview-copy strong{display:block;color:#27374d;margin:2px 0}.ad-preview-copy p{margin:3px 0 0;color:#737b86;font-size:9px}.ad-url{color:#47775e;font-size:8px}.ad-preview-metrics{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;align-content:start}.ad-preview-metrics span{font-size:7.5px;text-transform:uppercase;color:#9298a1}.ad-preview-metrics b{display:block;margin-top:4px;color:#38414c;font-size:9px;text-transform:none}
.report-preview-shell .topbar{position:static;margin:-16px -24px 10px}.report-preview-shell{padding-top:16px}.report-toolbar{top:0}
@media(max-width:900px){.form-grid,.schedule-form,.demographic-grid{grid-template-columns:1fr}.form-span-2{grid-column:auto}.ad-preview-row{grid-template-columns:1fr}.ad-preview-metrics{grid-template-columns:repeat(3,1fr)}.conversion-grid{grid-template-columns:1fr 1fr}.compact-select{min-width:180px}}
@media(max-width:600px){.conversion-grid{grid-template-columns:1fr}.ad-preview-metrics{grid-template-columns:1fr 1fr}}
.narrow-panel{max-width:620px}.narrow-panel form{max-width:520px}.brand-logo-white{max-height:62px;object-fit:contain;object-position:left center}

/* ===== Stage 3: range controls, stronger actions, schedule polish ===== */

/* Make every actionable control read as a control rather than orange text. */
.table-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:30px;
    padding:0 10px;
    margin:2px 5px 2px 0;
    border:1px solid #f2b181;
    border-radius:6px;
    background:#fff8f2;
    color:#d95f0d;
    font-size:10px;
    font-weight:800;
    line-height:1;
    text-decoration:none;
    transition:.16s ease;
}
.table-link:hover{background:#fff0e4;border-color:#ff7417;color:#c95106}
.table-link-primary{background:#ff7417;border-color:#ff7417;color:#fff}
.table-link-primary:hover{background:#e96512;border-color:#e96512;color:#fff}
.actions-cell{white-space:nowrap;min-width:170px}
.actions-cell .table-link{margin-right:5px}
.pdf-ready{display:inline-flex;align-items:center;gap:5px;color:#287b5c;font-weight:800;font-size:10px}
.pdf-ready:before{content:"";width:6px;height:6px;border-radius:50%;background:#2f9b70}
.muted-text{color:#999fa7}

.secondary-button{
    background:#fff;
    border-color:#d9d4cd;
    color:#343d48;
    box-shadow:0 1px 1px rgba(26,32,39,.03);
}
.secondary-button:hover{border-color:#ffb37e;color:#cc5a0a;background:#fff8f2}

.logout-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:30px;
    padding:0 10px;
    margin-top:12px;
    border:1px solid rgba(255,255,255,.18);
    border-radius:6px;
    background:rgba(255,255,255,.06);
    color:#d8dde3;
    font-size:10px;
    font-weight:700;
}
.logout-button:hover{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.3);color:#fff}

/* Report date-range builder */
.report-builder-panel{overflow:hidden}
.report-builder-heading{gap:18px}
.range-summary-card{min-width:265px;padding:9px 12px;border:1px solid #e4ded7;border-radius:6px;background:#faf9f6;text-align:right}
.range-summary-card span,.range-summary-card strong,.range-summary-card small{display:block}
.range-summary-card span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:#9a9fa7;font-weight:800}
.range-summary-card strong{margin-top:3px;font-size:12px;color:#2d3641}
.range-summary-card small{margin-top:2px;font-size:10px;color:#8c939c}
.report-range-form{padding:18px}
.report-range-grid{display:grid;grid-template-columns:minmax(320px,1.55fr) minmax(180px,.65fr) minmax(150px,.55fr) minmax(150px,.55fr);gap:14px;align-items:end}
.report-range-grid .field{margin:0}
.comparison-strip{display:flex;align-items:center;justify-content:space-between;margin-top:16px;padding:12px 14px;border:1px solid #e5e1db;border-radius:7px;background:#faf9f6}
.comparison-toggle-copy strong,.comparison-toggle-copy span{display:block}
.comparison-toggle-copy strong{font-size:11px;color:#2e3742}
.comparison-toggle-copy span{font-size:9px;color:#8b919a;margin-top:2px}
.comparison-panel{display:grid;grid-template-columns:minmax(220px,.8fr) minmax(170px,.6fr) minmax(170px,.6fr);gap:14px;padding:14px 14px 0;background:#fff}
.comparison-panel[hidden]{display:none!important}
.report-builder-actions{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:16px -18px -18px;padding:14px 18px;border-top:1px solid #e8e3dc;background:#fbfaf8}
.builder-note strong,.builder-note span{display:block}
.builder-note strong{font-size:10px;color:#3a434e}
.builder-note span{margin-top:2px;font-size:8.5px;color:#9298a0}
.report-generate-button{height:40px;min-width:180px;align-self:center;margin:0}

/* Shared toggle switch */
.switch-control{position:relative;display:inline-flex;align-items:center;flex:0 0 auto;cursor:pointer}
.switch-control input{position:absolute;opacity:0;pointer-events:none}
.switch-track{position:relative;width:38px;height:21px;border-radius:999px;background:#d7d9dc;box-shadow:inset 0 0 0 1px rgba(32,40,50,.08);transition:.18s ease}
.switch-track:after{content:"";position:absolute;width:17px;height:17px;left:2px;top:2px;border-radius:50%;background:#fff;box-shadow:0 1px 4px rgba(20,26,34,.22);transition:.18s ease}
.switch-control input:checked + .switch-track{background:#ff7417}
.switch-control input:checked + .switch-track:after{transform:translateX(17px)}
.switch-control input:focus-visible + .switch-track{outline:2px solid rgba(255,116,23,.28);outline-offset:2px}

/* Schedule page */
.schedule-editor-card{margin-top:14px;border:1px solid var(--line);border-radius:8px;background:#fff;overflow:hidden;box-shadow:0 1px 2px rgba(27,32,39,.02)}
.schedule-editor-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:17px 20px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#fff,#fdfcfb)}
.schedule-editor-head h2{font-size:15px;margin:3px 0 5px;color:#252e39}
.schedule-editor-head p{max-width:720px;margin:0;color:#7d848e;font-size:10px;line-height:1.55}
.schedule-status-chip{min-width:190px;padding:9px 12px;border:1px solid #e6e1da;border-radius:7px;background:#faf9f6;text-align:right}
.schedule-status-chip span,.schedule-status-chip strong{display:block}
.schedule-status-chip span{font-size:7.5px;text-transform:uppercase;letter-spacing:.08em;color:#9a9fa7;font-weight:800}
.schedule-status-chip strong{margin-top:3px;font-size:10px;color:#343d48}
.schedule-form-v2{padding:0}
.schedule-section{padding:18px 20px;border-bottom:1px solid #ece8e2}
.schedule-section-title{display:flex;align-items:flex-start;gap:10px;margin-bottom:14px}
.schedule-step{display:inline-flex;align-items:center;justify-content:center;width:27px;height:27px;border-radius:6px;background:#fff2e8;color:#d85f0c;font-size:9px;font-weight:900}
.schedule-section-title strong,.schedule-section-title small{display:block}
.schedule-section-title strong{font-size:11px;color:#303945}
.schedule-section-title small{font-size:8.5px;color:#959aa2;margin-top:2px}
.schedule-grid{display:grid;gap:14px 16px}
.schedule-grid-3{grid-template-columns:minmax(300px,1.5fr) minmax(180px,.7fr) minmax(170px,.65fr)}
.schedule-grid-2{grid-template-columns:1fr 1fr}
.schedule-grid .field{margin:0}
.automation-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.automation-option{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:74px;padding:13px 14px;border:1px solid #e4e0da;border-radius:7px;background:#fbfaf8;cursor:pointer;transition:.16s ease}
.automation-option:hover{border-color:#e9b995;background:#fffaf6}
.automation-option-copy strong,.automation-option-copy span{display:block}
.automation-option-copy strong{font-size:10px;color:#333c47}
.automation-option-copy span{font-size:8.5px;line-height:1.45;color:#90969e;margin-top:4px}
.schedule-save-bar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:14px 20px;background:#f8f7f4}
.schedule-save-bar span,.schedule-save-bar strong{display:block}
.schedule-save-bar span{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:#979ca3;font-weight:800}
.schedule-save-bar strong{margin-top:3px;font-size:10px;color:#343c47}
.schedule-save-button{min-width:155px;height:40px}
.yes-chip,.no-chip{display:inline-flex;align-items:center;justify-content:center;min-width:34px;padding:3px 7px;border-radius:999px;font-size:8px;font-weight:900;text-transform:uppercase}
.yes-chip{background:#e9f6ef;color:#2c8b64}.no-chip{background:#f1f1f1;color:#8c9299}

@media(max-width:1180px){
    .report-range-grid{grid-template-columns:1fr 1fr}.report-account-field{grid-column:1/-1}
    .automation-options{grid-template-columns:1fr}
    .schedule-grid-3{grid-template-columns:1fr 1fr}.schedule-grid-3 .field:first-child{grid-column:1/-1}
}
@media(max-width:760px){
    .report-builder-heading,.schedule-editor-head,.report-builder-actions,.schedule-save-bar{display:block}
    .range-summary-card,.schedule-status-chip{margin-top:12px;text-align:left;min-width:0}
    .report-range-grid,.comparison-panel,.schedule-grid-3,.schedule-grid-2{grid-template-columns:1fr}
    .report-account-field,.schedule-grid-3 .field:first-child,.form-span-2{grid-column:auto}
    .report-generate-button,.schedule-save-button{width:100%;margin-top:12px}
    .comparison-strip{gap:14px}
}

/* ===== Stage 4: dashboard ranges + settings/client editor refinement ===== */
.dashboard-page-header{align-items:flex-start}
.dashboard-period-summary{margin-left:auto}
.dashboard-range-panel{overflow:hidden;margin-top:0;margin-bottom:14px}
.dashboard-range-form{padding:16px 18px 0}
.dashboard-range-grid{grid-template-columns:minmax(300px,1.45fr) minmax(180px,.7fr) minmax(150px,.55fr) minmax(150px,.55fr)}
.dashboard-comparison-strip{margin-top:14px}
.dashboard-comparison-panel{padding-bottom:0}
.dashboard-range-actions{display:flex;align-items:center;justify-content:space-between;gap:18px;margin:14px -18px 0;padding:13px 18px;border-top:1px solid #e8e3dc;background:#fbfaf8}
.dashboard-apply-button{min-width:150px;height:40px}

.client-editor-card,.password-editor-card{max-width:1180px}
.client-status-chip{min-width:245px}
.client-google-grid{display:grid;grid-template-columns:minmax(300px,.95fr) minmax(360px,1.05fr);gap:16px;align-items:stretch}
.client-google-grid .field{margin:0}
.connection-details-card{border:1px solid #e4e0da;border-radius:7px;background:#fbfaf8;padding:13px 14px}
.connection-details-label{display:block;font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#9a9fa7;font-weight:800;margin-bottom:5px}
.connection-details-card>strong{display:block;color:#303945;font-size:13px}
.connection-details-card>p{margin:5px 0 0;color:#8d949d;font-size:8.8px;line-height:1.5}
.connection-detail-grid{display:grid;grid-template-columns:.7fr 1.3fr .7fr;gap:10px;margin-top:10px;padding-top:10px;border-top:1px solid #e8e4dd}
.connection-detail-grid span{display:block;font-size:10px;color:#3d4652;font-weight:700;overflow-wrap:anywhere}
.connection-detail-grid small{display:block;margin-bottom:3px;color:#969ca4;font-size:8px;text-transform:uppercase;letter-spacing:.05em;font-weight:800}
.single-option-row{grid-template-columns:minmax(0,1fr)}
.client-save-actions{display:flex;align-items:center;gap:8px}

.account-identity-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.account-identity-item{padding:12px 14px;border:1px solid #e4e0da;border-radius:7px;background:#fbfaf8}
.account-identity-item span,.account-identity-item strong{display:block}
.account-identity-item span{font-size:7.5px;text-transform:uppercase;letter-spacing:.07em;color:#999fa7;font-weight:800}
.account-identity-item strong{margin-top:4px;color:#313a46;font-size:10.5px;overflow-wrap:anywhere}
.password-form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 16px}
.password-form-grid .field{margin:0}
.password-current-field{grid-column:1/-1;max-width:calc(50% - 8px)}
.security-guidance-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.security-guidance-card{padding:12px 14px;border:1px solid #e4e0da;border-radius:7px;background:#fbfaf8}
.security-guidance-card strong,.security-guidance-card span{display:block}
.security-guidance-card strong{font-size:9.5px;color:#343d48}
.security-guidance-card span{margin-top:4px;font-size:8.4px;line-height:1.5;color:#90969e}

@media(max-width:1180px){
    .dashboard-range-grid{grid-template-columns:1fr 1fr}.dashboard-range-grid .report-account-field{grid-column:1/-1}
    .client-google-grid{grid-template-columns:1fr}
    .account-identity-grid,.security-guidance-grid{grid-template-columns:1fr}
}
@media(max-width:760px){
    .dashboard-page-header,.dashboard-range-actions,.client-save-actions{display:block}
    .dashboard-period-summary{margin:12px 0 0;text-align:left}
    .dashboard-range-grid,.password-form-grid{grid-template-columns:1fr}
    .dashboard-range-grid .report-account-field,.password-current-field{grid-column:auto;max-width:none}
    .dashboard-apply-button{width:100%;margin-top:12px}
    .client-status-chip{min-width:0}
    .connection-detail-grid{grid-template-columns:1fr}
    .client-save-actions .secondary-button,.client-save-actions .primary-button{width:100%;margin-top:8px}
}

/* ===== Stage 5: global account context, complete daily timelines, typography parity ===== */

/* Keep application typography consistent: no separate serif KPI face. */
.metric-value,
.report-kpi-value,
.conversion-count{
    font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    letter-spacing:-.02em;
}

/* Universal client / Google Ads account switcher in the application top bar. */
.topbar-with-account{min-height:52px;height:auto;padding-top:7px;padding-bottom:7px}
.topbar-with-account .topbar-right{gap:10px}
.global-account-switcher{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:330px;
    padding:4px 5px 4px 10px;
    border:1px solid #d9d5ce;
    border-radius:7px;
    background:#fff;
    box-shadow:0 1px 1px rgba(26,32,39,.025);
}
.global-account-label{
    flex:0 0 auto;
    font-size:8px;
    line-height:1;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:#90969e;
    font-weight:850;
}
.global-account-switcher select{
    min-width:245px;
    height:30px;
    border:0;
    background:#fff;
    color:#2d3641;
    font-size:10.5px;
    font-weight:750;
    outline:none;
    cursor:pointer;
}

/* Dashboard context + reporting control redesign. */
.dashboard-context-header{margin-bottom:14px}
.dashboard-control-panel{margin-top:0;overflow:hidden}
.dashboard-control-heading{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:24px;
    padding:16px 18px;
    border-bottom:1px solid #e8e3dc;
    background:linear-gradient(180deg,#fff,#fdfcfb);
}
.dashboard-control-heading h2{margin:3px 0 4px;font-size:14px;color:#28313d;letter-spacing:-.015em}
.dashboard-control-heading p{margin:0;color:#8b919a;font-size:9.5px;line-height:1.5}
.dashboard-account-context{
    min-width:250px;
    padding:9px 12px;
    border:1px solid #e4e0da;
    border-radius:7px;
    background:#faf9f6;
    text-align:right;
}
.dashboard-account-context span,
.dashboard-account-context strong,
.dashboard-account-context small{display:block}
.dashboard-account-context span{font-size:7px;text-transform:uppercase;letter-spacing:.08em;color:#9a9fa7;font-weight:850}
.dashboard-account-context strong{margin-top:3px;color:#303945;font-size:10.5px}
.dashboard-account-context small{margin-top:2px;color:#8e949d;font-size:8.5px}
.dashboard-range-grid-stage5{
    grid-template-columns:minmax(240px,.9fr) minmax(180px,.65fr) minmax(180px,.65fr);
}
.dashboard-range-form{padding-top:16px}
.dashboard-range-actions-stage5{padding-top:13px;padding-bottom:13px}
.dashboard-action-buttons{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.dashboard-report-button,.dashboard-apply-button{height:40px;min-width:145px}

/* Give the selected-period summary a little more structure. */
.dashboard-period-summary{min-width:285px;padding:10px 13px}
.dashboard-period-summary small{line-height:1.45}

/* Chart canvas remains daily; labels can be reduced, data points are never truncated. */
.chart-container{min-height:320px;height:320px}

@media(max-width:1180px){
    .global-account-switcher{min-width:270px}
    .global-account-switcher select{min-width:190px}
    .dashboard-range-grid-stage5{grid-template-columns:1fr 1fr}
    .dashboard-range-grid-stage5 .field:first-child{grid-column:1/-1}
}
@media(max-width:860px){
    .topbar-with-account{align-items:flex-start;gap:8px;flex-direction:column;height:auto}
    .topbar-with-account .topbar-right{width:100%;justify-content:space-between}
    .global-account-switcher{flex:1;min-width:0;max-width:100%}
    .global-account-switcher select{width:100%;min-width:0}
    .dashboard-control-heading{display:block}
    .dashboard-account-context{margin-top:12px;min-width:0;text-align:left}
}
@media(max-width:760px){
    .dashboard-range-grid-stage5{grid-template-columns:1fr}
    .dashboard-range-grid-stage5 .field:first-child{grid-column:auto}
    .dashboard-action-buttons{display:grid;grid-template-columns:1fr 1fr;width:100%;margin-top:12px}
    .dashboard-report-button,.dashboard-apply-button{width:100%;min-width:0;margin:0}
    .topbar-with-account .topbar-right{display:block}
    .live-dot{margin-top:7px}
}

/* ===== Stage 6: universal account context, PDF-parity report UI, remembered dashboard filters ===== */

/* The client/account is selected globally from the top bar; forms no longer repeat that selector. */
.report-account-context,
.schedule-account-context{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:24px;
    margin:0 0 18px;
    padding:14px 16px;
    border:1px solid #e5e0d9;
    border-radius:8px;
    background:#fbfaf8;
}
.report-account-context > div,
.schedule-account-context > div{min-width:240px}
.report-account-context span,
.schedule-account-context span{
    display:block;
    color:#969ca5;
    font-size:8px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.09em;
}
.report-account-context strong,
.schedule-account-context strong{
    display:block;
    margin-top:4px;
    color:#28313c;
    font-size:13px;
}
.report-account-context small,
.schedule-account-context small{
    display:block;
    margin-top:2px;
    color:#7f8791;
    font-size:10px;
}
.report-account-context p,
.schedule-account-context p{
    max-width:560px;
    margin:0;
    color:#858c95;
    font-size:10px;
    line-height:1.5;
    text-align:right;
}
.report-range-grid-no-account{grid-template-columns:1.1fr 1fr 1fr}
.dashboard-range-grid-stage6{grid-template-columns:1.2fr 1fr 1fr}
.dashboard-range-actions-stage6{align-items:center}

/* Strong, consistent positive/negative comparison language across dashboard and reports. */
.metric-change.positive,
.report-kpi-change.positive,
.pdf-parity-kpi small.positive{color:#18815f!important;font-weight:800}
.metric-change.negative,
.report-kpi-change.negative,
.pdf-parity-kpi small.negative{color:#c04d43!important;font-weight:800}
.pdf-parity-kpi small.neutral{color:#8c939c}

/* Remove the legacy serif KPI typography so the frontend matches the PDF's clean sans-serif system. */
.report-kpi-value,
.conversion-count{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif!important}

/* Frontend report now deliberately follows the exported PDF hierarchy. */
.report-paper-pdf-parity{
    max-width:1180px;
    margin:0 auto 40px;
    padding:42px 48px;
    background:#fff;
    border:1px solid #e7e2db;
    box-shadow:0 12px 35px rgba(29,35,42,.05);
    color:#27313d;
    font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
}
.pdf-parity-intro{
    padding:4px 0 22px;
    border-bottom:1px solid #e6e1da;
}
.pdf-parity-intro h1{
    margin:8px 0 7px;
    color:#202833;
    font-size:30px;
    line-height:1.08;
    letter-spacing:-.035em;
}
.pdf-parity-intro p{
    max-width:760px;
    margin:0;
    color:#747c86;
    font-size:12px;
    line-height:1.55;
}
.pdf-parity-meta{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    border-bottom:1px solid #e6e1da;
}
.pdf-parity-meta > div{padding:18px 22px 18px 0;min-width:0}
.pdf-parity-meta span{
    display:block;
    margin-bottom:6px;
    color:#9a9fa7;
    font-size:8px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.08em;
}
.pdf-parity-meta strong{
    display:block;
    color:#303945;
    font-size:11px;
    line-height:1.4;
}
.pdf-parity-section{
    padding-top:24px;
    margin-top:24px;
    border-top:1px solid #e6e1da;
}
.pdf-parity-section:first-of-type{border-top:0;margin-top:0}
.pdf-parity-section-head{
    display:grid;
    grid-template-columns:42px minmax(0,1fr) auto;
    align-items:baseline;
    gap:8px;
    margin-bottom:14px;
}
.pdf-parity-section-head .section-number{
    color:#9ca1a8;
    font-size:12px;
    font-weight:800;
}
.pdf-parity-section-head h2{
    margin:0;
    color:#29333f;
    font-size:18px;
    line-height:1.3;
}
.pdf-parity-section-head .section-note{
    color:#9ca1a8;
    font-size:8px;
    font-weight:700;
    text-transform:uppercase;
    letter-spacing:.08em;
    text-align:right;
}
.pdf-parity-kpis{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    border-top:1px solid #e7e2db;
    border-left:1px solid #e7e2db;
    background:#fff;
}
.pdf-parity-kpi{
    min-height:122px;
    padding:22px 24px;
    border-right:1px solid #e7e2db;
    border-bottom:1px solid #e7e2db;
}
.pdf-parity-kpi > span{
    display:block;
    color:#858c95;
    font-size:9px;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.08em;
}
.pdf-parity-kpi > strong{
    display:block;
    margin-top:10px;
    color:#202a35;
    font-size:28px;
    line-height:1.08;
    letter-spacing:-.035em;
}
.pdf-parity-kpi > small{
    display:block;
    margin-top:8px;
    color:#8b929a;
    font-size:10px;
}
.pdf-parity-chart-card{
    margin-top:16px;
    padding:16px 18px 12px;
    border:1px solid #e7e2db;
    background:#fff;
}
.pdf-parity-chart-title{
    margin-bottom:10px;
    color:#555f6b;
    font-size:11px;
    font-weight:800;
}
.pdf-parity-table th{
    background:#faf9f6!important;
    border-top:1px solid #e3ded7!important;
    border-bottom:1px solid #dcd7cf!important;
    color:#69717c!important;
    font-size:8px!important;
    text-transform:uppercase;
    letter-spacing:.03em;
}
.pdf-parity-table td{
    color:#3c4652;
    border-bottom:1px solid #eeeae4!important;
    vertical-align:top;
}
.pdf-parity-table td:not(:first-child),
.pdf-parity-table th:not(:first-child){white-space:nowrap}
.search-ad-preview-cell{min-width:360px;white-space:normal!important}
.search-ad-preview-cell strong{display:block;color:#2d3743;line-height:1.45}
.search-ad-preview-cell .ad-url{display:block;margin-top:4px;color:#47745e;font-size:8px;word-break:break-all}
.search-ad-preview-cell small{display:block;margin-top:5px;color:#707883;font-size:9px;line-height:1.5}
.pdf-parity-footer{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-top:28px;
    padding-top:14px;
    border-top:1px solid #e6e1da;
    color:#969ba3;
    font-size:8px;
}

@media(max-width:1000px){
    .pdf-parity-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
    .pdf-parity-meta{grid-template-columns:repeat(2,minmax(0,1fr))}
    .report-range-grid-no-account,.dashboard-range-grid-stage6{grid-template-columns:1fr 1fr}
}
@media(max-width:760px){
    .report-account-context,.schedule-account-context{display:block}
    .report-account-context p,.schedule-account-context p{margin-top:10px;text-align:left}
    .report-range-grid-no-account,.dashboard-range-grid-stage6{grid-template-columns:1fr}
    .report-paper-pdf-parity{padding:26px 16px}
    .pdf-parity-meta,.pdf-parity-kpis{grid-template-columns:1fr}
    .pdf-parity-section-head{grid-template-columns:34px minmax(0,1fr)}
    .pdf-parity-section-head .section-note{grid-column:2;text-align:left;margin-top:2px}
    .pdf-parity-kpi{min-height:0}
    .pdf-parity-kpi > strong{font-size:24px}
    .pdf-parity-footer{display:block}
    .pdf-parity-footer span{display:block;margin-top:4px}
}

/* ================================================================
   STAGE 7 — compact report controls + security/users + action clarity
   ================================================================ */

.report-workspace-header{margin-bottom:18px}
.report-control-card{background:#fff;border:1px solid #dfd9d0;border-radius:10px;overflow:hidden;margin-bottom:22px}
.report-control-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:28px;padding:22px 24px 18px;border-bottom:1px solid #e8e2da}
.report-control-card-head h2{margin:5px 0 4px;font-size:18px;line-height:1.2}
.report-control-card-head p{margin:0;color:#8b929a;font-size:12px;line-height:1.5}
.compact-range-form{padding:20px 24px 0}
.compact-range-primary{display:grid;grid-template-columns:minmax(220px,.75fr) minmax(170px,.55fr) minmax(170px,.55fr);gap:14px;align-items:end}
.compact-range-primary .field,.compact-range-comparison .field{margin:0}
.compact-range-comparison{display:grid;grid-template-columns:minmax(220px,.75fr) minmax(170px,.55fr) minmax(170px,.55fr);gap:14px;align-items:end;padding-top:14px}
.compact-range-toggle{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:16px;padding:12px 14px;border:1px solid #e5dfd7;border-radius:8px;background:#fbfaf8}
.compact-range-toggle-copy strong,.compact-range-toggle-copy span{display:block}
.compact-range-toggle-copy strong{font-size:12px;color:#343d48}
.compact-range-toggle-copy span{margin-top:2px;font-size:10px;color:#9298a0}
.compact-range-footer{display:flex;align-items:center;justify-content:space-between;gap:22px;margin:20px -24px 0;padding:15px 24px;border-top:1px solid #e8e2da;background:#fcfbf9}
.compact-range-footer-copy span,.compact-range-footer-copy strong{display:block}
.compact-range-footer-copy span{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#a0a5ac;font-weight:800}
.compact-range-footer-copy strong{margin-top:3px;font-size:11px;color:#4c5662;font-weight:650}
.compact-range-footer .primary-button{width:auto;min-width:170px;padding-left:24px;padding-right:24px}
.dashboard-compact-footer{margin-top:18px}
.period-readout{min-width:265px;padding:10px 14px;border:1px solid #dfd9d0;border-radius:8px;background:#fbfaf8;text-align:right}
.period-readout span,.period-readout strong,.period-readout small{display:block}
.period-readout span{font-size:8px;text-transform:uppercase;letter-spacing:.12em;color:#a1a6ad;font-weight:800}
.period-readout strong{margin-top:3px;font-size:11px;color:#343d48}
.period-readout small{margin-top:2px;font-size:9px;color:#90969e}

/* KPI parity with PDF */
.pdf-parity-kpis .metric-change.positive,.metric-change.positive{color:#16835f!important;font-weight:800}
.pdf-parity-kpis .metric-change.negative,.metric-change.negative{color:#c04d43!important;font-weight:800}
.pdf-parity-kpis .metric-change.neutral,.metric-change.neutral{color:#8b929a!important}

/* Report table actions */
.report-action-group,.actions-cell{white-space:nowrap}
.report-action-group{display:flex;align-items:center;gap:6px}
.inline-action-form{display:inline-flex;margin:0}
.table-link,.danger-button{display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:0 11px;border:1px solid #ddd7cf;border-radius:6px;background:#fff;color:#35404b;font-size:10px;font-weight:800;text-decoration:none;cursor:pointer}
.table-link:hover{border-color:#ff7417;color:#ff7417;background:#fffaf6}
.danger-button{border-color:#edd8d5;color:#b94c43;background:#fffafa}
.danger-button:hover{border-color:#c04d43;color:#fff;background:#c04d43}

/* Settings & users */
.security-overview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-bottom:20px}
.security-summary-card{padding:20px;border:1px solid #e2ddd5;border-radius:9px;background:#fff}
.security-summary-card span,.security-summary-card strong,.security-summary-card p{display:block}
.security-summary-card span{font-size:9px;text-transform:uppercase;letter-spacing:.09em;color:#949aa2;font-weight:800}
.security-summary-card strong{margin-top:7px;font-size:28px;line-height:1;color:#26303c}
.security-summary-card p{margin:10px 0 0;color:#7c848e;font-size:11px;line-height:1.55}
.settings-users-panel{padding:0;overflow:hidden}
.settings-users-panel .panel-heading{padding:20px 22px 15px;border-bottom:1px solid #e5dfd7;margin:0}
.user-access-table td{vertical-align:middle}
.role-badge{display:inline-flex;padding:4px 7px;border-radius:999px;background:#f1f2f3;color:#56606b;font-size:9px;font-weight:800}
.role-badge.admin{background:#fff0e6;color:#d85f0f}
.access-all{font-size:10px;font-weight:700;color:#16835f}
.muted-text{color:#9a9fa7;font-size:10px}
.user-editor-card{overflow:hidden}
.account-access-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.account-access-option{position:relative;display:flex;align-items:center;gap:11px;padding:13px 14px;border:1px solid #e3ded7;border-radius:8px;background:#fbfaf8;cursor:pointer;transition:.15s ease}
.account-access-option:hover{border-color:#f7b98e;background:#fffaf6}
.account-access-option input{position:absolute;opacity:0;pointer-events:none}
.account-access-check{width:18px;height:18px;border:1.5px solid #b9bec4;border-radius:5px;background:#fff;position:relative;flex:0 0 18px}
.account-access-option input:checked + .account-access-check{background:#ff7417;border-color:#ff7417}
.account-access-option input:checked + .account-access-check:after{content:'✓';position:absolute;color:#fff;font-size:12px;font-weight:900;left:3px;top:-1px}
.account-access-copy strong,.account-access-copy small{display:block}
.account-access-copy strong{font-size:11px;color:#303945}
.account-access-copy small{margin-top:3px;font-size:9px;color:#8c939b}
.admin-access-note{display:none;margin-top:10px;padding:10px 12px;border-radius:7px;background:#f4f7f5;color:#49715d;font-size:10px}
.account-access-section.admin-mode .account-access-grid{opacity:.38;pointer-events:none}
.single-option-row{grid-template-columns:minmax(0,1fr)}

/* General action visibility */
.page-actions{display:flex;align-items:center;gap:8px}
.secondary-button,.primary-button{white-space:nowrap}

@media(max-width:980px){
  .compact-range-primary,.compact-range-comparison{grid-template-columns:1fr 1fr}
  .preset-field{grid-column:1/-1}
  .account-access-grid{grid-template-columns:1fr}
}
@media(max-width:720px){
  .report-control-card-head{display:block}
  .period-readout{margin-top:14px;text-align:left;min-width:0}
  .compact-range-primary,.compact-range-comparison{grid-template-columns:1fr}
  .preset-field{grid-column:auto}
  .compact-range-footer{display:block}
  .compact-range-footer .primary-button{width:100%;margin-top:12px}
  .security-overview-grid{grid-template-columns:1fr}
}

/* ========================================================================
   Stage 10 — shared reporting builder + site-wide typography standardisation
   report.php is intentionally excluded because it lives in .report-preview-shell
   rather than .main-content.
   ======================================================================== */

/* Requested global content typography. Eyebrow text is intentionally untouched. */
.main-content h2{font-size:20px!important;line-height:1.25}
.main-content h3{font-size:16px!important;line-height:1.3}
.main-content p{font-size:12px!important;line-height:1.55}
.login-card p,.login-shell p{font-size:12px!important;line-height:1.55}

/* Same report-builder visual language used by reports.php and dashboard.php. */
.report-builder-v2{background:#fff;border:1px solid #e6dfd7;border-radius:18px;overflow:hidden;margin-bottom:24px}
.report-builder-v2__head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:26px 30px 22px;border-bottom:1px solid #eee8e1}
.report-builder-v2__head h2{margin:6px 0 7px;line-height:1.2;color:#202833}
.report-builder-v2__head p{margin:0;color:#7f8894;line-height:1.55;max-width:720px}
.report-builder-v2__client{display:flex;align-items:center;gap:12px;min-width:260px;padding:13px 15px;border:1px solid #eadfd3;border-radius:13px;background:#fcfbf9}
.report-builder-v2__client-dot{width:9px;height:9px;border-radius:50%;background:#22a06b;box-shadow:0 0 0 4px rgba(34,160,107,.1);flex:0 0 auto}
.report-builder-v2__client-copy span,.report-builder-v2__summary span{display:block;color:#9aa1aa;font-size:10px;font-weight:800;letter-spacing:.13em;text-transform:uppercase}
.report-builder-v2__client-copy strong{display:block;margin-top:3px;color:#202833;font-size:14px}
.report-builder-v2__client-copy small{display:block;margin-top:2px;color:#7f8894;font-size:12px}
.report-builder-v2__body{padding:26px 30px 0}
.report-step{border:1px solid #ece6de;border-radius:15px;background:#fff;padding:20px 20px 18px;margin-bottom:18px}
.report-step__top{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:17px}
.report-step__title-wrap{display:flex;align-items:flex-start;gap:12px}
.report-step__num{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:999px;background:rgba(249,115,22,.10);color:#f97316;font-size:11px;font-weight:850;flex:0 0 auto}
.report-step__title{margin:0;color:#202833;font-weight:800;line-height:1.25}
.report-step__desc{margin:4px 0 0;color:#8a929d;line-height:1.45}
.report-step__fields{display:grid;grid-template-columns:1.12fr 1fr 1fr;gap:14px;align-items:end}
.report-builder-v2 .field{margin-bottom:0}
.report-builder-v2 .field>span{display:block;margin:0 0 7px;color:#69727e;font-size:10.5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.report-builder-v2 .field input,.report-builder-v2 .field select{height:46px;background:#fff;border:1px solid #dcd6cf;border-radius:10px;padding:0 13px;color:#27313d}
.report-builder-v2 .field input:focus,.report-builder-v2 .field select:focus{border-color:#f97316;box-shadow:0 0 0 3px rgba(249,115,22,.08);outline:0}
.report-builder-v2__compare-switch{display:flex;align-items:center;gap:12px;padding:9px 12px;border:1px solid #ece6de;border-radius:12px;background:#fcfbf9;flex:0 0 auto}
.report-builder-v2__compare-switch strong{display:block;color:#27313d;font-size:13px}
.report-builder-v2__compare-switch small{display:block;color:#8a929d;font-size:11.5px;margin-top:2px}
.report-builder-v2__summary{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:2px}
.report-builder-v2__summary-card{padding:14px 15px;border:1px solid #ece6de;border-radius:12px;background:#fcfbf9}
.report-builder-v2__summary strong{display:block;margin-top:5px;color:#202833;font-size:14px;line-height:1.35}
.report-builder-v2__footer{display:flex;align-items:center;justify-content:space-between;gap:22px;margin:24px -30px 0;padding:20px 30px;border-top:1px solid #eee8e1;background:#fcfbf9}
.report-builder-v2__footer-copy strong{display:block;color:#27313d;font-size:13px}
.report-builder-v2__footer-copy span{display:block;margin-top:3px;color:#8a929d;font-size:11.5px}
.report-builder-v2__generate{min-width:220px;height:48px;border-radius:10px;font-weight:800}
.report-builder-v2 [data-compare-panel][hidden]{display:none!important}
.stage10-actions{display:flex;align-items:center;gap:10px;justify-content:flex-end}
.stage10-actions .secondary-button{height:48px;min-width:155px;border-radius:10px}
.dashboard-report-builder{margin-top:0}

@media(max-width:1000px){
  .report-builder-v2__head{flex-direction:column}
  .report-builder-v2__client{width:100%}
  .report-step__fields{grid-template-columns:1fr}
  .report-builder-v2__summary{grid-template-columns:1fr}
}
@media(max-width:700px){
  .report-builder-v2__head,.report-builder-v2__body{padding-left:18px;padding-right:18px}
  .report-builder-v2__footer{margin-left:-18px;margin-right:-18px;padding-left:18px;padding-right:18px;flex-direction:column;align-items:stretch}
  .report-builder-v2__generate,.stage10-actions .secondary-button{width:100%;min-width:0}
  .stage10-actions{flex-direction:column;width:100%}
  .report-step__top{flex-direction:column}
}


/* ========================================================================
   Stage 11 — reporting/schedule UI consistency
   report.php and PDF export styling are intentionally untouched.
   ======================================================================== */

/* Match the website's existing .panel geometry: 7px radius + compact spacing. */
.report-builder-v2{border-radius:7px!important;margin-bottom:14px!important}
.report-builder-v2__head{padding:14px 16px!important;gap:16px!important}
.report-builder-v2__client{min-width:220px!important;padding:10px 12px!important;border-radius:7px!important}
.report-builder-v2__body{padding:16px 16px 0!important}
.report-step{border-radius:7px!important;padding:14px 16px!important;margin-bottom:14px!important}
.report-step__top{margin-bottom:12px!important}
.report-step__num{width:27px!important;height:27px!important;border-radius:6px!important}
.report-step__fields{gap:12px 14px!important}
.report-builder-v2 .field input,.report-builder-v2 .field select{height:38px!important;border-radius:6px!important;padding:0 10px!important}
.report-builder-v2__compare-switch{padding:8px 10px!important;border-radius:7px!important}
.report-builder-v2__summary{gap:10px!important}
.report-builder-v2__summary-card{padding:10px 12px!important;border-radius:7px!important}
.report-builder-v2__footer{gap:16px!important;margin:16px -16px 0!important;padding:14px 16px!important}
.report-builder-v2__generate,.stage10-actions .secondary-button{height:38px!important;min-width:150px!important;border-radius:6px!important}

/* Schedules: same radius/padding rhythm as the rest of the app. */
.schedule-editor-card{margin-top:14px!important;border-radius:7px!important;box-shadow:none!important}
.schedule-editor-head{padding:14px 16px!important;gap:16px!important}
.schedule-status-chip{min-width:180px!important;padding:9px 12px!important;border-radius:6px!important}
.schedule-section{padding:16px!important}
.schedule-section-title{gap:10px!important;margin-bottom:12px!important}
.schedule-step{width:27px!important;height:27px!important;border-radius:6px!important}
.schedule-section-heading h3{margin:0!important;color:#303945!important}
.schedule-section-heading p{margin:3px 0 0!important;color:#90969e!important}
.schedule-account-context,.connection-details-card,.account-identity-item,.automation-option{border-radius:7px!important}
.schedule-account-context{margin-bottom:14px!important;padding:12px 14px!important}
.schedule-grid{gap:12px 14px!important}
.automation-options{gap:10px!important}
.automation-option{min-height:68px!important;padding:12px 14px!important}
.schedule-save-bar{padding:14px 16px!important}
.schedule-save-button{height:38px!important;border-radius:6px!important}

@media(max-width:700px){
  .report-builder-v2__head,.report-builder-v2__body{padding-left:14px!important;padding-right:14px!important}
  .report-builder-v2__footer{margin-left:-14px!important;margin-right:-14px!important;padding-left:14px!important;padding-right:14px!important}
}

/* ========================================================================
   Stage 12 — unified Reports-style forms + calendar schedule picker
   report.php and PDF styling remain intentionally untouched.
   ======================================================================== */

/* Dashboard: keep a clear visual break between analytics and controls. */
.dashboard-report-builder{
    margin-top:18px!important;
}

/* Schedules now use the same report-builder component family as Reports. */
.schedule-builder-v3{
    margin-top:0!important;
}
.schedule-builder-v3 .schedule-report-step:last-of-type{
    margin-bottom:12px!important;
}
.schedule-timing-layout{
    display:grid;
    grid-template-columns:minmax(0,1.35fr) minmax(260px,.65fr);
    gap:14px;
    align-items:stretch;
}
.schedule-calendar-card,
.schedule-time-card{
    border:1px solid #ece6de;
    border-radius:7px;
    background:#fcfbf9;
    padding:14px;
}
.schedule-calendar-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    margin-bottom:12px;
}
.schedule-calendar-head span,
.schedule-timezone-summary span,
.schedule-timing-summary span{
    display:block;
    color:#9aa1aa;
    font-size:10px;
    font-weight:800;
    letter-spacing:.11em;
    text-transform:uppercase;
}
.schedule-calendar-head strong,
.schedule-timezone-summary strong,
.schedule-timing-summary strong{
    display:block;
    margin-top:4px;
    color:#202833;
    font-size:14px;
    line-height:1.35;
}
.schedule-calendar-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:34px;
    height:34px;
    border-radius:6px;
    border:1px solid #eadfd3;
    background:#fff;
    color:#f97316;
    font-size:17px;
    font-weight:800;
}
.schedule-calendar-grid{
    display:grid;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:6px;
}
.schedule-day-button{
    appearance:none;
    width:100%;
    min-height:34px;
    border:1px solid #e4ddd5;
    border-radius:6px;
    background:#fff;
    color:#3b4551;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    transition:border-color .16s ease,background .16s ease,color .16s ease,box-shadow .16s ease;
}
.schedule-day-button:hover{
    border-color:#f97316;
    color:#d85f0c;
}
.schedule-day-button.selected{
    border-color:#f97316;
    background:#f97316;
    color:#fff;
    box-shadow:0 0 0 3px rgba(249,115,22,.08);
}
.schedule-calendar-note{
    margin:10px 0 0!important;
    color:#8a929d!important;
}
.schedule-time-card{
    display:flex;
    flex-direction:column;
    gap:12px;
}
.schedule-time-card .field{
    margin:0;
}
.schedule-timezone-summary,
.schedule-timing-summary{
    padding:11px 12px;
    border:1px solid #ece6de;
    border-radius:6px;
    background:#fff;
}
.schedule-timezone-summary small,
.schedule-timing-summary small{
    display:block;
    margin-top:3px;
    color:#8a929d;
    font-size:11px;
}
.schedule-recipient-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px 14px;
}
.schedule-recipient-grid .field{
    margin:0;
}
.schedule-recipient-to{
    grid-column:1/-1;
}
.schedule-automation-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}
.schedule-automation-option{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:68px;
    padding:12px 14px;
    border:1px solid #ece6de;
    border-radius:7px;
    background:#fcfbf9;
    cursor:pointer;
}
.schedule-automation-option>div{
    min-width:0;
}
.schedule-automation-option strong,
.schedule-automation-option span{
    display:block;
}
.schedule-automation-option strong{
    color:#27313d;
    font-size:13px;
}
.schedule-automation-option>div>span{
    margin-top:4px;
    color:#8a929d;
    font-size:11px;
    line-height:1.45;
}
.schedule-summary-grid{
    margin-top:0!important;
}
.schedule-history-panel{
    margin-top:18px;
}
.schedule-history-panel .panel-heading p{
    margin:4px 0 0;
    color:#8a929d;
}

/* User editor — same structural language as Reports. */
.user-builder-v3,
.password-builder-v3{
    margin-top:0!important;
}
.user-role-summary,
.password-user-summary{
    min-width:220px;
    padding:10px 12px;
    border:1px solid #eadfd3;
    border-radius:7px;
    background:#fcfbf9;
}
.user-role-summary span,
.password-user-summary span{
    display:block;
    color:#9aa1aa;
    font-size:10px;
    font-weight:800;
    letter-spacing:.11em;
    text-transform:uppercase;
}
.user-role-summary strong,
.password-user-summary strong{
    display:block;
    margin-top:4px;
    color:#202833;
    font-size:14px;
}
.user-role-summary small,
.password-user-summary small{
    display:block;
    margin-top:3px;
    color:#8a929d;
    font-size:11px;
}
.user-identity-fields{
    grid-template-columns:1fr 1fr!important;
}
.user-account-access-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
}
.user-account-access-option{
    position:relative;
    display:flex;
    align-items:center;
    gap:11px;
    min-height:62px;
    padding:11px 12px;
    border:1px solid #ece6de;
    border-radius:7px;
    background:#fcfbf9;
    cursor:pointer;
}
.user-account-access-option input{
    position:absolute;
    opacity:0;
    pointer-events:none;
}
.user-account-access-check{
    width:18px;
    height:18px;
    border:1px solid #bcc3cb;
    border-radius:5px;
    background:#fff;
    flex:0 0 auto;
    position:relative;
}
.user-account-access-option input:checked + .user-account-access-check{
    border-color:#f97316;
    background:#f97316;
}
.user-account-access-option input:checked + .user-account-access-check:after{
    content:'✓';
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#fff;
    font-size:12px;
    font-weight:900;
}
.user-account-access-copy strong,
.user-account-access-copy small{
    display:block;
}
.user-account-access-copy strong{
    color:#27313d;
    font-size:13px;
}
.user-account-access-copy small{
    margin-top:3px;
    color:#8a929d;
    font-size:11px;
}
.user-admin-note{
    display:flex;
    align-items:flex-start;
    gap:10px;
    margin-top:10px;
    padding:10px 12px;
    border:1px solid #dce9e2;
    border-radius:7px;
    background:#f5faf7;
}
.user-admin-note strong,
.user-admin-note span{
    display:block;
}
.user-admin-note strong{
    flex:0 0 auto;
    color:#347254;
    font-size:12px;
}
.user-admin-note span{
    color:#5f7b6b;
    font-size:11px;
    line-height:1.45;
}
#account-access-section.admin-mode .user-account-access-grid{
    opacity:.42;
    pointer-events:none;
}
.user-status-option{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    padding:12px 14px;
    border:1px solid #ece6de;
    border-radius:7px;
    background:#fcfbf9;
    cursor:pointer;
}
.user-status-option strong,
.user-status-option span{
    display:block;
}
.user-status-option strong{
    color:#27313d;
    font-size:13px;
}
.user-status-option>div>span{
    margin-top:3px;
    color:#8a929d;
    font-size:11px;
}
.user-summary-grid{
    margin-top:0!important;
}
.user-form-actions{
    display:flex;
    align-items:center;
    gap:10px;
}
.user-form-actions .secondary-button{
    min-height:38px;
}


.user-password-input-wrap{
    position:relative;
}
.user-password-input-wrap input{
    padding-right:62px!important;
}
.user-password-inline-button{
    position:absolute;
    top:50%;
    right:7px;
    transform:translateY(-50%);
    min-width:48px;
    height:26px;
    border:0;
    border-radius:5px;
    background:#f5f2ee;
    color:#3d4651;
    font-size:11px;
    font-weight:800;
    cursor:pointer;
}
.user-password-inline-button:hover{
    background:#ece7e1;
}
.user-password-tools{
    display:flex;
    flex-wrap:wrap;
    gap:7px;
    margin-top:8px;
}
.user-password-tool-button{
    min-height:30px!important;
    height:30px!important;
    padding:0 10px!important;
    font-size:11px!important;
}
.user-password-field>small{
    display:block;
    margin-top:7px;
    line-height:1.45;
}

/* Change-password page — same builder rhythm. */
.password-single-field{
    max-width:720px;
}
.password-single-field .field{
    margin:0;
}
.password-new-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px 14px;
}
.password-new-grid .field{
    margin:0;
}
.password-guidance-grid-v3{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
}
.password-guidance-item{
    min-height:70px;
    padding:12px 14px;
    border:1px solid #ece6de;
    border-radius:7px;
    background:#fcfbf9;
}
.password-guidance-item strong,
.password-guidance-item span{
    display:block;
}
.password-guidance-item strong{
    color:#27313d;
    font-size:13px;
}
.password-guidance-item span{
    margin-top:4px;
    color:#8a929d;
    font-size:11px;
    line-height:1.45;
}
.password-summary-grid{
    margin-top:0!important;
}

@media(max-width:1000px){
    .schedule-timing-layout{grid-template-columns:1fr}
    .schedule-automation-grid{grid-template-columns:1fr}
    .user-account-access-grid{grid-template-columns:1fr}
    .user-identity-fields{grid-template-columns:1fr!important}
    .password-guidance-grid-v3{grid-template-columns:1fr}
}
@media(max-width:700px){
    .schedule-recipient-grid,.password-new-grid{grid-template-columns:1fr}
    .schedule-recipient-to{grid-column:auto}
    .schedule-calendar-grid{grid-template-columns:repeat(7,minmax(32px,1fr));overflow-x:auto}
    .user-role-summary,.password-user-summary{width:100%;min-width:0}
    .user-form-actions{flex-direction:column;width:100%}
    .user-form-actions>*{width:100%}
}


/* Stage 15 — scheduled reporting rules */
.schedule-rule-preview{
    min-height:38px;
    border:1px solid #e8e1d8;
    border-radius:7px;
    background:#fbfaf8;
    padding:9px 11px;
    display:flex;
    flex-direction:column;
    justify-content:center;
}
.schedule-rule-preview>span{
    color:#8b94a0;
    font-size:10px;
    font-weight:800;
    letter-spacing:.11em;
    text-transform:uppercase;
    margin-bottom:3px;
}
.schedule-rule-preview>strong{
    color:#202833;
    font-size:12px;
    line-height:1.35;
}
.schedule-rule-preview>small{
    color:#8b94a0;
    font-size:11px;
    margin-top:3px;
    line-height:1.35;
}
.schedule-rule-note{
    background:rgba(249,115,22,.035);
}
.schedule-history-panel .report-table small{
    max-width:240px;
    white-space:normal;
}


/* ================================================================
   STAGE 17 — Paid Media report visuals + floating action feedback
   ================================================================ */

/* Floating, self-dismissing action feedback. */
.app-toast-stack{
    position:fixed;
    top:68px;
    right:24px;
    z-index:5000;
    width:min(390px,calc(100vw - 32px));
    pointer-events:none;
}
.app-toast{
    display:flex;
    align-items:flex-start;
    gap:11px;
    padding:13px 13px;
    border:1px solid #d8e7dd;
    border-radius:10px;
    background:#fff;
    box-shadow:0 14px 38px rgba(27,35,43,.14);
    pointer-events:auto;
    animation:toastIn .2s ease-out both;
}
.app-toast-success{border-color:#cfe6d9}
.app-toast-error{border-color:#efd3ce}
.app-toast-icon{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 27px;
    width:27px;
    height:27px;
    border-radius:50%;
    background:#eaf6ef;
    color:#16835f;
    font-size:14px;
    font-weight:900;
}
.app-toast-error .app-toast-icon{background:#fbefed;color:#c04d43}
.app-toast-copy{min-width:0;flex:1;padding-top:1px}
.app-toast-copy strong,.app-toast-copy span{display:block}
.app-toast-copy strong{color:#2d3742;font-size:11px;line-height:1.3}
.app-toast-copy span{margin-top:3px;color:#747c86;font-size:10px;line-height:1.45}
.app-toast-close{
    flex:0 0 auto;
    width:28px;
    height:28px;
    border:0;
    background:transparent;
    color:#969ca4;
    font-size:18px;
    line-height:1;
    cursor:pointer;
}
.app-toast.is-leaving{animation:toastOut .2s ease-in both}
@keyframes toastIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}
@keyframes toastOut{from{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-8px)}}

/* Meta report follows the existing PDF-parity visual language exactly. */
.meta-report-section{scroll-margin-top:20px}
.pdf-parity-kpis.meta-kpis{grid-template-columns:repeat(5,minmax(0,1fr))}
.pdf-parity-kpis.meta-kpis .pdf-parity-kpi{min-height:116px;padding:20px 20px}
.pdf-parity-kpis.meta-kpis .pdf-parity-kpi > strong{font-size:24px}
.meta-platform-chart{height:250px}
.meta-campaign-table td:first-child{min-width:250px;white-space:normal!important}
.meta-campaign-table td:not(:first-child),
.meta-campaign-table th:not(:first-child){text-align:right}

@media(max-width:1100px){
    .pdf-parity-kpis.meta-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px){
    .app-toast-stack{top:16px;right:16px;left:16px;width:auto}
    .pdf-parity-kpis.meta-kpis{grid-template-columns:1fr}
    .meta-platform-chart{height:220px}
}


/* Stage 18 — expanded Meta reporting */
.meta-targeting-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.meta-targeting-card{border:1px solid #e7e1da;border-radius:10px;padding:18px;background:#fff}
.meta-targeting-card h3{font-size:16px;margin:0 0 14px;color:#27313d}
.meta-target-row{display:grid;grid-template-columns:minmax(92px,140px) 1fr 58px;gap:10px;align-items:center;margin:9px 0;font-size:12px;color:#59636f}
.meta-target-track{height:8px;border-radius:999px;background:#f0ede9;overflow:hidden}
.meta-target-track i{display:block;height:100%;border-radius:999px;background:#ff6b17}
.meta-target-row strong{text-align:right;font-size:12px;color:#27313d}
.meta-ad-table .meta-ad-preview{min-width:300px;white-space:normal!important}
.meta-ad-preview strong,.meta-ad-preview small,.meta-ad-preview p{display:block}
.meta-ad-preview small{margin-top:4px;color:#8b929a}
.meta-ad-preview p{margin:7px 0 0;font-size:11px;line-height:1.45;color:#59636f;font-weight:400}
@media(max-width:900px){.meta-targeting-grid{grid-template-columns:1fr}.meta-target-row{grid-template-columns:110px 1fr 52px}}


/* ================================================================
   STAGE 19 — Meta targeting charts + rich Meta ad previews
   ================================================================ */

/* Targeting now follows the Google demographics visual language:
   proper chart cards rather than long percentage lists. */
.meta-targeting-section .pdf-parity-section-head{
    margin-bottom:16px;
}
.meta-targeting-chart-grid{
    align-items:stretch;
    gap:14px;
}
.meta-targeting-chart-card{
    min-width:0;
    padding:14px 16px;
}
.meta-targeting-chart-card .report-chart-wrap.small{
    height:220px;
}

/* Meta ad previews now mirror Search Ads Performance:
   headline/title, destination URL, primary text and context. */
.meta-ad-table{
    min-width:1320px;
}
.meta-ad-table th:first-child,
.meta-ad-table td:first-child{
    width:38%;
    min-width:410px;
}
.meta-ad-preview.search-ad-preview-cell strong{
    display:block;
    color:#2d3743;
    font-size:11px;
    line-height:1.45;
}
.meta-ad-preview.search-ad-preview-cell .ad-url{
    display:block;
    margin-top:4px;
    color:#47775e;
    font-size:9px;
    line-height:1.4;
    overflow-wrap:anywhere;
}
.meta-ad-primary-text{
    display:block!important;
    margin-top:6px!important;
    color:#737b86!important;
    font-size:9px!important;
    line-height:1.5!important;
}
.meta-ad-description{
    display:block!important;
    margin-top:5px!important;
    color:#9298a1!important;
    font-size:8px!important;
    line-height:1.45!important;
}
.meta-ad-context{
    display:flex;
    flex-wrap:wrap;
    gap:4px 10px;
    margin-top:7px;
    padding-top:7px;
    border-top:1px solid #eeeae4;
}
.meta-ad-context span{
    color:#9a9fa7;
    font-size:8px;
    line-height:1.35;
}

@media(max-width:900px){
    .meta-targeting-chart-card .report-chart-wrap.small{
        height:200px;
    }
}

/* ================================================================
   STAGE 20 — Meta targeting donuts + complete Meta ad preview
   ================================================================ */
.meta-targeting-donut-grid{
    align-items:stretch;
    gap:14px;
}
.meta-targeting-donut-card{
    min-width:0;
    padding:14px 16px;
}
.meta-targeting-donut-card .meta-donut-wrap{
    height:250px;
    min-height:250px;
}
.meta-ad-creative-headline{
    display:block!important;
    margin-top:6px!important;
    color:#3f4853!important;
    font-size:9px!important;
    font-weight:700!important;
    line-height:1.45!important;
}
.meta-ad-url-missing{
    color:#a0a6ad!important;
    font-style:italic;
}
.meta-ad-preview.search-ad-preview-cell .meta-ad-primary-text{
    margin-top:7px!important;
    font-size:9px!important;
    line-height:1.55!important;
    color:#737b86!important;
}
.meta-ad-preview.search-ad-preview-cell .meta-ad-description{
    margin-top:5px!important;
    font-size:8px!important;
    line-height:1.45!important;
    color:#9298a1!important;
}
@media(max-width:900px){
    .meta-targeting-donut-card .meta-donut-wrap{
        height:230px;
        min-height:230px;
    }
}


/* ================================================================
   STAGE 21 — demographic-card parity + Meta ad preview readability
   ================================================================ */
.demographic-grid > .pdf-parity-chart-card,
.meta-targeting-donut-grid > .pdf-parity-chart-card{
    margin-top:0;
    border:1px solid #ded8d0;
    border-radius:0;
    padding:18px 20px 14px;
    background:#fff;
    min-width:0;
}

.meta-ad-preview.search-ad-preview-cell{
    white-space:normal!important;
    overflow-wrap:anywhere;
    word-break:normal;
}
.meta-ad-preview-title{
    display:block;
    color:#2d3743;
    font-size:11px;
    line-height:1.4;
    font-weight:800;
}
.meta-ad-preview-url{
    display:block;
    margin-top:6px;
    color:#47775e;
    font-size:9px;
    line-height:1.45;
    overflow-wrap:anywhere;
}
.meta-ad-preview.search-ad-preview-cell .meta-ad-creative-headline{
    margin-top:7px!important;
}
.meta-ad-preview.search-ad-preview-cell .meta-ad-primary-text{
    margin-top:7px!important;
    max-width:100%;
}
.meta-ad-preview.search-ad-preview-cell .meta-ad-description{
    margin-top:6px!important;
    max-width:100%;
}
.meta-ad-context{
    display:block;
    margin-top:9px;
    padding-top:8px;
    border-top:1px solid #eeeae4;
}
.meta-ad-context-row{
    display:grid;
    grid-template-columns:64px minmax(0,1fr);
    gap:8px;
    margin-top:4px;
    min-width:0;
}
.meta-ad-context-row:first-child{margin-top:0}
.meta-ad-context-label{
    color:#9a9fa7!important;
    font-size:8px!important;
    font-weight:800;
    text-transform:uppercase;
    letter-spacing:.04em;
}
.meta-ad-context-row > span:last-child{
    color:#66707c;
    font-size:8px;
    line-height:1.4;
    overflow-wrap:anywhere;
}


/* ================================================================
   STAGE 22 — report generation feedback + strict Meta ad preview
   ================================================================ */

/* Keep Google and Meta demographic cards visually identical. */
.demographic-grid > .pdf-parity-chart-card,
.meta-targeting-donut-grid > .pdf-parity-chart-card{
    border:1px solid #ded8d0!important;
    background:#fff!important;
    padding:18px 20px 14px!important;
    min-width:0;
}

/* Match the supplied Meta reference: thumbnail, blue ad title/domain, copy. */
.meta-ad-preview-image{
    margin:0 0 8px;
}
.meta-ad-preview-image img{
    display:block;
    width:150px;
    max-width:100%;
    height:auto;
    max-height:115px;
    object-fit:cover;
}
.meta-ad-preview-title{
    color:#355ca8!important;
    font-weight:800!important;
    font-size:11px!important;
    line-height:1.35!important;
}
.meta-ad-preview-url{
    margin-top:3px!important;
    color:#355ca8!important;
    font-size:10px!important;
    line-height:1.3!important;
}
.meta-ad-preview.search-ad-preview-cell .meta-ad-primary-text{
    margin-top:4px!important;
    color:#68717d!important;
    font-size:10px!important;
    line-height:1.45!important;
}

/* Live generation state in Generated reports. */
.status-badge.generating{
    display:inline-flex;
    align-items:center;
    gap:7px;
    background:#fff4e9;
    color:#c95d0a;
}
.report-generation-spinner{
    width:12px;
    height:12px;
    border:2px solid rgba(249,115,22,.25);
    border-top-color:#f97316;
    border-radius:50%;
    animation:report-spin .8s linear infinite;
    flex:0 0 auto;
}
@keyframes report-spin{
    to{transform:rotate(360deg)}
}
.report-generating-row td{
    background:#fffdf9;
}
.report-generating-copy{
    display:flex;
    align-items:center;
    gap:8px;
    color:#8a6b50;
    font-size:11px;
}
.report-pending{
    color:#9a806b;
    font-size:11px;
}
.report-builder-v2__generate.is-generating{
    opacity:.78;
    cursor:wait;
}
.report-builder-v2__generate.is-generating::before{
    content:"";
    display:inline-block;
    width:12px;
    height:12px;
    margin-right:8px;
    vertical-align:-2px;
    border:2px solid rgba(255,255,255,.35);
    border-top-color:#fff;
    border-radius:50%;
    animation:report-spin .8s linear infinite;
}


/* Stage 24 — Meta KPI comparison parity + automatic one-line value fitting */
.pdf-parity-kpis.meta-kpis .pdf-parity-kpi > strong.meta-kpi-value{
    white-space:nowrap;
    overflow-wrap:normal;
    word-break:normal;
}
.pdf-parity-kpis.meta-kpis .pdf-parity-kpi > strong.meta-kpi-value--compact{
    font-size:19px!important;
    letter-spacing:-.045em;
}
.pdf-parity-kpis.meta-kpis .pdf-parity-kpi > strong.meta-kpi-value--tight{
    font-size:16px!important;
    letter-spacing:-.05em;
}
.pdf-parity-kpis.meta-kpis .pdf-parity-kpi > small{
    white-space:nowrap;
}


/* Stage 25 — true no-wrap for Meta KPI values.
   Currency strings now also use a Unicode NBSP between currency and amount. */
.pdf-parity-kpis.meta-kpis .pdf-parity-kpi > strong.meta-kpi-value{
    display:block;
    white-space:nowrap!important;
    word-break:keep-all!important;
    overflow-wrap:normal!important;
    hyphens:none!important;
}

/* ================================================================
   STAGE 35 — Meta ad description cleanup + strict two-line preview
   ================================================================ */
.search-ad-preview-cell .meta-ad-description-clamp{
    display:-webkit-box!important;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:normal!important;
    overflow-wrap:anywhere;
    word-break:normal;
    max-height:3em;
    margin-top:5px;
    color:#707883;
    font-size:9px;
    line-height:1.5;
}

