/* BE IT Ads Command Center — Stylesheet v4.0
   Phase 4: page-level UI/UX templates for dashboard, platform, and management pages */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --sidebar-bg:#0f1117;--sidebar-border:#1e2130;--sidebar-width:210px;
  --nav-hover:#1a1e2e;--nav-active:#1e2a45;--nav-active-text:#60a5fa;
  --nav-text:#9ca3af;--nav-sep:#374151;
  --bg:#f1f5f9;--surface:#fff;--surface-hover:#f8fafc;
  --border:#e2e8f0;--border-focus:#3b82f6;
  --text-primary:#0f172a;--text-secondary:#475569;--text-muted:#94a3b8;
  --blue:#3b82f6;--blue-dark:#2563eb;--blue-light:#eff6ff;
  --green:#22c55e;--green-light:#dcfce7;
  --red:#ef4444;--red-light:#fee2e2;
  --orange:#f59e0b;--orange-light:#fff7ed;
  --purple:#8b5cf6;--purple-light:#f5f3ff;
  --radius-sm:6px;--radius:8px;--radius-lg:12px;--radius-xl:16px;
  --shadow-xs:0 1px 2px rgba(0,0,0,.05);
  --shadow-sm:0 1px 3px rgba(0,0,0,.08);
  --shadow:0 4px 6px rgba(0,0,0,.07);
  --shadow-lg:0 10px 25px rgba(0,0,0,.1);
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-mono:'JetBrains Mono',Consolas,monospace;
  --t:.15s ease;
}
html{font-size:14px;height:100%}
body{font-family:var(--font);color:var(--text-primary);background:var(--bg);
  -webkit-font-smoothing:antialiased;min-height:100vh;overflow-x:hidden}
a{color:var(--blue);text-decoration:none}
a:hover{text-decoration:underline}
code{font-family:var(--font-mono);font-size:.875em;background:#f1f5f9;padding:2px 5px;border-radius:4px}
img{max-width:100%}

/* ── APP LAYOUT ── */
.app-layout{display:flex;min-height:100vh}

/* ── SIDEBAR ── */
.sidebar{
  width:var(--sidebar-width);min-width:var(--sidebar-width);max-width:var(--sidebar-width);
  background:var(--sidebar-bg);border-right:1px solid var(--sidebar-border);
  display:flex;flex-direction:column;
  position:fixed;top:0;left:0;bottom:0;
  overflow-y:auto;overflow-x:hidden;z-index:100;
  scrollbar-width:thin;scrollbar-color:#374151 transparent;
}
.sidebar::-webkit-scrollbar{width:3px}
.sidebar::-webkit-scrollbar-thumb{background:#374151;border-radius:2px}
.sidebar-logo{padding:15px 14px 13px;border-bottom:1px solid var(--sidebar-border);flex-shrink:0}
.logo-box{display:inline-flex;align-items:center;border-radius:8px;overflow:hidden;font-weight:800;font-size:15px;letter-spacing:-.3px}
.logo-be{padding:6px 8px;background:var(--blue);color:#fff}
.logo-it{padding:6px 8px;background:#1e2a45;color:#60a5fa}
.sidebar-nav{flex:1;padding:8px;display:flex;flex-direction:column;gap:1px}
.nav-separator{font-size:9.5px;font-weight:700;color:var(--nav-sep);text-transform:uppercase;letter-spacing:.1em;padding:12px 8px 4px;flex-shrink:0}
.nav-item{
  display:flex;align-items:center;gap:8px;padding:7px 9px;
  border-radius:var(--radius-sm);color:var(--nav-text);
  font-size:12.5px;font-weight:450;transition:background var(--t),color var(--t);
  cursor:pointer;text-decoration:none;white-space:nowrap;overflow:hidden;
}
.nav-item:hover{background:var(--nav-hover);color:#e2e8f0;text-decoration:none}
.nav-item.active{background:var(--nav-active);color:var(--nav-active-text);font-weight:600}
.nav-icon{width:15px;height:15px;flex-shrink:0}
.sidebar-user{padding:10px;border-top:1px solid var(--sidebar-border);display:flex;align-items:center;gap:8px;flex-shrink:0;min-width:0}
.user-avatar{width:28px;height:28px;border-radius:50%;background:linear-gradient(135deg,var(--blue),var(--purple));color:#fff;font-size:10.5px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.user-info{flex:1;min-width:0;overflow:hidden}
.user-name{font-size:11.5px;font-weight:600;color:#e2e8f0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-email{font-size:10px;color:var(--nav-text);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-role{display:inline-flex;align-items:center;width:max-content;max-width:100%;margin-top:3px;padding:2px 6px;border:1px solid rgba(96,165,250,.18);border-radius:999px;background:rgba(37,99,235,.10);color:#bfdbfe;font-size:9px;font-weight:850;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-logout{color:var(--nav-text);flex-shrink:0;display:flex;padding:3px;border-radius:4px;transition:color var(--t),background var(--t)}
.user-logout:hover{color:var(--red);background:rgba(239,68,68,.12)}

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

/* ── MOBILE TOP BAR ── */
.top-bar{display:none;align-items:center;justify-content:space-between;padding:11px 16px;background:var(--sidebar-bg);border-bottom:1px solid var(--sidebar-border);flex-shrink:0}
.top-bar-toggle{background:none;border:none;cursor:pointer;color:#e2e8f0;display:flex;align-items:center;padding:4px;border-radius:6px}

/* ── PAGE HEADER — FIXED ALIGNMENT ── */
.page-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  padding:20px 24px 10px;
  gap:14px 18px;
  flex-wrap:wrap;
  flex-shrink:0;
  background:linear-gradient(180deg,#f8fafc 0%,#eef2f7 100%);
  border-bottom:1px solid #e5edf5;
}
.page-header-left{
  display:flex;
  align-items:center;
  gap:12px;
  flex:1 1 360px;
  min-width:0;
}
.page-icon{
  width:38px;height:38px;min-width:38px;
  border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  background:var(--blue-light);color:var(--blue);
  flex-shrink:0;
}
/* Page title group */
.page-header-text{
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-width:0;
}
.page-title{
  font-size:19px;font-weight:800;color:var(--text-primary);
  line-height:1.25;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.page-header-right{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 1 auto;flex-wrap:wrap;margin-left:auto;padding-top:3px}
.page-header-right .btn{height:32px}

/* ── FILTER BAR ── */
.filter-bar{
  display:flex;align-items:flex-end;gap:10px 12px;
  padding:12px 24px;background:var(--surface);
  border-bottom:1px solid var(--border);flex-wrap:wrap;flex-shrink:0;
  box-shadow:0 1px 0 rgba(15,23,42,.02);
}
.filter-group{display:flex;flex-direction:column;gap:4px;min-width:max-content}
.filter-label{font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.07em}
.date-range-picker{display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.date-range-picker span{color:var(--text-muted);font-size:11px}
.date-preset-btns{display:flex;gap:4px;flex-wrap:wrap;align-items:center}
.date-preset-btn{padding:4px 8px;border-radius:99px;font-size:10.5px;font-weight:600;border:1px solid var(--border);background:var(--surface);color:var(--text-secondary);cursor:pointer;transition:all var(--t);white-space:nowrap}
.date-preset-btn:hover{border-color:var(--blue);color:var(--blue);background:var(--blue-light)}
.date-preset-btn.active{background:var(--blue);border-color:var(--blue);color:#fff}
.filter-bar .btn{height:34px}
.filter-bar .badge,.filter-bar .freshness-badge,.filter-bar .currency-selector,.filter-bar .currency-indicator{align-self:center}
.filter-bar > div[style*="display:flex"]{align-items:center!important}
.filter-bar > div[style*="margin-left:auto"]{margin-left:auto!important}
.filter-bar select{min-height:34px}
.filter-bar input[type="date"]{min-height:34px}

/* ── FORM INPUTS ── */
input[type="date"],input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="url"],select,textarea{
  padding:7px 10px;border:1px solid var(--border);border-radius:var(--radius);
  font-size:13px;font-family:var(--font);color:var(--text-primary);
  background:var(--surface);outline:none;
  transition:border-color var(--t),box-shadow var(--t);
  max-width:100%;
}
input:focus,select:focus,textarea:focus{border-color:var(--border-focus);box-shadow:0 0 0 3px rgba(59,130,246,.12)}
select{cursor:pointer}
textarea{resize:vertical;min-height:80px}

/* ── PAGE CONTENT ── */
.page-content{flex:1;padding:18px 24px 28px;display:flex;flex-direction:column;gap:16px;min-width:0;overflow-x:hidden}
.flashes-wrap{padding:0 24px;display:flex;flex-direction:column;gap:6px;margin-top:10px}

/* ══════════════════════════════════════════════════════════
   KPI CARDS — FIXED: text fully visible, no truncation of values
   ══════════════════════════════════════════════════════════ */
.kpi-grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.kpi-grid-2{grid-template-columns:repeat(2,minmax(170px,1fr))}
.kpi-grid-3{grid-template-columns:repeat(3,minmax(170px,1fr))}
.kpi-grid-4{grid-template-columns:repeat(4,minmax(170px,1fr))}
.kpi-grid-5,.kpi-grid-6,.kpi-grid-7,.kpi-grid-8{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}

.kpi-card{
  background:var(--surface);border:1px solid var(--border);
  border-radius:10px;
  padding:10px 12px;
  display:flex;align-items:center;gap:10px;
  box-shadow:var(--shadow-sm);
  transition:box-shadow var(--t),transform var(--t);
  min-width:0;min-height:72px;overflow:visible;
}
.kpi-card:hover{box-shadow:var(--shadow);transform:translateY(-1px)}

.kpi-icon{
  width:28px;height:28px;min-width:28px;
  border-radius:7px;display:flex;align-items:center;justify-content:center;
  font-size:14px;flex-shrink:0;
}
.kpi-body{
  flex:1;min-width:0;
  display:flex;flex-direction:column;
  justify-content:center;
}
.kpi-label{
  font-size:9.5px;font-weight:800;color:var(--text-muted);
  text-transform:uppercase;letter-spacing:.06em;
  white-space:normal;overflow:visible;text-overflow:clip;
  line-height:1.25;overflow-wrap:anywhere;
}
.kpi-value{
  font-size:clamp(15px,1vw,19px);font-weight:850;color:var(--text-primary);
  margin-top:3px;
  white-space:normal;overflow:visible;text-overflow:clip;
  line-height:1.2;
  letter-spacing:0;
  overflow-wrap:anywhere;
  font-variant-numeric:tabular-nums;
}
.kpi-delta{
  font-size:9.5px;margin-top:3px;font-weight:700;
  white-space:normal;overflow:visible;text-overflow:clip;
  line-height:1.25;overflow-wrap:anywhere;
}
.delta-positive{color:var(--green)}
.delta-negative{color:var(--red)}
.delta-neutral{color:var(--text-muted)}

/* ── CHARTS ── */
.charts-row{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.charts-row-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}
.chart-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px 17px;box-shadow:var(--shadow-sm);min-width:0;overflow:hidden}
.chart-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;gap:10px;flex-wrap:wrap;min-width:0}
.chart-title{font-size:13.5px;font-weight:800;color:var(--text-primary);line-height:1.3;min-width:0;overflow:hidden;text-overflow:ellipsis}
.chart-body{position:relative;height:var(--custom-chart-height,230px);width:100%;min-height:220px}

/* ── DATA TABLES ── */
.table-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);overflow:hidden;min-width:0}
.table-header{display:flex;align-items:center;justify-content:space-between;padding:13px 17px;border-bottom:1px solid var(--border);gap:8px;flex-wrap:wrap;min-width:0}
.table-title{font-size:13px;font-weight:700;color:var(--text-primary);white-space:nowrap}
.table-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.search-box{display:flex;align-items:center;gap:5px;padding:5px 9px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);transition:border-color var(--t)}
.search-box:focus-within{border-color:var(--border-focus)}
.search-box input{border:none;outline:none;background:none;font-size:12.5px;width:150px;padding:0}
.search-box svg{color:var(--text-muted);flex-shrink:0}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;min-width:400px}
thead th{padding:9px 11px;text-align:left;font-size:10px;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.07em;background:#f8fafc;border-bottom:1px solid var(--border);white-space:nowrap;cursor:pointer;user-select:none}
thead th:hover{color:var(--text-primary)}
thead th.text-right{text-align:right}
thead th.no-sort{cursor:default}
tbody tr{border-bottom:1px solid #f1f5f9;transition:background var(--t)}
tbody tr:last-child{border-bottom:none}
tbody tr:hover{background:#fafafa}
tbody td{padding:9px 11px;font-size:12.5px;color:var(--text-primary);vertical-align:middle;white-space:nowrap;max-width:280px;overflow:hidden;text-overflow:ellipsis}
tbody td.text-right{text-align:right}
tbody td.text-muted{color:var(--text-secondary)}
tbody td.wrap{white-space:normal;max-width:none}

/* Hierarchy rows */
.hier-row-l0 td:first-child{padding-left:11px}
.hier-row-l1 td:first-child{padding-left:26px}
.hier-row-l2 td:first-child{padding-left:43px;color:var(--text-secondary);font-size:12px}
.expand-btn{background:none;border:none;cursor:pointer;color:var(--text-muted);width:16px;height:16px;font-size:10px;display:inline-flex;align-items:center;justify-content:center;border-radius:3px;transition:all var(--t);flex-shrink:0;vertical-align:middle;margin-right:3px}
.expand-btn:hover{background:var(--border);color:var(--text-primary)}

/* Metric colors */
.metric-roas-high{color:#15803d;font-weight:700}
.metric-roas-low{color:#dc2626;font-weight:700}
.metric-cpa-high{color:#dc2626;font-weight:700}
.metric-ctr-high{color:#15803d;font-weight:700}

/* ── BADGES ── */
.badge{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:99px;font-size:10.5px;font-weight:700;white-space:nowrap}
.badge-active{background:var(--green-light);color:#15803d}
.badge-paused{background:#fef3c7;color:#b45309}
.badge-error{background:var(--red-light);color:#dc2626}
.badge-warning{background:var(--orange-light);color:#c2410c}
.badge-draft{background:#f1f5f9;color:var(--text-secondary)}
.badge-info{background:var(--blue-light);color:#1d4ed8}
.badge-purple{background:var(--purple-light);color:#6d28d9}
.badge-dot{width:5px;height:5px;border-radius:50%;background:currentColor;flex-shrink:0}

.freshness-badge{display:inline-flex;align-items:center;gap:6px;padding:5px 9px;border-radius:999px;border:1px solid var(--border);background:#fff;color:var(--text-secondary);font-size:11px;font-weight:700;white-space:nowrap;text-decoration:none}
.freshness-badge:hover{text-decoration:none;background:var(--surface-hover)}
.freshness-badge small{font-size:10px;font-weight:600;color:var(--text-muted)}
.fresh-good{border-color:#bbf7d0;background:#f0fdf4;color:#15803d}
.fresh-warn{border-color:#fde68a;background:#fffbeb;color:#b45309}
.fresh-danger{border-color:#fecaca;background:#fef2f2;color:#b91c1c}
.health-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}
.metric-stack{display:grid;gap:7px}
.status-pill{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:999px;font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}
.status-ok{background:#dcfce7;color:#15803d}
.status-warn{background:#fef3c7;color:#b45309}
.status-danger{background:#fee2e2;color:#b91c1c}.print-only{display:none}
@media print{.no-print,.sidebar,.top-bar,.page-header-right,.filter-bar,.beit-customize-btn,.beit-customizer-panel{display:none!important}.main-content{margin-left:0!important}.page-content{padding:0!important}.print-only{display:block}}

/* Universal customization */
.beit-customize-btn{position:fixed;right:18px;bottom:18px;z-index:800;background:#0f172a;color:#fff;border:1px solid #1f2937;border-radius:999px;padding:9px 13px;font-size:12px;font-weight:800;box-shadow:0 10px 24px rgba(15,23,42,.22);cursor:pointer}
.beit-customize-btn:hover{background:#1f2937}
.beit-customizer-panel{position:fixed;top:50%;left:50%;right:auto;width:min(1120px,calc(100vw - 56px));max-width:calc(100vw - 56px);height:min(780px,calc(100vh - 70px));max-height:calc(100vh - 70px);background:#fff;border:1px solid var(--border);border-radius:10px;box-shadow:0 0 0 9999px rgba(15,23,42,.50),0 22px 60px rgba(15,23,42,.28);z-index:1200;display:flex;flex-direction:column;transform:translate(-50%,-47%) scale(.985);opacity:0;pointer-events:none;transition:opacity .16s ease,transform .16s ease;overflow:hidden}
.beit-customizer-panel.open{right:auto;transform:translate(-50%,-50%) scale(1);opacity:1;pointer-events:auto}
.customizer-head{padding:16px 18px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:10px}
.customizer-head strong{display:block;font-size:14px}
.customizer-head small{display:block;font-size:10.5px;color:var(--text-muted);margin-top:2px}
.customizer-body{padding:14px 16px;overflow-y:auto;display:flex;flex-direction:column;gap:14px}
.customizer-foot{padding:12px 16px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px}
.customizer-section{border:1px solid var(--border);border-radius:10px;padding:12px;background:#fff}
.customizer-title{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.07em;color:var(--text-muted);margin-bottom:9px}
.custom-check{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-secondary);padding:5px 0;cursor:pointer}
.custom-check input{width:14px;height:14px;flex-shrink:0}
.customizer-add-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:10px 0}
.customizer-add-grid-wide{grid-template-columns:1fr 1fr}
.customizer-add-grid input,.customizer-add-grid select{min-width:0;width:100%;font-size:12px}
.customizer-widget-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;border-bottom:1px solid #f1f5f9}
.customizer-widget-row:last-child{border-bottom:none}
.customizer-widget-row strong{display:block;font-size:12.5px}
.customizer-widget-row small{display:block;font-size:10.5px;color:var(--text-muted);margin-top:2px}
.customizer-muted{font-size:12px;color:var(--text-muted);line-height:1.5}
.customizer-details{border-top:1px solid #f1f5f9;padding:8px 0}
.customizer-details:first-of-type{border-top:0}
.customizer-details summary{font-size:12px;font-weight:700;cursor:pointer}
.customizer-check-grid{display:grid;grid-template-columns:1fr;gap:1px;margin-top:7px;max-height:240px;overflow:auto}
.custom-widgets-shell{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--custom-widget-min,220px),1fr));gap:12px}
.custom-widget-card{min-height:88px}
.custom-widget-card.chart-card{padding:14px}
.beit-table-panel{z-index:1210}
.beit-customizer-panel.beit-table-panel{width:min(1220px,calc(100vw - 56px))}
.beit-table-panel .table-studio-head{padding:18px 20px}
.table-studio-body{display:grid;grid-template-columns:minmax(0,1fr) 330px;min-height:0;flex:1;overflow:hidden}
.table-studio-main{padding:14px 20px 18px;overflow:auto;border-right:1px solid var(--border);display:flex;flex-direction:column;gap:14px}
.table-studio-selected{padding:18px 14px 14px;overflow:hidden;display:flex;flex-direction:column;gap:12px;background:#fff}
.selected-head strong{display:block;font-size:16px;color:var(--text-primary)}
.selected-head small{display:block;font-size:12.5px;line-height:1.35;color:var(--text-secondary);margin-top:4px}
.table-studio-toolbar{display:grid;grid-template-columns:minmax(220px,1fr) auto auto;gap:8px;align-items:center}
.studio-search{display:flex;align-items:center;gap:8px;border:1px solid var(--border);border-radius:7px;background:#fff;padding:0 10px;height:44px;min-width:0}
.studio-search.compact{height:36px}
.studio-search span{color:var(--text-muted);font-weight:800}
.studio-search input{border:0;outline:0;width:100%;min-width:0;font-size:13px;background:transparent;color:var(--text-primary)}
.table-studio-tabs{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.table-studio-tabs button{padding:9px 14px;border:0;border-radius:6px;font-size:13px;font-weight:700;color:var(--text-secondary);background:transparent;cursor:pointer}
.table-studio-tabs button.active{background:#e0f2fe;color:#0369a1}
.table-studio-tabs button:hover{background:#f1f5f9;color:var(--text-primary)}
.table-studio-metrics{padding:0;border:0}
.table-studio-metrics>.customizer-title{padding:0 0 6px}
.studio-metric-group{border:0;border-bottom:1px solid #edf2f7;padding:10px 0}
.studio-metric-group summary{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px;font-weight:800;color:var(--text-primary);cursor:pointer;list-style:none}
.studio-metric-group summary::-webkit-details-marker{display:none}
.studio-metric-group summary small{font-size:11px;color:var(--text-muted);font-weight:700}
.table-studio-formula textarea{width:100%;min-height:74px;margin:8px 0;border:1px solid var(--border);border-radius:8px;padding:9px 10px;font:inherit;resize:vertical}
.studio-formula-grid{display:grid;grid-template-columns:minmax(0,1fr) 150px;gap:8px}
.studio-formula-grid input,.studio-formula-grid select{min-width:0}
.table-studio-custom{border:0;padding:0;min-height:360px}
.custom-metric-list-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.custom-metric-list-head strong{display:block;font-size:15px;color:var(--text-primary)}
.custom-metric-list-head small{display:block;font-size:11px;color:var(--text-muted);margin-top:2px}
.custom-metric-empty{min-height:330px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:var(--text-secondary);gap:8px}
.custom-metric-empty strong{font-size:16px;color:var(--text-primary)}
.custom-metric-empty p{max-width:360px;margin:0 0 8px;line-height:1.4}
.custom-metric-illustration{position:relative;width:142px;height:142px;border-radius:999px;background:#ead8f0;margin-bottom:12px;overflow:hidden}
.custom-metric-illustration span,.custom-metric-illustration i,.custom-metric-illustration b{position:absolute;bottom:28px;width:28px;background:#a855b7;display:block}
.custom-metric-illustration span{left:36px;height:42px}
.custom-metric-illustration i{left:72px;height:74px;background:#c084d0}
.custom-metric-illustration b{left:108px;height:92px;background:#9d4aa8}
.custom-metric-illustration:after{content:'';position:absolute;left:18px;top:42px;width:106px;height:62px;border-left:3px solid #fff;border-bottom:3px solid #fff;transform:skewY(-20deg);opacity:.9}
.custom-metric-create h3{font-size:18px;margin:0;color:var(--text-primary)}
.custom-metric-create p{margin:3px 0 14px;color:var(--text-secondary);line-height:1.4}
.custom-builder-toolbar{display:grid;grid-template-columns:minmax(180px,250px) repeat(6,74px);gap:4px;margin-bottom:8px}
.custom-builder-toolbar select,.custom-builder-toolbar button{height:44px}
.formula-editor-wrap{position:relative}
.formula-editor-wrap textarea{width:100%;min-height:208px;border:1px solid var(--border);border-radius:4px;padding:14px 15px;font:inherit;resize:vertical;line-height:1.5}
.metric-suggestions{position:absolute;left:10px;top:38px;width:min(340px,calc(100% - 20px));max-height:220px;overflow:auto;background:#fff;border:1px solid var(--border);border-radius:6px;box-shadow:var(--shadow-lg);padding:6px;z-index:5;display:none}
.metric-suggestions button{display:block;width:100%;padding:9px 10px;border:0;border-radius:4px;background:#fff;text-align:left;font:inherit;font-size:12.5px;color:var(--text-primary);cursor:pointer}
.metric-suggestions button:hover,.metric-suggestions button:first-child{background:#f1f5f9}
.custom-metric-grid{display:grid;grid-template-columns:minmax(0,1fr) 184px;gap:14px;margin-top:14px}
.custom-metric-grid label,.custom-desc{display:block;color:var(--text-primary)}
.custom-metric-grid strong,.custom-desc strong{display:block;font-size:13px;margin-bottom:6px}
.custom-desc strong span{color:var(--text-muted);font-weight:700}
.input-with-count{display:flex;align-items:center;border:1px solid var(--border);border-radius:5px;background:#fff;overflow:hidden}
.input-with-count:focus-within{border-color:var(--blue);box-shadow:0 0 0 1px var(--blue)}
.input-with-count input{border:0;outline:0;min-width:0;flex:1;padding:10px 12px;font:inherit;background:transparent}
.input-with-count span{padding:0 10px;color:var(--text-muted);font-size:12px;white-space:nowrap}
.custom-metric-grid select{width:100%;height:42px;border:1px solid var(--border);border-radius:5px;background:#fff;padding:0 10px;font:inherit}
.custom-desc{margin-top:14px}
.custom-create-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
.custom-metric-saved{border:1px solid var(--border);border-radius:7px;margin-bottom:8px;padding:10px 12px}
.table-studio-foot{align-items:center}
.table-studio-foot span{flex:1}
.beit-table-controls{display:inline-flex;align-items:center;gap:5px;flex-wrap:wrap}
.beit-preset-select{height:25px;min-width:92px;padding:3px 22px 3px 8px;font-size:11px;font-weight:700;border-radius:7px}
.beit-total-foot{display:table-footer-group}
.beit-total-foot td{background:#eef2f7;border-top:2px solid #cbd5e1;font-weight:900;color:#0f172a;padding:13px 11px;font-size:13px;white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
.beit-total-foot td.beit-total-label{text-align:left;color:#334155;text-transform:uppercase;letter-spacing:.04em}
.beit-total-row{box-shadow:0 -1px 0 #cbd5e1}
.table-wrap table{font-variant-numeric:tabular-nums}
.table-wrap thead th.text-right,.table-wrap tbody td.text-right,.table-wrap tfoot td.text-right{text-align:right;min-width:82px}
.table-wrap thead th:first-child,.table-wrap tbody td:first-child,.table-wrap tfoot td:first-child{min-width:180px}
.customizer-column-list{display:flex;flex-direction:column;gap:6px;max-height:280px;overflow:auto}
.table-studio-selected .customizer-column-list{max-height:none;flex:1;overflow:auto;border-top:1px solid var(--border)}
.table-studio-selected .customizer-column-row{padding:10px 0}
.table-studio-main .customizer-widget-row{padding:10px;border-radius:6px;border-bottom:0}
.table-studio-main .customizer-widget-row:hover{background:#f8fafc}
.customizer-column-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 0;border-bottom:1px solid #f1f5f9;font-size:12px}
.customizer-column-row:last-child{border-bottom:none}
.customizer-column-row.is-dragging{opacity:.55;background:#f8fafc}
.customizer-column-name{display:flex;align-items:center;gap:7px;min-width:0;font-weight:700}
.customizer-column-name span:last-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.customizer-column-actions{display:flex;align-items:center;gap:5px;flex-shrink:0}
.column-drag-handle{color:var(--text-muted);font-size:12px;cursor:grab;letter-spacing:-1px}
.column-remove-btn{width:22px;height:22px;border:1px solid #fecaca;border-radius:7px;background:#fff;color:#dc2626;font-size:12px;font-weight:900;line-height:1;cursor:pointer}
.column-remove-btn:hover{background:#fef2f2;border-color:#f87171}
.formula-ops{display:flex;gap:5px;flex-wrap:wrap;margin-bottom:8px}
.formula-token-grid{display:flex;gap:5px;flex-wrap:wrap;max-height:132px;overflow:auto;border:1px solid var(--border);border-radius:8px;padding:8px;margin-bottom:8px;background:#f8fafc}
.beit-sortable-th{position:relative;cursor:pointer;user-select:none}
.beit-sortable-th::after{content:'';font-size:9px;font-weight:900;color:var(--text-muted);margin-left:5px;text-transform:uppercase}
.beit-sortable-th.sort-asc::after{content:'^';color:var(--blue)}
.beit-sortable-th.sort-desc::after{content:'v';color:var(--blue)}
.table-zebra tbody tr:nth-child(even):not(.beit-total-row){background:#fcfcfd}
.sticky-table-head .table-wrap{max-height:70vh}
.sticky-table-head thead th{position:sticky;top:0;z-index:3}
.beit-resizable-table{table-layout:fixed}
.beit-resizable-table th{position:relative}
.column-resize-handle{position:absolute;top:0;right:-4px;width:8px;height:100%;cursor:col-resize;z-index:8;touch-action:none}
.column-resize-handle::after{content:'';position:absolute;top:18%;bottom:18%;left:3px;width:1px;background:#cbd5e1;opacity:0;transition:opacity var(--t)}
th:hover>.column-resize-handle::after,.is-resizing-column .column-resize-handle::after{opacity:1}
.is-resizing-column{cursor:col-resize!important;user-select:none}
.freeze-first-col .table-wrap{overflow:auto}
.freeze-first-col table.beit-main-table{border-collapse:separate;border-spacing:0}
.freeze-first-col table.beit-main-table th:not(:first-child),.freeze-first-col table.beit-main-table td:not(:first-child){position:relative;z-index:1}
.freeze-first-col table.beit-main-table th:first-child,.freeze-first-col table.beit-main-table td:first-child{position:sticky;left:0;z-index:7;background:#fff;box-shadow:10px 0 18px rgba(15,23,42,.10),1px 0 0 #cbd5e1;min-width:300px;max-width:460px}
.freeze-first-col table.beit-main-table thead th:first-child{z-index:10;background:#f8fafc}
.freeze-first-col table.beit-main-table tbody td:first-child{font-weight:700;color:#111827}
.freeze-first-col table.beit-main-table tfoot td:first-child{z-index:9;background:#eef2f7}
.soft-table-borders tbody tr{border-bottom-color:#f8fafc}
.custom-kpi-auto .kpi-grid{grid-template-columns:repeat(auto-fit,minmax(max(var(--custom-kpi-min,170px),160px),1fr))!important}
.density-compact .page-content{gap:10px;padding-top:12px}
.density-compact .kpi-card{padding:10px 11px}
.density-compact .chart-card{padding:11px 13px}
.density-compact tbody td{padding:7px 9px}
.density-compact thead th{padding:7px 9px}
.custom-wide .page-content{padding-left:14px;padding-right:14px}

/* Customize Studio */
.customize-studio-panel{right:-520px;width:510px;max-width:calc(100vw - 20px)}
.customize-studio-panel.open{right:0}
.customize-studio-panel .customizer-body{gap:12px}
.customize-hero-section{border-color:#bfdbfe;background:#f8fbff}
.custom-view-list,.version-list,.suggestion-list,.custom-rule-list,.custom-block-list,.custom-section-items-list{display:flex;flex-direction:column;gap:7px}
.custom-view-row,.version-row,.suggestion-card,.custom-rule-row,.custom-block-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 10px;border:1px solid #edf2f7;border-radius:8px;background:#fff}
.custom-view-row.active{border-color:#93c5fd;background:#eff6ff}
.custom-view-row strong,.version-row strong,.suggestion-card strong{display:block;font-size:12.5px;color:var(--text-primary)}
.custom-view-row small,.version-row small,.suggestion-card small{display:block;font-size:10.5px;color:var(--text-muted);margin-top:2px;line-height:1.35}
.template-grid{display:grid;grid-template-columns:1fr;gap:7px;margin-top:9px}
.template-card{display:block;width:100%;text-align:left;border:1px solid var(--border);border-radius:8px;background:#fff;padding:9px 10px;cursor:pointer;transition:background var(--t),border-color var(--t)}
.template-card:hover,.template-card.active{border-color:#93c5fd;background:#eff6ff}
.template-card strong{display:block;font-size:12.5px;color:var(--text-primary)}
.template-card span{display:block;font-size:10.5px;color:var(--text-secondary);line-height:1.35;margin-top:2px}
.custom-pills{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:9px}
.custom-pill{display:inline-flex;align-items:center;gap:5px;border:1px solid #dbeafe;background:#eff6ff;color:#1d4ed8;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:800}
.custom-pill button{border:0;background:transparent;color:#dc2626;font-weight:900;cursor:pointer;line-height:1}
.pinned-metrics-shell{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--custom-kpi-min,140px),1fr));gap:12px;order:-30}
.pinned-metric-card{border-color:#bfdbfe;background:#f8fbff}
.custom-widgets-shell{align-items:stretch;grid-auto-flow:dense}
.custom-widget-card{position:relative}
.custom-widget-card.is-dragging,.custom-page-block.is-dragging,.studio-widget-row.is-dragging,.pinned-metric-card.is-dragging,.custom-section-item.is-dragging,.section-order-row.is-dragging,.section-item-row.is-dragging{opacity:.55;outline:2px dashed #93c5fd}
.custom-page-block{transition:box-shadow var(--t),outline-color var(--t)}
.custom-page-block[draggable=true]:hover{outline:1px dashed #bfdbfe;outline-offset:3px}
.custom-section-item{transition:outline-color var(--t),box-shadow var(--t)}
.custom-section-item[draggable=true]:hover{outline:1px dashed #dbeafe;outline-offset:2px}
.widget-size-sm{grid-column:span 1}
.widget-size-md{grid-column:span 1}
.widget-size-lg{grid-column:span 2}
.widget-size-xl{grid-column:1/-1}
.custom-widget-card.widget-size-sm .chart-body{height:170px;min-height:170px}
.custom-widget-card.widget-size-lg .chart-body,.custom-widget-card.widget-size-xl .chart-body{height:calc(var(--custom-chart-height,230px) + 28px);min-height:250px}
.widget-card-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.widget-resize-controls{position:absolute;right:8px;top:8px}
.widget-size-switch{display:inline-flex;align-items:center;gap:2px;padding:2px;border:1px solid var(--border);border-radius:999px;background:#fff}
.widget-size-switch button{border:0;background:transparent;color:var(--text-muted);font-size:8.5px;font-weight:900;border-radius:999px;padding:2px 4px;cursor:pointer}
.widget-size-switch button.active,.widget-size-switch button:hover{background:#dbeafe;color:#1d4ed8}
.studio-widget-list{display:flex;flex-direction:column;gap:6px}
.studio-widget-row{display:grid;grid-template-columns:minmax(0,1fr) 88px auto auto 24px;align-items:center;border:1px solid #edf2f7;border-radius:8px;padding:8px 9px;background:#fff}
.studio-widget-row select{height:30px;padding:3px 8px;font-size:11px}
.custom-block-row strong{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:800;flex:1}
.custom-block-row span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:700}
.custom-block-row select{height:30px;padding:3px 8px;font-size:11px;min-width:96px}
.section-order-row,.section-item-row{cursor:grab}
.section-order-row .column-drag-handle,.section-item-row .column-drag-handle{flex:0 0 auto;color:var(--text-muted)}
.section-items-group{border:1px solid #edf2f7;border-radius:8px;padding:8px 10px;background:#fff}
.section-items-group summary{display:flex;align-items:center;justify-content:space-between;gap:8px;list-style:none;font-size:12px;font-weight:800;color:var(--text-primary)}
.section-items-group summary::-webkit-details-marker{display:none}
.section-items-group summary small{font-size:10.5px;color:var(--text-muted);font-weight:700}
.custom-default-grid{display:flex;flex-wrap:wrap;gap:6px;margin:9px 0}
.custom-default-grid span{display:inline-flex;gap:4px;border:1px solid #edf2f7;background:#f8fafc;border-radius:999px;padding:4px 8px;font-size:10.5px;color:var(--text-secondary)}
.customizer-actions-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.custom-rule-row span{font-size:12px;color:var(--text-primary);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cond-dot{width:10px;height:10px;border-radius:50%;display:inline-block;flex-shrink:0}
.cond-good{background:#dcfce7!important;color:#15803d!important;font-weight:800}
.cond-warn{background:#fffbeb!important;color:#b45309!important;font-weight:800}
.cond-bad{background:#fef2f2!important;color:#b91c1c!important;font-weight:800}
.cond-dot.cond-good{background:#22c55e!important}
.cond-dot.cond-warn{background:#f59e0b!important}
.cond-dot.cond-bad{background:#ef4444!important}
@media (min-width:1000px){
  .custom-widget-card.widget-size-lg,.custom-widget-card.widget-size-xl{min-height:120px}
}
@media (max-width:760px){
  .customize-studio-panel{width:calc(100vw - 12px);right:-100vw}
  .studio-widget-row{grid-template-columns:1fr;align-items:start}
  .widget-size-lg,.widget-size-xl{grid-column:1/-1}
}

/* ── BUTTONS ── */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:7px 14px;border-radius:var(--radius);font-size:12.5px;font-weight:600;font-family:var(--font);cursor:pointer;border:1px solid transparent;transition:all var(--t);white-space:nowrap;text-decoration:none;line-height:1.2;flex-shrink:0}
.btn:hover{text-decoration:none}
.btn:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}
.btn svg{flex-shrink:0}
.btn-primary{background:var(--blue);color:#fff;border-color:var(--blue)}
.btn-primary:hover{background:var(--blue-dark);border-color:var(--blue-dark);color:#fff}
.btn-secondary{background:var(--surface);color:var(--text-primary);border-color:var(--border)}
.btn-secondary:hover{background:var(--surface-hover);color:var(--text-primary)}
.btn-danger{background:var(--red);color:#fff;border-color:var(--red)}
.btn-danger:hover{background:#dc2626;color:#fff}
.btn-success{background:var(--green);color:#fff;border-color:var(--green)}
.btn-success:hover{background:#16a34a;color:#fff}
.btn-ghost{background:transparent;color:var(--text-secondary);border-color:transparent}
.btn-ghost:hover{background:var(--surface-hover);color:var(--text-primary)}
.btn-xs{padding:3px 7px;font-size:10.5px}
.btn-sm{padding:5px 10px;font-size:11.5px}
.btn-lg{padding:10px 20px;font-size:13.5px}

/* ── TWO-COLUMN LAYOUT ── */
.content-with-panel{display:grid;grid-template-columns:1fr 290px;gap:16px;align-items:start;min-width:0}
.right-panel{display:flex;flex-direction:column;gap:13px;position:sticky;top:18px;min-width:0}
.panel-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px;box-shadow:var(--shadow-sm);overflow:hidden}
.panel-title{font-size:12px;font-weight:700;color:var(--text-primary);margin-bottom:11px;display:flex;align-items:center;gap:6px}

/* ── SYNC ── */
.sync-row{display:flex;align-items:center;justify-content:space-between;padding:6px 0;border-bottom:1px solid #f1f5f9;gap:5px}
.sync-row:last-child{border-bottom:none}
.sync-platform{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;min-width:0}
.sync-time{font-size:10.5px;color:var(--text-muted);white-space:nowrap}
.sync-dot{width:6px;height:6px;border-radius:50%;background:var(--green);flex-shrink:0}
.sync-dot-warning{background:var(--orange)}
.sync-dot-error{background:var(--red)}
.sync-dot-grey{background:var(--text-muted)}

/* ── INSIGHT ITEMS ── */
.insight-item{display:flex;align-items:flex-start;gap:8px;padding:8px 0;border-bottom:1px solid #f1f5f9}
.insight-item:last-child{border-bottom:none}
.insight-icon{width:28px;height:28px;border-radius:7px;display:flex;align-items:center;justify-content:center;flex-shrink:0;font-size:13px}
.insight-body{flex:1;min-width:0}
.insight-label{font-size:9.5px;color:var(--text-muted);text-transform:uppercase;font-weight:700;letter-spacing:.06em}
.insight-title{font-size:12px;font-weight:700;color:var(--text-primary);margin-top:1px}
.insight-detail{font-size:11px;color:var(--text-secondary);margin-top:2px;line-height:1.4}

/* ── FUNNEL ── */
.funnel-bar-wrap{display:flex;flex-direction:column;gap:6px}
.funnel-step{display:flex;align-items:center;gap:7px}
.funnel-label{font-size:11.5px;color:var(--text-secondary);width:130px;min-width:130px;text-align:right;flex-shrink:0}
.funnel-bar-outer{flex:1;background:#f1f5f9;border-radius:5px;height:24px;position:relative;overflow:hidden}
.funnel-bar-inner{height:100%;border-radius:5px;display:flex;align-items:center;justify-content:flex-end;padding-right:7px;transition:width .7s cubic-bezier(.25,.8,.25,1)}
.funnel-bar-value{font-size:11px;font-weight:700;color:#fff}
.funnel-rate{font-size:10.5px;color:var(--text-muted);width:48px;text-align:right;flex-shrink:0}

/* ── EMPTY STATE ── */
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:44px 20px;text-align:center;gap:9px}
.empty-icon{color:var(--text-muted);opacity:.4}
.empty-title{font-size:15px;font-weight:700;color:var(--text-primary)}
.empty-message{font-size:13px;color:var(--text-secondary);max-width:360px;line-height:1.6}

/* ── FLASH ── */
.flash{padding:10px 14px;border-radius:var(--radius);font-size:12.5px;font-weight:500;border:1px solid transparent;line-height:1.4}
.flash-success{background:var(--green-light);color:#15803d;border-color:#bbf7d0}
.flash-error{background:var(--red-light);color:#b91c1c;border-color:#fecaca}
.flash-warning{background:#fef3c7;color:#b45309;border-color:#fde68a}
.flash-info{background:var(--blue-light);color:#1d4ed8;border-color:#bfdbfe}

/* ── AUTH ── */
.auth-page{min-height:100vh;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0f1117 0%,#1a1e2e 60%,#0f1117 100%);padding:20px}
.auth-card{background:var(--surface);border-radius:var(--radius-xl);padding:32px 28px;width:100%;max-width:410px;box-shadow:var(--shadow-lg)}
.auth-logo{display:flex;justify-content:center;margin-bottom:22px}
.auth-title{font-size:20px;font-weight:800;color:var(--text-primary);text-align:center;margin-bottom:5px}
.auth-sub{font-size:13px;color:var(--text-secondary);text-align:center;margin-bottom:22px}
.form-group{margin-bottom:13px}
.form-label{display:block;font-size:12px;font-weight:700;color:var(--text-primary);margin-bottom:4px}
.form-control{width:100%;padding:8px 11px;border:1.5px solid var(--border);border-radius:var(--radius);font-size:13.5px;font-family:var(--font);color:var(--text-primary);background:var(--surface);outline:none;transition:border-color var(--t),box-shadow var(--t)}
.form-control:focus{border-color:var(--border-focus);box-shadow:0 0 0 3px rgba(59,130,246,.12)}
.form-error{font-size:11px;color:var(--red);margin-top:3px}
.form-hint{font-size:11px;color:var(--text-muted);margin-top:3px}
.auth-footer{text-align:center;margin-top:16px;font-size:12.5px;color:var(--text-secondary)}

/* ── PLATFORM TAGS ── */
.platform-tag{display:inline-flex;align-items:center;gap:4px;padding:2px 7px;border-radius:6px;font-size:11px;font-weight:700;white-space:nowrap}
.platform-tag-meta{background:#eff6ff;color:#1877F2}
.platform-tag-google{background:#f0fdf4;color:#15803d}
.platform-tag-tiktok{background:#f9fafb;color:#111827;border:1px solid #e5e7eb}
.platform-tag-snapchat{background:#fefce8;color:#ca8a04}

/* ── TOGGLE ── */
.toggle{position:relative;width:36px;height:19px;display:inline-block;flex-shrink:0}
.toggle input{opacity:0;width:0;height:0}
.toggle-slider{position:absolute;inset:0;background:#cbd5e1;border-radius:99px;cursor:pointer;transition:background var(--t)}
.toggle-slider::before{content:'';position:absolute;width:13px;height:13px;border-radius:50%;background:#fff;left:3px;top:3px;transition:transform var(--t);box-shadow:var(--shadow-xs)}
.toggle input:checked+.toggle-slider{background:var(--blue)}
.toggle input:checked+.toggle-slider::before{transform:translateX(17px)}

/* ── SPINNER ── */
.spinner{width:17px;height:17px;border:2px solid var(--border);border-top-color:var(--blue);border-radius:50%;animation:spin .65s linear infinite;display:inline-block;flex-shrink:0}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── MODAL ── */
.modal-backdrop{display:none;position:fixed;inset:0;background:rgba(15,17,23,.55);z-index:1000;align-items:center;justify-content:center;padding:14px}
.modal-backdrop.open{display:flex}
.modal{background:var(--surface);border-radius:var(--radius-xl);width:100%;max-width:540px;box-shadow:var(--shadow-lg);overflow:hidden;animation:modalIn .18s ease;max-height:92vh;display:flex;flex-direction:column}
@keyframes modalIn{from{opacity:0;transform:translateY(-10px) scale(.98)}to{opacity:1;transform:none}}
.modal-header{padding:16px 20px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;flex-shrink:0}
.modal-title{font-size:14.5px;font-weight:700}
.modal-close{background:none;border:none;cursor:pointer;color:var(--text-muted);font-size:21px;line-height:1;padding:0 2px;border-radius:4px;transition:color var(--t)}
.modal-close:hover{color:var(--text-primary)}
.modal-body{padding:18px 20px;overflow-y:auto;flex:1}
.modal-footer{padding:12px 20px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:7px;flex-shrink:0}

/* ── PROGRESS ── */
.progress{background:#e2e8f0;border-radius:99px;height:5px;overflow:hidden}
.progress-bar{height:100%;border-radius:99px;background:linear-gradient(90deg,var(--blue),var(--purple));transition:width .5s ease}
.progress-bar-green{background:var(--green)}
.progress-bar-orange{background:var(--orange)}
.progress-bar-red{background:var(--red)}

/* ── PAGINATION ── */
.pagination{display:flex;align-items:center;gap:3px;padding:10px 16px;border-top:1px solid var(--border)}
.page-link{padding:4px 8px;border-radius:var(--radius-sm);font-size:12px;color:var(--text-secondary);border:1px solid transparent;cursor:pointer;transition:all var(--t);background:none}
.page-link:hover{background:var(--surface-hover);color:var(--text-primary)}
.page-link.active{background:var(--blue);color:#fff;border-color:var(--blue)}
.page-link:disabled{opacity:.4;cursor:not-allowed}
.pagination-info{margin-left:auto;font-size:11.5px;color:var(--text-muted)}

/* ── ACCOUNT SELECTOR ── */
.account-select-item{display:flex;align-items:center;gap:9px;padding:9px 11px;border:1.5px solid var(--border);border-radius:var(--radius);cursor:pointer;transition:all var(--t);background:var(--surface)}
.account-select-item:hover{border-color:var(--blue);background:var(--blue-light)}
.account-select-item.selected{border-color:var(--blue);background:var(--blue-light)}
.account-select-item input[type=checkbox]{width:14px;height:14px;cursor:pointer;flex-shrink:0}
.account-select-info{flex:1;min-width:0}
.account-select-name{font-size:12.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-select-meta{font-size:10.5px;color:var(--text-muted);margin-top:1px}

/* ── CODE BLOCK ── */
.code-block{background:#0f1117;color:#e2e8f0;border-radius:var(--radius);padding:12px 14px;font-family:var(--font-mono);font-size:11.5px;line-height:1.8;overflow-x:auto}
.code-block .comment{color:#6b7280}
.code-block .highlight{color:#60a5fa}

/* ── CURRENCY DISPLAY — multi-currency ── */
.currency-cell{font-variant-numeric:tabular-nums;text-align:right}
.currency-badge{display:inline-flex;align-items:center;gap:3px;font-size:9.5px;font-weight:700;padding:1px 5px;border-radius:4px;background:#f1f5f9;color:var(--text-muted);margin-left:3px}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE — handle 8-col grids on smaller screens
   ───────────────────────────────────────────────────────── */
@media(max-width:1400px){
  .kpi-grid-8{grid-template-columns:repeat(4,minmax(160px,1fr))}
  .kpi-grid-7{grid-template-columns:repeat(4,minmax(160px,1fr))}
}
@media(max-width:1200px){
  .kpi-grid-8,.kpi-grid-7{grid-template-columns:repeat(4,minmax(160px,1fr))}
  .kpi-grid-6{grid-template-columns:repeat(3,minmax(160px,1fr))}
  .charts-row{grid-template-columns:1fr}
  .content-with-panel{grid-template-columns:1fr}
  .right-panel{position:static}
}
@media(max-width:1024px){
  .kpi-grid-8,.kpi-grid-7,.kpi-grid-6{grid-template-columns:repeat(3,minmax(160px,1fr))}
  .kpi-grid-5{grid-template-columns:repeat(3,minmax(160px,1fr))}
  .charts-row-3{grid-template-columns:1fr 1fr}
}
@media(max-width:900px){
  :root{--sidebar-width:0px}
  .sidebar{left:-220px;width:220px;min-width:220px;transition:left .25s ease}
  .sidebar.mobile-open{left:0;box-shadow:var(--shadow-lg)}
  .main-content{margin-left:0}
  .top-bar{display:flex}
  .page-header,.page-content,.filter-bar{padding-left:14px;padding-right:14px}
  .kpi-grid-8,.kpi-grid-7,.kpi-grid-6,.kpi-grid-5{grid-template-columns:repeat(3,minmax(160px,1fr))}
  .kpi-grid-4{grid-template-columns:repeat(2,minmax(160px,1fr))}
  .beit-customizer-panel.beit-table-panel{width:calc(100vw - 20px);max-width:calc(100vw - 20px);height:calc(100vh - 24px);max-height:calc(100vh - 24px)}
  .table-studio-body{grid-template-columns:1fr}
  .table-studio-main{border-right:0}
  .table-studio-selected{border-top:1px solid var(--border);max-height:300px}
  .table-studio-toolbar{grid-template-columns:1fr}
  .custom-builder-toolbar{grid-template-columns:1fr 1fr 1fr}
  .custom-metric-grid{grid-template-columns:1fr}
}
@media(max-width:640px){
  .kpi-grid,.kpi-grid-8,.kpi-grid-7,.kpi-grid-6,.kpi-grid-5,.kpi-grid-4,.kpi-grid-3{grid-template-columns:1fr 1fr}
  .kpi-grid-2{grid-template-columns:1fr}
  .page-title{font-size:16px}
}

/* ── CURRENCY SYSTEM ── */
.currency-indicator {
  display:inline-flex;align-items:center;gap:4px;
  padding:3px 9px;border-radius:99px;
  background:var(--blue-light);color:var(--blue);
  font-size:10.5px;font-weight:700;white-space:nowrap;
  border:1px solid #bfdbfe;cursor:default;
}
.currency-selector {
  display:inline-flex;align-items:center;gap:4px;
  padding:4px 8px;border-radius:var(--radius);
  background:var(--blue-light);color:var(--blue);
  font-size:10.5px;font-weight:700;border:1px solid #bfdbfe;
  cursor:pointer;
}
.currency-selector select {
  background:none;border:none;outline:none;
  color:var(--blue);font-size:10.5px;font-weight:700;
  cursor:pointer;padding:0;
}
.multi-currency-note {
  font-size:10px;color:var(--text-muted);
  padding:3px 8px;background:#f8fafc;border-radius:99px;
  border:1px solid var(--border);white-space:nowrap;
}
.exchange-rate-chip {
  display:inline-flex;align-items:center;gap:3px;
  font-size:10px;color:var(--text-muted);
  padding:2px 7px;border-radius:99px;background:#f1f5f9;
}

/* Currency selector fix */
.currency-selector select {
  max-width: 90px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--blue);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}
.currency-selector select option {
  color: var(--text-primary);
  background: var(--surface);
  font-weight: 600;
}


/* ── COMPACT CURRENCY DROPDOWN ─────────────────────────────
   Keeps the global currency selector readable without crowding the top bar. */
select[data-currency-selector="1"] {
  min-width: 58px !important;
  max-width: 68px !important;
  height: 22px !important;
  line-height: 22px !important;
  padding: 0 16px 0 2px !important;
  border-radius: 8px !important;
  text-align: center !important;
  text-align-last: center !important;
  letter-spacing: .2px;
  background-color: transparent !important;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%) !important;
  background-position: calc(100% - 8px) 9px, calc(100% - 4px) 9px !important;
  background-size: 4px 4px, 4px 4px !important;
  background-repeat: no-repeat !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
select[data-currency-selector="1"] option {
  color: var(--text-primary);
  background: var(--surface);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}
@media (max-width: 640px) {
  select[data-currency-selector="1"] {
    min-width: 54px !important;
    max-width: 62px !important;
  }
}

/* Unified controls polish */
.legacy-date-control{display:none!important}
.legacy-date-input{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.beit-date-trigger{
  order:999;
  height:36px;display:inline-flex;align-items:center;gap:8px;border:1px solid #b8c4d2;
  border-radius:7px;background:#fff;color:#0f172a;padding:0 12px;font-size:13px;font-weight:700;
  box-shadow:0 1px 2px rgba(15,23,42,.05);cursor:pointer;white-space:nowrap;
}
.beit-date-trigger:hover{background:#f8fafc;border-color:#94a3b8}
.beit-date-icon{width:16px;height:16px;border:2px solid #475569;border-radius:3px;position:relative;display:inline-block}
.beit-date-icon:before{content:'';position:absolute;left:2px;right:2px;top:4px;border-top:2px solid #475569}
.beit-date-caret{width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent;border-top:6px solid #334155}
.beit-date-popover{
  position:absolute;z-index:2000;display:none;background:#fff;border:1px solid #d6dee8;border-radius:4px;
  box-shadow:0 18px 45px rgba(15,23,42,.22);overflow:hidden;color:#1f2937;
}
.beit-date-popover.open{display:grid;grid-template-columns:245px minmax(0,1fr)}
.beit-date-quick{padding:14px 18px;background:#fff;border-right:1px solid #e5e7eb;display:flex;flex-direction:column;gap:8px}
.beit-date-quick button{border:0;background:transparent;text-align:left;display:flex;align-items:center;gap:12px;padding:2px 0;font-size:14px;color:#1f2937;cursor:pointer}
.beit-date-quick button span{width:22px;height:22px;border-radius:50%;border:1px solid #cbd5e1;display:inline-block;background:#fff}
.beit-date-quick button.active span{border:6px solid #0b83cf}
.beit-date-main{padding:18px 20px;min-width:0}
.beit-date-nav{display:grid;grid-template-columns:34px 1fr 34px;align-items:center;margin-bottom:10px}
.beit-date-nav button{border:0;background:transparent;font-size:30px;color:#64748b;cursor:pointer;line-height:1}
.beit-date-calendars{display:grid;grid-template-columns:1fr 1fr;gap:32px}
.beit-date-month-head{display:flex;justify-content:center;gap:10px;font-size:15px;margin:0 0 14px;color:#1f2937}
.beit-date-weekdays,.beit-date-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;text-align:center}
.beit-date-weekdays span{font-size:12px;color:#64748b;padding-bottom:5px}
.beit-date-grid>span{height:28px}
.beit-date-day{height:28px;border:0;border-radius:4px;background:transparent;color:#1f2937;font-size:14px;cursor:pointer}
.beit-date-day.in-range{background:#cfe4f7}
.beit-date-day.selected{background:#0b83cf;color:#fff}
.beit-date-day:hover{outline:1px solid #0b83cf}
.beit-date-compare{display:flex;align-items:center;gap:8px;margin:18px 0 10px;font-size:14px;color:#1f2937}
.beit-date-compare input{width:22px;height:22px}
.beit-date-fields{display:grid;grid-template-columns:minmax(160px,1fr) minmax(135px,150px) 12px minmax(135px,150px);gap:7px;align-items:center}
.beit-date-fields input,.beit-date-fields select{height:36px;border-radius:5px;border-color:#cbd5e1;font-size:13px}
.beit-date-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:34px}
.beit-date-actions span{margin-right:auto;color:#64748b;font-size:12px}

select:not([multiple]){
  min-height:34px;border-color:#cbd5e1;background-color:#fff;
  background-image:linear-gradient(45deg,transparent 50%,#334155 50%),linear-gradient(135deg,#334155 50%,transparent 50%);
  background-position:calc(100% - 14px) 14px,calc(100% - 9px) 14px;background-size:5px 5px,5px 5px;background-repeat:no-repeat;
  appearance:none;-webkit-appearance:none;padding-right:30px!important;
}
.btn{box-shadow:0 1px 2px rgba(15,23,42,.05)}
.btn-ghost{background:#fff;color:#334155;border-color:#d6dee8}
.btn-ghost:hover{background:#f8fafc;border-color:#94a3b8;color:#0f172a}
.btn-secondary{border-color:#cbd5e1;background:#fff}
.btn-secondary:hover{border-color:#94a3b8;background:#f8fafc}
.filter-bar .btn-ghost{font-weight:800}
.beit-currency-control,.currency-selector,div[title="Change display currency"]{
  display:inline-flex!important;align-items:center!important;gap:7px!important;min-height:36px!important;
  padding:5px 9px!important;border:1px solid #bfdbfe!important;border-radius:8px!important;
  background:#eff6ff!important;color:#1d4ed8!important;box-shadow:0 1px 2px rgba(29,78,216,.08)!important;
}
.beit-currency-icon{width:18px;height:18px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#dbeafe;color:#1d4ed8;font-weight:900;font-size:11px}
select[data-currency-selector="1"]{
  min-width:76px!important;max-width:118px!important;height:26px!important;line-height:26px!important;
  padding:0 22px 0 7px!important;color:#1d4ed8!important;background-color:#fff!important;border:1px solid #bfdbfe!important;
}
.filter-bar .currency-indicator,.filter-bar .multi-currency-note,.filter-bar .exchange-rate-chip{min-height:30px;display:inline-flex;align-items:center}

.custom-widget-table-wrap{overflow:auto;border-top:1px solid #edf2f7}
.compact-metric-table{width:100%;min-width:360px!important;table-layout:fixed}
.compact-metric-table th,.compact-metric-table td{padding:10px 12px}
.compact-metric-table th:first-child,.compact-metric-table td:first-child{min-width:220px!important;max-width:none}
.compact-metric-table th:last-child,.compact-metric-table td:last-child{min-width:128px!important;text-align:right}
.compact-metric-table tbody td:first-child{font-weight:700;color:#111827;white-space:normal;line-height:1.35}
.compact-metric-table tfoot td{background:#eef4fb!important;border-top:2px solid #cbd5e1!important;font-weight:900!important}

.funnel-value-fixed{width:74px;min-width:74px;text-align:right;font-size:12px;font-weight:800;color:#0f172a;font-variant-numeric:tabular-nums}
.chart-card .funnel-step{align-items:center}
.funnel-bar-inner{min-width:8px}

body.pdf-exporting .sidebar,
body.pdf-exporting .top-bar,
body.pdf-exporting .filter-bar,
body.pdf-exporting .page-header-right,
body.pdf-exporting .beit-customize-btn,
body.pdf-exporting .beit-customizer-panel,
body.pdf-exporting .no-print,
body.pdf-exporting .column-resize-handle{display:none!important}
body.pdf-exporting .main-content{margin-left:0!important}@media(max-width:760px){
  .beit-date-popover.open{grid-template-columns:1fr;width:calc(100vw - 20px)!important;left:10px!important}
  .beit-date-quick{border-right:0;border-bottom:1px solid #e5e7eb;max-height:210px;overflow:auto}
  .beit-date-calendars{grid-template-columns:1fr;gap:16px}
  .beit-date-fields{grid-template-columns:1fr}
}

/* Mobile responsive layer: mobile-only overrides that keep desktop layouts intact. */
@media(max-width:900px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  .app-layout,.main-content{width:100%;max-width:100%;min-width:0}
  .main-content{margin-left:0!important}
  .sidebar{width:236px;min-width:236px;max-width:236px;left:-240px}
  .sidebar.mobile-open{left:0}
  .top-bar{position:sticky;top:0;z-index:950}
  .page-header{align-items:stretch;padding:14px 14px 10px;gap:10px}
  .page-header-left{flex:1 1 auto;width:100%;align-items:flex-start}
  .page-icon{width:34px;height:34px;min-width:34px;border-radius:8px}
  .page-title{white-space:normal;overflow:visible;text-overflow:clip;line-height:1.25}
  .page-header-right{width:100%;margin-left:0;justify-content:flex-start;gap:7px;padding-top:0}
  .page-header-right .btn,.page-header-right a.btn{height:34px}
  .beit-date-trigger{width:100%;justify-content:space-between;order:-1}
  .beit-date-text{min-width:0;overflow:hidden;text-overflow:ellipsis}

  .filter-bar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;gap:9px;padding:10px 14px}
  .filter-group,.filter-bar select,.filter-bar input,.filter-bar .btn{width:100%;min-width:0!important}
  .filter-bar > div[style*="margin-left:auto"]{margin-left:0!important}
  .filter-bar > div[style*="display:flex"]{width:100%;justify-content:stretch!important;flex-wrap:wrap}
  .filter-bar .freshness-badge,.filter-bar .currency-indicator,.filter-bar .multi-currency-note,.filter-bar .exchange-rate-chip{max-width:100%;white-space:normal}
  .beit-currency-control,.currency-selector,div[title="Change display currency"]{width:100%;justify-content:space-between}

  .page-content{padding:14px;gap:14px;overflow-x:hidden}
  .content-with-panel,.charts-row,.charts-row-3,.health-grid{grid-template-columns:1fr!important}
  .right-panel{position:static!important;width:100%}
  .page-content[style*="grid-template-columns"],
  .page-content > [style*="grid-template-columns"],
  .page-content [style*="grid-template-columns:1fr 1fr"],
  .page-content [style*="grid-template-columns:repeat(4,1fr)"],
  .page-content [style*="grid-template-columns:repeat(6,1fr)"],
  .page-content [style*="grid-template-columns:repeat(auto-fill"],
  .page-content form[style*="grid-template-columns"],
  .modal-body[style*="grid-template-columns"]{grid-template-columns:1fr!important}

  .kpi-grid,.kpi-grid-8,.kpi-grid-7,.kpi-grid-6,.kpi-grid-5,.kpi-grid-4,.kpi-grid-3,
  .page-content > .kpi-grid[style*="grid-template-columns"]{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .kpi-card{min-height:66px;padding:9px 10px;gap:8px}
  .kpi-icon{width:26px;height:26px;min-width:26px}
  .kpi-label{font-size:9px}
  .kpi-value{font-size:clamp(14px,4.5vw,18px)}

  .chart-card,.table-card,.panel-card{border-radius:10px}
  .chart-card{padding:13px}
  .chart-header,.table-header{align-items:flex-start}
  .chart-title,.table-title{white-space:normal;overflow:visible;text-overflow:clip}
  .chart-body{height:max(220px,var(--custom-chart-height,220px));min-height:210px}
  .table-header{flex-direction:column;align-items:stretch;padding:12px 13px}
  .table-actions,.beit-table-controls{width:100%;display:flex;gap:6px;overflow-x:auto;padding-bottom:2px}
  .table-actions .search-box{width:100%;min-width:0}
  .search-box input{width:100%}
  .beit-preset-select{min-width:125px}
  .table-wrap{width:100%;max-width:100%;overflow:auto}
  table{min-width:700px}
  .compact-metric-table{min-width:100%!important}
  .table-wrap thead th:first-child,.table-wrap tbody td:first-child,.table-wrap tfoot td:first-child{min-width:150px}
  .freeze-first-col table th:first-child,.freeze-first-col table td:first-child{min-width:190px!important;max-width:260px!important}
  tbody td{max-width:220px}

  .funnel-step{display:grid;grid-template-columns:minmax(92px,1fr) 70px;gap:7px 8px;align-items:center}
  .funnel-label{width:auto!important;min-width:0!important;text-align:left!important}
  .funnel-value-fixed{width:auto;min-width:0;text-align:right}
  .funnel-bar-outer{grid-column:1/-1;width:100%}
  .funnel-rate{grid-column:1/-1;width:auto!important;text-align:right!important}.modal-backdrop{padding:8px}
  .modal{max-width:calc(100vw - 16px)!important;border-radius:10px}
  .modal-header,.modal-body,.modal-footer{padding-left:14px;padding-right:14px}
  .modal-footer{flex-wrap:wrap}
  .modal-footer .btn{flex:1 1 auto}

  .beit-customizer-panel,.beit-customizer-panel.beit-table-panel{top:8px!important;left:8px!important;right:auto!important;transform:none!important;width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;height:calc(100vh - 16px)!important;max-height:calc(100vh - 16px)!important;border-radius:8px;opacity:0;pointer-events:none}
  .beit-customizer-panel.open,.beit-customizer-panel.beit-table-panel.open{transform:none!important;opacity:1;pointer-events:auto}
  .table-studio-body{grid-template-columns:1fr!important}
  .table-studio-main{border-right:0}
  .table-studio-selected{border-top:1px solid var(--border);max-height:36vh}
  .table-studio-toolbar,.customizer-add-grid,.customizer-add-grid-wide,.studio-formula-grid,.custom-metric-grid,.custom-builder-toolbar{grid-template-columns:1fr!important}
  .studio-widget-row{grid-template-columns:1fr!important;gap:7px}
  .widget-size-lg,.widget-size-xl{grid-column:1/-1}
}

@media(max-width:540px){
  .filter-bar{grid-template-columns:1fr}
  .page-header-right{display:grid;grid-template-columns:1fr 1fr}
  .page-header-right .beit-date-trigger{grid-column:1/-1}
  .page-header-right .btn,.page-header-right a.btn{width:100%}
  .kpi-grid,.kpi-grid-8,.kpi-grid-7,.kpi-grid-6,.kpi-grid-5,.kpi-grid-4,.kpi-grid-3,
  .page-content > .kpi-grid[style*="grid-template-columns"]{grid-template-columns:1fr!important}
  .kpi-card{min-height:62px}
  .chart-body{min-height:230px}
  table{min-width:620px}
  .table-wrap thead th:first-child,.table-wrap tbody td:first-child,.table-wrap tfoot td:first-child{min-width:135px}
  .freeze-first-col table th:first-child,.freeze-first-col table td:first-child{min-width:165px!important;max-width:210px!important}
  .beit-table-controls{flex-wrap:nowrap}
  .beit-date-popover.open{top:58px!important;position:fixed}
  .beit-date-main{padding:14px 12px}
  .beit-date-actions{margin-top:18px;display:grid;grid-template-columns:1fr 1fr}
  .beit-date-actions span{grid-column:1/-1}}

/* Mobile sidebar and table-scroll refinements. */
.table-card,.chart-card,.custom-widget-card,.panel-card{min-width:0;max-width:100%}
.table-card > .table-header,
.chart-card > .table-header,
.custom-widget-card > .table-header,
.panel-card > .table-header{
  width:100%;max-width:100%;position:relative;z-index:5;background:#fff;flex-shrink:0;
}
.table-card > .table-wrap,
.chart-card > .table-wrap,
.custom-widget-card > .table-wrap,
.panel-card > .table-wrap,
.custom-widget-table-wrap{
  width:100%;max-width:100%;overflow-x:auto;overflow-y:visible;
}
.creative-summary-kpis{order:-10000!important}

.template-card{
  text-align:left;align-items:flex-start;gap:4px;min-height:74px;
}
.template-card strong{font-size:12.5px;color:#0f172a}
.template-card span{font-size:11px;line-height:1.35;color:#64748b}
.template-card.active,.template-card:hover{
  border-color:#93c5fd;background:#eff6ff;box-shadow:0 8px 20px rgba(37,99,235,.08);
}
.customizer-section .customizer-muted{line-height:1.45}select[data-currency-selector="1"],#globalCurrencySelect{
  appearance:auto!important;border-radius:9px!important;border:1px solid #cbd5e1!important;background-color:#fff!important;
  color:#0f172a!important;font-weight:800!important;min-height:34px!important;padding:6px 28px 6px 10px!important;
}.select-caret{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid #475569;display:inline-block}.hierarchy-indent{display:inline-block;width:18px}
.hierarchy-caret{color:#94a3b8;margin-right:6px}
.total-row{background:#eaf1f8!important;font-weight:900;border-top:2px solid #cbd5e1}@media(max-width:900px){.app-layout{display:flex!important;flex-direction:column!important;min-height:100vh;width:100%}
  .top-bar{
    display:flex!important;position:sticky;top:0;z-index:1100;height:56px;
    width:100%;padding:8px 14px;background:linear-gradient(180deg,#f8fafc 0%,#eef2f7 100%);
    border-bottom:1px solid #e5edf5;justify-content:flex-start;gap:10px;
    box-shadow:0 4px 14px rgba(15,23,42,.06);
  }
  .top-bar-toggle{
    width:38px;height:38px;align-items:center;justify-content:center;
    background:#fff;border:1px solid #cbd5e1;color:#0f172a;border-radius:9px;padding:0;
    box-shadow:0 1px 2px rgba(15,23,42,.06);
  }
  .top-bar .logo-box{font-size:14px;box-shadow:0 1px 2px rgba(15,23,42,.06)}
  .top-bar > div:last-child{margin-left:auto;width:auto!important}
  .sidebar{
    left:0!important;transform:translateX(-105%)!important;width:246px!important;
    min-width:246px!important;max-width:246px!important;z-index:1090;
    transition:transform .22s ease!important;box-shadow:none;
  }
  .sidebar.mobile-open{
    transform:translateX(0)!important;box-shadow:18px 0 45px rgba(15,23,42,.32);
  }
  .main-content{margin-left:0!important;width:100%!important}
  .table-card > .table-header,
  .chart-card > .table-header,
  .custom-widget-card > .table-header,
  .panel-card > .table-header{
    position:sticky;left:0;right:0;z-index:6;
  }
  .custom-widget-card .table-header .table-actions,
  .chart-card .table-header .table-actions,
  .table-card .table-header .table-actions{min-width:0}
  .freeze-first-col table th,
  .freeze-first-col table td{position:static!important;left:auto!important;right:auto!important;z-index:auto!important;box-shadow:none!important}
  .freeze-first-col table th:first-child,
  .freeze-first-col table td:first-child{min-width:150px!important;max-width:none!important}
}

@media(max-width:540px){
  .freeze-first-col table th:first-child,
  .freeze-first-col table td:first-child{min-width:135px!important;max-width:none!important}
}

@media(min-width:901px){
  .sidebar{transform:none!important}
}

.currency-pill-icon{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:7px;background:#fff;color:#1d4ed8;font-size:10px;font-weight:900;letter-spacing:.03em;box-shadow:0 1px 2px rgba(37,99,235,.12)}
.kpi-icon{font-weight:900;font-size:11px;letter-spacing:.02em;line-height:1;text-align:center}@media(max-width:1180px){}
@media(max-width:900px){}@keyframes reportTabFade{
  from{opacity:.35;transform:translateY(4px)}
  to{opacity:1;transform:translateY(0)}
}

.beit-customizer-panel.customize-studio-panel{
  position:fixed!important;
  top:50%!important;
  left:50%!important;
  right:auto!important;
  bottom:auto!important;
  width:min(1240px,calc(100vw - 28px))!important;
  max-width:min(1240px,calc(100vw - 28px))!important;
  height:min(820px,calc(100vh - 48px))!important;
  max-height:calc(100vh - 48px)!important;
  border-radius:18px!important;
  border:1px solid rgba(203,213,225,.95)!important;
  box-shadow:0 0 0 9999px rgba(15,23,42,.50),0 24px 70px rgba(15,23,42,.30)!important;
  transform:translate(-50%,-47%) scale(.985)!important;
  opacity:0;
  pointer-events:none;
  overflow:hidden;
}
.beit-customizer-panel.customize-studio-panel.open{
  right:auto!important;
  transform:translate(-50%,-50%) scale(1)!important;
  opacity:1;
  pointer-events:auto;
}
.customize-studio-panel .customizer-head{
  padding:14px 22px!important;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
}
.customize-studio-panel .customizer-head strong{
  font-size:15px;
}
.customize-studio-panel .customizer-head small{
  font-size:11px;
}
.customize-studio-panel .customizer-body{
  padding:16px 22px!important;
  background:#fbfdff;
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px!important;
  align-content:start;
}
.customize-studio-panel .customizer-foot{
  padding:12px 22px!important;
  background:#fff;
  box-shadow:0 -10px 24px rgba(15,23,42,.07);
}
.customize-studio-panel .customizer-section{
  min-width:0;
  border-radius:14px!important;
  border-color:#dbe7f3!important;
  background:linear-gradient(180deg,#fff 0%,#f8fbff 100%);
  box-shadow:0 1px 3px rgba(15,23,42,.05);
}
.customize-studio-panel .customizer-section:nth-child(1),
.customize-studio-panel .customizer-section:nth-child(2),
.customize-studio-panel .customizer-section:has(.customizer-widgets),
.customize-studio-panel .customizer-section:has(.custom-section-items-list),
.customize-studio-panel .customizer-section:has(.table-studio-toolbar){
  grid-column:span 2;
}

@media(max-width:1320px){}
@media(max-width:1180px){}
@media(max-width:900px){.beit-customizer-panel.customize-studio-panel{
    top:8px!important;
    left:8px!important;
    transform:none!important;
    width:calc(100vw - 16px)!important;
    max-width:calc(100vw - 16px)!important;
    height:calc(100vh - 16px)!important;
    max-height:calc(100vh - 16px)!important;
    border-radius:12px!important;
  }
  .beit-customizer-panel.customize-studio-panel.open{transform:none!important}
  .customize-studio-panel .customizer-body{grid-template-columns:1fr!important;padding:14px!important}
  .customize-studio-panel .customizer-section{grid-column:auto!important}
}@media(max-width:1500px){}
@media(max-width:1320px){}
@media(max-width:900px){}@media(max-width:1280px){}
@media(max-width:1080px){}@media(max-width:1180px){}@media(max-width:1180px){}@media print{}

/* ── Phase 1 Stability & UX Upgrade ───────────────────────────────── */
.global-filter-bar{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:12px 18px;background:rgba(255,255,255,.92);backdrop-filter:blur(12px);position:relative;z-index:30}
.global-filter-bar .filter-row{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap;width:100%}
.global-filter-bar .filter-row-main{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin;padding-bottom:2px}
.global-filter-bar .filter-row-main::-webkit-scrollbar{height:5px}.global-filter-bar .filter-row-main::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px}
.global-filter-bar .filter-group{min-width:0;flex:0 0 auto}.global-filter-bar .filter-date-group{min-width:244px}.global-filter-bar .filter-client-group{min-width:150px}.global-filter-bar .filter-platform-group{min-width:130px}.global-filter-bar .filter-account-group{min-width:210px}.global-filter-bar .filter-currency-group{min-width:138px}
.global-filter-bar input,.global-filter-bar select{height:32px;border:1px solid var(--border);border-radius:8px;background:#fff;color:var(--text-primary);font-size:12px;font-weight:650;padding:0 9px;outline:none;box-shadow:var(--shadow-xs);max-width:100%}
.global-filter-bar input:focus,.global-filter-bar select:focus{border-color:var(--border-focus);box-shadow:0 0 0 3px rgba(59,130,246,.14)}
.global-filter-bar .date-range-picker{height:32px;border:1px solid var(--border);border-radius:9px;background:#fff;box-shadow:var(--shadow-xs);padding:0 6px;flex-wrap:nowrap}.global-filter-bar .date-range-picker input{border:0;box-shadow:none;width:110px;height:28px;padding:0 3px}.global-filter-bar .date-preset-btns{flex-wrap:nowrap;height:32px}.global-filter-bar .date-preset-btn{height:28px;padding:0 9px;background:#f8fafc}.filter-actions-group{display:flex;gap:6px;align-items:center;flex:0 0 auto}.filter-actions-group .btn{height:32px;white-space:nowrap}.filter-row-meta{align-items:center!important;justify-content:space-between;border-top:1px solid #edf2f7;padding-top:8px;min-height:32px}.filter-preset-control{display:flex;align-items:center;gap:6px;min-width:0;flex-wrap:wrap}.filter-preset-control select{height:28px;font-size:11.5px;min-width:150px}.filter-meta-label{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--text-muted);white-space:nowrap}.filter-meta-pill{display:inline-flex;align-items:center;height:24px;padding:0 9px;border-radius:999px;border:1px solid var(--border);background:#f8fafc;color:#475569;font-size:10.5px;font-weight:750;white-space:nowrap}.filter-meta-warning{background:#fff7ed;color:#c2410c;border-color:#fed7aa;cursor:pointer}.global-filter-bar.filter-dirty::after{content:'Unsaved filter changes';position:absolute;right:18px;top:-10px;background:#0f172a;color:#fff;border-radius:999px;padding:3px 8px;font-size:10px;font-weight:800;box-shadow:var(--shadow-sm)}
.beit-currency-control{height:32px;display:flex!important;align-items:center;gap:6px;background:var(--blue-light)!important;border:1px solid #bfdbfe!important;border-radius:9px!important;padding:0 8px!important;box-shadow:var(--shadow-xs)}.beit-currency-control select{height:28px!important;border:0!important;background:transparent!important;box-shadow:none!important;color:#1d4ed8!important;font-weight:800!important;padding:0!important;min-width:84px}.beit-currency-icon{width:18px;height:18px;border-radius:99px;background:#fff;color:#2563eb;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:900}
.freshness-badge{display:inline-flex;align-items:center;gap:6px;min-height:24px;border-radius:999px;padding:3px 8px;border:1px solid var(--border);background:#f8fafc;color:#475569;font-size:10.5px;font-weight:750;text-decoration:none!important;white-space:nowrap}.freshness-badge small{display:inline;color:inherit;font-size:10px;opacity:.72}.badge-dot{width:7px;height:7px;border-radius:99px;background:currentColor;box-shadow:0 0 0 3px rgba(100,116,139,.12)}.fresh-good{background:#ecfdf5;border-color:#bbf7d0;color:#15803d}.fresh-warn{background:#fff7ed;border-color:#fed7aa;color:#c2410c}.fresh-danger{background:#fef2f2;border-color:#fecaca;color:#dc2626}.fresh-muted{background:#f8fafc;color:#64748b}
.smart-empty-state{border:1px solid var(--border);background:linear-gradient(180deg,#fff,#f8fafc);box-shadow:var(--shadow-sm);padding:28px 20px;border-radius:18px}.empty-tips{display:grid;gap:7px;max-width:620px;margin:12px auto 0}.empty-tips span{display:flex;align-items:flex-start;gap:7px;font-size:12px;line-height:1.4;color:#475569;background:#fff;border:1px solid #e2e8f0;border-radius:10px;padding:8px 10px;text-align:left}.empty-tips span::before{content:'•';font-weight:900;color:#3b82f6}.empty-actions{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:14px}
.table-card{overflow:hidden}.table-wrap{overflow:auto;max-width:100%;border-radius:0 0 var(--radius-lg) var(--radius-lg)}.table-wrap table{min-width:920px}.smart-table thead th,.table-wrap thead th{position:sticky;top:0;z-index:2;background:#f8fafc;box-shadow:inset 0 -1px 0 var(--border)}.compact-table th,.compact-table td{padding:9px 10px;font-size:12px;vertical-align:middle}.table-subtitle{font-size:11px;color:var(--text-muted);margin-top:3px}.entity-cell{display:flex;align-items:center;gap:8px;min-width:180px}.entity-cell strong{display:block;font-size:12.5px;max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entity-cell small,.muted-block{display:block;font-size:10.5px;color:var(--text-muted);margin-top:2px}.table-actions-inline{display:flex;align-items:center;gap:4px;flex-wrap:nowrap}.issue-stack{display:flex;flex-direction:column;gap:4px;min-width:220px}.issue-stack span{font-size:10.5px;color:#475569;background:#f8fafc;border:1px solid #e2e8f0;border-radius:7px;padding:4px 6px;line-height:1.25}.badge-danger{background:#fee2e2!important;color:#b91c1c!important}.badge-warning{background:#fff7ed!important;color:#c2410c!important}.coverage-meter{height:7px;width:92px;background:#e2e8f0;border-radius:99px;overflow:hidden;margin-bottom:4px}.coverage-meter span{display:block;height:100%;background:linear-gradient(90deg,#38bdf8,#22c55e);border-radius:inherit}
.data-health-page{display:flex;flex-direction:column;gap:16px}.data-health-hero{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:16px;background:#fff;border:1px solid var(--border);border-radius:18px;padding:16px 18px;box-shadow:var(--shadow-sm);overflow:hidden;position:relative}.data-health-hero::before{content:'';position:absolute;inset:0 auto 0 0;width:5px;background:#94a3b8}.data-health-hero.health-good::before{background:#22c55e}.data-health-hero.health-warn::before{background:#f59e0b}.data-health-hero.health-danger::before{background:#ef4444}.health-score-ring{width:76px;height:76px;border-radius:999px;background:conic-gradient(#3b82f6 calc(var(--score, 80)*1%),#e2e8f0 0);display:flex;flex-direction:column;align-items:center;justify-content:center;border:6px solid #f8fafc;box-shadow:var(--shadow-sm)}.health-score-ring strong{font-size:22px;line-height:1}.health-score-ring span{font-size:10px;color:#64748b;font-weight:800}.health-hero-copy h2{font-size:20px;line-height:1.2;margin:2px 0 5px}.health-eyebrow{font-size:10px;font-weight:900;color:#64748b;letter-spacing:.1em;text-transform:uppercase}.health-hero-copy p{font-size:12.5px;color:#475569;line-height:1.5}.health-hero-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.health-kpi-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}.health-grid-two{display:grid;grid-template-columns:1.1fr .9fr;gap:16px}.health-panel{background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow-sm);overflow:hidden}.panel-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border);background:#fff}.panel-title{font-size:13px;font-weight:850;color:#0f172a}.panel-subtitle{font-size:11px;color:#94a3b8;margin-top:2px}.health-issue-list{display:grid;gap:8px;padding:12px}.health-issue-item{display:flex;align-items:flex-start;gap:10px;border:1px solid #e2e8f0;background:#f8fafc;border-radius:12px;padding:10px}.health-issue-item.danger{background:#fff7f7;border-color:#fecaca}.health-issue-item.warning{background:#fffbeb;border-color:#fde68a}.health-issue-item strong{display:block;font-size:12.5px}.health-issue-item small{display:block;color:#64748b;font-size:11px;margin-top:3px;line-height:1.35}.health-success-box{background:#ecfdf5;border:1px solid #bbf7d0;color:#166534;border-radius:12px;padding:12px;font-size:12.5px;font-weight:700}.health-checklist{display:grid;gap:9px;padding:14px}.health-checklist label{display:flex;align-items:center;gap:9px;font-size:12px;font-weight:700;color:#334155}.check-dot{width:10px;height:10px;border-radius:999px;background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.16)}.check-dot.good{background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.14)}.check-dot.warn{background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.16)}.check-dot.bad{background:#ef4444;box-shadow:0 0 0 4px rgba(239,68,68,.14)}.health-table-card .table-header{align-items:flex-start}
.beit-customizer-panel.customize-studio-panel{position:fixed!important;top:50%!important;left:50%!important;right:auto!important;width:min(1180px,calc(100vw - 48px))!important;max-width:calc(100vw - 48px)!important;height:min(820px,calc(100vh - 52px))!important;max-height:calc(100vh - 52px)!important;border-radius:18px!important;box-shadow:0 0 0 9999px rgba(15,23,42,.52),0 24px 80px rgba(15,23,42,.28)!important;transform:translate(-50%,-48%) scale(.985)!important;opacity:0;pointer-events:none;overflow:hidden}.beit-customizer-panel.customize-studio-panel.open{transform:translate(-50%,-50%) scale(1)!important;opacity:1;pointer-events:auto}.customize-studio-panel .customizer-head{background:linear-gradient(135deg,#0f172a,#1e293b);color:#fff;border-bottom:0!important;padding:18px 20px!important}.customize-studio-panel .customizer-head small{color:#cbd5e1!important}.customize-studio-panel .customizer-body{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:14px!important;padding:16px!important;background:#f8fafc}.customize-studio-panel .customizer-section{border-radius:14px!important;box-shadow:var(--shadow-xs);background:#fff!important}.customize-studio-panel .customizer-foot{background:#fff;padding:13px 16px!important;border-top:1px solid var(--border)!important}.customize-studio-panel .customizer-section.customize-hero-section{grid-column:1/-1}.customize-studio-panel .customizer-add-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.customizer-column-row,.customizer-widget-row{min-width:0}.customizer-widget-row>*{min-width:0}
@media (max-width:1200px){.global-filter-bar .filter-row-main{flex-wrap:wrap;overflow:visible}.health-kpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.health-grid-two{grid-template-columns:1fr}.data-health-hero{grid-template-columns:1fr}.health-hero-actions{justify-content:flex-start}.customize-studio-panel .customizer-body{grid-template-columns:1fr!important}}
@media (max-width:768px){.global-filter-bar{padding:10px}.global-filter-bar .filter-row-main{gap:7px}.global-filter-bar .filter-group,.global-filter-bar .filter-date-group,.global-filter-bar .filter-client-group,.global-filter-bar .filter-platform-group,.global-filter-bar .filter-account-group,.global-filter-bar .filter-currency-group{width:100%;min-width:0}.global-filter-bar .date-range-picker{width:100%;justify-content:space-between}.global-filter-bar .date-range-picker input{width:calc(50% - 16px)}.filter-actions-group{width:100%}.filter-actions-group .btn{flex:1}.filter-row-meta{justify-content:flex-start}.health-kpi-grid{grid-template-columns:1fr!important}.data-health-hero{padding:14px}.beit-customizer-panel.customize-studio-panel{top:8px!important;left:8px!important;transform:none!important;width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;height:calc(100vh - 16px)!important;max-height:calc(100vh - 16px)!important}.beit-customizer-panel.customize-studio-panel.open{transform:none!important}.customize-studio-panel .customizer-body{padding:12px!important}.customize-studio-panel .customizer-add-grid{grid-template-columns:1fr!important}}

/* ============================================================
   Phase 2 — Intelligence UX
   ============================================================ */
.intelligence-page { display:flex; flex-direction:column; gap:16px; }
.intelligence-hero,
.budget-hero {
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:22px;
  align-items:center;
  background:linear-gradient(135deg,#ffffff 0%,#f8fafc 100%);
  border:1px solid var(--border-color,#e5e7eb);
  border-radius:20px;
  padding:22px;
  box-shadow:0 12px 30px rgba(15,23,42,.06);
}
.intelligence-hero-copy h2,
.budget-hero h2 { margin:4px 0 6px;font-size:28px;line-height:1.1;color:var(--text-main,#0f172a); }
.intelligence-hero-copy p,
.budget-hero p { margin:0;color:var(--text-muted,#64748b);max-width:860px;line-height:1.55;font-size:13px; }
.eyebrow { font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--text-muted,#64748b); }
.score-dial { --score:70;width:108px;height:108px;border-radius:999px;display:grid;place-items:center;background:conic-gradient(#4f46e5 calc(var(--score)*1%), #e5e7eb 0);position:relative; }
.score-dial::before { content:"";position:absolute;inset:9px;border-radius:999px;background:#fff;box-shadow:inset 0 0 0 1px #eef2f7; }
.score-dial-lg { width:132px;height:132px; }
.score-dial-inner { position:relative;text-align:center;display:flex;flex-direction:column;gap:2px; }
.score-dial-inner strong { font-size:28px;line-height:1;color:#0f172a; }
.score-dial-inner span { font-size:11px;color:#64748b;font-weight:700; }
.mini-metric-row { display:flex;flex-wrap:wrap;gap:8px;margin-top:14px; }
.mini-metric-row span { display:flex;align-items:center;gap:6px;background:#fff;border:1px solid #e5e7eb;border-radius:999px;padding:7px 10px;font-size:12px;color:#64748b; }
.mini-metric-row strong { color:#0f172a; }
.intelligence-hero-side { display:grid;gap:8px;min-width:180px; }
.mini-stat { background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:10px 12px; }
.mini-stat span { display:block;font-size:11px;color:#64748b;font-weight:700; }
.mini-stat strong { display:block;font-size:16px;color:#0f172a;margin-top:2px; }
.intelligence-grid-2 { display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px; }
.score-part-list { padding:14px;display:grid;gap:14px; }
.score-part-head { display:flex;justify-content:space-between;gap:10px;align-items:center;font-size:13px; }
.score-track { height:8px;background:#eef2f7;border-radius:999px;overflow:hidden; }
.score-track span { display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,#6366f1,#22c55e); }
.score-part-meta,.muted-small { color:var(--text-muted,#64748b);font-size:11px; }
.insight-list { padding:14px;display:grid;gap:10px; }
.insight-item { display:grid;grid-template-columns:auto 1fr;gap:10px;border:1px solid #e5e7eb;border-radius:16px;padding:12px;background:#fff; }
.insight-item strong { display:block;font-size:13px;color:#0f172a; }
.insight-item p { margin:4px 0 0;color:#64748b;font-size:12px;line-height:1.45; }
.insight-dot { width:10px;height:10px;border-radius:999px;margin-top:4px;background:#64748b; }
.insight-success .insight-dot { background:#16a34a; }
.insight-warning .insight-dot { background:#f59e0b; }
.insight-danger .insight-dot { background:#dc2626; }
.score-pill { display:inline-flex;align-items:center;justify-content:center;min-width:48px;padding:4px 8px;border-radius:999px;background:#eef2ff;color:#3730a3;font-size:11px;font-weight:800; }
.budget-hero { grid-template-columns:minmax(0,1fr) minmax(280px,460px); }
.budget-success { background:linear-gradient(135deg,#ffffff,#ecfdf5); }
.budget-warning { background:linear-gradient(135deg,#ffffff,#fffbeb); }
.budget-danger { background:linear-gradient(135deg,#ffffff,#fef2f2); }
.budget-info { background:linear-gradient(135deg,#ffffff,#eff6ff); }
.budget-progress-wrap { background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:14px; }
.budget-progress-label,.budget-progress-meta { display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px;color:#64748b; }
.budget-progress-label strong { color:#0f172a;font-size:18px; }
.budget-progress { height:10px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin:10px 0; }
.budget-progress span { display:block;height:100%;background:linear-gradient(90deg,#06b6d4,#2563eb);border-radius:999px; }
.guidance-list { padding:14px;display:grid;gap:10px; }
.guidance-item { display:flex;justify-content:space-between;gap:10px;border:1px solid #e5e7eb;border-radius:14px;padding:11px 12px;background:#fff; }
.guidance-item strong { color:#0f172a;font-size:13px; }
.guidance-item span { color:#475569;font-weight:800;font-size:13px; }
.guidance-note { border-radius:14px;background:#f8fafc;border:1px dashed #cbd5e1;color:#475569;font-size:12px;line-height:1.55;padding:12px; }
.insight-strip { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px; }
.insight-chip { border:1px solid #e5e7eb;border-radius:16px;padding:12px;background:#fff;display:flex;flex-direction:column;gap:5px;min-height:88px; }
.insight-chip strong { font-size:13px;color:#0f172a; }
.insight-chip span { font-size:12px;line-height:1.4;color:#64748b; }
.insight-chip.insight-success { border-color:#bbf7d0;background:#f0fdf4; }
.insight-chip.insight-warning { border-color:#fed7aa;background:#fffbeb; }
.insight-chip.insight-danger { border-color:#fecaca;background:#fef2f2; }
.recommendation-board { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:start; }
.recommendation-lane { background:#f8fafc;border:1px solid #e5e7eb;border-radius:18px;padding:12px;display:grid;gap:10px; }
.recommendation-lane-head { display:flex;align-items:center;justify-content:space-between;font-size:13px;color:#0f172a;padding:0 2px 4px; }
.recommendation-lane-head span { background:#fff;border:1px solid #e5e7eb;border-radius:999px;padding:3px 8px;font-weight:800; }
.recommendation-card { background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:13px;box-shadow:0 6px 18px rgba(15,23,42,.04);display:grid;gap:9px; }
.recommendation-danger { border-left:4px solid #dc2626; }
.recommendation-warning { border-left:4px solid #f59e0b; }
.recommendation-success { border-left:4px solid #16a34a; }
.recommendation-info { border-left:4px solid #2563eb; }
.recommendation-card-top { display:flex;align-items:center;justify-content:space-between;gap:8px; }
.rec-category { font-size:11px;color:#64748b;font-weight:800;text-transform:uppercase;letter-spacing:.04em; }
.recommendation-card h3 { margin:0;font-size:15px;line-height:1.25;color:#0f172a; }
.recommendation-card p { margin:0;color:#64748b;font-size:12px;line-height:1.45; }
.rec-evidence { display:flex;flex-wrap:wrap;gap:6px; }
.rec-evidence span { display:flex;gap:5px;align-items:center;background:#f8fafc;border:1px solid #e5e7eb;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:800;color:#334155; }
.rec-evidence em { font-style:normal;color:#64748b;font-weight:700; }
.rec-action,.rec-impact { font-size:12px;line-height:1.45;color:#334155;background:#f8fafc;border-radius:12px;padding:9px; }
.rec-footer { display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap; }
.signal-cluster { display:flex;flex-wrap:wrap;gap:8px; }
.signal-pill { display:inline-flex;gap:8px;align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:999px;padding:7px 10px;font-size:12px;color:#64748b; }
.signal-pill strong { color:#0f172a; }
.anomaly-row td { vertical-align:top; }
.goal-create-form { padding:16px;display:grid;grid-template-columns:1.4fr 1fr .8fr .8fr 1fr .8fr .8fr .8fr auto;gap:10px;align-items:end; }
.goal-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px; }
.goal-card { background:#fff;border:1px solid #e5e7eb;border-radius:18px;padding:16px;box-shadow:0 8px 22px rgba(15,23,42,.04);display:grid;gap:12px; }
.goal-card-top { display:flex;justify-content:space-between;gap:12px;align-items:flex-start; }
.goal-title { font-size:15px;font-weight:900;color:#0f172a; }
.goal-meta { font-size:11px;color:#64748b;margin-top:3px; }
.goal-values { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px; }
.goal-values div { background:#f8fafc;border:1px solid #e5e7eb;border-radius:13px;padding:9px; }
.goal-values span { display:block;font-size:10px;color:#64748b;font-weight:800;text-transform:uppercase;letter-spacing:.04em; }
.goal-values strong { display:block;margin-top:3px;color:#0f172a;font-size:14px; }
.goal-foot,.goal-risk-row { display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:11px;color:#64748b; }
.goal-status-form { display:flex;gap:8px;align-items:center; }
.goal-status-form select { flex:1; }
@media (max-width: 1180px) {
  .intelligence-hero { grid-template-columns:auto 1fr; }
  .intelligence-hero-side { grid-column:1 / -1;grid-template-columns:repeat(3,minmax(0,1fr)); }
  .budget-hero,.intelligence-grid-2,.recommendation-board,.goal-grid { grid-template-columns:1fr; }
  .insight-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .goal-create-form { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .intelligence-hero { grid-template-columns:1fr;text-align:left; }
  .score-dial { margin:auto; }
  .intelligence-hero-side { grid-template-columns:1fr; }
  .insight-strip,.goal-values { grid-template-columns:1fr; }
  .goal-create-form { grid-template-columns:1fr; }
}

/* ============================================================
   Phase 3 — Workflow UX
   ============================================================ */
.workflow-page{display:grid;gap:18px}.workflow-filter-card{background:var(--card-bg,#fff);border:1px solid var(--border,#e5e7eb);border-radius:18px;padding:14px;box-shadow:0 10px 30px rgba(15,23,42,.04)}.workflow-filter-grid{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:12px;align-items:end}.workflow-filter-grid .filter-actions{display:flex;gap:8px;align-items:center}.workflow-columns{display:grid;grid-template-columns:repeat(4,minmax(220px,1fr));gap:14px;align-items:start}.workflow-lane{background:#f8fafc;border:1px solid #e2e8f0;border-radius:18px;padding:12px;min-height:160px}.workflow-lane-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.workflow-lane-head strong{font-size:13px;color:#0f172a}.workflow-lane-head span{background:#fff;border:1px solid #e2e8f0;border-radius:999px;padding:3px 8px;font-size:11px;color:#64748b}.workflow-card{background:#fff;border:1px solid #e5e7eb;border-left:4px solid #94a3b8;border-radius:16px;padding:12px;margin-bottom:10px;box-shadow:0 12px 24px rgba(15,23,42,.05)}.workflow-card.priority-urgent,.workflow-card.priority-high{border-left-color:#ef4444}.workflow-card.priority-medium{border-left-color:#f59e0b}.workflow-card.priority-low{border-left-color:#3b82f6}.workflow-card-top{display:flex;justify-content:space-between;gap:8px;align-items:center;font-size:11px;color:#64748b}.workflow-card h3{font-size:14px;line-height:1.35;margin:8px 0 4px;color:#0f172a}.workflow-card p{font-size:12px;color:#475569;line-height:1.45;margin:0 0 8px}.workflow-next{background:#f8fafc;border-radius:12px;padding:8px;font-size:12px;color:#334155;margin:8px 0}.workflow-meta{display:flex;flex-wrap:wrap;gap:6px;margin:9px 0}.workflow-meta span{font-size:10.5px;background:#f1f5f9;border-radius:999px;padding:4px 7px;color:#475569}.workflow-inline-form{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:8px}.workflow-card-actions{display:flex;justify-content:space-between;align-items:center;margin-top:8px;font-size:10px;color:#94a3b8}.workflow-empty{font-size:12px;color:#94a3b8;text-align:center;border:1px dashed #cbd5e1;border-radius:14px;padding:14px;background:rgba(255,255,255,.55)}.workflow-two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px}.workflow-suggestion-list{display:grid;gap:10px;padding:12px}.workflow-suggestion-card{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#fff;border:1px solid #e5e7eb;border-radius:14px;padding:12px}.workflow-suggestion-card strong{font-size:13px;color:#0f172a}.workflow-suggestion-card p{font-size:12px;color:#64748b;margin:3px 0 0;line-height:1.4}.workflow-suggestion-card small{font-size:11px;color:#94a3b8}.alert-card-mini{border-left:4px solid #f59e0b}.note-card-mini{border-left:4px solid #22c55e}.workflow-manual-form{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:12px;padding:14px}.workflow-span-2{grid-column:span 2}.workflow-form-actions{display:flex;align-items:end}.workflow-status-cell{display:grid;gap:6px;min-width:150px}.notification-feed{display:grid;gap:10px}.notification-card{display:grid;grid-template-columns:14px 1fr auto;gap:12px;background:#fff;border:1px solid #e5e7eb;border-radius:16px;padding:14px;box-shadow:0 10px 28px rgba(15,23,42,.04)}.notification-card.unread{border-color:#bfdbfe;background:linear-gradient(90deg,#eff6ff,#fff)}.notification-dot{width:9px;height:9px;border-radius:999px;background:#94a3b8;margin-top:6px}.notification-card.unread .notification-dot{background:#2563eb}.notification-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}.notification-head strong{font-size:14px;color:#0f172a}.notification-head time{font-size:11px;color:#94a3b8;white-space:nowrap}.notification-main p{font-size:12.5px;color:#475569;margin:5px 0 8px;line-height:1.5}.notification-meta{display:flex;flex-wrap:wrap;gap:6px}.notification-meta span{font-size:10.5px;background:#f1f5f9;border-radius:999px;padding:4px 8px;color:#64748b}.notification-actions{display:flex;gap:6px;align-items:center}.role-inline-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.permission-matrix th,.permission-matrix td{text-align:center}.permission-matrix td:first-child,.permission-matrix th:first-child{text-align:left}.permission-yes{display:inline-flex;border-radius:999px;background:#dcfce7;color:#166534;font-size:11px;font-weight:700;padding:4px 8px}.permission-no{display:inline-flex;border-radius:999px;background:#f1f5f9;color:#94a3b8;font-size:11px;font-weight:700;padding:4px 8px}.btn-xs{font-size:11px;padding:5px 8px;border-radius:8px}.alert{border-radius:14px;padding:12px 14px;font-size:13px}.alert-info{background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8}
@media (max-width:1200px){.workflow-columns{grid-template-columns:repeat(2,minmax(220px,1fr))}.workflow-two-col{grid-template-columns:1fr}.workflow-filter-grid,.workflow-manual-form{grid-template-columns:repeat(2,minmax(150px,1fr))}.workflow-span-2{grid-column:span 2}}
@media (max-width:700px){.workflow-columns,.workflow-filter-grid,.workflow-manual-form{grid-template-columns:1fr}.workflow-span-2{grid-column:span 1}.notification-card{grid-template-columns:10px 1fr}.notification-actions{grid-column:2;justify-content:flex-start}.workflow-suggestion-card{align-items:flex-start;flex-direction:column}.workflow-suggestion-card button{width:100%}}

.client-experience-kpis{margin-bottom:14px}
.client-exp-helper-card{display:flex;justify-content:space-between;gap:16px;align-items:center;background:linear-gradient(135deg,#eff6ff,#f8fafc);border:1px solid #bfdbfe;border-radius:18px;padding:16px 18px;box-shadow:var(--shadow-xs);margin-bottom:14px}
.client-exp-helper-card strong{display:block;font-size:16px;margin-bottom:4px}.client-exp-helper-card p{margin:0;color:var(--text-muted);font-size:13px}.client-exp-helper-card span{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.07em;color:#2563eb;white-space:nowrap}.btn-xs{font-size:10.5px;padding:4px 7px;border-radius:7px}

.global-filter-bar{display:flex!important;flex-direction:row!important;align-items:flex-end!important;gap:8px!important;flex-wrap:nowrap!important;overflow-x:auto!important;padding:10px 18px!important;background:rgba(255,255,255,.94)!important;border-bottom:1px solid #e8eef7!important;scrollbar-width:thin}
.global-filter-bar .filter-row{display:flex!important;align-items:flex-end!important;gap:8px!important;flex-wrap:nowrap!important;width:auto!important;min-width:max-content!important;border-top:0!important;padding-top:0!important}
.global-filter-bar .filter-row-main{overflow:visible!important;padding-bottom:0!important}
.global-filter-bar .filter-row-meta,.global-filter-bar .filter-preset-control{display:none!important}
.global-filter-bar .filter-date-group{min-width:230px!important}.global-filter-bar .filter-client-group{min-width:145px!important}.global-filter-bar .filter-platform-group{min-width:135px!important}.global-filter-bar .filter-account-group{min-width:190px!important}.global-filter-bar .filter-currency-group{min-width:124px!important}
.global-filter-bar .filter-quick-group{min-width:225px!important}.global-filter-bar .date-preset-btn{font-size:11px;padding:0 7px!important}.global-filter-bar input,.global-filter-bar select{height:31px!important;min-height:31px!important;font-size:11.5px!important;border-radius:9px!important}.global-filter-bar .date-range-picker{height:31px!important}.global-filter-bar .date-range-picker input{width:102px!important;height:27px!important}.global-filter-bar .btn{height:31px!important;padding:0 12px!important;font-size:11.5px!important;white-space:nowrap}.global-filter-bar .filter-label{font-size:9.5px!important;margin-bottom:4px!important}.filter-actions-group{gap:6px!important}.filter-status-group{display:flex;align-items:center;gap:6px;flex:0 0 auto;margin-left:4px;margin-bottom:1px}.filter-status-group .freshness-badge,.filter-status-group .filter-meta-pill{height:27px;white-space:nowrap;font-size:10.5px}.filter-meta-pill{height:27px!important}
.charts-row .chart-card,.table-card{min-width:0}.chart-card .chart-body canvas{max-width:100%}@media(max-width:900px){}/* Campaign hierarchy + synced breakdown overlay */
.hier-ad-thumb{width:22px;height:22px;border-radius:6px;object-fit:cover;border:1px solid var(--border);vertical-align:middle;margin-right:6px;background:#f8fafc}
.beit-campaign-hierarchy-card .table-title{display:flex;align-items:center;gap:8px}
.beit-breakdown-control,.beit-breakdown-inline-btn{white-space:nowrap}
tr.beit-breakdown-active>td:first-child{box-shadow:inset 3px 0 0 #7c3aed}
tr.beit-breakdown-row>td{background:#faf5ff!important;padding:10px 14px!important;border-top:1px solid #e9d5ff;border-bottom:1px solid #e9d5ff}
.beit-breakdown-box{border:1px solid #e9d5ff;background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 4px 14px rgba(124,58,237,.08)}
.beit-breakdown-title{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;background:#f5f3ff;color:#5b21b6;font-size:12px;font-weight:800}
.beit-breakdown-title em{font-style:normal;font-weight:600;color:#7c3aed;font-size:11px}
.beit-breakdown-mini{overflow:auto;max-width:100%}
.beit-breakdown-mini table{width:100%;font-size:11.5px;margin:0}
.beit-breakdown-mini th,.beit-breakdown-mini td{padding:7px 10px!important;white-space:nowrap;border-bottom:1px solid #f3e8ff!important}
.beit-breakdown-mini tbody tr:last-child td{border-bottom:none!important}
.beit-breakdown-mini td:first-child{max-width:280px;overflow:hidden;text-overflow:ellipsis}
.beit-breakdown-modal{position:fixed;inset:0;z-index:9999;background:rgba(15,23,42,.45);display:none;align-items:center;justify-content:center;padding:20px}
.beit-breakdown-modal.open{display:flex}
.beit-breakdown-dialog{width:min(620px,calc(100vw - 32px));background:var(--card-bg,#fff);border:1px solid var(--border);border-radius:18px;box-shadow:0 22px 70px rgba(15,23,42,.28);overflow:hidden}
.beit-breakdown-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:16px 18px;border-bottom:1px solid var(--border)}
.beit-breakdown-head strong{display:block;font-size:15px;color:var(--text-primary)}
.beit-breakdown-head small{display:block;margin-top:4px;color:var(--text-secondary);font-size:12px;line-height:1.4}
.beit-breakdown-body{padding:16px 18px}
.beit-breakdown-controls{display:flex;align-items:end;gap:10px;flex-wrap:wrap}
.beit-breakdown-controls label{display:flex;flex-direction:column;gap:5px;min-width:260px;font-size:11px;color:var(--text-secondary);font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.beit-breakdown-controls select{min-height:34px;border:1px solid var(--border);border-radius:8px;padding:6px 10px;background:#fff;color:var(--text-primary);font-size:13px;text-transform:none;font-weight:600;letter-spacing:0}
.beit-breakdown-notice{margin-top:12px;font-size:12px;color:var(--text-secondary);line-height:1.5}
.snap-zero-note{padding:10px 18px;background:#f8fafc;border-top:1px solid var(--border);font-size:12px;color:var(--text-secondary)}
@media(max-width:700px){.beit-breakdown-controls{display:block}.beit-breakdown-controls label{min-width:0;margin-bottom:10px}.beit-breakdown-dialog{width:100%}}

/* Safe Snapchat-style campaign hierarchy tables */
.beit-campaign-hierarchy-card table[data-beit-hierarchy-safe="1"] tbody td{height:auto!important;min-height:0!important;vertical-align:middle!important;line-height:1.35!important}
.beit-campaign-hierarchy-card table[data-beit-hierarchy-safe="1"] tbody tr{height:auto!important}
.beit-hierarchy-preset{min-height:30px;border:1px solid var(--border);border-radius:8px;background:#fff;color:var(--text-primary);font-size:12px;font-weight:700;padding:4px 8px;max-width:190px}
.beit-ad-name-cell{display:table-cell!important;white-space:nowrap!important;max-width:320px!important;overflow:hidden!important;text-overflow:ellipsis!important}
.hier-ad-title{vertical-align:middle;display:inline-block;max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hier-ad-thumb-empty{display:inline-flex!important;align-items:center;justify-content:center;font-size:8px;font-weight:800;color:#64748b;background:#f1f5f9;vertical-align:middle}
.beit-campaign-hierarchy-card .table-actions{gap:6px;align-items:center}
.beit-campaign-hierarchy-card .beit-breakdown-control{font-weight:800}

/* Campaign hierarchy table hardening: Snapchat-style across all pages */
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"]{border-collapse:collapse;width:100%;table-layout:auto;min-width:1180px;font-variant-numeric:tabular-nums}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] th,
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] td{height:auto!important;min-height:0!important;vertical-align:middle!important;line-height:1.35!important;white-space:nowrap;padding-top:9px;padding-bottom:9px}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr{height:auto!important;min-height:0!important}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody td:first-child{min-width:220px;max-width:360px;overflow:hidden;text-overflow:ellipsis}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] .hier-row-l0 td:first-child{padding-left:11px;font-weight:700;color:var(--text-primary)}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] .hier-row-l1 td:first-child{padding-left:26px;color:var(--text-primary)}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] .hier-row-l2 td:first-child{padding-left:43px;color:var(--text-secondary);font-size:12px}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] .snap-ad-thumb,
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] .hier-ad-thumb{width:22px!important;height:22px!important;border-radius:6px;object-fit:cover;border:1px solid var(--border);vertical-align:middle;margin-right:6px;background:#f8fafc;display:inline-block!important;position:static!important}
.beit-campaign-hierarchy-card .table-actions{gap:6px;align-items:center;flex-wrap:wrap}
.beit-campaign-hierarchy-card .table-actions .btn,
.beit-campaign-hierarchy-card .table-actions select{height:34px}
.beit-campaign-hierarchy-card .beit-hierarchy-preset{min-width:112px}
.beit-hierarchy-columns-control,.beit-breakdown-control{white-space:nowrap;font-weight:800}
.beit-hierarchy-columns-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px;max-height:360px;overflow:auto;border:1px solid var(--border);border-radius:12px;padding:10px;background:#f8fafc}
.beit-hierarchy-columns-list .custom-check{margin:0;background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:7px 8px}
.beit-columns-dialog{width:min(560px,calc(100vw - 32px))}
.beit-campaign-hierarchy-card tr.beit-breakdown-row>td{white-space:normal!important;max-width:none!important}
.beit-campaign-hierarchy-card .beit-breakdown-mini table{min-width:760px!important}
@media(max-width:700px){.beit-hierarchy-columns-list{grid-template-columns:1fr}.beit-campaign-hierarchy-card .table-actions{justify-content:flex-start}}

/* Campaign hierarchy final repair v4 */
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"],
.beit-campaign-hierarchy-card table[data-beit-hierarchy-safe="1"]{border-collapse:collapse;width:100%;table-layout:auto;min-width:1180px;font-variant-numeric:tabular-nums}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] th,
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] td,
.beit-campaign-hierarchy-card table[data-beit-hierarchy-safe="1"] th,
.beit-campaign-hierarchy-card table[data-beit-hierarchy-safe="1"] td{height:auto!important;min-height:0!important;vertical-align:middle!important;line-height:1.35!important;white-space:nowrap;padding-top:9px!important;padding-bottom:9px!important}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr,
.beit-campaign-hierarchy-card table[data-beit-hierarchy-safe="1"] tbody tr{height:auto!important;min-height:0!important}
.beit-campaign-hierarchy-card .hier-row-l0 td:first-child{padding-left:11px!important;font-weight:800;color:var(--text-primary)}
.beit-campaign-hierarchy-card .hier-row-l1 td:first-child{padding-left:26px!important;color:var(--text-primary)}
.beit-campaign-hierarchy-card .hier-row-l2 td:first-child,
.beit-campaign-hierarchy-card .beit-ad-row td:first-child{padding-left:43px!important;color:var(--text-secondary);font-size:12px;min-width:220px;max-width:390px;overflow:hidden;text-overflow:ellipsis}
.beit-campaign-hierarchy-card .hier-ad-indent{display:inline-block;width:16px;min-width:16px;vertical-align:middle}
.beit-campaign-hierarchy-card .hier-ad-creative{display:inline-flex;align-items:center;gap:7px;min-width:0;max-width:330px;vertical-align:middle}
.beit-campaign-hierarchy-card .hier-ad-name{display:inline-block;min-width:0;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-secondary)}
.beit-campaign-hierarchy-card .snap-ad-thumb,
.beit-campaign-hierarchy-card .hier-ad-thumb{width:24px!important;height:24px!important;min-width:24px!important;border-radius:6px;object-fit:cover;border:1px solid var(--border);vertical-align:middle;background:#f8fafc;display:inline-flex!important;align-items:center;justify-content:center;position:static!important;margin:0!important}
.beit-campaign-hierarchy-card .hier-ad-thumb-empty{font-size:8px;font-weight:900;color:#64748b;background:#f1f5f9;letter-spacing:.02em}
.beit-campaign-hierarchy-card .table-actions{gap:6px;align-items:center;flex-wrap:wrap}
.beit-campaign-hierarchy-card .table-actions .btn,
.beit-campaign-hierarchy-card .table-actions select{height:34px;min-height:34px}
.beit-campaign-hierarchy-card .beit-hierarchy-preset{min-width:112px}
.beit-campaign-hierarchy-card .beit-hierarchy-columns-control,
.beit-campaign-hierarchy-card .beit-breakdown-control{white-space:nowrap;font-weight:800;cursor:pointer;pointer-events:auto}
.beit-campaign-hierarchy-card .expand-btn{cursor:pointer;pointer-events:auto}
.beit-hierarchy-columns-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 12px;max-height:360px;overflow:auto;border:1px solid var(--border);border-radius:12px;padding:10px;background:#f8fafc}
.beit-hierarchy-columns-list .custom-check{margin:0;background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:7px 8px}
.beit-campaign-hierarchy-card tr.beit-breakdown-row>td{white-space:normal!important;max-width:none!important;background:#faf5ff!important;padding:10px 14px!important;border-top:1px solid #e9d5ff;border-bottom:1px solid #e9d5ff}
.beit-campaign-hierarchy-card .beit-breakdown-mini table{min-width:760px!important;width:100%}
.beit-campaign-hierarchy-card .beit-breakdown-mini th,
.beit-campaign-hierarchy-card .beit-breakdown-mini td{height:auto!important;min-height:0!important;padding:7px 10px!important;white-space:nowrap!important}
.beit-breakdown-modal.open{display:flex!important}
@media(max-width:700px){.beit-hierarchy-columns-list{grid-template-columns:1fr}.beit-campaign-hierarchy-card .table-actions{justify-content:flex-start}}

/* Campaign hierarchy defaults and safe totals */
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tfoot .beit-hierarchy-total-row td{
  background:#f8fafc!important;
  border-top:2px solid var(--border,#dbe3ef)!important;
  font-weight:800;
  color:var(--text-primary,#0f172a);
  white-space:nowrap;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tfoot .beit-hierarchy-total-row .total-row-note{
  display:block;
  margin-top:2px;
  font-size:10px;
  line-height:1.1;
  font-weight:600;
  color:var(--text-muted,#64748b);
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr[data-hidden="1"]{display:none;}

/* Campaign hierarchy v7: rich columns panel + Facebook-like aligned breakdown rows */
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr.beit-breakdown-heading-row > td {
  background: linear-gradient(90deg, rgba(99,102,241,.10), rgba(147,51,234,.07));
  border-top: 1px solid rgba(124,58,237,.22);
  border-bottom: 1px solid rgba(124,58,237,.16);
  padding: 9px 12px;
}
.beit-breakdown-inline-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  color:#4c1d95;
  font-size:12px;
}
.beit-breakdown-inline-head span { color:#64748b; font-weight:600; }
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr.beit-breakdown-segment-row td {
  background:#fbf8ff;
  border-bottom:1px solid rgba(124,58,237,.12);
  color:#0f172a;
  height:36px;
  vertical-align:middle;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr.beit-breakdown-segment-row:hover td {
  background:#f5efff;
}
.beit-breakdown-segment-cell {
  padding-left:28px !important;
  white-space:nowrap;
  min-width:220px;
}
.breakdown-pill {
  display:inline-flex;
  align-items:center;
  padding:2px 7px;
  margin-right:8px;
  border-radius:999px;
  background:#ede9fe;
  color:#6d28d9;
  font-size:10px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tr.beit-breakdown-active > td:first-child {
  box-shadow: inset 3px 0 0 rgba(124,58,237,.45);
}
/* Make campaign hierarchy rows stay compact and vertically aligned after column/order/custom metric changes. */
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] th,
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] td {
  vertical-align:middle;
}
.beit-campaign-hierarchy-card .hier-ad-creative {
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-width:0;
}
.beit-campaign-hierarchy-card .hier-ad-thumb {
  flex:0 0 auto;
  width:24px;
  height:24px;
  border-radius:6px;
  object-fit:cover;
  border:1px solid rgba(148,163,184,.35);
  background:#e2e8f0;
}
.beit-campaign-hierarchy-card .hier-ad-thumb-empty {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:8px;
  font-weight:800;
  color:#64748b;
}
.beit-campaign-hierarchy-card .hier-ad-name {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:210px;
}
.beit-campaign-hierarchy-card .beit-hierarchy-total-row td {
  background:#f8fafc;
  border-top:2px solid #dbeafe;
  font-weight:700;
}
.beit-campaign-hierarchy-card .total-row-note {
  display:block;
  margin-top:2px;
  color:#94a3b8;
  font-size:10px;
  font-weight:500;
}
/* Rich columns panel minor fixes for hierarchy tables. */
#beitTablePanel .customizer-column-item .column-actions {
  display:flex;
  align-items:center;
  gap:5px;
  margin-left:auto;
}
#beitTablePanel .customizer-column-item .danger {
  color:#ef4444;
  border-color:#fecaca;
}
#beitTablePanel .custom-metric-create textarea#hMetricFormula {
  width:100%;
  min-height:110px;
  border:1px solid #dbe3ef;
  border-radius:12px;
  padding:12px;
  resize:vertical;
  background:#fff;
}

/* Campaign hierarchy v8: clean selected columns UI and aligned Ads-Manager-style breakdown rows */
.beit-hierarchy-studio-v8.beit-customizer-panel.beit-table-panel{
  width:min(1280px,calc(100vw - 44px))!important;
  max-width:calc(100vw - 44px)!important;
}
.beit-hierarchy-studio-v8 .table-studio-body{
  grid-template-columns:minmax(0,1fr) 360px!important;
}
.beit-hierarchy-studio-v8 .table-studio-selected.v8-selected-panel{
  background:#f8fafc!important;
  border-left:1px solid #e2e8f0!important;
  padding:18px 14px 14px!important;
  overflow:hidden!important;
}
.beit-hierarchy-studio-v8 .selected-head strong{
  display:block;
  color:#0f172a;
  font-size:15px;
  margin-bottom:4px;
}
.beit-hierarchy-studio-v8 .selected-head small{
  display:block;
  color:#64748b;
  line-height:1.4;
}
.beit-hierarchy-studio-v8 .v8-selected-list{
  flex:1;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:8px 2px 2px;
  border-top:1px solid #e2e8f0;
}
.beit-hierarchy-studio-v8 .v8-selected-column{
  display:grid;
  grid-template-columns:18px minmax(0,1fr) auto;
  align-items:center;
  gap:9px;
  padding:9px 10px;
  border:1px solid #dbe3ef;
  border-radius:12px;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.035);
}
.beit-hierarchy-studio-v8 .v8-selected-column:hover{
  border-color:#bfdbfe;
  box-shadow:0 5px 16px rgba(15,23,42,.055);
}
.beit-hierarchy-studio-v8 .v8-selected-column.is-dragging{opacity:.55}
.beit-hierarchy-studio-v8 .v8-drag{
  color:#94a3b8;
  font-weight:900;
  letter-spacing:-3px;
  cursor:grab;
  user-select:none;
}
.beit-hierarchy-studio-v8 .v8-selected-name{min-width:0}
.beit-hierarchy-studio-v8 .v8-selected-name strong{
  display:block;
  font-size:12.5px;
  color:#0f172a;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.beit-hierarchy-studio-v8 .v8-selected-name small{
  display:block;
  margin-top:1px;
  color:#94a3b8;
  font-size:10.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.beit-hierarchy-studio-v8 .v8-selected-actions{
  display:flex;
  align-items:center;
  gap:5px;
  flex-wrap:nowrap;
}
.beit-hierarchy-studio-v8 .v8-selected-actions .btn-xs{
  height:24px;
  padding:0 7px;
  font-size:10.5px;
  border-radius:7px;
}
.beit-hierarchy-studio-v8 .v8-remove{
  width:24px;
  height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #fecaca;
  background:#fff;
  color:#ef4444;
  border-radius:8px;
  font-size:16px;
  font-weight:800;
  line-height:1;
  cursor:pointer;
}
.beit-hierarchy-studio-v8 .v8-remove:hover{background:#fef2f2}
.beit-hierarchy-studio-v8 .v8-lock{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#eef2ff;
  color:#4f46e5;
  font-size:10px;
  font-weight:800;
}
.beit-hierarchy-studio-v8 .studio-metric-group summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.beit-hierarchy-studio-v8 .studio-metric-group summary small{
  color:#94a3b8;
  font-size:10.5px;
  font-weight:700;
}

.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr.beit-breakdown-heading-row > td{
  background:#f5f3ff!important;
  border-top:1px solid #ddd6fe!important;
  border-bottom:1px solid #ddd6fe!important;
  padding:8px 12px!important;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr.beit-breakdown-segment-row td{
  background:#fbfaff!important;
  border-bottom:1px solid #ede9fe!important;
  color:#0f172a;
  height:34px;
  vertical-align:middle!important;
  font-variant-numeric:tabular-nums;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tbody tr.beit-breakdown-segment-row:hover td{background:#f7f2ff!important}
.beit-campaign-hierarchy-card .beit-breakdown-segment-cell{
  padding-left:34px!important;
  max-width:320px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.beit-campaign-hierarchy-card .beit-breakdown-segment-cell strong{
  font-weight:700;
  color:#312e81;
}
.beit-campaign-hierarchy-card .breakdown-pill{
  display:inline-flex;
  align-items:center;
  padding:2px 7px;
  margin-right:8px;
  border-radius:999px;
  background:#ede9fe;
  color:#6d28d9;
  font-size:9.5px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.beit-breakdown-inline-head{
  display:flex!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:12px!important;
  color:#4c1d95!important;
  font-size:12px!important;
}
.beit-breakdown-inline-head span{color:#64748b!important;font-weight:600!important}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tr.beit-breakdown-active > td:first-child{
  box-shadow:inset 3px 0 0 #8b5cf6!important;
}
@media(max-width:900px){
  .beit-hierarchy-studio-v8 .table-studio-body{grid-template-columns:1fr!important}
  .beit-hierarchy-studio-v8 .table-studio-selected.v8-selected-panel{max-height:360px;border-left:0!important;border-top:1px solid #e2e8f0!important}
}

/* Meta-style Campaign Hierarchy level navigation */
.beit-campaign-hierarchy-card .table-header{align-items:center;gap:12px;}
.beit-hierarchy-level-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;border-top:1px solid var(--border,#e5e7eb);border-bottom:1px solid var(--border,#e5e7eb);background:linear-gradient(180deg,#f8fafc,#fff);}
.beit-hierarchy-tabs{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.beit-hierarchy-level-tab{border:1px solid #dbe4f0;background:#f8fafc;color:#0f172a;border-radius:12px;padding:10px 16px;font-weight:800;display:inline-flex;align-items:center;gap:8px;cursor:pointer;box-shadow:0 1px 2px rgba(15,23,42,.04);transition:.16s ease;}
.beit-hierarchy-level-tab:hover{border-color:#bcd0ea;background:#f1f7ff;}
.beit-hierarchy-level-tab.active{background:#e8f2ff;border-color:#86b7ff;color:#0b57d0;box-shadow:inset 0 0 0 1px rgba(11,87,208,.08);}
.beit-hierarchy-level-tab em{font-style:normal;font-size:11px;line-height:1;background:#fff;border:1px solid #dbe4f0;border-radius:999px;padding:4px 7px;color:#64748b;}
.beit-hierarchy-level-tab.active em{background:#0b57d0;color:#fff;border-color:#0b57d0;}
.beit-hierarchy-level-tab .tab-icon{font-size:15px;color:inherit;opacity:.9;}
.beit-hierarchy-scope{font-size:12px;color:#64748b;max-width:440px;text-align:right;}
.beit-level-cell{display:flex;align-items:center;gap:9px;min-height:30px;}
.beit-row-select{display:inline-flex;align-items:center;justify-content:center;width:18px;min-width:18px;}
.beit-row-select input{width:16px;height:16px;cursor:pointer;accent-color:#2563eb;}
.beit-hierarchy-name{appearance:none;border:0;background:transparent;color:#0f172a;padding:0;text-align:left;font:inherit;cursor:pointer;max-width:420px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.beit-hierarchy-name:hover{color:#0b57d0;text-decoration:underline;}
.beit-campaign-row .beit-hierarchy-name{font-weight:800;}
.beit-adgroup-row .beit-hierarchy-name{font-weight:600;}
.beit-level-cell-adgroup{padding-left:2px;}
.beit-level-cell-ad{padding-left:2px;}
.beit-level-cell .hier-ad-creative{display:inline-flex;align-items:center;gap:9px;min-width:0;}
.beit-level-cell .hier-ad-name{max-width:360px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.beit-hierarchy-back:disabled{opacity:.45;cursor:not-allowed;}
.beit-campaign-hierarchy-card tr[data-hierarchy-level]{cursor:default;}
.beit-campaign-hierarchy-card tr[data-hierarchy-level="campaign"] .beit-hierarchy-name,
.beit-campaign-hierarchy-card tr[data-hierarchy-level="ad_group"] .beit-hierarchy-name{cursor:pointer;}
.beit-campaign-hierarchy-card tr[data-hierarchy-level="campaign"]:hover,
.beit-campaign-hierarchy-card tr[data-hierarchy-level="ad_group"]:hover,
.beit-campaign-hierarchy-card tr[data-hierarchy-level="ad"]:hover{background:#f8fbff;}
.beit-campaign-hierarchy-card .expand-btn{display:none!important;}
.beit-campaign-hierarchy-card .beit-breakdown-row,
.beit-campaign-hierarchy-card .beit-breakdown-heading-row{cursor:default;}
@media (max-width: 980px){.beit-hierarchy-level-bar{align-items:flex-start;flex-direction:column}.beit-hierarchy-scope{text-align:left}.beit-hierarchy-level-tab{padding:8px 10px}.beit-hierarchy-name{max-width:260px}}



/* Campaign hierarchy integrity v13 */
.beit-campaign-hierarchy-card .beit-breakdown-heading-row > td {
  background: #f4ecff;
  border-top: 1px solid #e3d1ff;
  border-bottom: 1px solid #eadcff;
  padding: 10px 14px;
}
.beit-breakdown-inline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: #4c1d95;
}
.beit-breakdown-inline-head strong {
  font-weight: 800;
}
.beit-breakdown-inline-head span {
  color: #7c6aa8;
  font-size: 11px;
}
tr.beit-breakdown-segment-row td {
  background: #fbf7ff;
  border-bottom: 1px solid #efe3ff;
  color: #172033;
  vertical-align: middle;
}
tr.beit-breakdown-segment-row:hover td {
  background: #f7efff;
}
.beit-breakdown-segment-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 260px;
  font-size: 12px;
  color: #1f2a44;
}
.beit-breakdown-segment-cell strong {
  display: inline-block;
  font-weight: 700;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breakdown-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.beit-hierarchy-total-row td {
  background: #fff;
  border-top: 2px solid #d7e3f5;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}
.beit-hierarchy-total-row td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  min-width: 220px;
}
.total-row-note {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 600;
  color: #7a8aa0;
}
.beit-campaign-hierarchy-card .table-wrap {
  overflow-x: auto;
}
.beit-campaign-hierarchy-card thead th,
.beit-campaign-hierarchy-card tbody td,
.beit-campaign-hierarchy-card tfoot td {
  height: 38px;
}
.beit-campaign-hierarchy-card .text-right {
  text-align: right;
}


/* UI polish v17: total row alignment, saved ad accounts, and sync modal readability */
.beit-campaign-hierarchy-card .table-wrap{
  position:relative;
  border-bottom:1px solid #e2e8f0;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"]{
  border-spacing:0;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tfoot{
  display:table-footer-group;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tfoot .beit-hierarchy-total-row td{
  height:44px!important;
  padding:9px 10px!important;
  background:#f8fafc!important;
  border-top:2px solid #cbd5e1!important;
  border-bottom:0!important;
  vertical-align:middle!important;
  font-weight:900!important;
  font-variant-numeric:tabular-nums!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.65);
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tfoot .beit-hierarchy-total-row td:first-child{
  position:sticky;
  left:0;
  z-index:5;
  min-width:240px;
  background:#f8fafc!important;
  box-shadow:2px 0 0 #e2e8f0, inset 0 1px 0 rgba(255,255,255,.65);
  text-align:left!important;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tfoot .beit-hierarchy-total-row td.text-right{
  text-align:right!important;
}
.beit-campaign-hierarchy-card table[data-campaign-hierarchy="1"] tfoot .beit-hierarchy-total-row .total-row-note{
  display:block;
  margin-top:2px;
  color:#64748b!important;
  font-size:10px!important;
  line-height:1.15!important;
  font-weight:700!important;
  white-space:nowrap;
}
.saved-ad-accounts-row{background:#f8fafc!important}
.saved-ad-accounts-cell{padding:12px 18px!important;border-top:1px solid #e5edf7!important}
.saved-ad-accounts-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:9px;color:#64748b;text-transform:uppercase;letter-spacing:.075em;font-size:10px;font-weight:900}
.saved-ad-accounts-head em{font-style:normal;text-transform:none;letter-spacing:0;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:3px 8px;font-size:10px;font-weight:900;white-space:nowrap}
.saved-ad-accounts-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:9px;width:100%}
.saved-ad-account-card{background:#fff;border:1px solid #dbe7f3;border-radius:11px;padding:10px 12px;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:12px;box-shadow:0 1px 2px rgba(15,23,42,.04);min-width:0}
.saved-ad-account-copy{min-width:0;display:grid;gap:3px}
.saved-ad-account-name{font-size:13px;font-weight:800;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.25}
.saved-ad-account-meta{display:flex;align-items:center;gap:5px;min-width:0;color:#64748b;font-size:10.7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.saved-ad-account-status{font-size:9.5px!important;white-space:nowrap;justify-self:end}
@media(max-width:760px){.saved-ad-accounts-grid{grid-template-columns:1fr}.saved-ad-account-card{grid-template-columns:1fr}.saved-ad-account-status{justify-self:start}}

.global-filter-bar .filter-label{display:none!important}
.global-filter-bar .filter-row-main{align-items:center!important}
.global-filter-bar .filter-group{justify-content:center!important}
.beit-multi-select{position:relative;width:100%;min-width:0}
.beit-multi-toggle{width:100%;height:31px;border:1px solid var(--border);border-radius:9px;background:#fff;color:var(--text-primary);font-size:11.5px;font-weight:700;padding:0 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;box-shadow:var(--shadow-xs);cursor:pointer;white-space:nowrap}
.beit-multi-toggle:hover,.beit-multi-toggle[aria-expanded="true"]{border-color:var(--border-focus);box-shadow:0 0 0 3px rgba(59,130,246,.12)}
.beit-multi-toggle [data-multi-label]{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.beit-multi-caret{font-size:13px;color:var(--text-muted);line-height:1}
.beit-multi-menu{position:absolute;top:calc(100% + 6px);left:0;z-index:1000;width:max-content;min-width:100%;max-width:320px;max-height:310px;overflow:auto;background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-lg);padding:6px}
.beit-multi-option{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:8px;font-size:12px;font-weight:650;color:var(--text-primary);cursor:pointer;white-space:nowrap}
.beit-multi-option:hover{background:#f8fafc}
.beit-multi-option input{width:14px;height:14px;accent-color:#3b82f6;flex:0 0 auto}
.beit-multi-all{font-weight:800;color:#2563eb}
.beit-multi-separator{height:1px;background:#edf2f7;margin:4px 2px}
.global-filter-bar .filter-client-group{min-width:160px!important}.global-filter-bar .filter-platform-group{min-width:150px!important}.global-filter-bar .filter-account-group{min-width:230px!important}
.global-filter-bar .filter-status-group .freshness-badge,.global-filter-bar .filter-status-group .filter-meta-warning{display:none!important}
@media (max-width:768px){.beit-multi-menu{position:fixed;left:10px;right:10px;width:auto;max-width:none;top:auto;bottom:12px;max-height:45vh}.beit-multi-toggle{height:34px}}

/* Floating global filter menus */
.beit-multi-select.beit-multi-open{z-index:10000!important}
.beit-multi-menu{position:fixed!important;z-index:10000!important;width:auto;min-width:180px;max-width:min(360px,calc(100vw - 20px));max-height:min(310px,calc(100vh - 20px));overflow:auto}
.beit-multi-menu[hidden]{display:none!important}
@media (max-width:768px){.beit-multi-menu{left:10px!important;right:auto!important;width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;bottom:auto!important;max-height:45vh}}


/* Global filter multi-select portal layer */
body > .beit-multi-menu.beit-multi-portal{
  position:fixed!important;
  z-index:2147483647!important;
  display:block;
  background:#fff!important;
  border:1px solid var(--border,#dbe3ef)!important;
  border-radius:12px!important;
  box-shadow:0 18px 45px rgba(15,23,42,.18)!important;
  overflow:auto!important;
  padding:6px!important;
}
body > .beit-multi-menu.beit-multi-portal[hidden]{display:none!important}
.global-filter-bar,.global-filter-bar .filter-row,.global-filter-bar .filter-group,.main-content,.page-content{overflow:visible}


.beit-campaign-table-settings-control{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-weight:800}
.beit-campaign-table-settings-control svg{width:15px;height:15px;flex-shrink:0}

.table-settings-grid{display:grid;grid-template-columns:1fr;gap:8px;margin:10px 0 12px}
.table-studio-settings .custom-check{border:1px solid var(--border);border-radius:10px;padding:10px 12px;background:#fff;display:flex;align-items:center;gap:8px;font-weight:750;color:var(--text-primary)}
.table-studio-settings .customizer-add-grid{grid-template-columns:minmax(180px,320px)}
.table-settings-side{margin:12px;padding:12px;border:1px solid var(--border);border-radius:12px;background:#fff}
.table-settings-side .customizer-muted{margin:0 0 7px}.table-settings-side .customizer-muted:last-child{margin-bottom:0}
table.beit-table-density-compact th,table.beit-table-density-compact td{padding:8px 9px!important;font-size:12px}
table.beit-table-zebra tbody tr:nth-child(even):not(.beit-total-row):not(.beit-breakdown-row):not(.beit-breakdown-heading-row):not(.saved-ad-accounts-row){background:#fcfcfd}
table.beit-table-soft-borders tbody tr{border-bottom-color:#f8fafc!important}
table.beit-table-sticky-head thead th{position:sticky!important;top:0;z-index:5;background:#f8fafc;box-shadow:inset 0 -1px 0 var(--border)}
table:not(.beit-table-sticky-head) thead th{position:static!important;top:auto!important;z-index:auto!important}
table.beit-table-freeze-first{border-collapse:separate;border-spacing:0}
table.beit-table-freeze-first th:first-child,table.beit-table-freeze-first td:first-child{position:sticky!important;left:0;z-index:7;background:#fff;box-shadow:10px 0 18px rgba(15,23,42,.10),1px 0 0 #cbd5e1;min-width:260px;max-width:460px}
table.beit-table-freeze-first thead th:first-child{z-index:10;background:#f8fafc}
table.beit-table-freeze-first tfoot td:first-child{z-index:9;background:#eef2f7}
@media(max-width:760px){table.beit-table-freeze-first th:first-child,table.beit-table-freeze-first td:first-child{min-width:165px!important;max-width:230px!important}}

/* Page customizer field labels */
.customize-studio-panel .customizer-field{display:flex;flex-direction:column;gap:5px;min-width:0}
.customize-studio-panel .customizer-field .filter-label{margin:0;color:#64748b;font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.07em}
.customize-studio-panel .customizer-field input,
.customize-studio-panel .customizer-field select{width:100%;min-width:0}
.customize-studio-panel .customizer-widget-size-field{flex:0 0 118px;max-width:118px}
.customize-studio-panel .customizer-widget-row .customizer-widget-size-field select{height:30px;font-size:12px;padding:0 8px}
@media(max-width:760px){.customize-studio-panel .customizer-widget-size-field{flex:1 1 100%;max-width:none}.customize-studio-panel .customizer-widget-row{flex-wrap:wrap}}

/* Reports Builder Phase 3 */
.reports-page-icon{background:#eef2ff;color:#4f46e5}.reports-library{display:flex;flex-direction:column;gap:14px}.reports-toolbar{padding:12px}.reports-toolbar-main{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.reports-search-box{min-width:240px;flex:1}.reports-select{padding:7px 10px;border:1px solid var(--border);border-radius:var(--radius);font-size:12.5px;background:var(--surface);color:var(--text-primary)}.reports-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.report-summary-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:14px;box-shadow:var(--shadow-sm)}.report-summary-card span{display:block;font-size:11.5px;color:var(--text-muted);font-weight:700;text-transform:uppercase;letter-spacing:.04em}.report-summary-card strong{display:block;margin-top:6px;font-size:18px;color:var(--text-primary)}.reports-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.report-card{background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:16px;box-shadow:var(--shadow-sm);display:flex;flex-direction:column;gap:12px}.report-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.report-card-title{font-size:15.5px;font-weight:800;color:var(--text-primary);line-height:1.25}.report-card-meta{font-size:11.5px;color:var(--text-muted);margin-top:4px}.report-card-description{font-size:12.5px;color:var(--text-secondary);line-height:1.55;margin:0}.report-card-scope{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.report-card-scope div{background:#f8fafc;border:1px solid #eef2f7;border-radius:12px;padding:9px;min-width:0}.report-card-scope span{display:block;font-size:10.5px;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);font-weight:700}.report-card-scope strong{display:block;font-size:12px;color:var(--text-primary);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-transform:capitalize}.report-chip-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.report-chip{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:999px;background:#f8fafc;border:1px solid #e5e7eb;color:#475569;font-size:11px;font-weight:700}.report-chip.info{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}.report-chip.success{background:#ecfdf5;border-color:#bbf7d0;color:#15803d}.report-chip.neutral{background:#f8fafc;color:#64748b}.report-chip.danger{background:#fef2f2;border-color:#fecaca;color:#b91c1c}.report-card-actions{display:flex;align-items:center;gap:7px;flex-wrap:wrap;margin-top:auto}.text-danger{color:#dc2626!important}.reports-warning-card,.reports-empty-card{min-height:260px}.report-wizard-modal{max-width:980px}.report-modal-subtitle{font-size:11.5px;color:var(--text-muted);margin-top:3px}.report-wizard-body{padding:0}.wizard-steps{display:flex;gap:0;border-bottom:1px solid var(--border);background:#f8fafc}.wizard-step{flex:1;border:0;background:transparent;padding:12px 10px;font-size:12px;font-weight:800;color:var(--text-muted);cursor:pointer;border-bottom:2px solid transparent}.wizard-step.active{color:#4f46e5;border-bottom-color:#4f46e5;background:#fff}.wizard-panel{display:none;padding:18px 20px}.wizard-panel.active{display:block}.form-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-field{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:700;color:var(--text-secondary)}.form-field.wide{grid-column:1/-1}.form-field input,.form-field select,.form-field textarea{width:100%;border:1px solid var(--border);border-radius:10px;padding:9px 10px;background:var(--surface);font-size:13px;color:var(--text-primary);font-family:inherit}.form-field textarea{resize:vertical}.scope-layout{display:grid;grid-template-columns:1fr 1fr 1.45fr;gap:14px}.scope-column{border:1px solid var(--border);border-radius:14px;overflow:hidden;background:#fff}.scope-head{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid var(--border);background:#f8fafc}.scope-head strong{font-size:12.5px}.scope-head button{border:0;background:transparent;color:#4f46e5;font-size:11.5px;font-weight:800;cursor:pointer}.scope-list{max-height:340px;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:6px}.scope-option{display:grid;grid-template-columns:auto 1fr auto;gap:8px;align-items:center;padding:8px;border:1px solid #eef2f7;border-radius:10px;cursor:pointer;font-size:12px}.scope-option:hover{background:#f8fafc}.scope-option span{font-weight:700;color:var(--text-primary);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.scope-option em{font-style:normal;color:var(--text-muted);font-size:10.5px;min-width:0}.account-scope-list .scope-option{grid-template-columns:auto minmax(0,1fr);align-items:start}.account-scope-list .scope-option em{grid-column:2;display:block;margin-top:-4px}.inline-warning{padding:10px 12px;margin-top:12px;background:#fff7ed;border:1px solid #fed7aa;border-radius:12px;color:#9a3412;font-size:12px;font-weight:700}.template-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.template-card{text-align:left;border:1px solid var(--border);border-radius:14px;background:#fff;padding:13px;display:flex;flex-direction:column;gap:7px;cursor:pointer;transition:.16s ease}.template-card:hover{border-color:#c7d2fe;box-shadow:var(--shadow-sm)}.template-card.selected{border-color:#4f46e5;background:#eef2ff}.template-card span{align-self:flex-start;border-radius:999px;background:#f8fafc;border:1px solid #e5e7eb;padding:3px 7px;font-size:10.5px;font-weight:800;color:#475569}.template-card strong{font-size:13px;color:var(--text-primary)}.template-card em{font-style:normal;font-size:12px;line-height:1.45;color:var(--text-secondary)}.template-card small{font-size:10.5px;color:var(--text-muted);line-height:1.35}.report-wizard-footer{align-items:center}.wizard-feedback{margin-right:auto;font-size:12px;color:var(--text-muted);font-weight:700}.wizard-feedback.error{color:#dc2626}.wizard-feedback.success{color:#16a34a}.reports-editor-shell{display:flex;flex-direction:column;gap:14px}.report-shell-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px}.report-shell-actions{display:flex;gap:8px;flex-wrap:wrap}.report-shell-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:14px}.report-scope-preview{display:flex;flex-direction:column;gap:12px;padding:14px}.report-scope-preview span{font-size:11px;color:var(--text-muted);font-weight:800;text-transform:uppercase;letter-spacing:.04em}.report-scope-preview p{margin:4px 0 0;color:var(--text-primary);font-size:13px;line-height:1.5}.report-tabs-preview{display:flex;flex-direction:column;gap:8px;padding:14px}.report-tab-preview{display:flex;align-items:center;justify-content:space-between;border:1px solid #eef2f7;background:#f8fafc;border-radius:12px;padding:10px 12px}.report-tab-preview strong{font-size:13px}.report-tab-preview span{font-size:11px;color:var(--text-muted);font-weight:700}
@media (max-width:1100px){.reports-grid{grid-template-columns:1fr}.reports-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.scope-layout{grid-template-columns:1fr}.report-shell-grid{grid-template-columns:1fr}}
@media (max-width:720px){.reports-summary-grid,.report-card-scope,.template-grid,.form-grid-2{grid-template-columns:1fr}.reports-toolbar-main{align-items:stretch}.reports-toolbar-main>*{width:100%}.report-shell-top{align-items:flex-start;flex-direction:column}.wizard-steps{overflow:auto}.wizard-step{min-width:120px}.report-wizard-modal{max-width:calc(100vw - 16px)}}
/* Reports Builder Phase 3 stability fix */
.custom-date-range-panel{grid-column:1/-1;display:none;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;border:1px solid #e5e7eb;background:#f8fafc;border-radius:14px;padding:12px}.custom-date-range-panel.is-visible{display:grid}.custom-date-range-panel[hidden]{display:none!important}.custom-date-range-panel input[type="date"]{min-height:38px;background:#fff}.form-help{display:block;margin-top:2px;font-size:11.5px;line-height:1.45;color:var(--text-muted);font-weight:600}.form-help.wide{grid-column:1/-1;margin-top:-4px}
@media (max-width:720px){.custom-date-range-panel{grid-template-columns:1fr}}

/* Reports Builder Phase 4 — editor shell, tabs, canvas, and contextual settings */
.report-editor{display:flex;flex-direction:column;min-height:calc(100vh - 0px);background:#eef3f9;margin:-24px;overflow:hidden}.report-editor-topbar{height:66px;background:#fff;border-bottom:1px solid #dfe7f1;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:10px 18px;position:sticky;top:0;z-index:40}.report-editor-title-wrap{display:flex;align-items:center;gap:10px;min-width:0}.report-back-link{display:inline-flex;width:34px;height:34px;border-radius:12px;align-items:center;justify-content:center;border:1px solid #dbe4f0;color:#334155;background:#f8fafc;font-size:24px;text-decoration:none;line-height:1}.report-back-link:hover{background:#eef2ff;color:#4f46e5}.report-editor-title-stack{min-width:0;display:flex;flex-direction:column;gap:3px}.report-name-input{border:0;background:transparent;color:#0f172a;font-size:18px;font-weight:850;min-width:280px;max-width:520px;outline:none;padding:3px 0}.report-name-input:focus{box-shadow:0 2px 0 #4f46e5}.report-name-readonly{font-size:18px;font-weight:850;color:#0f172a}.report-editor-subtitle{display:flex;gap:6px;align-items:center;color:#64748b;font-size:11.5px;font-weight:700}.report-editor-subtitle .save-status-dirty{color:#ca8a04}.report-editor-subtitle .save-status-saving{color:#2563eb}.report-editor-subtitle .save-status-saved{color:#16a34a}.report-editor-subtitle .save-status-error{color:#dc2626}.report-editor-controls{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}.report-editor-tabs{height:50px;background:#fff;border-bottom:1px solid #dfe7f1;display:flex;align-items:center;gap:10px;padding:0 18px;position:sticky;top:66px;z-index:39}.report-tabs-strip{display:flex;align-items:center;gap:8px;overflow:auto;flex:1;min-width:0;height:100%}.report-tab-btn{border:1px solid transparent;background:transparent;color:#475569;border-radius:12px;padding:9px 13px;font-size:12px;font-weight:850;display:inline-flex;align-items:center;gap:7px;cursor:pointer;white-space:nowrap}.report-tab-btn:hover{background:#f8fafc;border-color:#e2e8f0}.report-tab-btn.active{background:#eef2ff;color:#4338ca;border-color:#c7d2fe}.report-tab-btn em{font-style:normal;font-size:9px;text-transform:uppercase;letter-spacing:.04em;color:#b45309;background:#fff7ed;border:1px solid #fed7aa;border-radius:999px;padding:2px 5px}.report-tab-add{border:1px dashed #b6c4d7;background:#f8fafc;color:#334155;border-radius:12px;padding:8px 12px;font-size:12px;font-weight:850;cursor:pointer}.report-tab-add:hover{border-style:solid;background:#eef2ff;color:#4338ca}.report-editor-main{display:grid;grid-template-columns:260px minmax(0,1fr) 300px;min-height:calc(100vh - 116px);overflow:hidden}.report-left-panel,.report-right-panel{background:#fff;border-right:1px solid #dfe7f1;overflow:auto;padding:14px;z-index:10}.report-right-panel{border-right:0;border-left:1px solid #dfe7f1}.panel-title-row{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:10px}.panel-title-row strong{font-size:12.5px;color:#0f172a;font-weight:850}.panel-title-row span{font-size:10.5px;color:#94a3b8;font-weight:750;text-align:right}.report-widget-palette{display:grid;grid-template-columns:1fr;gap:8px}.palette-item{text-align:left;border:1px solid #e2e8f0;background:#f8fafc;border-radius:14px;padding:10px 11px;display:flex;flex-direction:column;gap:4px;cursor:pointer;transition:.14s ease}.palette-item:hover{background:#eef2ff;border-color:#c7d2fe;transform:translateY(-1px)}.palette-item:disabled{opacity:.55;cursor:not-allowed;transform:none}.palette-item strong{font-size:12.5px;color:#0f172a}.palette-item small{font-size:10.8px;color:#64748b;line-height:1.3}.panel-divider{height:1px;background:#edf2f7;margin:14px 0}.scope-mini-list{display:flex;flex-direction:column;gap:10px}.scope-mini-list div{border:1px solid #edf2f7;background:#f8fafc;border-radius:12px;padding:10px}.scope-mini-list span{display:block;font-size:10px;color:#94a3b8;font-weight:850;text-transform:uppercase;letter-spacing:.05em}.scope-mini-list p{margin:4px 0 0;font-size:11.5px;color:#334155;line-height:1.45;max-height:54px;overflow:auto}.report-canvas-column{display:flex;flex-direction:column;min-width:0;overflow:hidden;background:#eaf0f7}.report-canvas-toolbar{min-height:46px;background:#f8fafc;border-bottom:1px solid #dfe7f1;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;flex-wrap:wrap}.toolbar-group{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.btn-xs{font-size:11px!important;padding:5px 8px!important;border-radius:9px!important}.report-editor-readonly-note{font-size:12px;color:#64748b;font-weight:750}.report-canvas-viewport{overflow:auto;flex:1;padding:28px}.report-canvas-scale{--report-zoom:1;transform:scale(var(--report-zoom));transform-origin:top left;transition:transform .12s ease;min-width:960px}.report-canvas-grid{display:none;grid-template-columns:repeat(12,minmax(0,1fr));grid-auto-rows:var(--rb-row-height,28px);gap:var(--rb-gap,12px);min-height:calc((var(--rb-row-height,28px) * var(--rb-min-rows,24)) + (var(--rb-gap,12px) * (var(--rb-min-rows,24) - 1)));background:#fff;border:1px solid #dbe4f0;border-radius:18px;padding:18px;box-shadow:0 18px 35px rgba(15,23,42,.08);position:relative;background-image:linear-gradient(#f1f5f9 1px,transparent 1px),linear-gradient(90deg,#f1f5f9 1px,transparent 1px);background-size:calc((100% - 36px)/12) calc(var(--rb-row-height,28px) + var(--rb-gap,12px));}.report-canvas-grid.active{display:grid}.canvas-empty{grid-column:1/-1;grid-row:1/span 8;border:1px dashed #bfcae0;background:rgba(248,250,252,.88);border-radius:16px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#64748b;gap:6px;pointer-events:none}.canvas-empty strong{font-size:16px;color:#334155}.canvas-empty span{font-size:12px}.canvas-empty.is-hidden{display:none}.report-widget{grid-column:var(--x)/span var(--w);grid-row:var(--y)/span var(--h);background:#fff;border:1px solid #dbe4f0;border-radius:16px;box-shadow:0 6px 18px rgba(15,23,42,.08);min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden;cursor:grab;position:relative}.report-widget:active{cursor:grabbing}.report-widget.is-selected{outline:2px solid #4f46e5;outline-offset:2px;border-color:#a5b4fc}.report-widget.is-locked{cursor:default;background:#fbfdff}.report-widget.is-hidden-widget{opacity:.55}.widget-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:10px 11px;border-bottom:1px solid #eef2f7;background:linear-gradient(180deg,#fff,#f8fafc)}.widget-head strong{display:block;font-size:12.5px;color:#0f172a;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}.widget-head span{display:block;font-size:10.5px;color:#94a3b8;margin-top:2px;text-transform:capitalize}.widget-actions{display:flex;align-items:center;gap:4px;opacity:.8}.widget-actions button,.widget-resize-actions button{border:1px solid #dbe4f0;background:#fff;color:#334155;border-radius:8px;font-size:10px;font-weight:850;line-height:1;min-width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.widget-actions button:hover,.widget-resize-actions button:hover{background:#eef2ff;border-color:#c7d2fe;color:#4338ca}.widget-body{flex:1;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;padding:14px;gap:8px;color:#64748b}.widget-placeholder-icon{width:42px;height:42px;border-radius:14px;display:flex;align-items:center;justify-content:center;background:#eef2ff;color:#4f46e5;font-weight:900;font-size:13px}.widget-body p{margin:0;max-width:260px;font-size:11.5px;line-height:1.45}.widget-resize-actions{position:absolute;right:8px;bottom:8px;display:flex;gap:4px;opacity:0;transition:.14s ease}.report-widget:hover .widget-resize-actions,.report-widget.is-selected .widget-resize-actions{opacity:1}.settings-content{font-size:12px}.settings-form{display:flex;flex-direction:column;gap:12px}.settings-form label{display:flex;flex-direction:column;gap:6px;color:#64748b;font-size:10.5px;font-weight:850;text-transform:uppercase;letter-spacing:.05em}.settings-form input,.settings-form select{width:100%;border:1px solid #dbe4f0;border-radius:10px;padding:8px 9px;background:#fff;color:#0f172a;font-size:12.5px;font-weight:650;text-transform:none;letter-spacing:0}.settings-grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.settings-note{margin:0;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:10px;color:#64748b;font-size:11.5px;line-height:1.45}.report-editor.preview-mode .report-left-panel,.report-editor.preview-mode .report-right-panel,.report-editor.preview-mode .report-canvas-toolbar,.report-editor.preview-mode .widget-actions,.report-editor.preview-mode .widget-resize-actions{display:none!important}.report-editor.preview-mode .report-editor-main{grid-template-columns:minmax(0,1fr)}.report-editor.preview-mode .report-canvas-viewport{padding:24px 38px}.report-editor.preview-mode .report-widget{cursor:default}.report-editor.preview-mode .report-widget.is-selected{outline:0}.report-editor.preview-mode .report-canvas-grid{background-image:none}.report-editor.preview-mode .report-editor-tabs{top:66px}.report-editor.preview-mode .report-canvas-scale{min-width:920px}.report-editor.preview-mode .report-canvas-grid .canvas-empty{display:none}.report-editor.preview-mode .report-editor-controls .btn[disabled]{display:none}.report-editor.preview-mode .report-widget.is-hidden-widget{display:none}.page-reports .main-content:has(.report-editor){overflow:hidden}.page-reports .main-content:has(.report-editor) .flashes-wrap{display:none}
@media(max-width:1200px){.report-editor-main{grid-template-columns:220px minmax(0,1fr) 260px}.report-name-input{max-width:360px}.report-editor-controls{gap:5px}.report-canvas-viewport{padding:18px}}
@media(max-width:900px){.report-editor{margin:-16px}.report-editor-main{grid-template-columns:1fr}.report-left-panel,.report-right-panel{display:none}.report-canvas-scale{min-width:820px}.report-editor-topbar{height:auto;align-items:flex-start;flex-direction:column}.report-editor-tabs{top:101px}.report-editor-controls{justify-content:flex-start}.report-name-input{min-width:220px;max-width:90vw}.report-canvas-viewport{padding:14px}}

/* Reports Builder create wizard date selector */
.report-default-date-field{grid-column:auto;min-width:0}
.report-default-date-trigger{width:100%;justify-content:space-between;order:0;height:38px}
.report-default-date-trigger .beit-date-text{min-width:0;overflow:hidden;text-overflow:ellipsis;text-align:left;flex:1}
.report-default-date-popover{z-index:2600}
.report-date-compare-fields select:disabled{opacity:.55;background:#f8fafc;cursor:not-allowed}
@media (max-width:720px){.report-default-date-field{grid-column:1/-1}.report-default-date-popover.open{grid-template-columns:1fr;width:calc(100vw - 20px)!important;left:10px!important}}


/* Phase 4 layout polish before Phase 5 */
.report-editor{min-height:calc(100vh - 0px);background:linear-gradient(180deg,#eef4fb 0%,#e8eff8 100%);margin:-24px;overflow:hidden}
.report-editor-topbar{box-shadow:0 1px 0 rgba(148,163,184,.18),0 10px 24px rgba(15,23,42,.04)}
.report-editor-controls .report-chip{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.report-editor-main{grid-template-columns:290px minmax(0,1fr) 320px;min-height:calc(100vh - 116px);background:linear-gradient(180deg,#f4f7fb 0%,#edf3f9 100%)}
.report-left-panel,.report-right-panel{padding:16px;background:#f8fbff;overflow:auto}
.report-left-panel{border-right:1px solid #d9e3ef;box-shadow:inset -1px 0 0 rgba(255,255,255,.75)}
.report-right-panel{border-left:1px solid #d9e3ef;box-shadow:inset 1px 0 0 rgba(255,255,255,.75)}
.report-panel-card{background:#fff;border:1px solid #dde7f2;border-radius:16px;padding:13px;box-shadow:0 8px 18px rgba(15,23,42,.04)}
.report-panel-card+.report-panel-card{margin-top:12px}
.report-left-panel .panel-title-row:first-child,.report-right-panel .panel-title-row:first-child{margin-bottom:12px;padding-bottom:10px;border-bottom:1px solid #e9eff6}
.report-left-panel .panel-title-row:first-child strong,.report-right-panel .panel-title-row:first-child strong{text-transform:uppercase;letter-spacing:.06em;font-size:11px;color:#475569}
.report-canvas-toolbar{min-height:58px;padding:10px 14px;background:#fff;border-bottom:1px solid #d9e3ef;box-shadow:0 8px 18px rgba(15,23,42,.04)}
.toolbar-workspace-intro{gap:10px;min-width:0}
.toolbar-stack{display:flex;flex-direction:column;gap:2px;min-width:0}
.toolbar-stack strong{font-size:13px;font-weight:900;color:#0f172a}
.toolbar-stack span{font-size:11px;color:#64748b;line-height:1.35;white-space:normal}
.report-toolbar-divider{width:1px;align-self:stretch;background:#e2e8f0;margin:0 2px}
.report-canvas-viewport{padding:20px 22px 28px}
.report-canvas-scale{min-width:1040px}
.report-canvas-grid{border-radius:20px;padding:20px;border-color:#d7e2ee;box-shadow:0 20px 42px rgba(15,23,42,.08)}
.canvas-empty{border-style:dashed;border-color:#c7d4e7;background:rgba(248,250,252,.96)}
.report-widget{border-color:#d6e1ee;box-shadow:0 10px 24px rgba(15,23,42,.08)}
.widget-head{padding:11px 12px}
.widget-body{padding:18px}
.report-right-panel .settings-content .settings-form{gap:14px}
.report-right-panel .settings-content .settings-note{background:#f8fbff;border-color:#dbe6f2}
.report-editor.preview-mode .report-editor-main{grid-template-columns:minmax(0,1fr);background:#eef4fb}
.report-editor.preview-mode .report-canvas-viewport{padding:22px 28px 30px}
@media(max-width:1280px){.report-editor-main{grid-template-columns:260px minmax(0,1fr) 290px}.report-canvas-scale{min-width:980px}}
@media(max-width:900px){.report-editor-main{grid-template-columns:1fr}.report-canvas-scale{min-width:840px}.toolbar-stack span{display:none}}

/* Create report date selector: compact popover without left preset rail */
.report-default-date-popover.open{display:block;max-width:860px}
.report-default-date-popover .beit-date-main{padding:16px 18px}
.report-default-date-popover .report-date-topline{display:flex;align-items:end;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.report-default-date-popover .report-date-topline label{display:flex;flex-direction:column;gap:6px;min-width:220px;color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}
.report-default-date-popover .report-date-topline select{height:38px;border-radius:10px;border:1px solid #cbd5e1;background:#fff;color:#0f172a;font-size:13px;font-weight:700}
.report-default-date-popover .beit-date-nav{margin-bottom:14px}
.report-default-date-popover .beit-date-compare{margin:16px 0 10px}
.report-default-date-popover .beit-date-actions{margin-top:18px;padding-top:14px;border-top:1px solid #e5eaf1}
@media(max-width:720px){.report-default-date-popover .report-date-topline label{min-width:100%}.report-default-date-popover.open{width:calc(100vw - 20px)!important;left:10px!important}}


/* Phase 4 final visual spacing fix before Phase 5 */
.report-editor{
  margin:-24px;
  padding:14px;
  box-sizing:border-box;
  background:linear-gradient(180deg,#eef4fb 0%,#e8eff8 100%);
}
.report-editor-topbar,
.report-editor-tabs{
  margin:0;
  width:100%;
  box-sizing:border-box;
}
.report-editor-topbar{
  top:14px;
  border:1px solid #d9e3ef;
  border-radius:18px 18px 0 0;
  padding:12px 18px;
  background:#ffffff;
  box-shadow:0 14px 28px rgba(15,23,42,.08);
}
.report-editor-tabs{
  top:80px;
  border:1px solid #d9e3ef;
  border-top:0;
  border-radius:0 0 18px 18px;
  background:#ffffff;
  box-shadow:0 10px 24px rgba(15,23,42,.06);
  margin-bottom:12px;
}
.report-editor-main{
  grid-template-columns:290px minmax(0,1fr) 320px;
  gap:12px;
  min-height:calc(100vh - 142px);
  background:transparent;
}
.report-left-panel,
.report-right-panel,
.report-canvas-column{
  min-height:0;
}
.report-left-panel,
.report-right-panel{
  background:linear-gradient(180deg,#fbfdff 0%,#f4f8fd 100%);
  border:1px solid #d5e0ec;
  border-radius:18px;
  padding:16px;
  box-shadow:0 14px 28px rgba(15,23,42,.06);
}
.report-left-panel{border-right:1px solid #d5e0ec;}
.report-right-panel{border-left:1px solid #d5e0ec;}
.report-left-panel .panel-title-row:first-child,
.report-right-panel .panel-title-row:first-child{
  margin:-2px -2px 14px;
  padding:0 2px 12px;
  border-bottom:1px solid #e2eaf3;
}
.report-panel-card{
  border:1px solid #dbe6f2;
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 18px rgba(15,23,42,.04);
}
.report-canvas-column{
  border:1px solid #d5e0ec;
  border-radius:18px;
  background:linear-gradient(180deg,#f8fbff 0%,#eef4fb 100%);
  box-shadow:0 14px 28px rgba(15,23,42,.06);
  overflow:hidden;
}
.report-canvas-toolbar{
  background:#ffffff;
  border-bottom:1px solid #dbe5f0;
  padding:12px 16px;
}
.report-canvas-viewport{
  padding:18px;
  background:transparent;
}
.report-canvas-grid{
  border:1px solid #d7e2ee;
  box-shadow:0 20px 42px rgba(15,23,42,.08);
}
.report-editor.preview-mode .report-editor-topbar{
  top:14px;
  border-radius:18px 18px 0 0;
}
.report-editor.preview-mode .report-editor-tabs{
  top:80px;
  margin-bottom:12px;
}
.report-editor.preview-mode .report-editor-main{
  grid-template-columns:minmax(0,1fr);
}
@media(max-width:1280px){
  .report-editor{padding:12px}
  .report-editor-topbar{top:12px}
  .report-editor-tabs{top:78px}
  .report-editor-main{grid-template-columns:260px minmax(0,1fr) 290px;gap:10px}
}
@media(max-width:900px){
  .report-editor{margin:-16px;padding:10px}
  .report-editor-topbar{top:10px;border-radius:16px 16px 0 0}
  .report-editor-tabs{top:96px;border-radius:0 0 16px 16px}
  .report-editor-main{grid-template-columns:1fr;gap:10px;min-height:auto}
  .report-canvas-column{border-radius:16px}
}


/* Phase 5 report widgets and visualization UI */
.widget-loading-state,.widget-state{height:100%;min-height:96px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;gap:8px;color:#64748b;padding:14px}
.widget-loading-state strong,.widget-state strong{color:#0f172a;font-size:13px;font-weight:900}.widget-loading-state small,.widget-state p{font-size:11.5px;line-height:1.45;margin:0;max-width:260px}.widget-spinner{width:26px;height:26px;border-radius:50%;border:3px solid #e2e8f0;border-top-color:#3b82f6;animation:rbspin .8s linear infinite}@keyframes rbspin{to{transform:rotate(360deg)}}
.widget-state-error .widget-placeholder-icon{background:#fee2e2;color:#dc2626}.widget-state-empty .widget-placeholder-icon{background:#f1f5f9;color:#64748b}.widget-state-invalid .widget-placeholder-icon{background:#fff7ed;color:#d97706}
.rb-scorecard{height:100%;display:flex;flex-direction:column;justify-content:center;gap:8px;padding:18px}.rb-scorecard span{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#64748b;font-weight:900}.rb-scorecard strong{font-size:28px;line-height:1;color:#0f172a;font-weight:950;letter-spacing:-.03em}.rb-scorecard small{font-size:11px;color:#94a3b8;font-weight:700}
.rb-table-wrap{height:100%;overflow:auto}.rb-data-table{width:100%;border-collapse:separate;border-spacing:0;font-size:12px}.rb-data-table th{position:sticky;top:0;background:#f8fafc;color:#64748b;text-transform:uppercase;letter-spacing:.05em;font-size:10px;text-align:left;border-bottom:1px solid #e2e8f0;padding:9px 10px;z-index:1}.rb-data-table td{border-bottom:1px solid #edf2f7;padding:9px 10px;color:#0f172a;vertical-align:top}.rb-data-table td.num{text-align:right;font-variant-numeric:tabular-nums;font-weight:800}.rb-table-wrap.pivot .rb-data-table tbody tr:nth-child(even) td{background:#fbfdff}
.rb-chart,.rb-bars,.rb-funnel,.rb-share-chart,.rb-text-block,.rb-image-block,.rb-control-block{height:100%;min-height:0;padding:14px;box-sizing:border-box}.rb-chart-top{display:flex;justify-content:space-between;align-items:start;gap:10px;margin-bottom:10px}.rb-chart-top strong{font-size:12px;color:#0f172a;font-weight:900}.rb-chart-top span,.rb-chart-foot{font-size:10.5px;color:#64748b;font-weight:750}.rb-chart-foot{display:flex;justify-content:space-between;margin-top:8px}.rb-line-svg{width:100%;height:calc(100% - 50px);min-height:120px;overflow:visible;background:linear-gradient(180deg,#fff,#fbfdff);border:1px solid #edf2f7;border-radius:12px;padding:6px;box-sizing:border-box}.rb-chart-line{fill:none;stroke:#3b82f6;stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.rb-chart-area-fill{fill:rgba(59,130,246,.14)}
.rb-bar-row{display:grid;grid-template-columns:minmax(90px,1.2fr) minmax(100px,2fr) minmax(74px,.8fr);align-items:center;gap:9px;margin:8px 0}.rb-bar-row span{font-size:11px;color:#334155;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rb-bar-row div{height:12px;background:#edf2f7;border-radius:999px;overflow:hidden}.rb-bar-row i{display:block;height:100%;background:#3b82f6;border-radius:999px}.rb-bar-row b{text-align:right;font-size:11px;color:#0f172a;font-variant-numeric:tabular-nums}.rb-bars.columns{display:flex;flex-direction:column}.rb-bars.columns .rb-bar-row{grid-template-columns:1fr;grid-template-rows:auto 120px auto;display:inline-grid;width:calc(20% - 8px);min-width:78px;margin-right:8px;vertical-align:bottom}.rb-bars.columns .rb-bar-row div{height:120px;display:flex;align-items:end;border-radius:10px}.rb-bars.columns .rb-bar-row i{width:100%;height:20%;border-radius:10px 10px 0 0}.rb-bars.columns .rb-bar-row b{text-align:left}
.rb-share-chart{display:grid;grid-template-columns:140px minmax(0,1fr);align-items:center;gap:14px}.rb-donut{width:128px;height:128px;border-radius:50%;display:flex;align-items:center;justify-content:center;position:relative;box-shadow:inset 0 0 0 1px rgba(15,23,42,.08)}.rb-donut:after{content:'';position:absolute;width:72px;height:72px;border-radius:50%;background:#fff;box-shadow:0 0 0 1px rgba(15,23,42,.05)}.rb-donut.pie:after{display:none}.rb-donut span{position:relative;z-index:1;font-size:11px;font-weight:900;color:#475569}.rb-share-chart ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px;min-width:0}.rb-share-chart li{display:grid;grid-template-columns:12px minmax(0,1fr) auto;align-items:center;gap:7px;font-size:11px;color:#334155}.rb-share-chart li i{width:10px;height:10px;border-radius:50%}.rb-share-chart li span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rb-share-chart li b{font-variant-numeric:tabular-nums;color:#0f172a}
.rb-funnel{display:flex;flex-direction:column;justify-content:center;gap:10px}.rb-funnel-step{display:grid;grid-template-columns:minmax(120px,1fr) minmax(100px,2fr) minmax(70px,.7fr);align-items:center;gap:10px}.rb-funnel-step span{font-size:11px;font-weight:800;color:#334155}.rb-funnel-step div{height:18px;background:#edf2f7;border-radius:999px;overflow:hidden}.rb-funnel-step i{display:block;height:100%;background:#22c55e;border-radius:999px}.rb-funnel-step b{text-align:right;font-size:11px;color:#0f172a;font-variant-numeric:tabular-nums}
.rb-text-block{font-size:13px;line-height:1.55;color:#334155;display:flex;align-items:center}.rb-text-block.notes{align-items:flex-start;background:#fffdf5;border:1px solid #fde68a;border-radius:12px}.rb-divider{height:100%;display:flex;align-items:center;gap:10px;padding:0 10px}.rb-divider:before,.rb-divider:after{content:'';height:1px;background:#cbd5e1;flex:1}.rb-divider span{font-size:11px;color:#64748b;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.rb-image-block{display:flex;align-items:center;justify-content:center}.rb-image-block img{max-width:100%;max-height:100%;border-radius:12px;object-fit:contain}.rb-control-block{display:flex;flex-direction:column;justify-content:center;gap:6px}.rb-control-block span{font-size:10px;color:#64748b;text-transform:uppercase;letter-spacing:.06em;font-weight:900}.rb-control-block strong{border:1px solid #dbe4f0;border-radius:12px;background:#fff;padding:9px 10px;color:#0f172a;font-size:13px}.rb-control-block small{font-size:10.5px;color:#94a3b8}.settings-section-title{font-size:10.5px;text-transform:uppercase;letter-spacing:.08em;color:#64748b;font-weight:950;border-top:1px solid #e5edf5;padding-top:10px;margin-top:2px}.phase5-settings textarea{width:100%;border:1px solid #dbe4f0;border-radius:10px;padding:8px 9px;background:#fff;color:#0f172a;font-size:12.5px;font-weight:650;resize:vertical}.phase5-settings select[multiple]{min-height:132px;background-image:none!important;padding-right:8px!important}.settings-check{flex-direction:row!important;align-items:center!important;text-transform:none!important;letter-spacing:0!important;color:#334155!important}.settings-check input{width:auto!important}
.report-editor.preview-mode .widget-head{display:none}.report-editor.preview-mode .report-widget{border-color:#dbe4f0;box-shadow:0 8px 22px rgba(15,23,42,.06)}
@media(max-width:1200px){.rb-share-chart{grid-template-columns:1fr}.rb-donut{width:110px;height:110px}.rb-donut:after{width:62px;height:62px}.rb-funnel-step{grid-template-columns:1fr}.rb-bar-row{grid-template-columns:1fr}.rb-bar-row b{text-align:left}}

.report-widget.rb-hide-title .widget-head strong{display:none}.report-widget.rb-hide-title .widget-head span{font-weight:850;color:#64748b}

.report-widget.rb-density-compact .widget-body{padding:8px}.report-widget.rb-density-compact .rb-data-table td{padding:6px 8px}.report-widget.rb-density-spacious .widget-body{padding:22px}.report-widget.rb-density-spacious .rb-data-table td{padding:12px 14px}
.rb-bars.columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(72px,1fr));align-items:end;gap:8px}.rb-bars.columns .rb-chart-top{grid-column:1/-1}.rb-bars.columns .rb-bar-row{display:grid;grid-template-columns:1fr;grid-template-rows:auto 120px auto;width:auto;min-width:0;margin:0}.rb-bars.columns .rb-bar-row span{white-space:normal;line-height:1.25}.rb-bars.columns .rb-bar-row div{height:120px;display:flex;align-items:end;border-radius:10px}.rb-bars.columns .rb-bar-row i{width:100%;border-radius:10px 10px 0 0}.rb-bars.columns .rb-bar-row b{text-align:left;font-size:10.5px}

/* Phase 6 — Reports Builder advanced filters and controls */
.report-filter-bar{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 12px;padding:12px 16px;background:#fff;border:1px solid #d9e3ef;border-radius:16px;box-shadow:0 10px 22px rgba(15,23,42,.05)}
.report-filter-bar-main{display:flex;align-items:center;gap:10px;min-width:0;flex-wrap:wrap}.report-filter-bar-main>strong{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:#334155}.report-filter-bar-main>span{font-size:12px;color:#64748b}.report-filter-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.report-filter-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.report-filter-chip{display:inline-flex;align-items:center;max-width:280px;padding:5px 9px;border-radius:999px;background:#eef2ff;border:1px solid #c7d2fe;color:#3730a3;font-size:11px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.report-filter-chip.live{background:#ecfdf5;border-color:#bbf7d0;color:#166534}.report-filter-empty{color:#94a3b8;font-size:11.5px;font-weight:700}.filter-builder{display:flex;flex-direction:column;gap:9px;border:1px solid #dbe6f2;background:#fbfdff;border-radius:14px;padding:10px}.filter-builder-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.filter-builder-head strong{font-size:12px;color:#0f172a}.filter-rows{display:flex;flex-direction:column;gap:8px}.filter-row{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.9fr) minmax(0,.9fr) minmax(0,.9fr) 28px;gap:6px;align-items:center}.filter-row select,.filter-row input{width:100%;min-width:0;height:34px;border:1px solid #dbe4f0;border-radius:9px;background:#fff;color:#0f172a;font-size:11.5px;font-weight:650;padding:6px 8px}.filter-row button[data-filter-remove]{height:30px;width:28px;border:1px solid #fecaca;background:#fff;color:#dc2626;border-radius:8px;font-weight:900;cursor:pointer}.filter-row button[data-filter-remove]:hover{background:#fef2f2}.rb-live-control{align-items:stretch;text-align:left}.rb-live-control>span{font-size:10.5px;text-transform:uppercase;letter-spacing:.06em;color:#64748b;font-weight:900}.rb-control-row{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.rb-control-row input,.rb-control-row select{height:34px;border:1px solid #dbe4f0;border-radius:9px;background:#fff;padding:6px 8px;font-size:12px;min-width:120px;flex:1}.rb-control-row .btn{flex:0 0 auto}.report-editor.preview-mode .report-filter-bar{margin-top:0}.report-editor.preview-mode .report-filter-actions .btn:not(:last-child){display:none}
@media(max-width:1100px){.report-filter-bar{align-items:flex-start;flex-direction:column}.report-filter-actions{width:100%}.filter-row{grid-template-columns:1fr 1fr}.filter-row button[data-filter-remove]{grid-column:1/-1;width:100%}}

/* Phase 7: Report Builder interactivity, cross-filtering and drilldown */
.rb-clickable-row,
.rb-point-chip[data-rb-interactive="1"]{
  cursor:pointer;
  transition:background .14s ease, transform .14s ease, box-shadow .14s ease;
}
.rb-clickable-row[data-rb-interactive="1"]:hover{
  background:#eef6ff!important;
  box-shadow:inset 3px 0 0 #3b82f6;
}
.rb-bars .rb-clickable-row[data-rb-interactive="1"]:hover{
  transform:translateX(2px);
}
.rb-share-chart li.rb-clickable-row[data-rb-interactive="1"]:hover{
  background:#eef6ff;
  border-radius:10px;
}
.rb-point-chips{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:8px 0 2px;
  max-height:54px;
  overflow:auto;
}
.rb-point-chip{
  border:1px solid #d6e2f0;
  background:#fff;
  color:#334155;
  border-radius:999px;
  padding:4px 8px;
  font-size:10.5px;
  font-weight:800;
}
.rb-point-chip:hover{
  background:#eff6ff;
  border-color:#93c5fd;
  color:#1d4ed8;
}
.rb-drill-trail{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:7px 9px;
  margin:-4px -4px 8px;
  border:1px solid #bfdbfe;
  border-radius:12px;
  background:#eff6ff;
  color:#1e3a8a;
  font-size:11px;
  font-weight:800;
}
.rb-drill-trail>div{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
  overflow:auto;
}
.rb-drill-trail span{
  white-space:nowrap;
}
.rb-drill-trail b{
  color:#60a5fa;
}
.report-filter-chip.drill{
  background:#f5f3ff;
  border-color:#ddd6fe;
  color:#5b21b6;
}
.report-widget[data-interaction-mode="tab"] .widget-head,
.report-widget[data-interaction-mode="report"] .widget-head,
.report-widget[data-drilldown-enabled="1"] .widget-head{
  background:linear-gradient(180deg,#ffffff,#f8fbff);
}
.report-widget[data-interaction-mode="tab"] .widget-head:after,
.report-widget[data-interaction-mode="report"] .widget-head:after,
.report-widget[data-drilldown-enabled="1"] .widget-head:after{
  content:'Interactive';
  margin-left:auto;
  align-self:center;
  border:1px solid #bfdbfe;
  background:#eff6ff;
  color:#1d4ed8;
  border-radius:999px;
  padding:2px 7px;
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.settings-check input#settingDrilldownEnabled{
  margin-right:6px;
}


/* Phase 8 calculated metrics and mini modeling layer */
.report-metric-model-card .metric-model-summary{display:flex;flex-direction:column;gap:9px}
.report-metric-model-card .metric-model-summary p{margin:0;color:#64748b;font-size:11.5px;line-height:1.45}
.custom-metric-list{display:flex;flex-direction:column;gap:7px;margin-top:10px}
.custom-metric-empty{border:1px dashed #cbd5e1;background:#f8fafc;color:#94a3b8;border-radius:12px;padding:10px;font-size:11px;font-weight:750;text-align:center}
.custom-metric-pill{border:1px solid #dbe6f2;background:#fff;border-radius:12px;padding:9px 10px;text-align:left;display:flex;flex-direction:column;gap:3px;cursor:pointer;transition:.14s ease}
.custom-metric-pill:hover{background:#eef2ff;border-color:#c7d2fe;transform:translateY(-1px)}
.custom-metric-pill strong{font-size:12px;color:#0f172a;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.custom-metric-pill span{font-size:10.5px;color:#64748b;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.metric-builder-form textarea{resize:vertical;min-height:72px}
.metric-token-list{display:flex;flex-wrap:wrap;gap:6px;max-height:140px;overflow:auto;border:1px solid #e2e8f0;background:#f8fafc;border-radius:12px;padding:8px}
.metric-token-btn{border:1px solid #dbe6f2;background:#fff;color:#334155;border-radius:999px;padding:5px 8px;font-size:10.5px;font-weight:800;cursor:pointer}
.metric-token-btn:hover{background:#eef2ff;border-color:#c7d2fe;color:#4338ca}
.metric-check-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;border:1px solid #e2e8f0;background:#f8fafc;border-radius:12px;padding:10px}
.metric-check-grid strong{grid-column:1/-1;color:#0f172a;font-size:11px;text-transform:uppercase;letter-spacing:.05em}
.metric-check-grid label{display:flex!important;flex-direction:row!important;align-items:center;gap:6px;text-transform:none!important;letter-spacing:0!important;font-size:11.5px!important;color:#334155!important}
.metric-check-grid input{width:auto!important}
.metric-validation{border-radius:12px;padding:10px 11px;font-size:12px;font-weight:800;display:flex;flex-direction:column;gap:4px}
.metric-validation.ok{background:#ecfdf5;border:1px solid #bbf7d0;color:#047857}
.metric-validation.bad{background:#fef2f2;border:1px solid #fecaca;color:#b91c1c}
.metric-validation small{font-size:10.5px;font-weight:700;opacity:.85}
.metric-builder-actions{display:flex;gap:7px;flex-wrap:wrap;align-items:center}


/* Phase 8 QA fixes before Phase 9 */
.report-canvas-grid.no-alignment-grid{background-image:none!important}
.settings-toggle-row{display:flex!important;flex-direction:row!important;align-items:center!important;gap:9px!important;text-transform:none!important;letter-spacing:0!important;color:#334155!important;font-size:12px!important;font-weight:800!important;border:1px solid #dbe6f2;background:#f8fbff;border-radius:12px;padding:9px 10px}
.settings-toggle-row input{width:16px!important;height:16px!important;min-height:16px!important;padding:0!important;margin:0!important;flex:0 0 auto}
.settings-toggle-row span{display:block;text-transform:none;letter-spacing:0;color:#334155}
.report-widget .widget-actions,.report-widget .widget-resize-actions{z-index:15;pointer-events:auto}
.report-widget .widget-actions button,.report-widget .widget-resize-actions button{pointer-events:auto;position:relative;z-index:16}
.report-widget .widget-actions button:active,.report-widget .widget-resize-actions button:active{transform:translateY(1px)}
.report-right-panel .filter-builder{gap:10px;padding:12px;border-radius:16px;background:#fff}
.report-right-panel .filter-builder-head{align-items:center;gap:10px}
.report-right-panel .filter-builder-head strong{font-size:13px;line-height:1.2}
.report-right-panel .filter-builder-head .btn,.report-right-panel .filter-builder-head button{white-space:nowrap}
.report-right-panel .filter-rows{gap:10px}
.report-right-panel .filter-row{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;background:#f8fbff;border:1px solid #dbe6f2;border-radius:14px;padding:10px}
.report-right-panel .filter-row select,.report-right-panel .filter-row input{height:38px!important;min-width:0!important;width:100%!important;font-size:12.5px!important;border-radius:10px!important;background:#fff!important;color:#0f172a!important}
.report-right-panel .filter-row button[data-filter-remove]{width:100%!important;height:34px!important;border-radius:10px!important}
.report-right-panel .filter-row [hidden]{display:none!important}
.metric-builder-form{gap:13px}.metric-builder-actions{display:flex;gap:8px;flex-wrap:wrap}.metric-token-list{max-height:120px;overflow:auto;border:1px solid #e2e8f0;background:#f8fafc;border-radius:12px;padding:8px;display:flex;gap:6px;flex-wrap:wrap}.metric-token-btn{border:1px solid #dbe4f0;background:#fff;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:800;color:#334155;cursor:pointer}.metric-token-btn:hover{border-color:#a5b4fc;background:#eef2ff;color:#3730a3}.metric-validation{border-radius:12px;padding:10px;font-size:12px;font-weight:800}.metric-validation.ok{background:#ecfdf5;border:1px solid #bbf7d0;color:#166534}.metric-validation.bad{background:#fef2f2;border:1px solid #fecaca;color:#b91c1c}.metric-validation small{display:block;margin-top:5px;font-weight:700}


/* Phase 8 pre-Phase 9 canvas/model fixes */
body.report-builder-fullscreen .sidebar{display:none!important}
body.report-builder-fullscreen .main-content{margin-left:0!important;width:100%!important;max-width:none!important;padding-left:24px!important;padding-right:24px!important}
body.report-builder-fullscreen .app-layout{display:block!important}
body.report-builder-fullscreen .top-bar{display:none!important}
body.report-builder-fullscreen .report-editor{margin:-24px!important}
.metric-operator-list{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;border:1px solid #e2e8f0;background:#f8fafc;border-radius:12px;padding:8px}
.metric-operator-btn{height:34px;border:1px solid #dbe4f0;background:#fff;color:#0f172a;border-radius:10px;font-size:15px;font-weight:900;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.metric-operator-btn:hover{border-color:#a5b4fc;background:#eef2ff;color:#3730a3}
.report-canvas-grid{background-size:calc((100% - 40px)/12) calc(var(--rb-row-height,28px) + var(--rb-gap,12px))!important}
.report-canvas-grid.is-drop-target{outline:2px solid #60a5fa;outline-offset:3px}
.report-widget{will-change:contents;user-select:none}.report-widget input,.report-widget select,.report-widget textarea{user-select:auto}
.report-widget.is-moving{opacity:.74;outline:2px dashed #2563eb;outline-offset:3px}
.report-widget .widget-resize-actions button{min-width:34px;font-size:11px}
.settings-form input[type="number"]{step:1}
@media(max-width:900px){body.report-builder-fullscreen .main-content{padding-left:16px!important;padding-right:16px!important}}


/* Phase 9 stable modals */
.rb-phase9-modal-backdrop{z-index:3600;padding:18px}
.rb-phase9-modal{width:min(980px,calc(100vw - 36px));max-height:calc(100vh - 36px);display:flex;flex-direction:column;overflow:hidden;border-radius:18px}
.rb-phase9-modal .modal-body{overflow:auto;padding:18px;background:#f8fbff}
.rb-phase9-modal .modal-footer{border-top:1px solid #e2e8f0;background:#fff}
.rb-phase9-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
.rb-phase9-card{background:#fff;border:1px solid #dbe6f2;border-radius:16px;padding:14px;box-shadow:0 8px 18px rgba(15,23,42,.04)}
.rb-phase9-card h4{margin:0 0 12px;font-size:14px;color:#0f172a;font-weight:900}
.rb-phase9-card label{display:flex;flex-direction:column;gap:6px;margin-bottom:10px;font-size:11px;color:#64748b;font-weight:850;text-transform:uppercase;letter-spacing:.05em}
.rb-phase9-card input,.rb-phase9-card select,.rb-phase9-card textarea{width:100%;border:1px solid #cbd5e1;border-radius:10px;padding:9px 10px;background:#fff;color:#0f172a;font-size:13px;font-weight:650;text-transform:none;letter-spacing:0;box-sizing:border-box}
.rb-check-row,.rb-action-row{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.rb-check-row label{display:flex;flex-direction:row;align-items:center;gap:7px;margin:0 0 10px;text-transform:none;letter-spacing:0;font-size:12px;color:#334155}
.rb-check-row input{width:auto}
.rb-phase9-list{display:flex;flex-direction:column;gap:8px}
.rb-phase9-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #e2e8f0;background:#f8fafc;border-radius:12px;padding:10px}
.rb-phase9-row strong{display:block;color:#0f172a;font-size:12.5px;font-weight:900;word-break:break-word}
.rb-phase9-row span{display:block;color:#64748b;font-size:11px;margin-top:3px;line-height:1.35;word-break:break-word}
.rb-empty-box{border:1px dashed #cbd5e1;background:#f8fafc;color:#64748b;border-radius:12px;padding:16px;text-align:center;font-size:12px;font-weight:750}
@media(max-width:820px){.rb-phase9-grid{grid-template-columns:1fr}.rb-phase9-modal{width:calc(100vw - 22px);max-height:calc(100vh - 22px)}}


/* Phase 9 spacing polish before Phase 10 */
.report-filter-bar{margin:12px 0 12px!important;}
.report-editor.preview-mode .report-filter-bar{margin-top:12px!important;margin-bottom:12px!important;}

/* Phase 9 share link adjustments */
.report-share-page{background:#eef4fb;font-family:Inter,system-ui,sans-serif}
.report-share-page .report-editor{margin:0;padding:14px;min-height:100vh}
.report-share-page .report-editor-topbar{top:14px}
.report-share-page .report-editor-tabs{top:80px}
.report-share-main{grid-template-columns:minmax(0,1fr)!important;gap:0!important}
.report-share-mode .report-canvas-column{min-height:calc(100vh - 190px)}
.report-share-mode .report-canvas-toolbar{min-height:54px}
.report-share-mode .report-canvas-scale{min-width:980px}
.report-share-mode .widget-actions,.report-share-mode .widget-resize-actions{display:none!important}
.report-share-error{max-width:760px;margin:70px auto;padding:20px}
.shared-comments-panel{position:fixed;right:18px;top:90px;width:360px;max-width:calc(100vw - 36px);max-height:calc(100vh - 120px);background:#fff;border:1px solid #d6e2ef;border-radius:18px;box-shadow:0 24px 60px rgba(15,23,42,.18);z-index:3000;display:none;flex-direction:column;overflow:hidden}
.shared-comments-panel.open{display:flex}
.shared-comments-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 16px;border-bottom:1px solid #e5edf6;background:#f8fbff}
.shared-comments-head strong{font-size:14px;color:#0f172a;font-weight:900}
.shared-comments-head button{width:30px;height:30px;border:1px solid #d6e2ef;border-radius:10px;background:#fff;color:#64748b;cursor:pointer;font-size:18px;line-height:1}
.shared-comments-list{padding:14px;overflow:auto;display:flex;flex-direction:column;gap:10px;min-height:120px}
.shared-comment{border:1px solid #e0e8f2;background:#f8fbff;border-radius:14px;padding:11px 12px}
.shared-comment strong{font-size:12.5px;color:#0f172a;font-weight:850}
.shared-comment p{margin:6px 0;color:#334155;font-size:12.5px;line-height:1.45}
.shared-comment span{font-size:10.5px;color:#94a3b8;font-weight:750}
.shared-comments-form{border-top:1px solid #e5edf6;padding:14px;display:flex;flex-direction:column;gap:9px;background:#fff}
.shared-comments-form input,.shared-comments-form textarea{border:1px solid #d6e2ef;border-radius:12px;padding:9px 10px;font:inherit;font-size:12.5px;color:#0f172a;resize:vertical}
.shared-comments-form textarea{min-height:86px}
@media(max-width:800px){.report-share-mode .report-canvas-scale{min-width:820px}.shared-comments-panel{top:74px;right:10px;width:calc(100vw - 20px)}}

/* Comments fix after Phase 10 */
.report-comments-btn{display:inline-flex;align-items:center;gap:7px;position:relative}
.report-comments-badge{min-width:18px;height:18px;border-radius:999px;background:#2563eb;color:#fff;display:inline-flex;align-items:center;justify-content:center;font-size:10px;font-weight:900;padding:0 5px;line-height:1}
.report-comments-badge.is-empty{background:#cbd5e1;color:#334155}
.rb-comments-shell{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(280px,.9fr);gap:14px;align-items:start}
.rb-comments-list{display:flex;flex-direction:column;gap:10px;max-height:420px;overflow:auto;padding-right:2px}
.rb-comment-row{border:1px solid #dbe6f2;background:#f8fbff;border-radius:14px;padding:12px}
.rb-comment-row.from-user{background:#eef7ff;border-color:#bfdbfe}
.rb-comment-meta{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;margin-bottom:7px}
.rb-comment-meta strong{font-size:12.5px;color:#0f172a;font-weight:900}
.rb-comment-meta span{font-size:10.5px;color:#64748b;font-weight:750;text-align:right}
.rb-comment-row p{margin:0;color:#334155;font-size:12.5px;line-height:1.5;word-break:break-word}
.shared-comment-author-note{border:1px solid #dbe6f2;background:#f8fbff;border-radius:12px;padding:9px 10px;color:#475569;font-size:12px;line-height:1.35}
.shared-comment-author-note strong{color:#0f172a}
@media(max-width:820px){.rb-comments-shell{grid-template-columns:1fr}.rb-comments-list{max-height:300px}}

/* Widget settings final fix: readable dropdowns, ordered metrics, all widget settings */
.phase5-settings label{gap:7px!important}
.rb-settings-select{width:100%;height:38px;border:1px solid #dbe4f0;border-radius:11px;background:#fff;color:#0f172a;font-size:12.5px;font-weight:700;padding:0 34px 0 10px;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.rb-settings-select:focus{outline:2px solid rgba(59,130,246,.25);border-color:#93c5fd}
.rb-metric-picker{position:relative;width:100%;display:flex;flex-direction:column;gap:8px;text-transform:none;letter-spacing:0}
.rb-metric-trigger{width:100%;min-height:40px;border:1px solid #dbe4f0;border-radius:12px;background:#fff;color:#0f172a;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;font-size:12.5px;font-weight:750;cursor:pointer;text-align:left;box-shadow:0 1px 2px rgba(15,23,42,.04)}
.rb-metric-trigger span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-transform:none;letter-spacing:0;color:#0f172a}
.rb-metric-trigger i{font-style:normal;color:#64748b;font-size:11px;flex:0 0 auto}
.rb-metric-trigger:hover{background:#f8fafc;border-color:#cbd5e1}
.rb-metric-menu{display:none;position:absolute;left:0;right:0;top:44px;background:#fff;border:1px solid #d6e2ef;border-radius:14px;box-shadow:0 18px 42px rgba(15,23,42,.18);z-index:3000;overflow:hidden}
.rb-metric-picker.open .rb-metric-menu{display:block}
.rb-metric-menu-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:10px 12px;border-bottom:1px solid #e5edf5;background:#f8fbff}
.rb-metric-menu-head strong{font-size:12px;color:#0f172a;font-weight:900;text-transform:none;letter-spacing:0}
.rb-metric-menu-head small{font-size:10.5px;color:#64748b;text-align:right;line-height:1.3;text-transform:none;letter-spacing:0}
.rb-metric-options{max-height:245px;overflow:auto;padding:8px;display:flex;flex-direction:column;gap:5px}
.rb-metric-option{width:100%;border:1px solid transparent;border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 9px;cursor:pointer;text-align:left}
.rb-metric-option:hover{background:#f1f5f9;border-color:#e2e8f0}
.rb-metric-option.selected{background:#eef2ff;border-color:#c7d2fe;color:#3730a3}
.rb-metric-option span{font-size:12px;font-weight:850;color:inherit;text-transform:none;letter-spacing:0}
.rb-metric-option small{font-size:10px;color:#64748b;text-transform:none;letter-spacing:0;white-space:nowrap}
.rb-picked-metrics{display:flex;flex-direction:column;gap:6px;min-height:0}
.rb-metric-chip{display:grid;grid-template-columns:minmax(0,1fr) 24px 24px 24px;align-items:center;gap:4px;border:1px solid #dbeafe;background:#eff6ff;color:#1e3a8a;border-radius:11px;padding:6px 6px 6px 9px}
.rb-metric-chip b{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11.5px;text-transform:none;letter-spacing:0}
.rb-metric-chip button{height:24px;width:24px;border:1px solid #bfdbfe;background:#fff;color:#1d4ed8;border-radius:8px;font-weight:900;font-size:10px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.rb-metric-chip button:hover:not(:disabled){background:#dbeafe}
.rb-metric-chip button:disabled{opacity:.45;cursor:not-allowed}
.report-right-panel .phase5-settings .settings-grid-2{align-items:start}
.report-right-panel .phase5-settings input[type="number"]{height:38px;border-radius:11px}
.rb-combo-metric-strip{display:grid;grid-template-columns:repeat(auto-fit,minmax(105px,1fr));gap:7px;margin:8px 0 10px}
.rb-combo-metric-strip span{border:1px solid #e2e8f0;background:#f8fafc;border-radius:10px;padding:7px 8px;display:flex;flex-direction:column;gap:2px;min-width:0}
.rb-combo-metric-strip b{font-size:10px;color:#64748b;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rb-combo-metric-strip em{font-style:normal;font-weight:900;color:#0f172a;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Final widget settings repair */
.report-right-panel .settings-content{overflow:visible}.report-right-panel .settings-form{overflow:visible}.report-right-panel .settings-form label{position:relative}.phase5-settings[data-widget-settings]{gap:14px}.phase5-settings .settings-section-title{margin-top:4px;padding-top:12px;border-top:1px solid #e2eaf3;color:#516176}.phase5-settings .settings-section-title:first-child{border-top:0;padding-top:0}.rb-settings-select,.phase5-settings select:not([multiple]){width:100%!important;min-height:42px!important;border:1px solid #d7e2ef!important;border-radius:13px!important;background-color:#fff!important;color:#0f172a!important;font-size:13px!important;font-weight:750!important;padding:0 38px 0 12px!important;box-shadow:0 1px 2px rgba(15,23,42,.05)!important;cursor:pointer!important}.rb-settings-select:hover,.phase5-settings select:not([multiple]):hover{border-color:#b9c7d8!important;background-color:#fbfdff!important}.rb-settings-select:focus,.phase5-settings select:not([multiple]):focus{outline:3px solid rgba(59,130,246,.16)!important;border-color:#60a5fa!important}.rb-metric-picker{position:relative;z-index:20}.rb-metric-picker.open{z-index:5000}.rb-metric-trigger{min-height:44px!important;border-radius:14px!important;border-color:#d7e2ef!important;padding:9px 12px!important}.rb-metric-trigger span{font-weight:850!important}.rb-metric-menu{top:49px!important;border-radius:16px!important;box-shadow:0 22px 50px rgba(15,23,42,.22)!important;max-height:390px!important}.rb-metric-options{max-height:285px!important}.rb-metric-option{min-height:42px!important;border-radius:12px!important}.rb-metric-option.selected:after{content:'✓';font-weight:900;color:#2563eb}.rb-picked-metrics{max-height:none!important;gap:7px}.rb-metric-chip{grid-template-columns:minmax(0,1fr) 28px 28px 28px!important;min-height:34px;border-radius:13px!important}.rb-metric-chip button{width:28px!important;height:28px!important}.phase5-settings input[type="hidden"]{display:none!important}.phase5-settings .settings-note{font-size:11.5px!important}.settings-check input[type="checkbox"]{width:18px!important;height:18px!important;flex:0 0 auto}.report-widget.rb-settings-saving{box-shadow:0 0 0 2px rgba(59,130,246,.18),0 10px 24px rgba(15,23,42,.08)!important}.report-widget.rb-settings-saving:after{content:'Saving…';position:absolute;right:10px;bottom:10px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:900;z-index:4}


/* Report Builder metric multi-select checkboxes */
.rb-metric-option.has-checkbox{
  display:grid!important;
  grid-template-columns:18px minmax(0,1fr) auto;
  align-items:center;
  justify-content:normal!important;
  gap:9px!important;
}
.rb-metric-option.has-checkbox .rb-metric-checkbox{
  width:16px!important;
  height:16px!important;
  margin:0!important;
  accent-color:#2563eb;
  pointer-events:none;
  flex:0 0 auto;
}
.rb-metric-option.has-checkbox span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.rb-metric-option.has-checkbox small{
  justify-self:end;
}
.rb-metric-option.has-checkbox.selected:after{
  content:none!important;
}
.rb-metric-option:focus-visible{
  outline:3px solid rgba(59,130,246,.16)!important;
  border-color:#60a5fa!important;
}


/* Report Builder metrics picker reliability fix */
.settings-field{
  display:flex;
  flex-direction:column;
  gap:7px;
  color:#64748b;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.04em;
}
.settings-field .settings-field-label{
  display:block;
}
.settings-field-metrics{
  position:relative;
  z-index:30;
}
.rb-metric-picker.open .rb-metric-menu{
  pointer-events:auto;
}
.rb-metric-option.has-checkbox{
  user-select:none;
}
.rb-metric-option.has-checkbox .rb-metric-checkbox{
  pointer-events:none;
}

/* ──────────────────────────────────────────────────────────
   Phase 1 — Core layout foundation cleanup
   Scope: tool pages only. Report Builder fullscreen keeps its own shell.
   ────────────────────────────────────────────────────────── */
:root{
  --page-gutter:24px;
  --panel-border:#dbe5f1;
  --panel-shadow:0 10px 30px rgba(15,23,42,.06);
  --panel-shadow-hover:0 14px 36px rgba(15,23,42,.09);
}
.sidebar-tagline{font-size:9px;color:#64748b;margin-top:5px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.top-bar-logo{font-size:14px}.top-bar-spacer{width:30px;flex:0 0 30px}
body:not(.report-builder-fullscreen){background:#f6f8fb}
body:not(.report-builder-fullscreen) .main-content{background:linear-gradient(180deg,#f8fafc 0,#f3f6fb 310px,#f6f8fb 100%)}
body:not(.report-builder-fullscreen) .page-header{
  align-items:center;
  padding:18px var(--page-gutter);
  gap:12px 18px;
  background:rgba(248,250,252,.92);
  border-bottom:1px solid #e3ebf5;
  box-shadow:0 1px 0 rgba(255,255,255,.82) inset;
}
body:not(.report-builder-fullscreen) .page-header-left{flex:1 1 320px;gap:12px}
body:not(.report-builder-fullscreen) .page-header-text{gap:0}
body:not(.report-builder-fullscreen) .page-title{font-size:20px;letter-spacing:-.025em;line-height:1.2}
body:not(.report-builder-fullscreen) .page-icon{
  width:40px;height:40px;min-width:40px;border-radius:12px;
  box-shadow:0 8px 20px rgba(15,23,42,.08), inset 0 0 0 1px rgba(255,255,255,.8);
}
body:not(.report-builder-fullscreen) .page-header-right{align-items:center;padding-top:0;gap:8px}
body:not(.report-builder-fullscreen) .page-header-right .btn{height:34px}
body:not(.report-builder-fullscreen) .page-content{padding:20px var(--page-gutter) 32px;gap:18px}
body:not(.report-builder-fullscreen) .flashes-wrap{padding:0 var(--page-gutter);margin-top:12px}
body:not(.report-builder-fullscreen) .filter-bar.global-filter-bar{
  padding:11px var(--page-gutter)!important;
  background:rgba(255,255,255,.92)!important;
  backdrop-filter:saturate(130%) blur(10px);
  border-bottom:1px solid #e3ebf5!important;
  box-shadow:0 2px 12px rgba(15,23,42,.025);
}
body:not(.report-builder-fullscreen) .table-card,
body:not(.report-builder-fullscreen) .chart-card,
body:not(.report-builder-fullscreen) .kpi-card,
body:not(.report-builder-fullscreen) .empty-state,
body:not(.report-builder-fullscreen) .smart-empty-state,
body:not(.report-builder-fullscreen) .custom-widget-card{
  border-color:var(--panel-border);
  border-radius:16px;
  box-shadow:var(--panel-shadow);
}
body:not(.report-builder-fullscreen) .chart-card,
body:not(.report-builder-fullscreen) .table-card{background:#fff}
body:not(.report-builder-fullscreen) .table-card:hover,
body:not(.report-builder-fullscreen) .chart-card:hover,
body:not(.report-builder-fullscreen) .kpi-card:hover{box-shadow:var(--panel-shadow-hover)}
body:not(.report-builder-fullscreen) .table-header,
body:not(.report-builder-fullscreen) .chart-header{padding:15px 18px}
body:not(.report-builder-fullscreen) .table-header{background:linear-gradient(180deg,#fff,#fbfdff)}
body:not(.report-builder-fullscreen) .table-title,
body:not(.report-builder-fullscreen) .chart-title{font-size:13.5px;font-weight:850;letter-spacing:-.01em}
body:not(.report-builder-fullscreen) .kpi-grid{gap:12px}
body:not(.report-builder-fullscreen) .kpi-card{min-height:78px;padding:13px 14px;transform:none}
body:not(.report-builder-fullscreen) .kpi-card:hover{transform:translateY(-1px)}
body:not(.report-builder-fullscreen) .kpi-icon{width:32px;height:32px;min-width:32px;border-radius:10px}
body:not(.report-builder-fullscreen) .kpi-value{font-size:clamp(16px,1.1vw,20px);letter-spacing:-.02em}
body:not(.report-builder-fullscreen) .btn{border-radius:10px;font-weight:800;box-shadow:0 1px 2px rgba(15,23,42,.05)}
body:not(.report-builder-fullscreen) .btn-primary{background:#2563eb;border-color:#2563eb}
body:not(.report-builder-fullscreen) .btn-primary:hover{background:#1d4ed8;border-color:#1d4ed8}
body:not(.report-builder-fullscreen) input[type="date"],
body:not(.report-builder-fullscreen) input[type="text"],
body:not(.report-builder-fullscreen) input[type="email"],
body:not(.report-builder-fullscreen) input[type="password"],
body:not(.report-builder-fullscreen) input[type="number"],
body:not(.report-builder-fullscreen) input[type="url"],
body:not(.report-builder-fullscreen) select,
body:not(.report-builder-fullscreen) textarea{border-color:#d8e2ee;border-radius:10px}
body:not(.report-builder-fullscreen) input:focus,
body:not(.report-builder-fullscreen) select:focus,
body:not(.report-builder-fullscreen) textarea:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.13)}
body:not(.report-builder-fullscreen) .modal{border-radius:18px;box-shadow:0 28px 80px rgba(15,23,42,.24)}
body:not(.report-builder-fullscreen) .modal-header{background:linear-gradient(180deg,#fff,#fbfdff)}
body:not(.report-builder-fullscreen) thead th{background:#f8fafc;color:#64748b}
body:not(.report-builder-fullscreen) tbody tr:hover{background:#f8fafc}
@media (max-width:900px){
  :root{--page-gutter:16px}
  body:not(.report-builder-fullscreen) .page-header{padding:16px var(--page-gutter);align-items:flex-start}
  body:not(.report-builder-fullscreen) .page-title{font-size:18px;white-space:normal}
  body:not(.report-builder-fullscreen) .page-header-right{width:100%;justify-content:flex-start;margin-left:52px}
  body:not(.report-builder-fullscreen) .page-header-right .btn{flex:0 1 auto}
  body:not(.report-builder-fullscreen) .page-content{padding-top:16px}
}
@media (max-width:640px){
  :root{--page-gutter:12px}
  body:not(.report-builder-fullscreen) .page-header-left{flex-basis:100%}
  body:not(.report-builder-fullscreen) .page-header-right{margin-left:0;width:100%}
  body:not(.report-builder-fullscreen) .page-header-right .btn{width:100%}
  body:not(.report-builder-fullscreen) .kpi-grid,
  body:not(.report-builder-fullscreen) .charts-row,
  body:not(.report-builder-fullscreen) .charts-row-3{grid-template-columns:1fr!important}
}

/* ──────────────────────────────────────────────────────────
   Phase 2 — Sidebar, topbar, and navigation UX
   Scope: tool pages only. Report Builder keeps its own fullscreen shell.
   ────────────────────────────────────────────────────────── */
:root{
  --sidebar-expanded-width:236px;
  --sidebar-collapsed-width:72px;
  --sidebar-mobile-width:min(288px,84vw);
  --sidebar-accent:#60a5fa;
}
body:not(.report-builder-fullscreen){--sidebar-width:var(--sidebar-expanded-width)}
body.sidebar-collapsed:not(.report-builder-fullscreen){--sidebar-width:var(--sidebar-collapsed-width)}
body:not(.report-builder-fullscreen) .sidebar,
body:not(.report-builder-fullscreen) .main-content{transition:width .22s ease,min-width .22s ease,max-width .22s ease,margin-left .22s ease,transform .22s ease}
body:not(.report-builder-fullscreen) .sidebar{
  background:
    radial-gradient(circle at 28px 22px,rgba(96,165,250,.16),transparent 34px),
    linear-gradient(180deg,#0b1120 0%,#0f172a 42%,#0d111b 100%);
  border-right:1px solid rgba(148,163,184,.16);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.025);
}
.sidebar-header{
  min-height:68px;
  padding:13px 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:9px;
  border-bottom:1px solid rgba(148,163,184,.14);
  flex-shrink:0;
}
.sidebar-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  color:#e2e8f0;
  text-decoration:none;
}
.sidebar-brand:hover{text-decoration:none;color:#fff}
.sidebar-brand .logo-box{box-shadow:0 8px 20px rgba(37,99,235,.18);flex-shrink:0}
.sidebar-brand-text{display:flex;flex-direction:column;min-width:0;line-height:1.15}
.sidebar-brand-text strong{font-size:13px;font-weight:900;letter-spacing:-.02em;color:#f8fafc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-brand-text span{font-size:9px;color:#94a3b8;margin-top:3px;font-weight:850;text-transform:uppercase;letter-spacing:.09em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-collapse-toggle{
  width:30px;height:30px;display:inline-flex;align-items:center;justify-content:center;
  border:1px solid rgba(148,163,184,.18);border-radius:10px;background:rgba(15,23,42,.62);
  color:#94a3b8;cursor:pointer;transition:background var(--t),color var(--t),border-color var(--t),transform var(--t),box-shadow var(--t);flex-shrink:0;
}
.sidebar-collapse-toggle:hover{background:rgba(37,99,235,.18);border-color:rgba(96,165,250,.38);color:#dbeafe;box-shadow:0 8px 18px rgba(0,0,0,.18)}
.sidebar-search-wrap{
  margin:10px 10px 6px;
  height:36px;
  display:flex;
  align-items:center;
  gap:7px;
  padding:0 9px;
  color:#64748b;
  border:1px solid rgba(148,163,184,.16);
  border-radius:12px;
  background:rgba(15,23,42,.54);
  transition:border-color var(--t),background var(--t),box-shadow var(--t);
  flex-shrink:0;
}
.sidebar-search-wrap:focus-within{border-color:rgba(96,165,250,.55);background:rgba(15,23,42,.82);box-shadow:0 0 0 3px rgba(59,130,246,.12)}
.sidebar-search{width:100%;min-width:0;border:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;color:#e2e8f0!important;padding:0!important;font-size:12px;font-weight:700}
.sidebar-search::placeholder{color:#64748b}
.sidebar-search-wrap kbd{font:700 9px/1 var(--font);color:#64748b;border:1px solid rgba(148,163,184,.18);border-radius:5px;padding:3px 4px;background:rgba(2,6,23,.32);white-space:nowrap}
.sidebar-nav{padding:8px 9px 10px;gap:4px}
.nav-section{display:flex;flex-direction:column;gap:2px}
.nav-separator{padding:12px 9px 5px;color:#64748b;font-size:9.5px;letter-spacing:.12em}
.nav-item{
  position:relative;
  min-height:36px;
  padding:8px 10px;
  gap:10px;
  border:1px solid transparent;
  border-radius:11px;
  color:#a8b3c4;
  font-weight:700;
  letter-spacing:-.01em;
}
.nav-item:hover{background:rgba(30,41,59,.72);border-color:rgba(148,163,184,.12);color:#f1f5f9}
.nav-item.active{
  background:linear-gradient(135deg,rgba(37,99,235,.28),rgba(14,165,233,.12));
  border-color:rgba(96,165,250,.24);
  color:#e0f2fe;
  box-shadow:inset 3px 0 0 var(--sidebar-accent),0 10px 22px rgba(2,6,23,.12);
}
.nav-item .nav-icon{width:17px;height:17px;opacity:.96}
.nav-item span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-active-dot{margin-left:auto;width:6px;height:6px;border-radius:50%;background:#60a5fa;box-shadow:0 0 0 4px rgba(96,165,250,.12);flex-shrink:0}
.sidebar-search-empty{margin:10px 7px;padding:10px;border:1px dashed rgba(148,163,184,.25);border-radius:12px;color:#94a3b8;font-size:12px;font-weight:800;text-align:center;background:rgba(15,23,42,.42)}
.sidebar-user{margin:0 10px 10px;padding:9px;border:1px solid rgba(148,163,184,.14);border-radius:14px;background:rgba(15,23,42,.50)}
.user-logout{width:28px;height:28px;align-items:center;justify-content:center;border-radius:9px}
.sidebar-overlay{display:none}

body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar{overflow-x:visible}
body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-header{justify-content:center;padding-left:10px;padding-right:10px;position:relative}
body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-brand{justify-content:center;width:100%;gap:0}
body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-brand-text,
body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-search-wrap,
body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-separator,
body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-item span,
body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-active-dot,
body.sidebar-collapsed:not(.report-builder-fullscreen) .user-info,
body.sidebar-collapsed:not(.report-builder-fullscreen) .user-logout{display:none!important}
body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-collapse-toggle{
  position:fixed!important;
  left:calc(var(--sidebar-collapsed-width) - 14px);
  right:auto!important;
  top:18px;
  z-index:1180;
  width:34px;
  height:34px;
  border-radius:999px;
  background:#fff;
  color:#0f172a;
  border-color:#dbe5f1;
  box-shadow:0 10px 26px rgba(15,23,42,.18),0 0 0 1px rgba(255,255,255,.88);
  transform:rotate(180deg);
}
body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-collapse-toggle:hover{
  background:#f8fafc;
  border-color:#bfdbfe;
  color:#2563eb;
  box-shadow:0 14px 30px rgba(15,23,42,.22),0 0 0 1px rgba(255,255,255,.96);
}
body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-nav{padding:10px 9px;align-items:center}
body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-section{width:100%;align-items:center;gap:6px}
body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-item{width:42px;height:42px;min-height:42px;padding:0;justify-content:center;border-radius:14px;overflow:visible}
body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-item .nav-icon{width:19px;height:19px}
body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-item.active{box-shadow:inset 0 -3px 0 var(--sidebar-accent),0 8px 20px rgba(37,99,235,.12)}
body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-user{justify-content:center;margin-left:9px;margin-right:9px;padding:8px;background:transparent;border-color:transparent}
body.sidebar-collapsed:not(.report-builder-fullscreen) .user-avatar{width:34px;height:34px;font-size:11px}

.top-bar-title{display:flex;flex-direction:column;min-width:0;line-height:1.15;margin-left:2px!important;width:auto!important;flex:1}
.top-bar-title span{font-size:10px;font-weight:850;color:#64748b;text-transform:uppercase;letter-spacing:.07em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.top-bar-title strong{font-size:14px;font-weight:900;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;letter-spacing:-.02em}

@media(max-width:900px){
  body:not(.report-builder-fullscreen),
  body.sidebar-collapsed:not(.report-builder-fullscreen){--sidebar-width:var(--sidebar-mobile-width)}
  body.sidebar-open{overflow:hidden}
  body:not(.report-builder-fullscreen) .sidebar,
  body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar{
    left:0!important;right:auto!important;top:0!important;bottom:0!important;
    width:var(--sidebar-mobile-width)!important;min-width:var(--sidebar-mobile-width)!important;max-width:var(--sidebar-mobile-width)!important;
    transform:translateX(-105%)!important;z-index:1110!important;transition:transform .22s ease!important;
    border-radius:0 22px 22px 0;box-shadow:none;overflow-y:auto;overflow-x:hidden;
  }
  body:not(.report-builder-fullscreen) .sidebar.mobile-open{transform:translateX(0)!important;box-shadow:20px 0 55px rgba(15,23,42,.34)}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-brand-text,
  body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-search-wrap,
  body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-separator,
  body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-item span,
  body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-active-dot,
  body.sidebar-collapsed:not(.report-builder-fullscreen) .user-info,
  body.sidebar-collapsed:not(.report-builder-fullscreen) .user-logout{display:flex!important}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-separator{display:block!important}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-collapse-toggle{display:none!important}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-header{justify-content:space-between;padding:13px 12px}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-brand{justify-content:flex-start;width:auto;gap:10px}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .sidebar-nav{align-items:stretch;padding:8px 9px 10px}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-section{align-items:stretch;gap:2px}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-item{width:auto;height:auto;min-height:36px;padding:8px 10px;justify-content:flex-start;border-radius:11px}
  body.sidebar-collapsed:not(.report-builder-fullscreen) .nav-item .nav-icon{width:17px;height:17px}
  .sidebar-overlay{position:fixed;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(2px);z-index:1100;display:block}
  .sidebar-overlay[hidden]{display:none!important}
  .top-bar{
    display:flex!important;position:sticky;top:0;z-index:1085;height:58px;width:100%;
    padding:8px 13px;background:rgba(248,250,252,.94);backdrop-filter:saturate(130%) blur(10px);
    border-bottom:1px solid #dbe5f1;justify-content:flex-start;gap:10px;box-shadow:0 4px 18px rgba(15,23,42,.06)
  }
  .top-bar-toggle{width:40px;height:40px;align-items:center;justify-content:center;background:#fff;border:1px solid #d6e2ef;color:#0f172a;border-radius:12px;padding:0;box-shadow:0 2px 7px rgba(15,23,42,.06)}
  .top-bar-toggle:hover{background:#f8fafc;color:#2563eb}
  .top-bar .logo-box{font-size:13px;box-shadow:0 2px 8px rgba(37,99,235,.10);flex-shrink:0}
  .top-bar .top-bar-title{margin-left:0!important;min-width:0;max-width:calc(100vw - 122px)}
}

@media(max-width:420px){
  .top-bar-logo{display:none!important}
  .top-bar .top-bar-title{max-width:calc(100vw - 66px)}
  .sidebar-search-wrap kbd{display:none}
}


/* ============================================================
   Phase 3 — Component Design System
   Scope: regular tool pages only. Report Builder keeps its own fullscreen UI.
   ============================================================ */
:root{
  --component-radius:16px;
  --component-radius-sm:11px;
  --component-radius-lg:20px;
  --component-border:#dbe5f1;
  --component-muted:#eef4fb;
  --component-shadow:0 10px 28px rgba(15,23,42,.055);
  --component-shadow-hover:0 18px 46px rgba(15,23,42,.095);
  --focus-ring:0 0 0 3px rgba(37,99,235,.16);
}
body:not(.report-builder-fullscreen){background:#eef3f8;color:var(--text-primary)}
body:not(.report-builder-fullscreen) .page-content{gap:18px}
body:not(.report-builder-fullscreen) .page-header{border-bottom:1px solid var(--component-border);box-shadow:0 1px 0 rgba(255,255,255,.75) inset}
body:not(.report-builder-fullscreen) .page-title{letter-spacing:-.025em}
body:not(.report-builder-fullscreen) :focus-visible{outline:0!important;box-shadow:var(--focus-ring)!important}
body:not(.report-builder-fullscreen) ::selection{background:#bfdbfe;color:#0f172a}

/* Cards */
body:not(.report-builder-fullscreen) .table-card,
body:not(.report-builder-fullscreen) .chart-card,
body:not(.report-builder-fullscreen) .panel-card,
body:not(.report-builder-fullscreen) .kpi-card,
body:not(.report-builder-fullscreen) .workflow-filter-card,
body:not(.report-builder-fullscreen) .workflow-lane,
body:not(.report-builder-fullscreen) .data-health-hero,
body:not(.report-builder-fullscreen) .health-card{
  border-color:var(--component-border);
  box-shadow:var(--component-shadow);
}
body:not(.report-builder-fullscreen) .table-card,
body:not(.report-builder-fullscreen) .chart-card,
body:not(.report-builder-fullscreen) .panel-card{border-radius:var(--component-radius);background:rgba(255,255,255,.96)}
body:not(.report-builder-fullscreen) .chart-card,
body:not(.report-builder-fullscreen) .table-card,
body:not(.report-builder-fullscreen) .panel-card{transition:box-shadow .18s ease,border-color .18s ease,transform .18s ease}
body:not(.report-builder-fullscreen) .chart-card:hover,
body:not(.report-builder-fullscreen) .table-card:hover,
body:not(.report-builder-fullscreen) .panel-card:hover{border-color:#cbd9e8;box-shadow:var(--component-shadow-hover)}
body:not(.report-builder-fullscreen) .table-header,
body:not(.report-builder-fullscreen) .chart-header{background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
body:not(.report-builder-fullscreen) .table-title,
body:not(.report-builder-fullscreen) .chart-title,
body:not(.report-builder-fullscreen) .panel-title{letter-spacing:-.01em}

/* KPI cards */
body:not(.report-builder-fullscreen) .kpi-grid{gap:12px}
body:not(.report-builder-fullscreen) .kpi-card{border-radius:15px;padding:12px 13px;min-height:82px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
body:not(.report-builder-fullscreen) .kpi-card:hover{box-shadow:0 16px 38px rgba(15,23,42,.09);border-color:#cbd9e8}
body:not(.report-builder-fullscreen) .kpi-icon{width:34px;height:34px;min-width:34px;border-radius:12px;font-weight:900;box-shadow:inset 0 0 0 1px rgba(255,255,255,.45)}
body:not(.report-builder-fullscreen) .kpi-label{font-size:10px;letter-spacing:.075em;color:#64748b}
body:not(.report-builder-fullscreen) .kpi-value{font-size:clamp(17px,1.25vw,22px);letter-spacing:-.025em}
body:not(.report-builder-fullscreen) .kpi-delta{display:inline-flex;align-items:center;width:max-content;max-width:100%;padding:2px 7px;border-radius:999px;background:#f8fafc;border:1px solid #e2e8f0;font-size:10px}
body:not(.report-builder-fullscreen) .kpi-delta.delta-positive{background:#ecfdf5;border-color:#bbf7d0;color:#15803d}
body:not(.report-builder-fullscreen) .kpi-delta.delta-negative{background:#fef2f2;border-color:#fecaca;color:#dc2626}

/* Buttons */
body:not(.report-builder-fullscreen) .btn{min-height:34px;border-radius:11px;font-weight:800;letter-spacing:-.005em;box-shadow:0 1px 2px rgba(15,23,42,.055);transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease,color .16s ease}
body:not(.report-builder-fullscreen) .btn:hover{transform:translateY(-1px);box-shadow:0 8px 18px rgba(15,23,42,.09)}
body:not(.report-builder-fullscreen) .btn:active{transform:translateY(0);box-shadow:0 1px 2px rgba(15,23,42,.08)}
body:not(.report-builder-fullscreen) .btn-sm{min-height:32px;padding:6px 11px}
body:not(.report-builder-fullscreen) .btn-xs{min-height:28px;min-width:28px;padding:4px 8px;border-radius:9px}
body:not(.report-builder-fullscreen) .btn-icon{width:32px;min-width:32px;padding:0!important;gap:0;font-size:13px}
body:not(.report-builder-fullscreen) .btn-primary{background:linear-gradient(135deg,#2563eb,#1d4ed8);border-color:#1d4ed8;color:#fff}
body:not(.report-builder-fullscreen) .btn-primary:hover{background:linear-gradient(135deg,#1d4ed8,#1e40af);color:#fff}
body:not(.report-builder-fullscreen) .btn-secondary{background:#fff;border-color:#cbd5e1;color:#0f172a}
body:not(.report-builder-fullscreen) .btn-secondary:hover{border-color:#94a3b8;background:#f8fafc;color:#0f172a}
body:not(.report-builder-fullscreen) .btn-ghost{background:#fff;border-color:#dbe5f1;color:#334155}
body:not(.report-builder-fullscreen) .btn-ghost:hover{background:#f8fafc;border-color:#cbd5e1;color:#0f172a}
body:not(.report-builder-fullscreen) .btn-danger{background:linear-gradient(135deg,#ef4444,#dc2626);border-color:#dc2626;color:#fff}

/* Forms */
body:not(.report-builder-fullscreen) .form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
body:not(.report-builder-fullscreen) .form-grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
body:not(.report-builder-fullscreen) .form-group{margin-bottom:14px}
body:not(.report-builder-fullscreen) .form-label{font-size:11.5px;font-weight:850;color:#334155;letter-spacing:.01em;margin-bottom:6px}
body:not(.report-builder-fullscreen) .form-control,
body:not(.report-builder-fullscreen) input[type="date"],
body:not(.report-builder-fullscreen) input[type="text"],
body:not(.report-builder-fullscreen) input[type="email"],
body:not(.report-builder-fullscreen) input[type="password"],
body:not(.report-builder-fullscreen) input[type="number"],
body:not(.report-builder-fullscreen) input[type="url"],
body:not(.report-builder-fullscreen) select,
body:not(.report-builder-fullscreen) textarea{
  border-color:#d8e2ee;border-radius:11px;background:#fff;min-height:36px;font-weight:650;color:#0f172a;
}
body:not(.report-builder-fullscreen) textarea.form-control{line-height:1.5}
body:not(.report-builder-fullscreen) input[type="checkbox"],
body:not(.report-builder-fullscreen) input[type="radio"]{accent-color:#2563eb}
body:not(.report-builder-fullscreen) .form-hint{color:#64748b;line-height:1.45}
body:not(.report-builder-fullscreen) .form-error{font-weight:700}
body:not(.report-builder-fullscreen) .field-inline{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
body:not(.report-builder-fullscreen) .field-stack{display:flex;flex-direction:column;gap:7px;min-width:0}

/* Badges and status */
body:not(.report-builder-fullscreen) .badge{min-height:22px;border:1px solid transparent;padding:3px 8px;font-weight:850;letter-spacing:.005em}
body:not(.report-builder-fullscreen) .badge-active{border-color:#bbf7d0;background:#ecfdf5;color:#15803d}
body:not(.report-builder-fullscreen) .badge-paused{border-color:#fde68a;background:#fffbeb;color:#b45309}
body:not(.report-builder-fullscreen) .badge-error{border-color:#fecaca;background:#fef2f2;color:#b91c1c}
body:not(.report-builder-fullscreen) .badge-warning{border-color:#fed7aa;background:#fff7ed;color:#c2410c}
body:not(.report-builder-fullscreen) .badge-info{border-color:#bfdbfe;background:#eff6ff;color:#1d4ed8}
body:not(.report-builder-fullscreen) .status-dot{width:8px;height:8px;border-radius:999px;background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.12)}
body:not(.report-builder-fullscreen) .status-dot.ok{background:#22c55e;box-shadow:0 0 0 4px rgba(34,197,94,.14)}
body:not(.report-builder-fullscreen) .status-dot.warn{background:#f59e0b;box-shadow:0 0 0 4px rgba(245,158,11,.14)}
body:not(.report-builder-fullscreen) .status-dot.bad{background:#ef4444;box-shadow:0 0 0 4px rgba(239,68,68,.14)}

/* Tables */
body:not(.report-builder-fullscreen) .beit-table-card--enhanced .table-header{gap:10px}
body:not(.report-builder-fullscreen) .beit-table-title-wrap{display:flex;align-items:center;gap:8px;min-width:0}
body:not(.report-builder-fullscreen) .beit-table-tools{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-left:auto;min-width:0}
body:not(.report-builder-fullscreen) .beit-table-count{font-size:10.5px;font-weight:850;color:#64748b;background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px;padding:4px 8px;white-space:nowrap}
body:not(.report-builder-fullscreen) .beit-table-search{height:32px;display:flex;align-items:center;gap:6px;border:1px solid #dbe5f1;border-radius:10px;background:#fff;padding:0 9px;color:#94a3b8;box-shadow:0 1px 2px rgba(15,23,42,.04)}
body:not(.report-builder-fullscreen) .beit-table-search input{height:28px;min-height:28px;border:0!important;box-shadow:none!important;padding:0!important;width:150px;background:transparent;font-size:12px;font-weight:700}
body:not(.report-builder-fullscreen) .beit-table-density{height:32px;min-width:32px;border:1px solid #dbe5f1;border-radius:10px;background:#fff;color:#334155;font-size:13px;font-weight:900;cursor:pointer;box-shadow:0 1px 2px rgba(15,23,42,.04)}
body:not(.report-builder-fullscreen) .beit-table-density:hover{background:#f8fafc;border-color:#cbd5e1;color:#2563eb}
body:not(.report-builder-fullscreen) .table-wrap{border-top:1px solid #eef3f8;background:#fff}
body:not(.report-builder-fullscreen) .table-wrap table{min-width:100%}
body:not(.report-builder-fullscreen) thead th{position:sticky;top:0;z-index:2;background:linear-gradient(180deg,#f8fafc,#f1f5f9);border-bottom:1px solid #dbe5f1;font-weight:850;color:#64748b}
body:not(.report-builder-fullscreen) tbody td{height:42px;border-bottom-color:#f2f5f9}
body:not(.report-builder-fullscreen) tbody tr:hover{background:#f8fbff}
body:not(.report-builder-fullscreen) .beit-density-compact tbody td{height:34px;padding-top:6px;padding-bottom:6px;font-size:12px}
body:not(.report-builder-fullscreen) .beit-density-compact thead th{padding-top:7px;padding-bottom:7px}
body:not(.report-builder-fullscreen) tr.is-filtered-out{display:none!important}
body:not(.report-builder-fullscreen) .table-card .empty-state{background:linear-gradient(180deg,#fff,#fbfdff)}

/* Active filter chips */
body:not(.report-builder-fullscreen) .filter-active-chips{display:flex;align-items:center;gap:6px;flex-wrap:wrap;padding-top:8px;border-top:1px solid #edf2f7;width:100%}
body:not(.report-builder-fullscreen) .filter-chip-label{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#94a3b8;margin-right:2px}
body:not(.report-builder-fullscreen) .filter-chip{display:inline-flex;align-items:center;gap:6px;max-width:260px;min-height:26px;padding:4px 8px;border:1px solid #dbe5f1;border-radius:999px;background:#fff;color:#334155;font-size:11px;font-weight:800;white-space:nowrap;box-shadow:0 1px 2px rgba(15,23,42,.04)}
body:not(.report-builder-fullscreen) .filter-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
body:not(.report-builder-fullscreen) .filter-chip button{width:16px;height:16px;border:0;border-radius:999px;background:#eef2f7;color:#64748b;display:inline-flex;align-items:center;justify-content:center;font-weight:900;line-height:1;cursor:pointer;flex-shrink:0}
body:not(.report-builder-fullscreen) .filter-chip button:hover{background:#fee2e2;color:#dc2626}
body:not(.report-builder-fullscreen) .filter-chip-reset{border:0;background:transparent;color:#2563eb;font-size:11px;font-weight:900;cursor:pointer;padding:3px 5px}
body:not(.report-builder-fullscreen) .filter-chip-reset:hover{text-decoration:underline}

/* Multi select polish */
body:not(.report-builder-fullscreen) .beit-multi-toggle{border-radius:11px!important;border-color:#d8e2ee!important;box-shadow:0 1px 2px rgba(15,23,42,.04)!important;font-weight:800!important}
body:not(.report-builder-fullscreen) .beit-multi-toggle:hover{border-color:#cbd5e1!important;background:#f8fafc!important}
body:not(.report-builder-fullscreen) .beit-multi-menu{border-radius:14px!important;border-color:#dbe5f1!important;box-shadow:0 22px 60px rgba(15,23,42,.18)!important;padding:6px!important}
body:not(.report-builder-fullscreen) .beit-multi-option{border-radius:10px!important;min-height:32px!important;padding:7px 9px!important;font-weight:750!important}
body:not(.report-builder-fullscreen) .beit-multi-option:hover{background:#eff6ff!important;color:#1d4ed8!important}
body:not(.report-builder-fullscreen) .beit-multi-option input{width:15px;height:15px;flex-shrink:0}

/* Empty and loading states */
body:not(.report-builder-fullscreen) .empty-state{border-radius:16px;background:linear-gradient(180deg,#fff 0%,#fbfdff 100%)}
body:not(.report-builder-fullscreen) .empty-icon{width:58px;height:58px;border-radius:20px;display:flex;align-items:center;justify-content:center;background:#f1f5f9;color:#64748b;opacity:1;margin-bottom:3px}
body:not(.report-builder-fullscreen) .empty-title{font-size:16px;letter-spacing:-.015em}
body:not(.report-builder-fullscreen) .empty-message{color:#64748b}
body:not(.report-builder-fullscreen) .skeleton{position:relative;overflow:hidden;background:#e2e8f0;border-radius:10px;color:transparent!important}
body:not(.report-builder-fullscreen) .skeleton::after{content:"";position:absolute;inset:0;transform:translateX(-100%);background:linear-gradient(90deg,transparent,rgba(255,255,255,.58),transparent);animation:beitSkeleton 1.2s infinite}
@keyframes beitSkeleton{to{transform:translateX(100%)}}

/* Modals */
body.modal-open:not(.report-builder-fullscreen){overflow:hidden}
body:not(.report-builder-fullscreen) .modal-backdrop.open{backdrop-filter:blur(5px);background:rgba(15,23,42,.58);animation:beitFadeIn .15s ease both}
body:not(.report-builder-fullscreen) .modal{border:1px solid rgba(226,232,240,.9);border-radius:20px;box-shadow:0 32px 90px rgba(15,23,42,.32)}
body:not(.report-builder-fullscreen) .modal-header{background:linear-gradient(180deg,#fff,#fbfdff);padding:18px 22px}
body:not(.report-builder-fullscreen) .modal-title{font-size:15.5px;font-weight:900;letter-spacing:-.015em}
body:not(.report-builder-fullscreen) .modal-close{width:32px;height:32px;display:flex;align-items:center;justify-content:center;background:#f8fafc;border:1px solid #e2e8f0;border-radius:11px;font-size:20px;color:#64748b}
body:not(.report-builder-fullscreen) .modal-close:hover{background:#fff;border-color:#cbd5e1;color:#0f172a}
body:not(.report-builder-fullscreen) .modal-body{padding:20px 22px}
body:not(.report-builder-fullscreen) .modal-footer{padding:14px 22px;background:#fbfdff;border-top-color:#e7edf5}
@keyframes beitFadeIn{from{opacity:0}to{opacity:1}}

/* Tabs and action menu primitives for Phase 4 page work */
body:not(.report-builder-fullscreen) .tabs{display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid #e2e8f0;margin-bottom:12px}
body:not(.report-builder-fullscreen) .tab-btn{border:0;background:transparent;color:#64748b;font-weight:850;font-size:12px;padding:10px 12px;border-radius:10px 10px 0 0;cursor:pointer}
body:not(.report-builder-fullscreen) .tab-btn.active{background:#fff;color:#2563eb;box-shadow:inset 0 -2px 0 #2563eb}
body:not(.report-builder-fullscreen) .action-menu{position:relative;display:inline-flex}
body:not(.report-builder-fullscreen) .action-menu-panel{position:absolute;right:0;top:calc(100% + 6px);min-width:180px;background:#fff;border:1px solid #dbe5f1;border-radius:13px;box-shadow:0 18px 42px rgba(15,23,42,.16);padding:6px;z-index:100;display:none}
body:not(.report-builder-fullscreen) .action-menu.open .action-menu-panel{display:grid;gap:2px}
body:not(.report-builder-fullscreen) .action-menu-panel a,
body:not(.report-builder-fullscreen) .action-menu-panel button{display:flex;width:100%;align-items:center;gap:8px;text-align:left;border:0;background:transparent;border-radius:9px;padding:8px 9px;color:#334155;font-size:12px;font-weight:800;text-decoration:none;cursor:pointer}
body:not(.report-builder-fullscreen) .action-menu-panel a:hover,
body:not(.report-builder-fullscreen) .action-menu-panel button:hover{background:#eff6ff;color:#1d4ed8}

@media(max-width:900px){
  body:not(.report-builder-fullscreen) .form-grid,
  body:not(.report-builder-fullscreen) .form-grid-3{grid-template-columns:1fr}
  body:not(.report-builder-fullscreen) .beit-table-tools{width:100%;justify-content:flex-start;margin-left:0}
  body:not(.report-builder-fullscreen) .beit-table-search{flex:1;min-width:180px}
  body:not(.report-builder-fullscreen) .beit-table-search input{width:100%}
  body:not(.report-builder-fullscreen) .filter-active-chips{padding-top:7px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  body:not(.report-builder-fullscreen) .filter-active-chips::-webkit-scrollbar{display:none}
  body:not(.report-builder-fullscreen) .filter-chip{flex:0 0 auto;max-width:220px}
}
@media(max-width:640px){
  body:not(.report-builder-fullscreen) .page-content{padding-left:12px;padding-right:12px}
  body:not(.report-builder-fullscreen) .kpi-grid{grid-template-columns:1fr!important}
  body:not(.report-builder-fullscreen) .modal{max-width:calc(100vw - 18px)!important;border-radius:16px}
  body:not(.report-builder-fullscreen) .modal-footer{display:grid;grid-template-columns:1fr;gap:8px}
  body:not(.report-builder-fullscreen) .modal-footer .btn{width:100%}
}

/* Phase 3 filter bar layout override so active chips live on their own row */
body:not(.report-builder-fullscreen) .global-filter-bar{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:8px!important;overflow:visible!important;padding:10px 18px!important;background:rgba(255,255,255,.96)!important}
body:not(.report-builder-fullscreen) .global-filter-bar .filter-row{display:flex!important;align-items:flex-end!important;gap:8px!important;width:100%!important;min-width:0!important;border-top:0!important;padding-top:0!important}
body:not(.report-builder-fullscreen) .global-filter-bar .filter-row-main{flex-wrap:nowrap!important;overflow-x:auto!important;padding-bottom:2px!important;scrollbar-width:thin}
body:not(.report-builder-fullscreen) .global-filter-bar .filter-active-chips{flex:0 0 auto!important}
@media(max-width:768px){
  body:not(.report-builder-fullscreen) .global-filter-bar{padding:10px!important}
  body:not(.report-builder-fullscreen) .global-filter-bar .filter-row-main{flex-wrap:wrap!important;overflow:visible!important}
}


/* ──────────────────────────────────────────────────────────
   Phase 4 — Page-level UI/UX templates
   Scope: normal tool pages only. Report Builder fullscreen is excluded.
   ────────────────────────────────────────────────────────── */
:root{
  --phase4-card-border:#d9e4f0;
  --phase4-card-shadow:0 14px 38px rgba(15,23,42,.065);
  --phase4-card-shadow-hover:0 18px 46px rgba(15,23,42,.095);
  --phase4-soft-bg:#f8fbff;
  --phase4-rail-width:320px;
}
body:not(.report-builder-fullscreen) .phase4-stack{display:flex!important;flex-direction:column!important;gap:18px!important;min-width:0!important}
body:not(.report-builder-fullscreen) .phase4-stack-sm{display:flex!important;flex-direction:column!important;gap:12px!important;min-width:0!important}
body:not(.report-builder-fullscreen) .phase4-section-card,
body:not(.report-builder-fullscreen) .settings-panel,
body:not(.report-builder-fullscreen) .connection-platform-card{
  background:linear-gradient(180deg,#fff 0%,#fbfdff 100%);
  border:1px solid var(--phase4-card-border);
  border-radius:20px;
  box-shadow:var(--phase4-card-shadow);
  overflow:hidden;
}
body:not(.report-builder-fullscreen) .phase4-section-card:hover,
body:not(.report-builder-fullscreen) .settings-panel:hover,
body:not(.report-builder-fullscreen) .connection-platform-card:hover{box-shadow:var(--phase4-card-shadow-hover);border-color:#cbd9e8}
body:not(.report-builder-fullscreen) .content-with-panel,
body:not(.report-builder-fullscreen) .phase4-two-col{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(280px,var(--phase4-rail-width))!important;
  gap:18px!important;
  align-items:start!important;
}
body:not(.report-builder-fullscreen) .right-panel{
  gap:14px!important;
  top:18px!important;
}
body:not(.report-builder-fullscreen) .right-panel .panel-card{
  padding:16px;
  border-radius:18px;
  border-color:var(--phase4-card-border);
  background:linear-gradient(180deg,#fff,#fbfdff);
}
body:not(.report-builder-fullscreen) .panel-title,
body:not(.report-builder-fullscreen) .table-title,
body:not(.report-builder-fullscreen) .chart-title{display:flex;align-items:center;gap:8px}
body:not(.report-builder-fullscreen) .phase4-full-btn{width:100%;justify-content:center;margin-top:12px}
body:not(.report-builder-fullscreen) .phase4-muted{color:#64748b!important;font-size:12px;line-height:1.5}
body:not(.report-builder-fullscreen) .phase4-row,
body:not(.report-builder-fullscreen) .phase4-info-row,
body:not(.report-builder-fullscreen) .phase4-mini-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:9px 0;border-bottom:1px solid #edf2f7;font-size:12.5px;
}
body:not(.report-builder-fullscreen) .phase4-row:last-child,
body:not(.report-builder-fullscreen) .phase4-info-row:last-child,
body:not(.report-builder-fullscreen) .phase4-mini-row:last-child{border-bottom:0}
body:not(.report-builder-fullscreen) .phase4-row span:first-child,
body:not(.report-builder-fullscreen) .phase4-info-row span:first-child{color:#64748b;font-weight:650}
body:not(.report-builder-fullscreen) .phase4-row strong,
body:not(.report-builder-fullscreen) .phase4-info-row strong{font-weight:850;color:#0f172a}
body:not(.report-builder-fullscreen) .chart-legend{display:flex;align-items:center;gap:12px;flex-wrap:wrap;color:#475569;font-size:11.5px;font-weight:800}
body:not(.report-builder-fullscreen) .chart-legend-item{display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
body:not(.report-builder-fullscreen) .chart-legend-dot{width:9px;height:9px;border-radius:3px;display:inline-block;background:#94a3b8;box-shadow:0 0 0 3px rgba(148,163,184,.13)}
body:not(.report-builder-fullscreen) .chart-legend-dot.spend{background:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.12)}
body:not(.report-builder-fullscreen) .chart-legend-dot.revenue{background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.12)}
body:not(.report-builder-fullscreen) .chart-legend-dot.video{background:#06b6d4;box-shadow:0 0 0 3px rgba(6,182,212,.12)}

/* Dashboard and platform pages */
body.page-overview:not(.report-builder-fullscreen) .content-with-panel{--phase4-rail-width:322px}
body.page-overview:not(.report-builder-fullscreen) .charts-row{gap:18px}
body.page-overview:not(.report-builder-fullscreen) .chart-card,
body.page-meta:not(.report-builder-fullscreen) .chart-card,
body.page-google:not(.report-builder-fullscreen) .chart-card,
body.page-tiktok:not(.report-builder-fullscreen) .chart-card,
body.page-snapchat:not(.report-builder-fullscreen) .chart-card{
  border-radius:20px;
  overflow:hidden;
}
body.page-overview:not(.report-builder-fullscreen) .chart-header,
body.page-meta:not(.report-builder-fullscreen) .chart-header,
body.page-google:not(.report-builder-fullscreen) .chart-header,
body.page-tiktok:not(.report-builder-fullscreen) .chart-header,
body.page-snapchat:not(.report-builder-fullscreen) .chart-header{
  padding:16px 18px;
  border-bottom:1px solid #edf2f7;
}
body:not(.report-builder-fullscreen) .phase4-platform-main{display:flex!important;flex-direction:column!important;gap:18px!important;min-width:0!important}
body:not(.report-builder-fullscreen) .platform-metric-list{display:flex;flex-direction:column;gap:0}
body:not(.report-builder-fullscreen) .platform-note{padding:12px 13px;border:1px solid #e5eaf2;border-radius:14px;background:#f8fbff;color:#64748b;font-size:12.5px;line-height:1.55}
body:not(.report-builder-fullscreen) .funnel-bar-wrap{display:flex;flex-direction:column;gap:9px}
body:not(.report-builder-fullscreen) .funnel-step{display:grid;grid-template-columns:minmax(112px,150px) minmax(0,1fr) minmax(50px,70px);gap:10px;align-items:center}
body:not(.report-builder-fullscreen) .funnel-label{font-weight:750;color:#334155;font-size:12px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body:not(.report-builder-fullscreen) .funnel-bar-outer{height:26px;background:#edf2f7;border-radius:999px;overflow:hidden;border:1px solid #e2e8f0}
body:not(.report-builder-fullscreen) .funnel-bar-inner{height:100%;min-width:4px;border-radius:999px;display:flex;align-items:center;justify-content:flex-end;padding-right:8px;color:#fff;font-size:10px;font-weight:900;box-shadow:inset 0 -10px 16px rgba(15,23,42,.08)}
body:not(.report-builder-fullscreen) .funnel-rate{font-size:11px;font-weight:850;text-align:right;color:#64748b;white-space:nowrap}

/* Clients */
body.page-clients:not(.report-builder-fullscreen) .content-with-panel{--phase4-rail-width:300px}
body.page-clients:not(.report-builder-fullscreen) .client-toolbar{display:flex;align-items:center;gap:9px;flex-wrap:wrap;background:#fff;border:1px solid #dbe5f1;border-radius:18px;padding:10px;box-shadow:0 8px 22px rgba(15,23,42,.04)}
body.page-clients:not(.report-builder-fullscreen) .client-toolbar .search-box{flex:1;min-width:220px;height:38px;border-radius:12px;background:#f8fbff;border-color:#dbe5f1}
body.page-clients:not(.report-builder-fullscreen) .client-toolbar select{height:38px;min-width:150px;border-radius:12px}
body.page-clients:not(.report-builder-fullscreen) .client-identity{display:flex;align-items:center;gap:10px;min-width:0}
body.page-clients:not(.report-builder-fullscreen) .client-avatar{width:34px;height:34px;border-radius:12px;background:linear-gradient(135deg,#2563eb,#7c3aed);color:#fff;font-size:11px;font-weight:900;display:flex;align-items:center;justify-content:center;flex-shrink:0;box-shadow:0 8px 18px rgba(37,99,235,.18)}
body.page-clients:not(.report-builder-fullscreen) .client-name{font-weight:850;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}
body.page-clients:not(.report-builder-fullscreen) .client-website{font-size:10.5px;color:#94a3b8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:180px}
body.page-clients:not(.report-builder-fullscreen) .client-actions{display:flex;gap:5px;flex-wrap:wrap}
body.page-clients:not(.report-builder-fullscreen) .client-mini-row{display:flex;align-items:center;gap:9px;padding:8px 0;border-bottom:1px solid #edf2f7}
body.page-clients:not(.report-builder-fullscreen) .client-mini-row:last-child{border-bottom:0}
body.page-clients:not(.report-builder-fullscreen) .client-rank{width:22px;height:22px;border-radius:9px;background:#f1f5f9;color:#64748b;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;flex-shrink:0}
body.page-clients:not(.report-builder-fullscreen) .client-mini-name{flex:1;min-width:0;font-size:12.5px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Connections */
body.page-connections:not(.report-builder-fullscreen) .connection-platform-card{margin-bottom:18px}
body.page-connections:not(.report-builder-fullscreen) .connection-platform-card .table-header{padding:17px 18px;background:linear-gradient(180deg,#fff,#fbfdff)}
body.page-connections:not(.report-builder-fullscreen) .connection-logo{width:46px;height:46px;min-width:46px;border-radius:15px;display:flex;align-items:center;justify-content:center;box-shadow:inset 0 0 0 1px rgba(255,255,255,.7)}
body.page-connections:not(.report-builder-fullscreen) .connection-title{display:flex;flex-direction:column;gap:3px;min-width:0}
body.page-connections:not(.report-builder-fullscreen) .connection-title strong{font-size:14px;font-weight:900;color:#0f172a}
body.page-connections:not(.report-builder-fullscreen) .connection-title span{font-size:11.5px;color:#64748b;line-height:1.35}
body.page-connections:not(.report-builder-fullscreen) .connection-warning{display:flex;align-items:center;gap:9px;background:#fffbeb;border-top:1px solid #fde68a;padding:11px 18px;color:#92400e;font-size:12.5px}
body.page-connections:not(.report-builder-fullscreen) .connection-warning .btn{margin-left:auto;flex-shrink:0}

/* Settings */
body.page-settings:not(.report-builder-fullscreen) .settings-grid{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;gap:20px!important;align-items:start!important}
body.page-settings:not(.report-builder-fullscreen) .settings-panel{padding:22px!important;min-height:0}
body.page-settings:not(.report-builder-fullscreen) .settings-panel-danger{border-color:#fecaca!important;background:linear-gradient(180deg,#fff,#fffafa)!important}
body.page-settings:not(.report-builder-fullscreen) .settings-card-title{font-size:15px;font-weight:900;margin-bottom:18px;display:flex;align-items:center;gap:9px;color:#0f172a;letter-spacing:-.01em}
body.page-settings:not(.report-builder-fullscreen) .settings-step{width:24px;height:24px;border-radius:10px;background:#eff6ff;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:900;color:#2563eb;flex-shrink:0;box-shadow:0 0 0 1px #dbeafe inset}
body.page-settings:not(.report-builder-fullscreen) .settings-table{width:100%;border-collapse:collapse}
body.page-settings:not(.report-builder-fullscreen) .settings-table th{font-size:10.5px;text-transform:uppercase;color:#64748b;padding:7px 0;font-weight:900;letter-spacing:.07em;text-align:left;background:transparent;position:static}
body.page-settings:not(.report-builder-fullscreen) .settings-table td{padding:10px 0;border-bottom:1px solid #edf2f7;font-size:12.5px;vertical-align:middle}
body.page-settings:not(.report-builder-fullscreen) .settings-table tr:last-child td{border-bottom:0}
body.page-settings:not(.report-builder-fullscreen) .settings-inline-form{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
body.page-settings:not(.report-builder-fullscreen) .settings-inline-form input{flex:1;min-width:190px}
body.page-settings:not(.report-builder-fullscreen) .settings-inline-form select{width:130px}
body.page-settings:not(.report-builder-fullscreen) .settings-pending-box{margin-bottom:14px;padding:13px;border:1px dashed #cbd5e1;border-radius:14px;background:#f8fbff}
body.page-settings:not(.report-builder-fullscreen) .settings-pending-title{font-size:11px;font-weight:900;color:#64748b;text-transform:uppercase;letter-spacing:.08em;margin-bottom:8px}
body.page-settings:not(.report-builder-fullscreen) .settings-pending-row{display:flex;align-items:center;gap:10px;justify-content:space-between;padding:8px 0;border-bottom:1px solid #edf2f7}
body.page-settings:not(.report-builder-fullscreen) .settings-pending-row:last-child{border-bottom:0}
body.page-settings:not(.report-builder-fullscreen) .settings-meta-list{display:grid;gap:0}
body.page-settings:not(.report-builder-fullscreen) .settings-meta-row{display:flex;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid #edf2f7;font-size:13px}
body.page-settings:not(.report-builder-fullscreen) .settings-meta-row span:first-child{color:#64748b;font-weight:700}
body.page-settings:not(.report-builder-fullscreen) .settings-meta-row span:last-child{font-weight:850;color:#0f172a;text-align:right}

/* Data Sync */
body.page-sync:not(.report-builder-fullscreen) .sync-page-content{gap:20px}
body.page-sync:not(.report-builder-fullscreen) .sync-page-content .table-card{border-radius:20px;overflow:hidden}
body.page-sync:not(.report-builder-fullscreen) .sync-platform-head{display:flex;align-items:center;gap:10px;min-width:0}
body.page-sync:not(.report-builder-fullscreen) .sync-platform-head .table-title{white-space:normal;line-height:1.25}
body.page-sync:not(.report-builder-fullscreen) .cron-card{background:linear-gradient(135deg,#0f172a,#111827)!important;border-color:#1e293b!important;box-shadow:0 18px 44px rgba(15,23,42,.22)!important}

/* Goals, creative, funnel and reports polish */
body.page-goals:not(.report-builder-fullscreen) .table-card,
body.page-creative:not(.report-builder-fullscreen) .table-card,
body.page-funnel:not(.report-builder-fullscreen) .table-card,
body.page-reports:not(.report-builder-fullscreen) .table-card{border-radius:20px;overflow:hidden}
body.page-goals:not(.report-builder-fullscreen) .page-content,
body.page-creative:not(.report-builder-fullscreen) .page-content,
body.page-funnel:not(.report-builder-fullscreen) .page-content{gap:20px}

@media(max-width:1200px){
  body:not(.report-builder-fullscreen) .content-with-panel,
  body:not(.report-builder-fullscreen) .phase4-two-col{grid-template-columns:1fr!important}
  body:not(.report-builder-fullscreen) .right-panel{position:static!important}
  body.page-settings:not(.report-builder-fullscreen) .settings-grid{grid-template-columns:1fr!important}
}
@media(max-width:760px){
  body:not(.report-builder-fullscreen) .funnel-step{grid-template-columns:1fr;gap:5px;padding-bottom:9px;border-bottom:1px solid #edf2f7}
  body:not(.report-builder-fullscreen) .funnel-label,
  body:not(.report-builder-fullscreen) .funnel-rate{text-align:left!important;width:auto!important;white-space:normal}
  body.page-clients:not(.report-builder-fullscreen) .client-toolbar{align-items:stretch}
  body.page-clients:not(.report-builder-fullscreen) .client-toolbar .search-box,
  body.page-clients:not(.report-builder-fullscreen) .client-toolbar select,
  body.page-clients:not(.report-builder-fullscreen) .client-toolbar .btn{width:100%;min-width:0}
  body.page-connections:not(.report-builder-fullscreen) .connection-platform-card .table-header{align-items:flex-start;flex-direction:column}
  body.page-connections:not(.report-builder-fullscreen) .connection-warning{align-items:flex-start;flex-direction:column}
  body.page-connections:not(.report-builder-fullscreen) .connection-warning .btn{margin-left:0;width:100%}
  body.page-settings:not(.report-builder-fullscreen) .settings-panel{padding:16px!important}
  body.page-settings:not(.report-builder-fullscreen) .settings-inline-form input,
  body.page-settings:not(.report-builder-fullscreen) .settings-inline-form select,
  body.page-settings:not(.report-builder-fullscreen) .settings-inline-form button{width:100%;min-width:0}
}
body.page-connections:not(.report-builder-fullscreen) .connection-warning-cell{padding:0!important;background:#fffbeb!important;border-top:1px solid #fde68a!important}
body:not(.report-builder-fullscreen) .platform-note-card{background:linear-gradient(180deg,#eff6ff,#f8fbff)!important;border-color:#bfdbfe!important}

/* ─────────────────────────────────────────────────────────────
   Phase 5 — responsive polish, performance states, final QA
   Scoped to the main tool; report-builder is intentionally isolated.
   ───────────────────────────────────────────────────────────── */
:root{
  --safe-top:env(safe-area-inset-top,0px);
  --safe-right:env(safe-area-inset-right,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-left:env(safe-area-inset-left,0px);
}
html{scroll-behavior:smooth;text-size-adjust:100%;-webkit-text-size-adjust:100%}
body:not(.report-builder-fullscreen){min-height:100vh;min-height:100dvh}
body:not(.report-builder-fullscreen) .app-layout{min-height:100vh;min-height:100dvh}
body:not(.report-builder-fullscreen) :focus-visible{outline:3px solid rgba(37,99,235,.28);outline-offset:2px;border-radius:10px}
body:not(.report-builder-fullscreen) .main-content{min-height:100vh;min-height:100dvh}
body:not(.report-builder-fullscreen) .page-header{padding-top:max(16px,var(--safe-top));contain:layout paint style}
body:not(.report-builder-fullscreen) .page-content{padding-bottom:max(32px,calc(28px + var(--safe-bottom)))}
body:not(.report-builder-fullscreen) .chart-body{min-height:clamp(240px,28vw,360px)}
body:not(.report-builder-fullscreen) .chart-card canvas{max-width:100%!important;height:100%!important}
body:not(.report-builder-fullscreen) img,
body:not(.report-builder-fullscreen) svg,
body:not(.report-builder-fullscreen) canvas{max-width:100%}
body:not(.report-builder-fullscreen) .table-wrap{
  position:relative;
  overscroll-behavior-inline:contain;
  scrollbar-width:thin;
  scrollbar-color:#cbd5e1 transparent;
}
body:not(.report-builder-fullscreen) .table-wrap::-webkit-scrollbar{height:9px;width:9px}
body:not(.report-builder-fullscreen) .table-wrap::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:999px;border:2px solid #f8fafc}
body:not(.report-builder-fullscreen) .table-wrap.has-overflow-left:before,
body:not(.report-builder-fullscreen) .table-wrap.has-overflow-right:after{
  content:"";position:sticky;top:0;bottom:0;width:22px;pointer-events:none;z-index:3;display:block;height:100%;min-height:54px;
}
body:not(.report-builder-fullscreen) .table-wrap.has-overflow-left:before{left:0;float:left;background:linear-gradient(90deg,rgba(15,23,42,.12),rgba(15,23,42,0))}
body:not(.report-builder-fullscreen) .table-wrap.has-overflow-right:after{right:0;float:right;background:linear-gradient(270deg,rgba(15,23,42,.12),rgba(15,23,42,0));margin-top:-54px}
body:not(.report-builder-fullscreen) .table-card.is-loading,
body:not(.report-builder-fullscreen) .chart-card.is-loading,
body:not(.report-builder-fullscreen) .panel-card.is-loading{position:relative;overflow:hidden}
body:not(.report-builder-fullscreen) .table-card.is-loading:after,
body:not(.report-builder-fullscreen) .chart-card.is-loading:after,
body:not(.report-builder-fullscreen) .panel-card.is-loading:after{
  content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.52),transparent);transform:translateX(-100%);animation:beitShimmer 1.35s infinite;
}
@keyframes beitShimmer{100%{transform:translateX(100%)}}
body:not(.report-builder-fullscreen) .modal-backdrop{padding:max(14px,var(--safe-top)) max(14px,var(--safe-right)) max(14px,var(--safe-bottom)) max(14px,var(--safe-left))}
body:not(.report-builder-fullscreen) .modal{max-height:calc(100dvh - max(28px,calc(var(--safe-top) + var(--safe-bottom) + 28px)))}
body:not(.report-builder-fullscreen) .beit-customize-btn{right:max(18px,calc(var(--safe-right) + 18px));bottom:max(18px,calc(var(--safe-bottom) + 18px))}
body:not(.report-builder-fullscreen).sidebar-collapsed .sidebar-collapse-toggle{box-shadow:0 12px 30px rgba(15,23,42,.28),0 0 0 4px rgba(255,255,255,.94)}
body:not(.report-builder-fullscreen) .flashes-wrap{position:relative;z-index:50}
body:not(.report-builder-fullscreen) .flash{max-width:min(720px,calc(100vw - 32px))}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  body:not(.report-builder-fullscreen) *,
  body:not(.report-builder-fullscreen) *:before,
  body:not(.report-builder-fullscreen) *:after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}
}

@media(max-width:1100px){
  body:not(.report-builder-fullscreen) .page-header{gap:12px;align-items:flex-start}
  body:not(.report-builder-fullscreen) .page-header-right{width:100%;justify-content:flex-start;margin-left:0}
  body:not(.report-builder-fullscreen) .global-filter-bar .filter-row-main{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch}
  body:not(.report-builder-fullscreen) .global-filter-bar .filter-group,
  body:not(.report-builder-fullscreen) .filter-actions-group{min-width:0!important;width:100%;justify-content:stretch!important}
  body:not(.report-builder-fullscreen) .global-filter-bar .beit-multi-toggle,
  body:not(.report-builder-fullscreen) .global-filter-bar .date-range-picker,
  body:not(.report-builder-fullscreen) .global-filter-bar .beit-currency-control,
  body:not(.report-builder-fullscreen) .global-filter-bar .filter-actions-group .btn{width:100%}
}

@media(max-width:900px){
  body:not(.report-builder-fullscreen){overflow-x:hidden}
  body:not(.report-builder-fullscreen) .top-bar{padding-top:max(10px,var(--safe-top));padding-left:max(14px,var(--safe-left));padding-right:max(14px,var(--safe-right));box-shadow:0 8px 22px rgba(15,23,42,.08)}
  body:not(.report-builder-fullscreen) .sidebar{padding-top:var(--safe-top);padding-bottom:var(--safe-bottom);max-width:min(290px,calc(100vw - 54px))}
  body:not(.report-builder-fullscreen) .sidebar-overlay{position:fixed;inset:0;background:rgba(15,23,42,.48);backdrop-filter:blur(2px);z-index:940}
  body:not(.report-builder-fullscreen) .page-header{position:relative;top:auto;z-index:20;padding-left:max(14px,var(--safe-left));padding-right:max(14px,var(--safe-right))}
  body:not(.report-builder-fullscreen) .page-title{font-size:clamp(20px,6vw,28px);line-height:1.12}
  body:not(.report-builder-fullscreen) .page-content{padding-left:max(14px,var(--safe-left));padding-right:max(14px,var(--safe-right))}
  body:not(.report-builder-fullscreen) .global-filter-bar{position:relative;z-index:22;padding-left:max(14px,var(--safe-left));padding-right:max(14px,var(--safe-right));border-top:1px solid #edf2f7}
  body:not(.report-builder-fullscreen) .global-filter-bar .filter-row-main{grid-template-columns:repeat(2,minmax(0,1fr))}
  body:not(.report-builder-fullscreen) .filter-active-chips{overflow:auto;padding-bottom:2px;scrollbar-width:none}
  body:not(.report-builder-fullscreen) .filter-active-chips::-webkit-scrollbar{display:none}
  body:not(.report-builder-fullscreen) .filter-chip{white-space:nowrap;flex:0 0 auto}
  body:not(.report-builder-fullscreen) .chart-body{min-height:260px}
  body:not(.report-builder-fullscreen) .table-header,
  body:not(.report-builder-fullscreen) .chart-header{gap:10px}
  body:not(.report-builder-fullscreen) .table-actions,
  body:not(.report-builder-fullscreen) .beit-table-tools{width:100%;justify-content:flex-start;flex-wrap:wrap}
  body:not(.report-builder-fullscreen) .beit-table-search{flex:1 1 190px;min-width:0}
  body:not(.report-builder-fullscreen) .beit-table-search input{width:100%}
  body:not(.report-builder-fullscreen) .modal{width:100%;max-width:calc(100vw - 22px);border-radius:18px}
  body:not(.report-builder-fullscreen) .beit-customizer-panel,
  body:not(.report-builder-fullscreen) .customize-studio-panel{width:calc(100vw - 18px)!important;right:9px!important;left:9px!important;max-width:none!important}
}

@media(max-width:640px){
  body:not(.report-builder-fullscreen) .top-bar-title span{max-width:36vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body:not(.report-builder-fullscreen) .top-bar-title strong{max-width:52vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body:not(.report-builder-fullscreen) .page-header{padding-top:12px}
  body:not(.report-builder-fullscreen) .page-icon{width:38px;height:38px;min-width:38px;border-radius:13px}
  body:not(.report-builder-fullscreen) .page-header-right{display:flex;flex-direction:column;align-items:stretch}
  body:not(.report-builder-fullscreen) .page-header-right .btn,
  body:not(.report-builder-fullscreen) .page-header-right a.btn,
  body:not(.report-builder-fullscreen) .page-header-right .beit-date-trigger{width:100%;justify-content:center}
  body:not(.report-builder-fullscreen) .global-filter-bar .filter-row-main{grid-template-columns:1fr}
  body:not(.report-builder-fullscreen) .global-filter-bar .filter-quick-group .date-preset-btns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
  body:not(.report-builder-fullscreen) .global-filter-bar .date-preset-btn{justify-content:center}
  body:not(.report-builder-fullscreen) .date-range-picker{display:grid!important;grid-template-columns:1fr auto 1fr}
  body:not(.report-builder-fullscreen) .date-range-picker input{width:100%!important}
  body:not(.report-builder-fullscreen) .kpi-card{min-height:104px;padding:14px}
  body:not(.report-builder-fullscreen) .kpi-value{font-size:clamp(18px,7vw,25px)}
  body:not(.report-builder-fullscreen) .chart-body{min-height:240px}
  body:not(.report-builder-fullscreen) .table-wrap{margin-inline:-1px}
  body:not(.report-builder-fullscreen) table{font-size:12px}
  body:not(.report-builder-fullscreen) th,
  body:not(.report-builder-fullscreen) td{padding-left:10px!important;padding-right:10px!important}
  body:not(.report-builder-fullscreen) .modal-backdrop.open{align-items:flex-end}
  body:not(.report-builder-fullscreen) .modal{max-height:calc(100dvh - max(18px,var(--safe-top)));border-bottom-left-radius:0;border-bottom-right-radius:0}
  body:not(.report-builder-fullscreen) .modal-body,
  body:not(.report-builder-fullscreen) .customizer-body{max-height:calc(100dvh - 160px);overflow:auto}
  body:not(.report-builder-fullscreen) .beit-customize-btn{right:max(12px,var(--safe-right));bottom:max(12px,var(--safe-bottom));padding:9px 12px;font-size:11px}
}

@media(max-width:430px){
  body:not(.report-builder-fullscreen) .top-bar{gap:8px}
  body:not(.report-builder-fullscreen) .logo-box{min-width:36px}
  body:not(.report-builder-fullscreen) .page-content{padding-top:12px;gap:12px}
  body:not(.report-builder-fullscreen) .table-header,
  body:not(.report-builder-fullscreen) .chart-header{padding-left:13px!important;padding-right:13px!important}
  body:not(.report-builder-fullscreen) .table-title,
  body:not(.report-builder-fullscreen) .chart-title{font-size:13px}
  body:not(.report-builder-fullscreen) .btn{min-height:34px}
}

@media print{
  body:not(.report-builder-fullscreen){background:#fff!important;color:#111827!important}
  body:not(.report-builder-fullscreen) .main-content{margin-left:0!important;width:100%!important;display:block!important}
  body:not(.report-builder-fullscreen) .page-header{padding:0 0 12px!important;border-bottom:1px solid #e5e7eb!important}
  body:not(.report-builder-fullscreen) .page-content{padding:0!important;display:block!important}
  body:not(.report-builder-fullscreen) .table-card,
  body:not(.report-builder-fullscreen) .chart-card,
  body:not(.report-builder-fullscreen) .kpi-card,
  body:not(.report-builder-fullscreen) .panel-card{break-inside:avoid;box-shadow:none!important;border-color:#e5e7eb!important;margin-bottom:12px!important}
}

/* Phase 5 hotfix — mobile date picker + global filter dropdown usability */
body:not(.report-builder-fullscreen) .global-filter-bar.filter-dirty::after{
  content:none!important;
  display:none!important;
}
body.beit-date-open:not(.report-builder-fullscreen){
  overflow:hidden!important;
}
@media (max-width:760px){
  body:not(.report-builder-fullscreen) .beit-date-popover.open{
    position:fixed!important;
    inset:max(10px,var(--safe-top,0px)) 10px max(10px,var(--safe-bottom,0px)) 10px!important;
    left:10px!important;
    right:10px!important;
    top:max(10px,var(--safe-top,0px))!important;
    bottom:max(10px,var(--safe-bottom,0px))!important;
    width:auto!important;
    height:auto!important;
    max-height:none!important;
    display:grid!important;
    grid-template-columns:1fr!important;
    grid-template-rows:auto minmax(0,1fr)!important;
    border-radius:18px!important;
    overflow:hidden!important;
    box-shadow:0 24px 70px rgba(15,23,42,.32)!important;
  }
  body:not(.report-builder-fullscreen) .beit-date-quick{
    max-height:170px!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
    border-right:0!important;
    border-bottom:1px solid #e5e7eb!important;
    padding:12px 16px!important;
    gap:7px!important;
  }
  body:not(.report-builder-fullscreen) .beit-date-main{
    min-height:0!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch;
    padding:14px 12px 0!important;
  }
  body:not(.report-builder-fullscreen) .beit-date-calendars{
    grid-template-columns:1fr!important;
    gap:18px!important;
  }
  body:not(.report-builder-fullscreen) .beit-date-day,
  body:not(.report-builder-fullscreen) .beit-date-grid>span{
    height:34px!important;
  }
  body:not(.report-builder-fullscreen) .beit-date-compare,
  body:not(.report-builder-fullscreen) .beit-date-fields{
    display:none!important;
  }
  body:not(.report-builder-fullscreen) .beit-date-actions{
    position:sticky!important;
    bottom:0!important;
    z-index:4!important;
    margin:14px -12px 0!important;
    padding:10px 12px max(12px,var(--safe-bottom,0px))!important;
    background:#fff!important;
    border-top:1px solid #e5e7eb!important;
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:10px!important;
  }
  body:not(.report-builder-fullscreen) .beit-date-actions span{
    grid-column:1/-1!important;
    margin:0!important;
    text-align:center!important;
  }
  body:not(.report-builder-fullscreen) .beit-date-actions .btn{
    width:100%!important;
    min-height:38px!important;
  }
}
@media (max-width:760px) and (max-height:700px){
  body:not(.report-builder-fullscreen) .beit-date-quick{max-height:125px!important;}
  body:not(.report-builder-fullscreen) .beit-date-day,
  body:not(.report-builder-fullscreen) .beit-date-grid>span{height:30px!important;}
  body:not(.report-builder-fullscreen) .beit-date-month-head{margin-bottom:8px!important;}
}
body:not(.report-builder-fullscreen) .beit-multi-all input:indeterminate{
  accent-color:#3b82f6;
}

/* ══════════════════════════════════════════════════════════
   PHASE 6 — Empty / Loading / Error states + Toast system
   Scoped away from the report builder fullscreen editor.
   ══════════════════════════════════════════════════════════ */
body:not(.report-builder-fullscreen) .flashes-wrap.is-toast-source{display:none!important}
body:not(.report-builder-fullscreen) .toast-host{
  position:fixed;
  top:max(16px,var(--safe-top,0px));
  right:max(16px,var(--safe-right,0px));
  z-index:2147483600;
  display:flex;
  flex-direction:column;
  gap:10px;
  width:min(420px,calc(100vw - 32px));
  pointer-events:none;
}
body:not(.report-builder-fullscreen) .beit-toast{
  position:relative;
  display:grid;
  grid-template-columns:34px minmax(0,1fr) 26px;
  gap:10px;
  align-items:flex-start;
  padding:13px 12px 13px 13px;
  border:1px solid rgba(226,232,240,.96);
  border-left-width:4px;
  border-radius:16px;
  background:rgba(255,255,255,.96);
  box-shadow:0 18px 48px rgba(15,23,42,.18),0 3px 8px rgba(15,23,42,.08);
  backdrop-filter:blur(14px);
  pointer-events:auto;
  overflow:hidden;
  animation:beitToastIn .22s cubic-bezier(.2,.8,.2,1) both;
}
body:not(.report-builder-fullscreen) .beit-toast.is-hiding{animation:beitToastOut .2s ease both}
body:not(.report-builder-fullscreen) .beit-toast-icon{
  width:32px;height:32px;border-radius:12px;display:flex;align-items:center;justify-content:center;
  font-size:14px;font-weight:950;line-height:1;background:#eff6ff;color:#2563eb;flex-shrink:0;
}
body:not(.report-builder-fullscreen) .beit-toast-title{font-size:12.5px;font-weight:900;color:#0f172a;letter-spacing:-.01em;margin-top:1px}
body:not(.report-builder-fullscreen) .beit-toast-message{font-size:12px;line-height:1.45;color:#475569;margin-top:2px;overflow-wrap:anywhere}
body:not(.report-builder-fullscreen) .beit-toast-close{width:24px;height:24px;border:0;border-radius:9px;background:#f1f5f9;color:#64748b;cursor:pointer;font-size:18px;line-height:1;display:flex;align-items:center;justify-content:center}
body:not(.report-builder-fullscreen) .beit-toast-close:hover{background:#e2e8f0;color:#0f172a}
body:not(.report-builder-fullscreen) .beit-toast-action{display:inline-flex;margin-top:8px;font-size:11px;font-weight:900;color:#2563eb}
body:not(.report-builder-fullscreen) .beit-toast-progress{position:absolute;left:0;right:0;bottom:0;height:3px;background:currentColor;opacity:.28;transform-origin:left;animation:beitToastProgress linear forwards}
body:not(.report-builder-fullscreen) .toast-success{border-left-color:#22c55e}.toast-success .beit-toast-icon{background:#dcfce7;color:#15803d}
body:not(.report-builder-fullscreen) .toast-error{border-left-color:#ef4444}.toast-error .beit-toast-icon{background:#fee2e2;color:#b91c1c}
body:not(.report-builder-fullscreen) .toast-warning{border-left-color:#f59e0b}.toast-warning .beit-toast-icon{background:#fef3c7;color:#b45309}
body:not(.report-builder-fullscreen) .toast-info{border-left-color:#3b82f6}.toast-info .beit-toast-icon{background:#eff6ff;color:#1d4ed8}
body:not(.report-builder-fullscreen) .toast-loading{border-left-color:#6366f1}.toast-loading .beit-toast-icon{background:#eef2ff;color:#4f46e5}
@keyframes beitToastIn{from{opacity:0;transform:translate3d(20px,-8px,0) scale(.98)}to{opacity:1;transform:none}}
@keyframes beitToastOut{to{opacity:0;transform:translate3d(18px,-4px,0) scale(.98)}}
@keyframes beitToastProgress{from{transform:scaleX(1)}to{transform:scaleX(0)}}

body:not(.report-builder-fullscreen) .state-card{
  min-height:220px;
  border:1px solid #dbe5f1;
  background:radial-gradient(circle at top left,rgba(59,130,246,.08),transparent 34%),linear-gradient(180deg,#fff,#fbfdff);
  box-shadow:0 10px 30px rgba(15,23,42,.06);
  padding:32px 22px;
}
body:not(.report-builder-fullscreen) .state-card .state-icon,
body:not(.report-builder-fullscreen) .state-card .empty-icon{
  width:64px;height:64px;border-radius:22px;background:#f1f5f9;color:#64748b;margin-bottom:4px;
}
body:not(.report-builder-fullscreen) .state-card .empty-title{font-size:17px;font-weight:950;color:#0f172a;letter-spacing:-.02em}
body:not(.report-builder-fullscreen) .state-card .empty-message{max-width:600px;margin:0 auto;color:#64748b;font-size:13px;line-height:1.55}
body:not(.report-builder-fullscreen) .state-card.state-error{border-color:#fecaca;background:radial-gradient(circle at top left,rgba(239,68,68,.1),transparent 34%),linear-gradient(180deg,#fff,#fff7f7)}
body:not(.report-builder-fullscreen) .state-card.state-error .state-icon{background:#fee2e2;color:#b91c1c}
body:not(.report-builder-fullscreen) .state-card.state-warning{border-color:#fde68a;background:radial-gradient(circle at top left,rgba(245,158,11,.13),transparent 34%),linear-gradient(180deg,#fff,#fffaf0)}
body:not(.report-builder-fullscreen) .state-card.state-warning .state-icon{background:#fef3c7;color:#b45309}
body:not(.report-builder-fullscreen) .state-card.state-success{border-color:#bbf7d0;background:radial-gradient(circle at top left,rgba(34,197,94,.1),transparent 34%),linear-gradient(180deg,#fff,#f7fff9)}
body:not(.report-builder-fullscreen) .state-card.state-success .state-icon{background:#dcfce7;color:#15803d}
body:not(.report-builder-fullscreen) .state-card.state-loading .state-icon{background:#eef2ff;color:#4f46e5}
body:not(.report-builder-fullscreen) .state-spinner,
body:not(.report-builder-fullscreen) .btn-spinner{
  width:24px;height:24px;border-radius:999px;border:3px solid rgba(99,102,241,.18);border-top-color:#4f46e5;display:inline-block;animation:beitSpin .75s linear infinite;
}
body:not(.report-builder-fullscreen) .state-spinner-sm{width:18px;height:18px;border-width:2px}
body:not(.report-builder-fullscreen) .btn-spinner{width:14px;height:14px;border-width:2px;border-color:rgba(255,255,255,.38);border-top-color:#fff;vertical-align:-2px;margin-right:6px}
@keyframes beitSpin{to{transform:rotate(360deg)}}

body:not(.report-builder-fullscreen) form.is-submitting{cursor:progress}
body:not(.report-builder-fullscreen) form.is-submitting button[type="submit"],
body:not(.report-builder-fullscreen) form.is-submitting input[type="submit"]{cursor:progress;opacity:.82}
body:not(.report-builder-fullscreen) button[disabled] .btn-spinner{margin-right:6px}

body:not(.report-builder-fullscreen) .beit-table-empty-row td{padding:0!important;background:#fbfdff!important;border-bottom:0!important}
body:not(.report-builder-fullscreen) .table-empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:6px;min-height:148px;padding:24px;color:#64748b}
body:not(.report-builder-fullscreen) .table-empty-icon{width:42px;height:42px;border-radius:16px;background:#eef2ff;color:#4f46e5;display:flex;align-items:center;justify-content:center;font-weight:950;font-size:18px}
body:not(.report-builder-fullscreen) .table-empty-state strong{font-size:13.5px;color:#0f172a;font-weight:950}
body:not(.report-builder-fullscreen) .table-empty-state p{font-size:12px;max-width:420px;line-height:1.45;margin:0;color:#64748b}
body:not(.report-builder-fullscreen) .beit-multi-empty{font-size:12px;color:#64748b;padding:12px;text-align:center;background:#f8fafc;border:1px dashed #dbe5f1;border-radius:10px;margin:5px}
body:not(.report-builder-fullscreen) .error-panel{border:1px solid #fecaca;background:#fff7f7;color:#991b1b;border-radius:14px;padding:14px 16px;display:flex;gap:10px;align-items:flex-start;font-size:12.5px;line-height:1.45}
body:not(.report-builder-fullscreen) .error-panel strong{color:#7f1d1d}
body:not(.report-builder-fullscreen) .loading-panel{border:1px solid #c7d2fe;background:#f5f7ff;color:#3730a3;border-radius:14px;padding:14px 16px;display:flex;gap:10px;align-items:center;font-size:12.5px;font-weight:800}

@media(max-width:720px){
  body:not(.report-builder-fullscreen) .toast-host{top:auto;right:max(12px,var(--safe-right,0px));left:max(12px,var(--safe-left,0px));bottom:max(12px,var(--safe-bottom,0px));width:auto}
  body:not(.report-builder-fullscreen) .beit-toast{grid-template-columns:32px minmax(0,1fr) 24px;border-radius:15px;padding:12px}
  body:not(.report-builder-fullscreen) .state-card{min-height:190px;padding:26px 16px}
  body:not(.report-builder-fullscreen) .state-card .state-icon{width:56px;height:56px;border-radius:19px}
}

/* ══════════════════════════════════════════════════════════
   PHASE 7 — Filter UX + local saved views
   Browser-local saved views only. No database schema changes.
   ══════════════════════════════════════════════════════════ */
body:not(.report-builder-fullscreen) .filter-view-group{
  min-width:270px!important;
  flex:0 0 auto;
}
body:not(.report-builder-fullscreen) .filter-view-control{
  display:flex;
  align-items:center;
  gap:6px;
  height:32px;
  padding:0;
}
body:not(.report-builder-fullscreen) .filter-view-control select{
  width:150px;
  max-width:220px;
  height:32px!important;
  min-height:32px!important;
  border:1px solid #d8e2ee;
  border-radius:10px;
  background:#fff;
  color:#0f172a;
  font-size:11.5px;
  font-weight:800;
  padding:0 9px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
body:not(.report-builder-fullscreen) .filter-view-save,
body:not(.report-builder-fullscreen) .filter-view-delete{
  height:32px;
  border:1px solid #d8e2ee;
  border-radius:10px;
  background:#fff;
  color:#334155;
  font-size:11.5px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
body:not(.report-builder-fullscreen) .filter-view-save{padding:0 10px;white-space:nowrap;color:#2563eb;background:#eff6ff;border-color:#bfdbfe}
body:not(.report-builder-fullscreen) .filter-view-delete{width:32px;font-size:16px;line-height:1;color:#94a3b8}
body:not(.report-builder-fullscreen) .filter-view-save:hover{background:#dbeafe;border-color:#93c5fd;color:#1d4ed8}
body:not(.report-builder-fullscreen) .filter-view-delete:hover{background:#fef2f2;border-color:#fecaca;color:#dc2626}
body:not(.report-builder-fullscreen) .filter-view-group:not(.has-saved-views) .filter-view-delete{display:none}
body:not(.report-builder-fullscreen) .beit-multi-toggle{position:relative;justify-content:flex-start!important}
body:not(.report-builder-fullscreen) .beit-multi-toggle [data-multi-label]{flex:1 1 auto;text-align:left}
body:not(.report-builder-fullscreen) .beit-multi-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:999px;
  background:#dbeafe;
  color:#1d4ed8;
  font-size:10.5px;
  font-weight:950;
  line-height:1;
  flex:0 0 auto;
}
body:not(.report-builder-fullscreen) .beit-multi-count[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-multi-search-wrap{
  position:sticky;
  top:0;
  z-index:3;
  display:flex;
  align-items:center;
  gap:7px;
  min-height:36px;
  margin:0 0 5px;
  padding:5px 8px;
  border:1px solid #dbe5f1;
  border-radius:11px;
  background:rgba(255,255,255,.98);
  color:#94a3b8;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
body:not(.report-builder-fullscreen) .beit-multi-search-wrap span{font-size:14px;font-weight:900;line-height:1}
body:not(.report-builder-fullscreen) .beit-multi-search{
  width:100%;
  height:24px!important;
  min-height:24px!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  background:transparent!important;
  color:#0f172a;
  font-size:12px!important;
  font-weight:750;
  outline:0!important;
}
body:not(.report-builder-fullscreen) .beit-multi-option.is-search-hidden{display:none!important}
body:not(.report-builder-fullscreen) .filter-active-chips{
  background:linear-gradient(180deg,rgba(248,250,252,.78),rgba(255,255,255,.35));
  border-radius:12px;
  padding:8px!important;
  border:1px solid #edf2f7!important;
  margin-top:2px;
}
body:not(.report-builder-fullscreen) .filter-chip{border-color:#d6e4f5;background:#fff}
body:not(.report-builder-fullscreen) .filter-chip-reset{margin-left:2px;background:#eff6ff!important;border:1px solid #bfdbfe!important;border-radius:999px!important;padding:4px 9px!important;text-decoration:none!important}
body:not(.report-builder-fullscreen) .filter-chip-reset:hover{background:#dbeafe!important;color:#1d4ed8!important}
body:not(.report-builder-fullscreen) .global-filter-bar.filter-dirty{
  box-shadow:0 2px 12px rgba(15,23,42,.025), inset 0 -2px 0 rgba(37,99,235,.12)!important;
}
@media(max-width:1100px){
  body:not(.report-builder-fullscreen) .filter-view-group{min-width:0!important;width:100%}
  body:not(.report-builder-fullscreen) .filter-view-control{width:100%}
  body:not(.report-builder-fullscreen) .filter-view-control select{flex:1 1 auto;max-width:none;width:auto}
  body:not(.report-builder-fullscreen) .filter-view-save{flex:0 0 auto}
}
@media(max-width:640px){
  body:not(.report-builder-fullscreen) .filter-view-control{display:grid;grid-template-columns:1fr auto auto;height:auto;gap:7px}
  body:not(.report-builder-fullscreen) .filter-view-control select,
  body:not(.report-builder-fullscreen) .filter-view-save,
  body:not(.report-builder-fullscreen) .filter-view-delete{height:36px!important;min-height:36px!important}
  body:not(.report-builder-fullscreen) .beit-multi-search-wrap{min-height:40px}
  body:not(.report-builder-fullscreen) .beit-multi-search{height:28px!important;min-height:28px!important}
}

/* ──────────────────────────────────────────────────────────
   Phase 7 hotfix — dropdowns, report filters, active chips removal,
   and table horizontal-scroll gap fix. No database changes.
   ────────────────────────────────────────────────────────── */
body:not(.report-builder-fullscreen) .filter-active-chips{
  display:none!important;
  visibility:hidden!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  overflow:hidden!important;
}

/* Native selects get the same premium shell as the header filter dropdowns without changing behavior. */
body:not(.report-builder-fullscreen) select:not([multiple]){
  min-height:36px;
  border:1px solid #d8e2ee!important;
  border-radius:12px!important;
  background-color:#fff!important;
  color:#0f172a!important;
  font-size:12px!important;
  font-weight:850!important;
  padding:0 36px 0 12px!important;
  box-shadow:0 1px 2px rgba(15,23,42,.04)!important;
  cursor:pointer!important;
  appearance:none!important;
  -webkit-appearance:none!important;
  background-image:linear-gradient(45deg,transparent 50%,#94a3b8 50%),linear-gradient(135deg,#94a3b8 50%,transparent 50%)!important;
  background-position:calc(100% - 17px) 50%,calc(100% - 12px) 50%!important;
  background-size:5px 5px,5px 5px!important;
  background-repeat:no-repeat!important;
}
body:not(.report-builder-fullscreen) select:not([multiple]):hover{
  border-color:#b8c7d9!important;
  background-color:#fbfdff!important;
}
body:not(.report-builder-fullscreen) select:not([multiple]):focus{
  outline:0!important;
  border-color:#60a5fa!important;
  box-shadow:0 0 0 3px rgba(59,130,246,.14),0 1px 2px rgba(15,23,42,.04)!important;
}
body:not(.report-builder-fullscreen) .beit-currency-control select:not([multiple]){
  min-height:28px!important;
  background-image:none!important;
  padding:0!important;
}

body:not(.report-builder-fullscreen) .beit-multi-toggle{
  min-height:36px!important;
  height:36px!important;
  border-radius:12px!important;
  border-color:#d8e2ee!important;
  background:#fff!important;
  box-shadow:0 1px 2px rgba(15,23,42,.04)!important;
  font-size:12px!important;
  font-weight:900!important;
  padding:0 12px!important;
}
body:not(.report-builder-fullscreen) .beit-multi-toggle:hover,
body:not(.report-builder-fullscreen) .beit-multi-toggle[aria-expanded="true"]{
  border-color:#93c5fd!important;
  background:#fbfdff!important;
  box-shadow:0 0 0 3px rgba(59,130,246,.12),0 1px 2px rgba(15,23,42,.04)!important;
}
body:not(.report-builder-fullscreen) .beit-multi-caret{color:#94a3b8;font-weight:950;margin-left:auto}
body:not(.report-builder-fullscreen) .beit-multi-menu{
  border:1px solid #d8e2ee!important;
  border-radius:16px!important;
  padding:8px!important;
  background:#fff!important;
  box-shadow:0 24px 60px rgba(15,23,42,.20)!important;
}
body:not(.report-builder-fullscreen) .beit-multi-search-wrap{
  display:flex!important;
  margin:0 0 7px!important;
  min-height:38px!important;
  border-radius:12px!important;
  background:#f8fbff!important;
}
body:not(.report-builder-fullscreen) .beit-multi-all{
  color:#1d4ed8!important;
  background:#f8fbff!important;
  border:1px solid #dbeafe!important;
  margin-bottom:6px!important;
}
body:not(.report-builder-fullscreen) .beit-multi-all:hover{background:#eff6ff!important;border-color:#bfdbfe!important}
body:not(.report-builder-fullscreen) .beit-multi-option{
  min-height:36px!important;
  border-radius:12px!important;
  padding:8px 10px!important;
  font-size:12px!important;
  font-weight:850!important;
}
body:not(.report-builder-fullscreen) .beit-multi-option input{
  width:17px!important;
  height:17px!important;
  border-radius:5px!important;
  accent-color:#2563eb!important;
}
body:not(.report-builder-fullscreen) .beit-multi-separator{margin:6px 0!important;background:#edf2f7!important}

/* Reports library filters now use the same multi-select component as the global header filters. */
body.page-reports:not(.report-builder-fullscreen) .reports-toolbar-main{
  align-items:center!important;
  gap:10px!important;
}
body.page-reports:not(.report-builder-fullscreen) .reports-library-filter{
  min-width:170px;
  flex:0 0 170px;
}
body.page-reports:not(.report-builder-fullscreen) .report-client-filter{flex-basis:190px;min-width:190px}
body.page-reports:not(.report-builder-fullscreen) .report-platform-filter{flex-basis:180px;min-width:180px}
body.page-reports:not(.report-builder-fullscreen) .report-visibility-filter{flex-basis:170px;min-width:170px}
body.page-reports:not(.report-builder-fullscreen) .reports-search-box{min-height:40px}
body.page-reports:not(.report-builder-fullscreen) .reports-toolbar-main .btn{height:38px}

/* The old overflow hint pseudo-elements created a blank gap while horizontally scrolling tables. */
body:not(.report-builder-fullscreen) .table-wrap.has-overflow-left:before,
body:not(.report-builder-fullscreen) .table-wrap.has-overflow-right:after{
  content:none!important;
  display:none!important;
}
body:not(.report-builder-fullscreen) .table-wrap{
  background:#fff;
  position:relative;
  scrollbar-gutter:stable both-edges;
}
body:not(.report-builder-fullscreen) .table-wrap table{
  margin-top:0!important;
}
body:not(.report-builder-fullscreen) .table-wrap thead th{
  transform:translateZ(0);
}

@media(max-width:900px){
  body.page-reports:not(.report-builder-fullscreen) .reports-library-filter,
  body.page-reports:not(.report-builder-fullscreen) .report-client-filter,
  body.page-reports:not(.report-builder-fullscreen) .report-platform-filter,
  body.page-reports:not(.report-builder-fullscreen) .report-visibility-filter{
    flex:1 1 180px;
    min-width:180px;
  }
}
@media(max-width:640px){
  body:not(.report-builder-fullscreen) .beit-multi-toggle,
  body:not(.report-builder-fullscreen) select:not([multiple]){
    min-height:40px!important;
    height:40px!important;
  }
  body:not(.report-builder-fullscreen) .beit-multi-menu{max-height:55vh!important}
}

/* ──────────────────────────────────────────────────────────
   Phase 7 hotfix v2 — modern single-select dropdowns + funnel polish
   No database changes.
   ────────────────────────────────────────────────────────── */
body:not(.report-builder-fullscreen) .beit-native-select-hidden{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  min-width:1px!important;
  min-height:1px!important;
  opacity:0!important;
  overflow:hidden!important;
  pointer-events:none!important;
  clip:rect(0 0 0 0)!important;
  clip-path:inset(50%)!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}
body:not(.report-builder-fullscreen) .beit-single-select{
  position:relative;
  display:inline-flex;
  width:100%;
  min-width:0;
  vertical-align:middle;
}
body:not(.report-builder-fullscreen) .filter-view-control .beit-single-select{width:150px;max-width:220px;flex:0 1 180px}
body:not(.report-builder-fullscreen) .beit-currency-control .beit-single-select{width:88px;min-width:88px;flex:0 0 auto}
body:not(.report-builder-fullscreen) .beit-single-toggle{
  width:100%;
  min-height:36px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid #d8e2ee;
  border-radius:12px;
  background:linear-gradient(180deg,#fff,#fbfdff);
  color:#0f172a;
  font-size:12px;
  font-weight:900;
  line-height:1;
  padding:0 12px;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  cursor:pointer;
  transition:border-color .16s ease,box-shadow .16s ease,background .16s ease,transform .16s ease;
}
body:not(.report-builder-fullscreen) .beit-single-toggle:hover,
body:not(.report-builder-fullscreen) .beit-single-select.is-open .beit-single-toggle{
  border-color:#93c5fd;
  background:#fbfdff;
  box-shadow:0 0 0 3px rgba(59,130,246,.12),0 1px 2px rgba(15,23,42,.04);
}
body:not(.report-builder-fullscreen) .beit-single-toggle:focus-visible{
  outline:0;
  border-color:#60a5fa;
  box-shadow:0 0 0 3px rgba(59,130,246,.18),0 1px 2px rgba(15,23,42,.04);
}
body:not(.report-builder-fullscreen) .beit-single-label{
  flex:1 1 auto;
  min-width:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  text-align:left;
}
body:not(.report-builder-fullscreen) .beit-single-caret{
  flex:0 0 auto;
  color:#94a3b8;
  font-size:13px;
  font-weight:950;
  transform:translateY(-1px);
  transition:transform .16s ease,color .16s ease;
}
body:not(.report-builder-fullscreen) .beit-single-select.is-open .beit-single-caret{transform:rotate(180deg);color:#2563eb}
body:not(.report-builder-fullscreen) .beit-single-select.is-disabled{opacity:.64;cursor:not-allowed}
body:not(.report-builder-fullscreen) .beit-single-select.is-disabled .beit-single-toggle{cursor:not-allowed;background:#f8fafc;color:#94a3b8}
body:not(.report-builder-fullscreen) .beit-single-menu{
  position:absolute;
  top:calc(100% + 6px);
  left:0;
  width:100%;
  min-width:220px;
  max-height:360px;
  overflow:auto;
  padding:8px;
  border:1px solid #d8e2ee;
  border-radius:16px;
  background:rgba(255,255,255,.98);
  box-shadow:0 24px 60px rgba(15,23,42,.20),0 3px 8px rgba(15,23,42,.08);
  backdrop-filter:blur(14px);
  z-index:2147483647;
  scrollbar-width:thin;
}
body:not(.report-builder-fullscreen) .beit-single-menu[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-single-menu.beit-single-portal{overflow:auto!important}
body:not(.report-builder-fullscreen) .beit-single-search-wrap{
  position:sticky;
  top:0;
  z-index:2;
  display:flex;
  align-items:center;
  gap:7px;
  min-height:38px;
  margin:0 0 7px;
  padding:5px 9px;
  border:1px solid #dbe5f1;
  border-radius:12px;
  background:#f8fbff;
  color:#94a3b8;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
body:not(.report-builder-fullscreen) .beit-single-search-wrap span{font-size:14px;font-weight:950;line-height:1}
body:not(.report-builder-fullscreen) .beit-single-search{
  width:100%;
  height:26px!important;
  min-height:26px!important;
  border:0!important;
  box-shadow:none!important;
  outline:0!important;
  background:transparent!important;
  padding:0!important;
  color:#0f172a!important;
  font-size:12px!important;
  font-weight:750!important;
}
body:not(.report-builder-fullscreen) .beit-single-list{display:flex;flex-direction:column;gap:3px}
body:not(.report-builder-fullscreen) .beit-single-option{
  width:100%;
  min-height:36px;
  display:flex;
  align-items:center;
  gap:10px;
  border:0;
  border-radius:12px;
  background:transparent;
  color:#0f172a;
  padding:8px 10px;
  text-align:left;
  font-size:12px;
  font-weight:850;
  cursor:pointer;
  transition:background .14s ease,color .14s ease,transform .14s ease;
}
body:not(.report-builder-fullscreen) .beit-single-option:hover,
body:not(.report-builder-fullscreen) .beit-single-option:focus-visible{
  background:#eff6ff;
  color:#1d4ed8;
  outline:0;
}
body:not(.report-builder-fullscreen) .beit-single-option.is-selected{
  background:#eef5ff;
  color:#1d4ed8;
}
body:not(.report-builder-fullscreen) .beit-single-option:disabled{opacity:.45;cursor:not-allowed;background:transparent;color:#94a3b8}
body:not(.report-builder-fullscreen) .beit-single-option-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body:not(.report-builder-fullscreen) .beit-single-check{flex:0 0 auto;width:18px;height:18px;border-radius:7px;display:none;align-items:center;justify-content:center;background:#2563eb;color:#fff;font-size:11px;font-weight:950}
body:not(.report-builder-fullscreen) .beit-single-option.is-selected .beit-single-check{display:inline-flex}
body:not(.report-builder-fullscreen) .beit-single-empty{
  margin-top:4px;
  padding:12px;
  border:1px dashed #dbe5f1;
  border-radius:12px;
  background:#f8fafc;
  color:#64748b;
  text-align:center;
  font-size:12px;
  font-weight:750;
}
body:not(.report-builder-fullscreen) .beit-currency-control{
  gap:7px!important;
}
body:not(.report-builder-fullscreen) .beit-currency-control .beit-single-toggle{
  height:28px;
  min-height:28px;
  padding:0 4px 0 0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#1d4ed8;
  box-shadow:none;
  font-weight:900;
}
body:not(.report-builder-fullscreen) .beit-currency-control .beit-single-toggle:hover,
body:not(.report-builder-fullscreen) .beit-currency-control .beit-single-select.is-open .beit-single-toggle{
  background:transparent;
  box-shadow:none;
}
body:not(.report-builder-fullscreen) .beit-currency-control .beit-single-caret{color:#60a5fa}
body:not(.report-builder-fullscreen) .filter-view-control .beit-single-toggle{height:32px;min-height:32px;font-size:11.5px;border-radius:10px}
body:not(.report-builder-fullscreen) .date-select-control + .beit-single-select .beit-single-toggle{min-width:78px}
body:not(.report-builder-fullscreen) .client-toolbar .beit-single-select,
body:not(.report-builder-fullscreen) .filter-group .beit-single-select,
body:not(.report-builder-fullscreen) .form-control + .beit-single-select{max-width:100%}
@media(max-width:900px){
  body:not(.report-builder-fullscreen) .filter-view-control .beit-single-select{flex:1 1 auto;width:auto;max-width:none}
}
@media(max-width:640px){
  body:not(.report-builder-fullscreen) .beit-single-toggle{height:40px;min-height:40px}
  body:not(.report-builder-fullscreen) .filter-view-control .beit-single-toggle{height:36px;min-height:36px}
  body:not(.report-builder-fullscreen) .beit-single-menu{max-height:55vh!important;border-radius:18px}
}

body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-card{
  padding:0;
  overflow:hidden;
  background:radial-gradient(circle at top left,rgba(59,130,246,.08),transparent 36%),linear-gradient(180deg,#fff,#fbfdff);
}
body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-header{
  padding:18px 20px 14px;
  border-bottom:1px solid #edf2f7;
  align-items:flex-start;
  gap:14px;
}
body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-subtitle{
  margin:5px 0 0;
  color:#64748b;
  font-size:12.5px;
  line-height:1.45;
  font-weight:650;
}
body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-summary{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:3px;
  min-width:138px;
  padding:10px 12px;
  border:1px solid #dbeafe;
  border-radius:16px;
  background:#eff6ff;
  color:#1d4ed8;
}
body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-summary span{
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#64748b;
}
body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-summary strong{
  font-size:20px;
  font-weight:950;
  letter-spacing:-.03em;
  color:#0f172a;
}
body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:16px 18px 18px;
}
body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-stage{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:12px;
  align-items:stretch;
  padding:12px;
  border:1px solid #e2eaf3;
  border-radius:18px;
  background:rgba(255,255,255,.86);
  box-shadow:0 6px 18px rgba(15,23,42,.045);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-stage:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1;
  box-shadow:0 12px 28px rgba(15,23,42,.07);
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-index{
  width:42px;
  height:42px;
  border-radius:15px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb,var(--stage-color) 14%,#fff);
  color:var(--stage-color);
  border:1px solid color-mix(in srgb,var(--stage-color) 28%,#e2e8f0);
  font-size:13px;
  font-weight:950;
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-main{min-width:0;display:flex;flex-direction:column;gap:8px}
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-top,
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-bottom{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-title-wrap{min-width:0;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-label{
  font-size:13px;
  font-weight:950;
  color:#0f172a;
  letter-spacing:-.01em;
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-sub{
  font-size:11px;
  font-weight:850;
  color:#64748b;
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-value{
  font-size:16px;
  font-weight:950;
  color:#0f172a;
  font-variant-numeric:tabular-nums;
  white-space:nowrap;
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-progress-track{
  position:relative;
  height:13px;
  overflow:hidden;
  border-radius:999px;
  background:#eef2f7;
  border:1px solid #e2e8f0;
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-progress-fill{
  width:var(--stage-pct);
  min-width:18px;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg,color-mix(in srgb,var(--stage-color) 76%,#fff),var(--stage-color));
  box-shadow:inset 0 -8px 16px rgba(15,23,42,.11),0 0 0 1px color-mix(in srgb,var(--stage-color) 16%,transparent);
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-bottom{
  justify-content:flex-start;
  color:#64748b;
  font-size:11.5px;
  font-weight:750;
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-drop-chip{
  display:inline-flex;
  align-items:center;
  height:22px;
  padding:0 9px;
  border-radius:999px;
  border:1px solid #dbe5f1;
  background:#f8fafc;
  color:#475569;
  font-size:10.5px;
  font-weight:950;
  white-space:nowrap;
}
body.page-funnel:not(.report-builder-fullscreen) .funnel-drop-chip.danger{background:#fef2f2;border-color:#fecaca;color:#dc2626}
body.page-funnel:not(.report-builder-fullscreen) .funnel-drop-chip.warning{background:#fff7ed;border-color:#fed7aa;color:#c2410c}
body.page-funnel:not(.report-builder-fullscreen) .funnel-drop-chip.success{background:#f0fdf4;border-color:#bbf7d0;color:#15803d}
body.page-funnel:not(.report-builder-fullscreen) .funnel-drop-chip.neutral{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
@media(max-width:760px){
  body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-header{flex-direction:column;padding:16px}
  body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-summary{align-items:flex-start;width:100%;min-width:0}
  body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-list{padding:14px;gap:9px}
  body.page-funnel:not(.report-builder-fullscreen) .conversion-funnel-stage{grid-template-columns:36px minmax(0,1fr);padding:10px;border-radius:16px;gap:10px}
  body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-index{width:36px;height:36px;border-radius:13px}
  body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-top{align-items:flex-start}
  body.page-funnel:not(.report-builder-fullscreen) .funnel-stage-bottom{flex-wrap:wrap;gap:7px}
}

/* ══════════════════════════════════════════════════════════
   PHASE 8 — Table UX + detail drawers
   Client-side table controls only. Report builder remains scoped out.
   ══════════════════════════════════════════════════════════ */
body:not(.report-builder-fullscreen) .beit-table-tools .beit-table-columns-btn{
  min-height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:1px solid #dbe5f1;
  border-radius:10px;
  background:#fff;
  color:#334155;
  padding:0 10px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease;
}
body:not(.report-builder-fullscreen) .beit-table-tools .beit-table-columns-btn:hover,
body:not(.report-builder-fullscreen) .beit-table-tools .beit-table-columns-btn:focus-visible{
  background:#eff6ff;
  border-color:#bfdbfe;
  color:#1d4ed8;
  box-shadow:0 8px 18px rgba(37,99,235,.10);
  outline:0;
  transform:translateY(-1px);
}
body:not(.report-builder-fullscreen) .beit-table-tools .beit-table-columns-btn span:first-child{font-size:14px;line-height:1}
body:not(.report-builder-fullscreen) .beit-table-columns-menu{
  position:fixed;
  z-index:2147483647;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:9px;
  border:1px solid #d8e2ee;
  border-radius:17px;
  background:rgba(255,255,255,.98);
  box-shadow:0 24px 60px rgba(15,23,42,.20),0 4px 12px rgba(15,23,42,.08);
  backdrop-filter:blur(14px);
  overflow:hidden;
}
body:not(.report-builder-fullscreen) .beit-table-columns-menu[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-table-columns-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:2px 2px 0 4px;
}
body:not(.report-builder-fullscreen) .beit-table-columns-head strong{font-size:12.5px;font-weight:950;color:#0f172a;letter-spacing:-.01em}
body:not(.report-builder-fullscreen) .beit-table-columns-close{
  width:28px;height:28px;border-radius:10px;border:1px solid #e2e8f0;background:#f8fafc;color:#64748b;font-size:18px;line-height:1;cursor:pointer;
}
body:not(.report-builder-fullscreen) .beit-table-columns-close:hover{background:#fff;color:#0f172a;border-color:#cbd5e1}
body:not(.report-builder-fullscreen) .beit-table-columns-search{
  min-height:38px;
  display:flex;
  align-items:center;
  gap:7px;
  border:1px solid #dbe5f1;
  border-radius:13px;
  background:#f8fbff;
  color:#94a3b8;
  padding:5px 9px;
}
body:not(.report-builder-fullscreen) .beit-table-columns-search input{
  width:100%;
  height:26px!important;
  min-height:26px!important;
  border:0!important;
  box-shadow:none!important;
  outline:0!important;
  background:transparent!important;
  padding:0!important;
  color:#0f172a!important;
  font-size:12px!important;
  font-weight:750!important;
}
body:not(.report-builder-fullscreen) .beit-table-columns-list{
  display:flex;
  flex-direction:column;
  gap:3px;
  overflow:auto;
  padding-right:2px;
  max-height:265px;
  scrollbar-width:thin;
}
body:not(.report-builder-fullscreen) .beit-table-column-option{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:34px;
  padding:7px 9px;
  border-radius:12px;
  color:#0f172a;
  font-size:12px;
  font-weight:850;
  cursor:pointer;
  transition:background .14s ease,color .14s ease;
}
body:not(.report-builder-fullscreen) .beit-table-column-option:hover{background:#eff6ff;color:#1d4ed8}
body:not(.report-builder-fullscreen) .beit-table-column-option input{width:17px;height:17px;flex:0 0 auto;accent-color:#2563eb}
body:not(.report-builder-fullscreen) .beit-table-column-option span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
body:not(.report-builder-fullscreen) .beit-table-columns-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding-top:6px;
  border-top:1px solid #eef2f7;
  color:#64748b;
  font-size:11px;
  font-weight:850;
}
body:not(.report-builder-fullscreen) .beit-col-hidden{display:none!important}
body:not(.report-builder-fullscreen) th.beit-sortable-th{cursor:pointer;user-select:none;position:sticky}
body:not(.report-builder-fullscreen) th.beit-sortable-th::after{
  content:'↕';
  display:inline-flex;
  margin-left:6px;
  color:#94a3b8;
  font-size:10px;
  font-weight:950;
  vertical-align:1px;
  opacity:.72;
}
body:not(.report-builder-fullscreen) th.beit-sortable-th:hover{color:#1d4ed8;background:linear-gradient(180deg,#eff6ff,#eaf2ff)}
body:not(.report-builder-fullscreen) th.beit-sortable-th.is-sorted-asc::after{content:'↑';color:#2563eb;opacity:1}
body:not(.report-builder-fullscreen) th.beit-sortable-th.is-sorted-desc::after{content:'↓';color:#2563eb;opacity:1}
body:not(.report-builder-fullscreen) tbody tr.beit-row-detail-ready{cursor:pointer;transition:background .14s ease,box-shadow .14s ease}
body:not(.report-builder-fullscreen) tbody tr.beit-row-detail-ready:focus-visible{
  outline:2px solid #60a5fa;
  outline-offset:-2px;
  background:#eff6ff;
}
body:not(.report-builder-fullscreen) tbody tr.beit-row-detail-ready:hover td{background:rgba(239,246,255,.70)}
body:not(.report-builder-fullscreen) tbody tr.is-row-selected td{background:#eff6ff!important}
body:not(.report-builder-fullscreen) .beit-selection-bar{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:8px 16px;
  border-top:1px solid #dbeafe;
  border-bottom:1px solid #dbeafe;
  background:linear-gradient(90deg,#eff6ff,#f8fbff);
  color:#1e40af;
  font-size:12px;
  font-weight:850;
}
body:not(.report-builder-fullscreen) .beit-selection-bar[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-selection-bar strong{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:24px;
  height:24px;
  border-radius:999px;
  background:#2563eb;
  color:#fff;
  font-size:12px;
  font-weight:950;
}
body:not(.report-builder-fullscreen) .beit-selection-bar .btn{margin-left:auto}
body:not(.report-builder-fullscreen) .beit-detail-drawer-backdrop{
  position:fixed;
  inset:0;
  z-index:2147483600;
  background:rgba(15,23,42,.38);
  backdrop-filter:blur(3px);
  display:flex;
  justify-content:flex-end;
  animation:beitFadeIn .14s ease both;
}
body:not(.report-builder-fullscreen) .beit-detail-drawer-backdrop[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-detail-drawer{
  width:min(520px,calc(100vw - 28px));
  height:100%;
  background:linear-gradient(180deg,#fff,#fbfdff);
  border-left:1px solid rgba(226,232,240,.95);
  box-shadow:-28px 0 70px rgba(15,23,42,.28);
  display:flex;
  flex-direction:column;
  animation:beitDrawerIn .18s ease both;
}
@keyframes beitDrawerIn{from{transform:translateX(28px);opacity:.72}to{transform:translateX(0);opacity:1}}
body:not(.report-builder-fullscreen) .beit-detail-drawer-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:22px 22px 16px;
  border-bottom:1px solid #e8eef6;
  background:radial-gradient(circle at top left,rgba(37,99,235,.10),transparent 38%),linear-gradient(180deg,#fff,#f8fbff);
}
body:not(.report-builder-fullscreen) .beit-detail-eyebrow{
  display:inline-flex;
  margin-bottom:5px;
  color:#2563eb;
  font-size:10px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.09em;
}
body:not(.report-builder-fullscreen) .beit-detail-drawer-head h3{
  margin:0;
  color:#0f172a;
  font-size:19px;
  font-weight:950;
  letter-spacing:-.035em;
  line-height:1.2;
}
body:not(.report-builder-fullscreen) .beit-detail-drawer-head p{
  margin:6px 0 0;
  color:#64748b;
  font-size:12px;
  font-weight:750;
}
body:not(.report-builder-fullscreen) .beit-detail-close{
  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid #e2e8f0;
  background:#fff;
  color:#64748b;
  font-size:21px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
body:not(.report-builder-fullscreen) .beit-detail-close:hover{border-color:#cbd5e1;color:#0f172a;background:#f8fafc}
body:not(.report-builder-fullscreen) .beit-detail-drawer-body{
  flex:1;
  overflow:auto;
  padding:18px 22px;
}
body:not(.report-builder-fullscreen) .beit-detail-summary{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:14px;
}
body:not(.report-builder-fullscreen) .beit-detail-summary span{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:30px;
  padding:5px 9px;
  border:1px solid #dbeafe;
  border-radius:999px;
  background:#eff6ff;
  color:#1d4ed8;
  font-size:11px;
  font-weight:850;
}
body:not(.report-builder-fullscreen) .beit-detail-summary b{color:#64748b;text-transform:uppercase;font-size:9px;letter-spacing:.06em}
body:not(.report-builder-fullscreen) .beit-detail-grid{display:grid;grid-template-columns:1fr;gap:8px}
body:not(.report-builder-fullscreen) .beit-detail-item{
  display:grid;
  grid-template-columns:minmax(110px,38%) minmax(0,1fr);
  gap:12px;
  align-items:start;
  padding:11px 12px;
  border:1px solid #e6edf5;
  border-radius:14px;
  background:#fff;
  box-shadow:0 1px 2px rgba(15,23,42,.035);
}
body:not(.report-builder-fullscreen) .beit-detail-item span{
  color:#64748b;
  font-size:10.5px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.07em;
  line-height:1.35;
}
body:not(.report-builder-fullscreen) .beit-detail-item strong{
  min-width:0;
  color:#0f172a;
  font-size:12.5px;
  font-weight:850;
  line-height:1.45;
  overflow-wrap:anywhere;
}
body:not(.report-builder-fullscreen) .beit-detail-item.is-hidden-source{background:#fbfdff;border-style:dashed}
body:not(.report-builder-fullscreen) .beit-detail-empty{
  border:1px dashed #cbd5e1;
  border-radius:16px;
  background:#f8fafc;
  color:#64748b;
  padding:28px;
  text-align:center;
  font-size:12px;
  font-weight:850;
}
body:not(.report-builder-fullscreen) .beit-detail-drawer-foot{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding:14px 22px;
  border-top:1px solid #e8eef6;
  background:#fbfdff;
}
body.beit-drawer-open:not(.report-builder-fullscreen){overflow:hidden}

@media(max-width:720px){
  body:not(.report-builder-fullscreen) .beit-table-tools .beit-table-columns-btn span:last-child{display:none}
  body:not(.report-builder-fullscreen) .beit-table-columns-menu{left:12px!important;right:12px!important;top:auto!important;bottom:max(12px,var(--safe-bottom,0px))!important;width:auto!important;max-height:min(70vh,520px)!important;border-radius:20px}
  body:not(.report-builder-fullscreen) .beit-detail-drawer-backdrop{align-items:flex-end;justify-content:center;background:rgba(15,23,42,.46)}
  body:not(.report-builder-fullscreen) .beit-detail-drawer{width:100%;height:min(86vh,720px);border-left:0;border-radius:24px 24px 0 0;box-shadow:0 -24px 70px rgba(15,23,42,.30);animation:beitDrawerUp .18s ease both}
  @keyframes beitDrawerUp{from{transform:translateY(28px);opacity:.72}to{transform:translateY(0);opacity:1}}
  body:not(.report-builder-fullscreen) .beit-detail-drawer-head{padding:18px 18px 14px}
  body:not(.report-builder-fullscreen) .beit-detail-drawer-body{padding:14px 16px}
  body:not(.report-builder-fullscreen) .beit-detail-drawer-foot{padding:12px 16px calc(12px + var(--safe-bottom,0px));display:grid;grid-template-columns:1fr 1fr}
  body:not(.report-builder-fullscreen) .beit-detail-item{grid-template-columns:1fr;gap:5px}
  body:not(.report-builder-fullscreen) table.beit-mobile-card-table{border-spacing:0 10px!important;border-collapse:separate!important;background:transparent!important;min-width:0!important;width:100%!important}
  body:not(.report-builder-fullscreen) table.beit-mobile-card-table thead{display:none!important}
  body:not(.report-builder-fullscreen) table.beit-mobile-card-table tbody{display:block!important}
  body:not(.report-builder-fullscreen) table.beit-mobile-card-table tbody tr{
    display:block!important;
    margin:0 10px 10px;
    padding:8px;
    border:1px solid #e2e8f0;
    border-radius:16px;
    background:#fff;
    box-shadow:0 6px 18px rgba(15,23,42,.06);
  }
  body:not(.report-builder-fullscreen) table.beit-mobile-card-table tbody td{
    display:grid!important;
    grid-template-columns:minmax(92px,38%) minmax(0,1fr);
    gap:10px;
    height:auto!important;
    padding:8px 7px!important;
    border-bottom:1px solid #f1f5f9!important;
    text-align:left!important;
    white-space:normal!important;
  }
  body:not(.report-builder-fullscreen) table.beit-mobile-card-table tbody td:last-child{border-bottom:0!important}
  body:not(.report-builder-fullscreen) table.beit-mobile-card-table tbody td::before{
    content:attr(data-label);
    color:#64748b;
    font-size:10px;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.065em;
  }
}
body:not(.report-builder-fullscreen) table.beit-mobile-card-table .beit-col-hidden,
body:not(.report-builder-fullscreen) table.beit-mobile-card-table [hidden]{display:none!important}

/* ──────────────────────────────────────────────────────────
   Phase 8 hotfix — campaign table toolbar, selected counts,
   compact presets, and shared funnel visual.
   ────────────────────────────────────────────────────────── */
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-toolbar-row{
  padding:13px 16px;
  align-items:center;
  justify-content:flex-start;
  background:linear-gradient(180deg,#fff,#fbfdff);
}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-table-actions{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  flex-wrap:nowrap;
  min-width:0;
}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-search{
  flex:1 1 230px;
  max-width:320px;
  min-width:190px;
}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-search input{height:34px;min-height:34px}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-table-actions .btn{
  white-space:nowrap;
  min-height:34px;
  height:34px;
}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-select-visible,
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-deselect-visible{
  padding-inline:12px;
  font-weight:900;
}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-select-visible:disabled,
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-deselect-visible:disabled{
  opacity:.45;
  cursor:not-allowed;
}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-preset{
  width:128px!important;
  min-width:128px!important;
  max-width:128px!important;
}
body:not(.report-builder-fullscreen) .beit-single-select.is-compact-dropdown,
body:not(.report-builder-fullscreen) .beit-single-select.is-hierarchy-preset{
  width:128px!important;
  min-width:128px!important;
  max-width:128px!important;
  flex:0 0 128px!important;
}
body:not(.report-builder-fullscreen) .beit-single-select.is-compact-dropdown .beit-single-toggle,
body:not(.report-builder-fullscreen) .beit-single-select.is-hierarchy-preset .beit-single-toggle{
  height:34px;
  min-height:34px;
  padding-inline:10px;
  border-radius:11px;
}
body:not(.report-builder-fullscreen) .beit-single-menu.beit-single-portal:has(.beit-single-search){
  scrollbar-width:thin;
}
body:not(.report-builder-fullscreen) .beit-hierarchy-level-tab em[data-selected-count-level]{
  min-width:74px;
  text-align:center;
  font-size:10px;
  padding:4px 8px;
  letter-spacing:-.01em;
}
body:not(.report-builder-fullscreen) .beit-hierarchy-level-tab em[data-selected-count-level].has-selected{
  background:#0b57d0;
  border-color:#0b57d0;
  color:#fff;
}
@media(max-width:1120px){
  body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-table-actions{flex-wrap:wrap}
  body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-search{order:10;flex:1 1 100%;max-width:none;width:100%}
}

body:not(.report-builder-fullscreen) .conversion-funnel-card{
  padding:0;
  overflow:hidden;
  background:radial-gradient(circle at top left,rgba(59,130,246,.08),transparent 36%),linear-gradient(180deg,#fff,#fbfdff);
}
body:not(.report-builder-fullscreen) .conversion-funnel-header{
  padding:18px 20px 14px;
  border-bottom:1px solid #edf2f7;
  align-items:flex-start;
  gap:14px;
}
body:not(.report-builder-fullscreen) .conversion-funnel-subtitle{
  margin:5px 0 0;
  color:#64748b;
  font-size:12.5px;
  line-height:1.45;
  font-weight:650;
}
body:not(.report-builder-fullscreen) .conversion-funnel-summary{
  flex:0 0 auto;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:3px;
  min-width:138px;
  padding:10px 12px;
  border:1px solid #dbeafe;
  border-radius:16px;
  background:#eff6ff;
  color:#1d4ed8;
}
body:not(.report-builder-fullscreen) .conversion-funnel-summary span{
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#64748b;
}
body:not(.report-builder-fullscreen) .conversion-funnel-summary strong{
  font-size:20px;
  font-weight:950;
  letter-spacing:-.03em;
  color:#0f172a;
}
body:not(.report-builder-fullscreen) .conversion-funnel-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:16px 18px 18px;
}
body:not(.report-builder-fullscreen) .conversion-funnel-stage{
  display:grid;
  grid-template-columns:42px minmax(0,1fr);
  gap:12px;
  align-items:stretch;
  padding:12px;
  border:1px solid #e2eaf3;
  border-radius:18px;
  background:rgba(255,255,255,.86);
  box-shadow:0 6px 18px rgba(15,23,42,.045);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
body:not(.report-builder-fullscreen) .conversion-funnel-stage:hover{
  transform:translateY(-1px);
  border-color:#cbd5e1;
  box-shadow:0 12px 28px rgba(15,23,42,.07);
}
body:not(.report-builder-fullscreen) .funnel-stage-index{
  width:42px;
  height:42px;
  border-radius:15px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb,var(--stage-color) 14%,#fff);
  color:var(--stage-color);
  border:1px solid color-mix(in srgb,var(--stage-color) 28%,#e2e8f0);
  font-size:13px;
  font-weight:950;
}
body:not(.report-builder-fullscreen) .funnel-stage-main{min-width:0;display:flex;flex-direction:column;gap:8px}
body:not(.report-builder-fullscreen) .funnel-stage-top,
body:not(.report-builder-fullscreen) .funnel-stage-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px}
body:not(.report-builder-fullscreen) .funnel-stage-title-wrap{min-width:0;display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
body:not(.report-builder-fullscreen) .funnel-stage-label{font-size:13px;font-weight:950;color:#0f172a;letter-spacing:-.01em}
body:not(.report-builder-fullscreen) .funnel-stage-sub{font-size:11px;font-weight:850;color:#64748b}
body:not(.report-builder-fullscreen) .funnel-stage-value{font-size:16px;font-weight:950;color:#0f172a;font-variant-numeric:tabular-nums;white-space:nowrap}
body:not(.report-builder-fullscreen) .funnel-progress-track{position:relative;height:13px;overflow:hidden;border-radius:999px;background:#eef2f7;border:1px solid #e2e8f0}
body:not(.report-builder-fullscreen) .funnel-progress-fill{width:var(--stage-pct);min-width:18px;height:100%;border-radius:999px;background:linear-gradient(90deg,color-mix(in srgb,var(--stage-color) 76%,#fff),var(--stage-color));box-shadow:inset 0 -8px 16px rgba(15,23,42,.11),0 0 0 1px color-mix(in srgb,var(--stage-color) 16%,transparent)}
body:not(.report-builder-fullscreen) .funnel-stage-bottom{justify-content:flex-start;color:#64748b;font-size:11.5px;font-weight:750}
body:not(.report-builder-fullscreen) .funnel-drop-chip{display:inline-flex;align-items:center;height:22px;padding:0 9px;border-radius:999px;border:1px solid #dbe5f1;background:#f8fafc;color:#475569;font-size:10.5px;font-weight:950;white-space:nowrap}
body:not(.report-builder-fullscreen) .funnel-drop-chip.danger{background:#fef2f2;border-color:#fecaca;color:#dc2626}
body:not(.report-builder-fullscreen) .funnel-drop-chip.warning{background:#fff7ed;border-color:#fed7aa;color:#c2410c}
body:not(.report-builder-fullscreen) .funnel-drop-chip.success{background:#f0fdf4;border-color:#bbf7d0;color:#15803d}
body:not(.report-builder-fullscreen) .funnel-drop-chip.neutral{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-header{padding:16px 18px 12px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-list{padding:14px 16px 16px;gap:9px}
@media(max-width:760px){
  body:not(.report-builder-fullscreen) .conversion-funnel-header{flex-direction:column;padding:16px}
  body:not(.report-builder-fullscreen) .conversion-funnel-summary{align-items:flex-start;width:100%;min-width:0}
  body:not(.report-builder-fullscreen) .conversion-funnel-list{padding:14px;gap:9px}
  body:not(.report-builder-fullscreen) .conversion-funnel-stage{grid-template-columns:36px minmax(0,1fr);padding:10px;border-radius:16px;gap:10px}
  body:not(.report-builder-fullscreen) .funnel-stage-index{width:36px;height:36px;border-radius:13px}
  body:not(.report-builder-fullscreen) .funnel-stage-top{align-items:flex-start}
  body:not(.report-builder-fullscreen) .funnel-stage-bottom{flex-wrap:wrap;gap:7px}
}


/* ──────────────────────────────────────────────────────────
   UX hotfix — compact selection counts, header select menu,
   and compact overview funnel.
   ────────────────────────────────────────────────────────── */
body:not(.report-builder-fullscreen) .beit-selection-bar span{display:none!important}
body:not(.report-builder-fullscreen) .beit-hierarchy-level-tab em[data-selected-count-level]{
  display:none;
  min-width:28px;
  height:22px;
  padding:0 8px;
  align-items:center;
  justify-content:center;
  text-align:center;
  font-size:11px;
  line-height:20px;
  font-weight:950;
  border-radius:999px;
}
body:not(.report-builder-fullscreen) .beit-hierarchy-level-tab em[data-selected-count-level].has-selected:not([hidden]){display:inline-flex}
body:not(.report-builder-fullscreen) .beit-hierarchy-name-head{display:flex;align-items:center;gap:9px;min-width:0}
body:not(.report-builder-fullscreen) .beit-hierarchy-name-head > span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu-wrap{position:relative;display:inline-flex;flex:0 0 auto;z-index:7}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu-trigger{
  width:28px;height:28px;border-radius:9px;border:1px solid #cbd5e1;background:#fff;color:#64748b;
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 1px 2px rgba(15,23,42,.06);
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu-trigger:hover,
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu-wrap.is-open .beit-hierarchy-select-menu-trigger{
  background:#eff6ff;border-color:#93c5fd;color:#1d4ed8;box-shadow:0 8px 18px rgba(37,99,235,.12);transform:translateY(-1px);
}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu-trigger:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}
body:not(.report-builder-fullscreen) .beit-select-menu-box{width:14px;height:14px;border-radius:4px;border:1.7px solid currentColor;background:#fff;position:relative;display:block}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu-trigger.is-partial .beit-select-menu-box::after{content:'';position:absolute;left:3px;right:3px;top:5px;height:2px;border-radius:999px;background:currentColor}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu-trigger.is-all-selected .beit-select-menu-box{background:#2563eb;border-color:#2563eb;color:#fff}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu-trigger.is-all-selected .beit-select-menu-box::after{content:'✓';position:absolute;inset:-3px 0 0 0;font-size:12px;line-height:14px;text-align:center;color:#fff;font-weight:950}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu{
  position:absolute;top:34px;left:0;min-width:188px;padding:7px;border:1px solid #dbe4f0;border-radius:14px;background:#fff;
  box-shadow:0 22px 50px rgba(15,23,42,.18);z-index:5000;
}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu button{
  width:100%;display:flex;align-items:center;gap:8px;border:0;background:transparent;color:#0f172a;border-radius:10px;padding:9px 10px;
  font-size:12.5px;font-weight:850;text-align:left;cursor:pointer;
}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu button:hover{background:#eff6ff;color:#1d4ed8}
body:not(.report-builder-fullscreen) .beit-hierarchy-select-menu button:disabled{opacity:.45;cursor:not-allowed;background:transparent;color:#94a3b8}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-select-visible,
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-deselect-visible{display:none!important}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-table-actions{gap:10px}
body:not(.report-builder-fullscreen) .beit-campaign-hierarchy-card .beit-hierarchy-preset,
body:not(.report-builder-fullscreen) .beit-single-select.is-hierarchy-preset,
body:not(.report-builder-fullscreen) .beit-single-select.is-compact-dropdown{width:116px!important;min-width:116px!important;max-width:116px!important;flex-basis:116px!important}

body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-header{padding:13px 15px 10px;gap:10px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .chart-title{font-size:14px;line-height:1.2}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-subtitle{font-size:11.2px;line-height:1.35;margin-top:3px;max-width:330px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-summary{min-width:104px;padding:7px 9px;border-radius:13px;gap:1px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-summary span{font-size:8.8px;letter-spacing:.07em}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-summary strong{font-size:17px;line-height:1.05}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-list{padding:12px 14px 14px;gap:7px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-stage{grid-template-columns:32px minmax(0,1fr);gap:9px;padding:8px 10px;border-radius:14px;box-shadow:0 3px 12px rgba(15,23,42,.035)}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-stage-index{width:32px;height:32px;border-radius:11px;font-size:11.5px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-stage-main{gap:6px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-stage-top{gap:8px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-stage-title-wrap{gap:6px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-stage-label{font-size:12px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-stage-sub{font-size:10px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-stage-value{font-size:14px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-progress-track{height:9px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-progress-fill{min-width:12px}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-stage-bottom{font-size:10px;gap:7px;line-height:1.2}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .funnel-drop-chip{height:18px;padding:0 7px;font-size:9.5px}
@media(max-width:760px){
  body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-header{padding:13px}
  body:not(.report-builder-fullscreen) .overview-performance-funnel-card .conversion-funnel-list{padding:11px 12px 13px}
}

/* ─────────────────────────────────────────────────────────────
   Phase 9 — Chart UX improvements
   Scoped to main app; report-builder stays isolated.
   ───────────────────────────────────────────────────────────── */
body:not(.report-builder-fullscreen) .beit-chart-card-enhanced .chart-header{
  align-items:flex-start;
  gap:12px;
}
body:not(.report-builder-fullscreen) .beit-chart-card-enhanced .chart-title{
  min-height:32px;
  display:flex;
  align-items:center;
}
body:not(.report-builder-fullscreen) .beit-chart-controls{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
  margin-left:auto;
  min-width:0;
}
body:not(.report-builder-fullscreen) .beit-chart-controls [hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-chart-control-select{
  height:32px;
  min-width:112px;
  max-width:170px;
  border:1px solid #d8e3f0;
  border-radius:12px;
  background:#fff;
  padding:0 28px 0 11px;
  font-size:11.5px;
  font-weight:850;
  color:#0f172a;
}
body:not(.report-builder-fullscreen) .beit-chart-controls .beit-single-select{
  min-width:112px;
  max-width:178px;
}
body:not(.report-builder-fullscreen) .beit-chart-controls .beit-single-toggle{
  min-height:32px;
  height:32px;
  padding:0 10px;
  border-radius:12px;
  font-size:11.5px;
  box-shadow:0 5px 14px rgba(15,23,42,.04);
}
body:not(.report-builder-fullscreen) .beit-chart-control-btn,
body:not(.report-builder-fullscreen) .beit-chart-control-icon{
  height:32px;
  border:1px solid #d8e3f0;
  background:linear-gradient(180deg,#fff,#f8fbff);
  color:#0f172a;
  border-radius:12px;
  font-size:11.5px;
  font-weight:850;
  padding:0 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  box-shadow:0 5px 14px rgba(15,23,42,.04);
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease;
}
body:not(.report-builder-fullscreen) .beit-chart-control-icon{
  width:32px;
  padding:0;
  font-size:14px;
  line-height:1;
}
body:not(.report-builder-fullscreen) .beit-chart-control-btn:hover,
body:not(.report-builder-fullscreen) .beit-chart-control-icon:hover{
  border-color:#bcd0ea;
  background:#fff;
  color:#1d4ed8;
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(15,23,42,.07);
}
body:not(.report-builder-fullscreen) .beit-chart-control-btn.is-active{
  background:#eff6ff;
  border-color:#9cc2ff;
  color:#1d4ed8;
  box-shadow:inset 0 0 0 1px rgba(37,99,235,.12),0 5px 14px rgba(37,99,235,.08);
}
body:not(.report-builder-fullscreen) .beit-chart-insights{
  display:flex;
  align-items:center;
  gap:7px;
  flex-wrap:wrap;
  padding:0 18px 12px;
  margin-top:-4px;
  color:#64748b;
  font-size:11.2px;
  font-weight:750;
}
body:not(.report-builder-fullscreen) .beit-chart-insights span{
  display:inline-flex;
  align-items:center;
  gap:5px;
  min-height:24px;
  padding:3px 8px;
  border:1px solid #e3ebf5;
  border-radius:999px;
  background:#f8fbff;
  white-space:nowrap;
}
body:not(.report-builder-fullscreen) .beit-chart-insights b{
  color:#94a3b8;
  text-transform:uppercase;
  letter-spacing:.07em;
  font-size:9px;
}
body:not(.report-builder-fullscreen) .beit-chart-insights .is-up{color:#15803d;background:#f0fdf4;border-color:#bbf7d0}
body:not(.report-builder-fullscreen) .beit-chart-insights .is-down{color:#dc2626;background:#fef2f2;border-color:#fecaca}
body:not(.report-builder-fullscreen) .chart-body .beit-chart-empty{
  position:absolute;
  inset:12px;
  z-index:4;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  pointer-events:none;
  border:1px dashed #cbd5e1;
  border-radius:18px;
  background:rgba(248,251,255,.88);
  backdrop-filter:blur(3px);
}
body:not(.report-builder-fullscreen) .chart-body .beit-chart-empty[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-chart-empty div{
  max-width:280px;
  display:grid;
  gap:5px;
  padding:16px;
}
body:not(.report-builder-fullscreen) .beit-chart-empty strong{
  font-size:13px;
  font-weight:900;
  color:#0f172a;
}
body:not(.report-builder-fullscreen) .beit-chart-empty span{
  font-size:12px;
  line-height:1.45;
  color:#64748b;
}
body.beit-chart-fs-open{overflow:hidden}
body:not(.report-builder-fullscreen) .beit-chart-fullscreen{
  position:fixed;
  inset:0;
  z-index:2147483646;
  background:rgba(15,23,42,.58);
  backdrop-filter:blur(10px);
  padding:clamp(12px,2vw,26px);
}
body:not(.report-builder-fullscreen) .beit-chart-fullscreen[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-chart-fullscreen-panel{
  width:min(1180px,100%);
  height:min(760px,100%);
  margin:auto;
  background:#fff;
  border:1px solid rgba(226,232,240,.9);
  border-radius:24px;
  box-shadow:0 35px 100px rgba(15,23,42,.32);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
body:not(.report-builder-fullscreen) .beit-chart-fullscreen-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 18px;
  border-bottom:1px solid #edf2f7;
  background:linear-gradient(180deg,#fff,#f8fbff);
}
body:not(.report-builder-fullscreen) .beit-chart-fullscreen-head span{
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:#94a3b8;
  margin-bottom:3px;
}
body:not(.report-builder-fullscreen) .beit-chart-fullscreen-head h3{
  margin:0;
  font-size:16px;
  font-weight:900;
  color:#0f172a;
}
body:not(.report-builder-fullscreen) .beit-chart-fs-close{
  width:36px;
  height:36px;
  border:1px solid #dbe5f1;
  border-radius:13px;
  background:#fff;
  color:#0f172a;
  font-size:22px;
  line-height:1;
  cursor:pointer;
}
body:not(.report-builder-fullscreen) .beit-chart-fullscreen-body{
  position:relative;
  flex:1;
  min-height:0;
  padding:18px;
}
body:not(.report-builder-fullscreen) .beit-chart-fullscreen-body canvas{
  width:100%!important;
  height:100%!important;
}
@media(max-width:900px){
  body:not(.report-builder-fullscreen) .beit-chart-controls{width:100%;justify-content:flex-start}
  body:not(.report-builder-fullscreen) .beit-chart-controls .beit-single-select,
  body:not(.report-builder-fullscreen) .beit-chart-control-select{flex:1 1 132px;max-width:none}
  body:not(.report-builder-fullscreen) .beit-chart-insights{padding-left:13px;padding-right:13px}
}
@media(max-width:560px){
  body:not(.report-builder-fullscreen) .beit-chart-control-btn{flex:1 1 auto}
  body:not(.report-builder-fullscreen) .beit-chart-control-icon{flex:0 0 34px;width:34px}
  body:not(.report-builder-fullscreen) .beit-chart-fullscreen{padding:8px}
  body:not(.report-builder-fullscreen) .beit-chart-fullscreen-panel{border-radius:20px;height:100%}
  body:not(.report-builder-fullscreen) .beit-chart-fullscreen-body{padding:12px}
}

/* Phase 9 hotfix — working controls, saved views, table reset and funnel chart mode */
body:not(.report-builder-fullscreen) .beit-chart-controls-plus{
  justify-content:flex-end;
  max-width:100%;
}
body:not(.report-builder-fullscreen) .beit-chart-controls-plus .beit-chart-control-select,
body:not(.report-builder-fullscreen) .beit-funnel-controls .beit-single-select,
body:not(.report-builder-fullscreen) .beit-funnel-controls select{
  min-width:104px;
  max-width:154px;
}
body:not(.report-builder-fullscreen) .beit-chart-controls-plus [data-p9-chart-type]{min-width:118px;max-width:168px}
body:not(.report-builder-fullscreen) .beit-chart-controls-plus [data-p9-chart-metric]{min-width:124px;max-width:190px}
body:not(.report-builder-fullscreen) .beit-table-reset-btn{
  height:32px;
  border-radius:12px;
  font-size:11.5px;
  font-weight:850;
  white-space:nowrap;
}
body:not(.report-builder-fullscreen) .beit-sortable-th{
  cursor:pointer;
  user-select:none;
  position:relative;
}
body:not(.report-builder-fullscreen) .beit-sortable-th:hover,
body:not(.report-builder-fullscreen) table[data-campaign-hierarchy="1"] thead th:hover{
  color:#1d4ed8;
  background:#f8fbff;
}
body:not(.report-builder-fullscreen) .beit-sortable-th.is-sorted-asc::after,
body:not(.report-builder-fullscreen) .beit-sortable-th.is-sorted-desc::after,
body:not(.report-builder-fullscreen) table[data-campaign-hierarchy="1"] thead th.is-sorted-asc::after,
body:not(.report-builder-fullscreen) table[data-campaign-hierarchy="1"] thead th.is-sorted-desc::after{
  content:'↑';
  margin-left:6px;
  color:#2563eb;
  font-size:10px;
}
body:not(.report-builder-fullscreen) .beit-sortable-th.is-sorted-desc::after,
body:not(.report-builder-fullscreen) table[data-campaign-hierarchy="1"] thead th.is-sorted-desc::after{content:'↓'}
body:not(.report-builder-fullscreen) .beit-row-detail-ready:not(.beit-table-empty-row){cursor:pointer}
body:not(.report-builder-fullscreen) .beit-row-detail-ready:not(.beit-table-empty-row):hover>td{background:#f8fbff}
body:not(.report-builder-fullscreen) .beit-funnel-controls{
  margin-left:auto;
  justify-content:flex-end;
}
body:not(.report-builder-fullscreen) .beit-funnel-chart-body{
  height:260px;
  padding:12px 16px 16px;
  border-top:1px solid #eef3f8;
}
body:not(.report-builder-fullscreen) .overview-performance-funnel-card .beit-funnel-chart-body{
  height:250px;
  padding:10px 14px 14px;
}
body:not(.report-builder-fullscreen) .beit-funnel-chart-body[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-funnel-chart-body canvas{
  width:100%!important;
  height:100%!important;
}
body:not(.report-builder-fullscreen) .conversion-funnel-card.is-funnel-chart-mode .conversion-funnel-list[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .saved-filter-select[data-beit-single-enhanced]+.beit-single-select,
body:not(.report-builder-fullscreen) .saved-filter-select + .beit-single-select{
  min-width:170px;
  max-width:220px;
}
@media(max-width:1100px){
  body:not(.report-builder-fullscreen) .beit-chart-card-enhanced .chart-header,
  body:not(.report-builder-fullscreen) .conversion-funnel-header{
    align-items:flex-start;
  }
  body:not(.report-builder-fullscreen) .beit-chart-controls-plus,
  body:not(.report-builder-fullscreen) .beit-funnel-controls{
    width:100%;
    justify-content:flex-start;
    margin-left:0;
  }
}
@media(max-width:640px){
  body:not(.report-builder-fullscreen) .beit-chart-controls-plus .beit-chart-control-select,
  body:not(.report-builder-fullscreen) .beit-funnel-controls .beit-single-select,
  body:not(.report-builder-fullscreen) .beit-funnel-controls select{
    flex:1 1 145px;
    max-width:none;
  }
  body:not(.report-builder-fullscreen) .beit-funnel-chart-body{height:230px;padding:10px 12px 12px}
}

/* ── Phase 10: onboarding, settings tabs, command palette and final UI polish ── */
body:not(.report-builder-fullscreen) .beit-onboarding-card{
  border:1px solid #d6e3f5;background:linear-gradient(135deg,#ffffff 0%,#f8fbff 58%,#eef6ff 100%);border-radius:22px;box-shadow:0 16px 42px rgba(15,23,42,.08);padding:18px;margin-bottom:20px;position:relative;overflow:hidden
}
body:not(.report-builder-fullscreen) .beit-onboarding-card[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-onboarding-card:before{content:"";position:absolute;inset:0 auto 0 0;width:5px;background:linear-gradient(180deg,#2563eb,#22c55e)}
body:not(.report-builder-fullscreen) .beit-onboarding-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:14px;padding-left:6px}
body:not(.report-builder-fullscreen) .beit-eyebrow{display:inline-flex;align-items:center;gap:6px;font-size:10.5px;font-weight:950;text-transform:uppercase;letter-spacing:.09em;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:5px 9px;margin-bottom:8px}
body:not(.report-builder-fullscreen) .beit-onboarding-head h2{font-size:19px;font-weight:950;letter-spacing:-.03em;margin:0 0 4px;color:#0f172a}
body:not(.report-builder-fullscreen) .beit-onboarding-head p{margin:0;color:#64748b;font-size:13px;font-weight:700;line-height:1.45;max-width:720px}
body:not(.report-builder-fullscreen) .beit-onboarding-progress{--progress:0%;width:92px;height:92px;border-radius:999px;display:flex;flex-direction:column;align-items:center;justify-content:center;background:conic-gradient(#2563eb var(--progress),#e8eef7 0);position:relative;flex:0 0 auto;box-shadow:0 10px 26px rgba(37,99,235,.13)}
body:not(.report-builder-fullscreen) .beit-onboarding-progress:before{content:"";position:absolute;inset:8px;background:#fff;border-radius:inherit;box-shadow:inset 0 0 0 1px #e2e8f0}
body:not(.report-builder-fullscreen) .beit-onboarding-progress strong,body:not(.report-builder-fullscreen) .beit-onboarding-progress span{position:relative;z-index:1}.beit-onboarding-progress strong{font-size:20px;font-weight:950;color:#0f172a}.beit-onboarding-progress span{font-size:10px;text-transform:uppercase;letter-spacing:.08em;font-weight:900;color:#64748b}
body:not(.report-builder-fullscreen) .beit-onboarding-dismiss{position:absolute;top:12px;right:12px;width:30px;height:30px;border:1px solid #dbe4f0;border-radius:12px;background:#fff;color:#64748b;font-size:18px;font-weight:900;line-height:1;cursor:pointer;box-shadow:0 4px 12px rgba(15,23,42,.06)}
body:not(.report-builder-fullscreen) .beit-onboarding-dismiss:hover{background:#f8fafc;color:#0f172a;border-color:#cbd5e1}
body:not(.report-builder-fullscreen) .beit-onboarding-steps{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
body:not(.report-builder-fullscreen) .beit-onboarding-step{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"icon copy" "icon action";gap:3px 10px;text-decoration:none;color:inherit;background:#fff;border:1px solid #e2eaf5;border-radius:16px;padding:12px;min-height:112px;transition:.16s ease;box-shadow:0 6px 18px rgba(15,23,42,.04)}
body:not(.report-builder-fullscreen) .beit-onboarding-step:hover{transform:translateY(-1px);border-color:#bfdbfe;box-shadow:0 12px 26px rgba(37,99,235,.1)}
body:not(.report-builder-fullscreen) .beit-onboarding-step-icon{grid-area:icon;width:32px;height:32px;border-radius:12px;background:#eff6ff;border:1px solid #bfdbfe;color:#2563eb;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:950;flex:0 0 auto}
body:not(.report-builder-fullscreen) .beit-onboarding-step-copy{grid-area:copy;min-width:0}.beit-onboarding-step-copy strong{display:block;font-size:12.8px;font-weight:950;color:#0f172a;margin-bottom:4px}.beit-onboarding-step-copy small{display:block;color:#64748b;font-size:11.2px;font-weight:700;line-height:1.35}
body:not(.report-builder-fullscreen) .beit-onboarding-step em{grid-area:action;align-self:end;justify-self:start;font-style:normal;font-size:10.5px;font-weight:950;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:4px 8px}
body:not(.report-builder-fullscreen) .beit-onboarding-step.is-done{background:#f7fef9;border-color:#bbf7d0}.beit-onboarding-step.is-done .beit-onboarding-step-icon{background:#dcfce7;border-color:#86efac;color:#16a34a}.beit-onboarding-step.is-done em{background:#dcfce7;border-color:#86efac;color:#15803d}

body.page-settings:not(.report-builder-fullscreen) .settings-page-shell{display:block!important}
body.page-settings:not(.report-builder-fullscreen) .settings-tabs-layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:20px;align-items:start}
body.page-settings:not(.report-builder-fullscreen) .settings-tabs-nav{position:sticky;top:18px;display:grid;gap:9px;background:#fff;border:1px solid #dbe4f0;border-radius:20px;padding:10px;box-shadow:0 12px 30px rgba(15,23,42,.06)}
body.page-settings:not(.report-builder-fullscreen) .settings-tab-button{display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-rows:auto auto;gap:2px 10px;text-align:left;border:1px solid transparent;background:transparent;border-radius:15px;padding:11px;cursor:pointer;color:#334155;transition:.16s ease}
body.page-settings:not(.report-builder-fullscreen) .settings-tab-button span{grid-row:1 / span 2;width:34px;height:34px;border-radius:12px;background:#f1f5f9;border:1px solid #e2e8f0;display:flex;align-items:center;justify-content:center;font-weight:950;color:#64748b;font-size:12px}
body.page-settings:not(.report-builder-fullscreen) .settings-tab-button strong{font-size:13px;font-weight:950;color:#0f172a;letter-spacing:-.01em}.settings-tab-button small{font-size:11px;color:#64748b;font-weight:750;line-height:1.25}
body.page-settings:not(.report-builder-fullscreen) .settings-tab-button:hover{background:#f8fafc;border-color:#e2e8f0}
body.page-settings:not(.report-builder-fullscreen) .settings-tab-button.active{background:#eff6ff;border-color:#bfdbfe;box-shadow:0 8px 18px rgba(37,99,235,.09)}
body.page-settings:not(.report-builder-fullscreen) .settings-tab-button.active span{background:#2563eb;color:#fff;border-color:#2563eb}.settings-tab-button.danger.active{background:#fff7f7;border-color:#fecaca}.settings-tab-button.danger.active span{background:#ef4444;border-color:#ef4444;color:#fff}
body.page-settings:not(.report-builder-fullscreen) .settings-tabs-content{min-width:0}.settings-tabs-content .settings-panel{display:none!important}.settings-tabs-content .settings-panel.active{display:block!important;animation:settingsPanelIn .16s ease}
@keyframes settingsPanelIn{from{opacity:.4;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}
body.page-settings:not(.report-builder-fullscreen) .settings-tabs-content .settings-panel{max-width:880px;margin:0!important}
body.page-settings:not(.report-builder-fullscreen) .settings-panel{padding:24px!important;border-radius:20px!important}

body:not(.report-builder-fullscreen) .beit-command-palette{position:fixed;inset:0;z-index:100000;display:flex;align-items:flex-start;justify-content:center;padding:9vh 18px 18px}.beit-command-palette[hidden]{display:none!important}.beit-command-backdrop{position:absolute;inset:0;background:rgba(15,23,42,.44);backdrop-filter:blur(7px)}
body:not(.report-builder-fullscreen) .beit-command-panel{position:relative;width:min(680px,calc(100vw - 28px));max-height:min(680px,calc(100vh - 70px));background:#fff;border:1px solid #dbe4f0;border-radius:22px;box-shadow:0 28px 80px rgba(2,8,23,.28);overflow:hidden;display:flex;flex-direction:column}
body:not(.report-builder-fullscreen) .beit-command-search{height:62px;border-bottom:1px solid #edf2f7;display:flex;align-items:center;gap:12px;padding:0 16px;color:#64748b}.beit-command-search input{border:0;outline:0;flex:1;height:100%;font-size:15px;font-weight:800;color:#0f172a;background:transparent}.beit-command-search input::placeholder{color:#94a3b8}.beit-command-search kbd{font-size:10px;font-weight:950;color:#64748b;background:#f8fafc;border:1px solid #dbe4f0;border-bottom-width:2px;border-radius:8px;padding:4px 7px}
body:not(.report-builder-fullscreen) .beit-command-list{padding:10px;overflow:auto;display:grid;gap:6px}.beit-command-empty{padding:24px;text-align:center;color:#64748b;font-weight:800}.beit-command-item{border:1px solid transparent;background:#fff;border-radius:15px;padding:11px 12px;display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:10px;align-items:center;text-decoration:none;color:#0f172a;cursor:pointer}.beit-command-item:hover,.beit-command-item.is-active{background:#eff6ff;border-color:#bfdbfe}.beit-command-icon{width:34px;height:34px;border-radius:12px;background:#f1f5f9;display:flex;align-items:center;justify-content:center;color:#2563eb;font-weight:950}.beit-command-copy strong{font-size:13px;font-weight:950;display:block}.beit-command-copy small{font-size:11px;color:#64748b;font-weight:750}.beit-command-shortcut{font-size:10px;font-weight:950;color:#64748b;background:#f8fafc;border:1px solid #e2e8f0;border-radius:999px;padding:4px 7px}

body:not(.report-builder-fullscreen) .final-polish-section{border-radius:20px}
body:not(.report-builder-fullscreen) .btn,body:not(.report-builder-fullscreen) .form-control,body:not(.report-builder-fullscreen) .beit-single-button,body:not(.report-builder-fullscreen) .beit-multi-toggle{transition:border-color .16s ease,box-shadow .16s ease,background-color .16s ease,transform .16s ease}
body:not(.report-builder-fullscreen) .btn:active{transform:translateY(1px)}
@media (max-width:1200px){body:not(.report-builder-fullscreen) .beit-onboarding-steps{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:900px){body:not(.report-builder-fullscreen) .beit-onboarding-head{align-items:flex-start}.beit-onboarding-progress{width:78px!important;height:78px!important}.beit-onboarding-steps{grid-template-columns:1fr!important}body.page-settings:not(.report-builder-fullscreen) .settings-tabs-layout{grid-template-columns:1fr}.settings-tabs-nav{position:static!important;display:flex!important;overflow:auto}.settings-tab-button{min-width:185px}.beit-command-palette{padding-top:6vh!important}.beit-command-panel{max-height:calc(var(--beit-vh,1vh) * 88)!important}}
@media (max-width:620px){body:not(.report-builder-fullscreen) .beit-onboarding-card{padding:15px}.beit-onboarding-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto}.beit-onboarding-dismiss{top:8px;right:8px}.beit-onboarding-progress{grid-column:2;grid-row:1}.beit-onboarding-head>div:first-child{padding-right:4px}.beit-command-item{grid-template-columns:30px minmax(0,1fr)}.beit-command-shortcut{display:none}.beit-command-search{height:56px}}


/* Final QA hotfix: settings tabs + onboarding click/reorder polish */
body.page-settings:not(.report-builder-fullscreen) .settings-panel[hidden]{display:none!important;}
body.page-settings:not(.report-builder-fullscreen) .settings-panel.active{display:block!important;}
body:not(.report-builder-fullscreen) .beit-onboarding-card{position:relative;}
body:not(.report-builder-fullscreen) .beit-onboarding-dismiss{z-index:20;pointer-events:auto;display:inline-flex;align-items:center;justify-content:center;}
body:not(.report-builder-fullscreen) .beit-onboarding-card.custom-page-block{cursor:grab;}
body:not(.report-builder-fullscreen) .beit-onboarding-card.custom-page-block .beit-onboarding-dismiss,
body:not(.report-builder-fullscreen) .beit-onboarding-card.custom-page-block a,
body:not(.report-builder-fullscreen) .beit-onboarding-card.custom-page-block button{cursor:pointer;}
body:not(.report-builder-fullscreen) .beit-onboarding-card.is-dragging{opacity:.65;}
body:not(.report-builder-fullscreen) .queue-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}

/* Final chart metrics hotfix — chart metric picker and expanded chart controls */
body:not(.report-builder-fullscreen) .beit-chart-metrics-v2 .beit-chart-controls-plus{
  gap:7px;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-picker{
  position:relative;
  flex:0 1 220px;
  min-width:150px;
  max-width:260px;
  z-index:12;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-toggle{
  width:100%;
  height:32px;
  border:1px solid #d8e3f0;
  border-radius:12px;
  background:linear-gradient(180deg,#fff,#f8fbff);
  color:#0f172a;
  padding:0 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  font-size:11.5px;
  font-weight:900;
  box-shadow:0 5px 14px rgba(15,23,42,.04);
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-toggle:hover,
body:not(.report-builder-fullscreen) .beit-chart-metric-picker.is-open .beit-chart-metric-toggle{
  border-color:#9cc2ff;
  color:#1d4ed8;
  background:#fff;
  box-shadow:0 9px 20px rgba(37,99,235,.10);
}
body:not(.report-builder-fullscreen) .beit-chart-metric-toggle span:first-child{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  width:min(360px,92vw);
  min-width:260px;
  max-height:390px;
  padding:10px;
  border:1px solid #dbe5f1;
  border-radius:18px;
  background:#fff;
  box-shadow:0 24px 60px rgba(15,23,42,.22);
  display:none;
  z-index:2147483000;
  overflow:hidden;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-picker.is-open .beit-chart-metric-menu{display:block}
body:not(.report-builder-fullscreen) .beit-chart-metric-search{
  display:flex;
  align-items:center;
  gap:8px;
  height:38px;
  padding:0 11px;
  border:1px solid #dbe5f1;
  border-radius:13px;
  background:#f8fbff;
  color:#94a3b8;
  margin-bottom:8px;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-search input{
  border:0!important;
  outline:0!important;
  background:transparent!important;
  padding:0!important;
  min-width:0;
  width:100%;
  height:100%;
  box-shadow:none!important;
  font-size:12.5px;
  font-weight:750;
  color:#0f172a;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-list{
  max-height:274px;
  overflow:auto;
  padding-right:3px;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-group + .beit-chart-metric-group{
  border-top:1px solid #edf2f7;
  margin-top:8px;
  padding-top:8px;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-group-title{
  padding:4px 8px 5px;
  font-size:9.5px;
  font-weight:950;
  text-transform:uppercase;
  letter-spacing:.10em;
  color:#94a3b8;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-option{
  min-height:36px;
  display:flex;
  align-items:center;
  gap:9px;
  padding:7px 9px;
  border-radius:12px;
  cursor:pointer;
  color:#0f172a;
  font-size:12.5px;
  font-weight:850;
  transition:background .14s ease,color .14s ease;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-option:hover{background:#f1f6ff;color:#1d4ed8}
body:not(.report-builder-fullscreen) .beit-chart-metric-option input{
  width:17px;
  height:17px;
  flex:0 0 auto;
  accent-color:#2563eb;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-option span{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-empty{
  padding:18px 10px;
  text-align:center;
  color:#64748b;
  font-size:12px;
  font-weight:750;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-footer{
  display:flex;
  gap:8px;
  padding-top:9px;
  margin-top:8px;
  border-top:1px solid #edf2f7;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-footer[hidden]{display:none!important}
body:not(.report-builder-fullscreen) .beit-chart-metric-footer button{
  flex:1;
  height:31px;
  border:1px solid #dbe5f1;
  border-radius:11px;
  background:#f8fbff;
  color:#1d4ed8;
  font-size:11px;
  font-weight:900;
  cursor:pointer;
}
body:not(.report-builder-fullscreen) .beit-chart-metric-footer button:hover{background:#eff6ff;border-color:#bfdbfe}
body:not(.report-builder-fullscreen) .beit-chart-metric-picker.is-single-metric .beit-chart-metric-option input{border-radius:999px}
body:not(.report-builder-fullscreen) .beit-chart-card-enhanced.beit-chart-loading .chart-body:after{
  content:'Loading metric…';
  position:absolute;
  inset:12px;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:18px;
  background:rgba(248,251,255,.82);
  backdrop-filter:blur(4px);
  color:#1d4ed8;
  font-size:12px;
  font-weight:900;
}
body:not(.report-builder-fullscreen) .beit-chart-controls-plus [data-p9-chart-group]{min-width:112px;max-width:156px}
body:not(.report-builder-fullscreen) .beit-chart-controls-plus [data-p9-chart-x]{min-width:120px;max-width:170px}
body:not(.report-builder-fullscreen) .beit-chart-controls-plus [data-p9-chart-limit]{min-width:108px;max-width:150px}
@media(max-width:900px){
  body:not(.report-builder-fullscreen) .beit-chart-metric-picker{flex:1 1 180px;max-width:none}
  body:not(.report-builder-fullscreen) .beit-chart-metric-menu{width:min(360px,calc(100vw - 24px))}
}
@media(max-width:560px){
  body:not(.report-builder-fullscreen) .beit-chart-metric-picker{flex:1 1 100%;max-width:none}
  body:not(.report-builder-fullscreen) .beit-chart-metric-menu{position:fixed;left:12px!important;right:12px;width:auto;top:auto;bottom:12px;max-height:min(70vh,430px)}
  body:not(.report-builder-fullscreen) .beit-chart-metric-list{max-height:calc(70vh - 128px)}
}

.permission-note{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px dashed rgba(148,163,184,.38);border-radius:14px;background:rgba(248,250,252,.74);color:#64748b;font-size:12.5px;font-weight:650}

/* ── Phase 14: Advanced page onboarding ───────────────────── */
body:not(.report-builder-fullscreen) .beit-smart-onboarding{margin-bottom:16px;border-color:#dbeafe;background:radial-gradient(circle at top left,rgba(37,99,235,.10),transparent 34%),linear-gradient(180deg,#fff,#fbfdff)}
body:not(.report-builder-fullscreen) .beit-smart-onboarding.onboarding-warning{border-color:#fde68a;background:radial-gradient(circle at top left,rgba(245,158,11,.13),transparent 34%),linear-gradient(180deg,#fff,#fffaf0)}
body:not(.report-builder-fullscreen) .beit-smart-onboarding.onboarding-success{border-color:#bbf7d0;background:radial-gradient(circle at top left,rgba(34,197,94,.10),transparent 34%),linear-gradient(180deg,#fff,#f7fff9)}
body:not(.report-builder-fullscreen) .beit-onboarding-eyebrow{display:inline-flex;align-items:center;gap:6px;margin-bottom:6px;padding:4px 8px;border-radius:999px;background:#eff6ff;border:1px solid #bfdbfe;color:#1d4ed8;font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.08em}
body:not(.report-builder-fullscreen) .onboarding-warning .beit-onboarding-eyebrow{background:#fff7ed;border-color:#fed7aa;color:#c2410c}
body:not(.report-builder-fullscreen) .beit-onboarding-step-action{grid-area:action;align-self:end;justify-self:start;font-style:normal;font-size:10.5px;font-weight:950;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:4px 8px}
body:not(.report-builder-fullscreen) .beit-onboarding-step.is-done .beit-onboarding-step-action{background:#dcfce7;border-color:#86efac;color:#15803d}
body:not(.report-builder-fullscreen) .beit-onboarding-tip-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
body:not(.report-builder-fullscreen) .beit-onboarding-tip{display:flex;flex-direction:column;gap:7px;text-decoration:none;color:inherit;background:#fff;border:1px solid #e2eaf5;border-radius:16px;padding:14px;min-height:132px;transition:.16s ease;box-shadow:0 6px 18px rgba(15,23,42,.04)}
body:not(.report-builder-fullscreen) .beit-onboarding-tip:hover{transform:translateY(-1px);border-color:#bfdbfe;box-shadow:0 12px 26px rgba(37,99,235,.1)}
body:not(.report-builder-fullscreen) .beit-onboarding-tip-icon{width:34px;height:34px;border-radius:13px;background:#eff6ff;border:1px solid #bfdbfe;color:#2563eb;display:inline-flex;align-items:center;justify-content:center;font-size:15px;font-weight:950}
body:not(.report-builder-fullscreen) .beit-onboarding-tip strong{font-size:13px;font-weight:950;color:#0f172a;letter-spacing:-.01em}
body:not(.report-builder-fullscreen) .beit-onboarding-tip small{display:block;color:#64748b;font-size:11.5px;font-weight:700;line-height:1.45}
body:not(.report-builder-fullscreen) .beit-onboarding-tip em{margin-top:auto;align-self:flex-start;font-style:normal;font-size:10.5px;font-weight:950;color:#2563eb;background:#eff6ff;border:1px solid #bfdbfe;border-radius:999px;padding:4px 8px}
body:not(.report-builder-fullscreen) .reports-empty-card .beit-smart-onboarding{box-shadow:none;border-radius:18px;margin:0}
@media (max-width:900px){body:not(.report-builder-fullscreen) .beit-onboarding-tip-grid{grid-template-columns:1fr}}

/* Phase 15 — Advanced Customize Studio */
.customize-preview-badge{display:inline-flex;align-items:center;margin-left:8px;padding:3px 8px;border-radius:999px;border:1px solid #dbe4f0;background:#f8fafc;color:#475569;font-size:10px;font-weight:900;letter-spacing:.04em;text-transform:uppercase;vertical-align:middle}.customize-preview-badge.active{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8}.customize-preview-badge.dirty{background:#fff7ed;border-color:#fed7aa;color:#c2410c}.custom-import-textarea{width:100%;min-height:120px;margin:10px 0 8px;border:1px solid #dbe4f0;border-radius:12px;background:#fff;color:#0f172a;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;padding:10px;resize:vertical}.custom-file-label{cursor:pointer}.customize-studio-panel .customize-io-section,.customize-studio-panel .customize-reset-section{grid-column:span 2}.customize-preview-mode .page-content{outline:1px dashed rgba(37,99,235,.22);outline-offset:6px}.customize-preview-dirty .beit-customize-btn::after{content:'Unsaved';margin-left:6px;font-size:9px;background:#fff7ed;color:#c2410c;border:1px solid #fed7aa;border-radius:999px;padding:2px 5px}.section-order-row.is-dragging,.section-item-row.is-dragging,.studio-widget-row.is-dragging{opacity:.56;background:#eef2ff!important;border-color:#c7d2fe!important}.custom-section-drop-hint{border:1px dashed #93c5fd;background:#eff6ff;border-radius:12px;min-height:38px}@media(max-width:900px){.customize-studio-panel .customize-io-section,.customize-studio-panel .customize-reset-section{grid-column:auto}.custom-import-textarea{min-height:96px}}

/* ── Phase 16: Accessibility + Keyboard UX ───────────────── */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.skip-link{position:fixed;top:10px;left:10px;z-index:2147483647;transform:translateY(-160%);padding:10px 13px;border-radius:999px;background:#0f172a;color:#fff;font-size:12px;font-weight:900;box-shadow:0 12px 32px rgba(15,23,42,.25);transition:transform .16s ease;text-decoration:none!important}
.skip-link:focus,.skip-link:focus-visible{transform:translateY(0);outline:3px solid rgba(96,165,250,.75);outline-offset:3px}
:where(a[href],button,[role="button"],input:not([type="hidden"]),select,textarea,[tabindex]:not([tabindex="-1"])):focus-visible{outline:3px solid rgba(37,99,235,.45);outline-offset:2px;box-shadow:0 0 0 5px rgba(59,130,246,.14)}
.sidebar :where(a[href],button,input):focus-visible{outline-color:rgba(147,197,253,.78);box-shadow:0 0 0 3px rgba(96,165,250,.24)}
.nav-item:focus-visible{background:var(--nav-hover);color:#e2e8f0;text-decoration:none}
.btn:focus-visible,.beit-customize-btn:focus-visible,.modal-close:focus-visible{outline:3px solid rgba(37,99,235,.46);outline-offset:2px;box-shadow:0 0 0 5px rgba(59,130,246,.14),var(--shadow-sm)}
.beit-multi-option:focus-within,.beit-multi-option:focus-visible{background:#eff6ff;color:#1d4ed8;outline:2px solid rgba(37,99,235,.34);outline-offset:1px}
.beit-multi-option[aria-selected="true"]{background:rgba(239,246,255,.72)}
body:not(.report-builder-fullscreen) .beit-single-option[aria-selected="true"],body:not(.report-builder-fullscreen) .beit-single-option:focus-visible{background:#eff6ff;border-color:#bfdbfe;color:#1d4ed8;outline:2px solid rgba(37,99,235,.36);outline-offset:-2px}
.beit-command-panel:focus-visible,.beit-customizer-panel:focus-visible{outline:3px solid rgba(59,130,246,.38);outline-offset:-6px}
.settings-tab-button:focus-visible,.wizard-step:focus-visible{outline:3px solid rgba(37,99,235,.45);outline-offset:2px;box-shadow:0 0 0 5px rgba(59,130,246,.12)}
.beit-command-item[aria-selected="true"]{background:#eff6ff;border-color:#bfdbfe}
.chart-sr-summary{margin:0!important}
[aria-busy="true"]{cursor:progress}
.empty-state[role="alert"]{border-color:#fecaca}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.01ms!important}
  .kpi-card:hover,.btn:hover{transform:none!important}
}
@media (forced-colors: active){
  :where(a[href],button,[role="button"],input,select,textarea,[tabindex]:not([tabindex="-1"])):focus-visible{outline:2px solid Highlight!important;box-shadow:none!important}
  .status-pill,.badge{border:1px solid ButtonText}
}


/* Currency/KPI values: keep currency and number together, but never let text escape the card. */
.kpi-card,
.pinned-metric-card,
.custom-widget-card.kpi-card{
  overflow:hidden!important;
}
.kpi-card .kpi-body,
.pinned-metric-card .kpi-body,
.custom-widget-card.kpi-card .kpi-body{
  min-width:0!important;
  max-width:100%!important;
}
.kpi-card .kpi-value,
.pinned-metric-card .kpi-value,
.custom-widget-card.kpi-card .kpi-value,
.rb-scorecard strong,
.rb-combo-metric-strip em,
.rb-bar-row b,
.rb-funnel-step b,
.rb-share-chart li b{
  display:block!important;
  max-width:100%!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
}
@supports (font-size: clamp(12px, 1vw, 20px)){
  .kpi-card .kpi-value,
  .pinned-metric-card .kpi-value,
  .custom-widget-card.kpi-card .kpi-value{
    font-size:clamp(13px, 1vw, 20px)!important;
  }
}

/* Funnel value alignment fix: keep counts outside the colored bar in platform side panels. */
body:not(.report-builder-fullscreen) .platform-funnel-step{
  grid-template-columns:minmax(90px,1fr) minmax(44px,58px) 58px minmax(38px,52px);
  gap:7px;
  align-items:center;
}
body:not(.report-builder-fullscreen) .platform-funnel-step .funnel-step-value{
  min-width:0;
  text-align:right;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:#0f172a;
  font-weight:950;
  font-variant-numeric:tabular-nums;
  line-height:1;
}
body:not(.report-builder-fullscreen) .platform-funnel-step .funnel-bar-outer{
  width:100%;
  min-width:0;
}
body:not(.report-builder-fullscreen) .platform-funnel-step .funnel-bar-inner{
  padding-right:0;
}
@media(max-width:760px){
  body:not(.report-builder-fullscreen) .platform-funnel-step{
    grid-template-columns:minmax(82px,1fr) minmax(44px,58px) 58px minmax(38px,52px)!important;
    gap:7px!important;
    padding-bottom:6px;
  }
  body:not(.report-builder-fullscreen) .platform-funnel-step .funnel-label{
    text-align:right!important;
    white-space:nowrap!important;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  body:not(.report-builder-fullscreen) .platform-funnel-step .funnel-rate{
    text-align:right!important;
    white-space:nowrap!important;
  }
}
