:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #fbfcff;
  --border: #e6e9f2;
  --border-strong: #d9deea;
  --text: #111827;
  --muted: #667085;
  --muted-2: #98a2b3;
  --primary: #6d3df2;
  --primary-2: #2563eb;
  --primary-soft: #f1eaff;
  --blue-soft: #eff6ff;
  --green: #039855;
  --green-soft: #ecfdf3;
  --red: #d92d20;
  --red-soft: #fef3f2;
  --yellow: #b54708;
  --yellow-soft: #fffaeb;
  --shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, 0.04);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(109,61,242,0.08), transparent 34rem),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 48%, #f8fafc 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 244px;
  background: rgba(255,255,255,0.88);
  border-right: 1px solid var(--border);
  color: var(--text);
  padding: 22px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  backdrop-filter: blur(18px);
  box-shadow: 10px 0 30px rgba(15,23,42,0.03);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.03em;
  margin: 0 0 28px 2px;
  color: #101828;
}
.brand::before {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 10px 22px rgba(109,61,242,0.28);
}
.sidebar nav { display: flex; flex-direction: column; gap: 6px; }
.sidebar a {
  color: #344054;
  text-decoration: none;
  padding: 11px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.sidebar a::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.sidebar a:hover { color: var(--primary); background: var(--primary-soft); transform: translateX(2px); }
.sidebar a.active { color: var(--primary); background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.sidebar a.active::before { border-color: var(--primary); background: linear-gradient(135deg, var(--primary-2), var(--primary)); }

.main { flex: 1; min-width: 0; }
.topbar {
  background: rgba(255,255,255,0.78);
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
}
.topbar h1 { margin: 0; font-size: 26px; font-weight: 850; letter-spacing: -0.04em; color: #101828; }
.topbar p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#site-filter { min-width: 210px; }

.content { padding: 24px 28px 34px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card, .panel {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.metric-card { padding: 18px; min-height: 128px; position: relative; overflow: hidden; }
.metric-card::after {
  content: "";
  position: absolute;
  right: -38px;
  top: -38px;
  width: 104px;
  height: 104px;
  border-radius: 999px;
  background: rgba(109,61,242,0.07);
}
.metric-label { color: #344054; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
.metric-value { font-size: 26px; font-weight: 850; margin-top: 8px; letter-spacing: -0.03em; color: var(--primary-2); }
.metric-note { color: var(--muted); font-size: 12px; margin-top: 6px; max-width: 95%; }
.panel { margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow); }
.panel-header {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(250,251,255,0.96));
}
.panel-title { margin: 0; font-weight: 850; font-size: 15px; letter-spacing: -0.01em; color: #101828; }
.panel-body { padding: 16px 18px; }

.form-label { color: #344054; font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.form-control, .form-select {
  border-color: var(--border-strong);
  border-radius: 12px;
  min-height: 40px;
  color: #101828;
  box-shadow: none !important;
}
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(109,61,242,0.12) !important; }
.btn { border-radius: 12px; font-weight: 800; border-width: 1px; }
.btn-sm { border-radius: 10px; padding: 0.42rem 0.72rem; }
.btn-primary, .btn-success, .btn-info, .btn-dark { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .btn-success:hover, .btn-info:hover, .btn-dark:hover { background: #5b2ee1; border-color: #5b2ee1; color: #fff; }
.btn-outline-primary { color: var(--primary); border-color: #d8c8ff; background: #fff; }
.btn-outline-primary:hover { color: #fff; background: var(--primary); border-color: var(--primary); }
.btn-warning { background: #fffaeb; border-color: #fedf89; color: #93370d; }
.btn-danger { background: var(--red); border-color: var(--red); }

.table-responsive { border-radius: 14px; }
.table { margin: 0; vertical-align: middle; }
.table > :not(caption) > * > * { padding: 0.82rem 0.78rem; border-bottom-color: var(--border); }
.table thead th {
  color: #475467;
  background: #f9fafb;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 850;
  white-space: nowrap;
}
.table tbody tr:hover { background: #faf7ff; }
.table code { color: #344054; background: #f2f4f7; padding: 3px 6px; border-radius: 8px; font-size: 12px; }
.table-light td, tr.table-light td { background: #faf7ff !important; color: #101828; font-weight: 700; }
.badge-soft { border-radius: 999px; padding: 6px 10px; font-weight: 800; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-yellow { background: var(--yellow-soft); color: var(--yellow); }
.badge-blue { background: var(--blue-soft); color: #175cd3; }
.action-row { display:flex; gap:8px; flex-wrap:wrap; }
.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 9999; display: grid; gap: 10px; }
.toast-msg { background:#101828; color:white; border-radius:14px; padding:12px 14px; min-width:280px; box-shadow:0 18px 42px rgba(0,0,0,0.22); }
pre.json, .console-box {
  background:#101828;
  color:#e5e7eb;
  padding:14px;
  border-radius:14px;
  overflow:auto;
  white-space:pre-wrap;
  word-break:break-word;
}
pre.json { max-height:500px; }
.console-box { max-height:140px; }
.modal-content { border: 0; border-radius: 20px; box-shadow: 0 24px 80px rgba(15,23,42,0.25); }
.modal-header, .modal-footer { border-color: var(--border); }
.modal-title { font-weight: 850; letter-spacing: -0.02em; }
.alert { border-radius: 14px; border: 1px solid var(--border); }
.text-muted { color: var(--muted) !important; }

/* Experiment dashboard polish: use the same card system for the new result UI. */
.exp-filter-bar, .dashboard-filter-bar {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 14px;
  margin-bottom: 16px;
}
.download-btn { white-space: nowrap; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; padding: 14px; }
  .brand { margin-bottom: 12px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .sidebar a { white-space: nowrap; }
  .topbar { position: relative; flex-direction: column; align-items: flex-start; padding: 18px; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .content { padding: 18px; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr; }
  #site-filter { min-width: 100%; width: 100%; }

/* Experiment results on main dashboard */
.exp-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.exp-kpi-card .exp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.exp-kpi-card .metric-value { font-size: 22px; }
.exp-kpi-card .metric-value.variant { color: var(--primary); }
.exp-lift { margin-top: 10px; font-size: 12px; font-weight: 850; }
.exp-lift.good { color: var(--green); }
.exp-lift.bad { color: var(--red); }
.exp-tabs .nav-link { color: #475467; font-weight: 800; border: 0; border-bottom: 2px solid transparent; }
.exp-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
@media (max-width: 1320px) { .exp-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .exp-kpi-grid { grid-template-columns: 1fr; } }
  .topbar-actions .btn { width: 100%; }
}

/* Experiment Results dashboard */
.exp-kpi-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.exp-kpi-card .exp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.exp-kpi-card .metric-value { font-size: 22px; }
.exp-kpi-card .metric-value.variant { color: var(--primary); }
.exp-lift { margin-top: 10px; font-size: 12px; font-weight: 850; }
.exp-lift.good { color: var(--green); }
.exp-lift.bad { color: var(--red); }
.exp-tabs .nav-link { color: #475467; font-weight: 800; border: 0; border-bottom: 2px solid transparent; }
.exp-tabs .nav-link.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
@media (max-width: 1320px) { .exp-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .exp-kpi-grid { grid-template-columns: 1fr; } }

/* Exact Experiment Results dashboard layout */
.px-filter-panel,.px-card,.px-kpi-card{background:#fff;border:1px solid #e5e7f1;border-radius:18px;box-shadow:0 18px 45px rgba(20,22,50,.06)}
.px-filter-panel{padding:16px;margin-bottom:18px}.px-filter-row{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr)) auto;gap:12px;align-items:end}.px-filter-row+.px-filter-row{margin-top:12px;grid-template-columns:repeat(4,minmax(160px,1fr)) 1fr}.px-filter-row-single{grid-template-columns:minmax(130px,1fr) minmax(130px,1fr) minmax(130px,1fr) minmax(120px,1fr) minmax(120px,1fr) minmax(110px,.8fr) minmax(145px,1.1fr) auto auto;gap:10px;align-items:end}.px-filter span{display:block;font-size:12px;font-weight:800;color:#566177;margin-bottom:6px}.px-filter input,.px-filter select,.px-search-row input{width:100%;height:46px;border:1px solid #d9e0ee;border-radius:12px;padding:0 14px;background:#fff;color:#101827;font-size:14px}.px-filter-button{height:46px;border:0;border-radius:12px;background:#6f3ff5;color:#fff;font-weight:900;padding:0 24px}.px-clear-button{justify-self:end;height:46px;border:0;background:transparent;color:#6f3ff5;font-weight:800}.px-kpi-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px;margin-bottom:14px}.px-kpi-card{padding:16px}.px-kpi-title{font-weight:900;color:#111827;margin-bottom:10px}.px-info{display:inline-flex;align-items:center;justify-content:center;width:15px;height:15px;border:1px solid #9aa5bb;border-radius:50%;font-size:10px;color:#6b7280}.px-kpi-values{display:grid;grid-template-columns:1fr 1px 1fr;gap:14px;align-items:center}.px-kpi-values strong{font-size:20px;color:#1368ff}.px-kpi-values span{display:block;font-size:12px;color:#607089;margin-top:4px}.px-divider{height:38px;background:#e1e6f0}.px-kpi-lift{text-align:center;font-weight:900;font-size:13px;margin-top:8px}.good{color:#059669!important}.bad{color:#dc2626!important}.px-spark{height:22px;margin-top:9px;border-bottom:2px solid #e9edf6;position:relative}.px-spark span{display:block;height:3px;background:linear-gradient(90deg,#1677ff,#793cf4);border-radius:99px;position:absolute;bottom:3px}.px-chart-grid{display:grid;grid-template-columns:2fr 1fr 1.05fr;gap:14px;margin-bottom:14px}.px-table-grid{display:grid;grid-template-columns:1fr;gap:14px}.px-card{padding:14px;min-width:0}.px-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}.px-card-head h3{font-size:16px;margin:0;color:#111827;font-weight:900}.px-card-head p{margin:3px 0 0;color:#748096;font-size:12px}.px-mini-btn{border:1px solid #dfe5f1;border-radius:10px;background:#fff;color:#111827;height:34px;padding:0 12px;font-weight:800;font-size:12px;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}.px-download-icon{width:18px;height:18px;border-radius:999px;background:#f2f6ff;color:#6f3ff5;display:inline-flex;align-items:center;justify-content:center;font-size:14px;line-height:1;font-weight:900}.px-download-btn:hover{border-color:#c9d4ea;background:#fbfcff}.px-breakdown-card,.px-inventory-card{width:100%}.px-legend{font-size:12px;color:#566177;margin-bottom:10px}.px-legend span{display:inline-block;width:22px;height:3px;border-radius:20px;margin:0 5px 2px 12px}.px-legend .base,.px-trend-day .base{background:#1677ff}.px-legend .variant,.px-trend-day .variant{background:#793cf4}.px-trend-bars{height:210px;display:flex;gap:12px;align-items:end;border-left:1px solid #e8edf6;border-bottom:1px solid #e8edf6;padding:12px 8px 0}.px-trend-day{flex:1;text-align:center;height:100%;display:flex;flex-direction:column;justify-content:flex-end}.px-bars{height:170px;display:flex;gap:4px;align-items:end;justify-content:center}.px-bars i{display:block;width:8px;border-radius:8px 8px 0 0}.px-trend-day small{font-size:11px;color:#667085;margin-top:8px}.px-lift-chart{display:flex;flex-direction:column;gap:13px}.px-lift-row{display:grid;grid-template-columns:85px 1fr 58px;gap:8px;align-items:center;font-size:12px}.px-lift-row div{height:14px;background:#eef2f8;border-radius:99px;overflow:hidden}.px-lift-row b{display:block;height:100%;background:linear-gradient(90deg,#a78bfa,#6f3ff5);border-radius:99px}.px-lift-row em{text-align:right;font-style:normal;font-weight:800}.px-device-box{display:grid;grid-template-columns:155px 1fr;gap:12px;align-items:center}.px-donut{width:150px;height:150px;border-radius:50%;background:conic-gradient(#1368ff 0 58%,#793cf4 58% 88%,#14b8a6 88% 100%);display:grid;place-items:center}.px-donut span{width:90px;height:90px;border-radius:50%;background:#fff;display:grid;place-items:center;text-align:center;font-weight:900}.px-donut small{display:block;font-size:10px;color:#6b7280;font-weight:600}.px-device-box ul{margin:0;padding:0;list-style:none}.px-device-box li{display:grid;grid-template-columns:10px 1fr;gap:8px;margin-bottom:10px;font-size:12px}.px-device-box li b{width:9px;height:9px;border-radius:50%;background:#1368ff;margin-top:5px}.px-device-box li b.c1{background:#793cf4}.px-device-box li b.c2{background:#14b8a6}.px-device-box li em{grid-column:2;font-style:normal;color:#6b7280}.px-tabs{display:flex;gap:4px;border-bottom:1px solid #e8edf6;margin-bottom:10px}.px-tabs button{border:0;background:transparent;padding:10px 12px;font-weight:800;color:#566177;border-bottom:3px solid transparent}.px-tabs button.active{color:#6f3ff5;border-color:#6f3ff5}.px-table{width:100%;border-collapse:collapse;font-size:12px}.px-table th{background:#fafbff;color:#344054;text-align:left;font-weight:900;border-bottom:1px solid #e8edf6;padding:10px;white-space:nowrap}.px-table td{border-bottom:1px solid #edf1f7;padding:10px;vertical-align:top}.px-table td small{display:block;color:#667085}.px-search-row{display:flex;justify-content:flex-end;margin-bottom:10px}.px-search-row input{max-width:220px;height:38px}.px-empty,.px-empty-cell{color:#667085;text-align:center;padding:26px}.px-footnote{font-size:12px;color:#667085;margin:14px 0}.content{background:linear-gradient(180deg,#fbfbff 0,#f7f8fc 100%)}
@media(max-width:1400px){.px-filter-row-single{grid-template-columns:repeat(4,minmax(140px,1fr));}}
@media(max-width:1200px){.px-kpi-grid{grid-template-columns:repeat(2,1fr)}.px-chart-grid,.px-table-grid{grid-template-columns:1fr}.px-filter-row,.px-filter-row+.px-filter-row,.px-filter-row-single{grid-template-columns:repeat(2,1fr)}}
@media(max-width:700px){.px-kpi-grid,.px-filter-row,.px-filter-row+.px-filter-row{grid-template-columns:1fr}.px-device-box{grid-template-columns:1fr}.px-filter-button,.px-clear-button{width:100%;justify-self:stretch}}

/* PriceOptimiser sortable tables */
table th { cursor: pointer; user-select: none; white-space: nowrap; }
table th::after { content: " ↕"; opacity: .35; font-size: .85em; }
table th.po-sort-asc::after { content: " ↑"; opacity: .9; }
table th.po-sort-desc::after { content: " ↓"; opacity: .9; }


/* PriceOptimiser Admin v3 Authentication */
body.po-logged-out .main { margin-left: 0; width: 100%; }
body.po-logged-out .topbar { justify-content: center; text-align: center; }
.po-login-wrap { min-height: 70vh; display:flex; align-items:center; justify-content:center; padding:32px; }
.po-login-card { width: min(460px, 100%); background:#fff; border:1px solid #e4e8f2; border-radius:24px; box-shadow:0 20px 70px rgba(17,24,39,.10); padding:32px; }
.po-login-brand { display:flex; align-items:center; gap:16px; margin-bottom:24px; }
.po-login-brand h2 { margin:0; font-weight:800; }
.po-login-brand p { margin:0; color:#64748b; }
.po-login-logo { width:48px; height:48px; border-radius:14px; background:linear-gradient(135deg,#0d6efd,#7c3aed); box-shadow:0 14px 30px rgba(124,58,237,.30); }



/* Auth UI polish + no-dashboard-flash fix */
body.po-auth-boot .sidebar,
body.po-auth-boot .topbar,
body.po-auth-boot .content,
body.po-auth-boot .toast-root {
  visibility: hidden;
}
body.po-auth-boot::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(109,61,242,.10), transparent 34rem), linear-gradient(180deg,#fbfcff,#f7f8fc);
  z-index: 9998;
}
body.po-auth-boot::after {
  content: "Loading PriceOptimiser...";
  position: fixed;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  color: #475467;
  font-weight: 800;
  letter-spacing: -.02em;
}

.topbar {
  align-items: flex-start;
  padding: 20px 28px;
}
.topbar > div:first-child {
  min-width: 260px;
  padding-top: 3px;
}
.topbar-actions {
  display: grid !important;
  grid-template-columns: minmax(220px, 360px) auto auto;
  align-items: center;
  gap: 10px;
  justify-content: end;
  width: min(720px, 100%);
}
.topbar-actions #site-filter {
  min-width: 0;
  width: 100%;
  height: 42px;
  border-radius: 13px;
  border: 1px solid #d7deea;
  box-shadow: 0 8px 20px rgba(15,23,42,.04);
  font-weight: 650;
}
.topbar-actions > .btn {
  height: 42px;
  border-radius: 13px;
  padding: 0 18px;
  font-weight: 800;
  white-space: nowrap;
}
.po-auth-user-box {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
  background: #ffffff;
  border: 1px solid #d7deea;
  border-radius: 999px;
  padding: 4px 5px 4px 4px;
  box-shadow: 0 8px 20px rgba(15,23,42,.05);
  max-width: 310px;
}
.po-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-left: 2px;
}
.po-user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(109,61,242,.24);
  flex: 0 0 auto;
}
.po-auth-email {
  font-weight: 800;
  color: #344054;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}
.po-logout-btn {
  border: 0;
  background: #f2f4f7;
  color: #475467;
  border-radius: 999px;
  height: 32px;
  padding: 0 12px;
  font-weight: 850;
  line-height: 32px;
}
.po-logout-btn:hover {
  background: #fee4e2;
  color: #b42318;
}

body.po-logged-out .app-shell { display: block; }
body.po-logged-out .main { min-height: 100vh; }
body.po-logged-out .topbar {
  position: relative;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 22px 28px;
}
body.po-logged-out .topbar > div:first-child { padding: 0; }
body.po-logged-out .content { padding: 0; }
body.po-logged-out .po-login-wrap { min-height: calc(100vh - 104px); }
body.po-logged-out .po-login-card { margin-top: -20px; }

@media (max-width: 1100px) {
  .topbar { flex-direction: column; align-items: stretch; }
  .topbar-actions { width: 100%; grid-template-columns: 1fr auto auto; justify-content: stretch; }
}
@media (max-width: 760px) {
  .topbar-actions { grid-template-columns: 1fr; }
  .topbar-actions > .btn, .po-auth-user-box { width: 100%; justify-content: center; }
  .po-auth-email { max-width: 220px; display: inline-block; }
}



/* Inventory Yield dashboard */
.px-yield-layout { display:grid; grid-template-columns: 1.05fr .95fr; gap:18px; align-items:stretch; margin:0 0 22px; }
.px-yield-left { display:flex; flex-direction:column; gap:14px; min-width:0; }
.px-exec-summary { display:flex; gap:14px; align-items:flex-start; border:1px solid #c9f1df; background:linear-gradient(180deg,#f2fff8,#f8fffb); border-radius:18px; padding:16px 18px; color:#0f3f2b; box-shadow:0 12px 30px rgba(15,23,42,.05); }
.px-exec-summary.bad { border-color:#ffd5d5; background:linear-gradient(180deg,#fff7f7,#fffafa); color:#5f1f1f; }
.px-exec-icon { width:32px; height:32px; border-radius:50%; display:grid; place-items:center; border:2px solid currentColor; font-weight:900; flex:0 0 auto; }
.px-yield-section { background:#fff; border:1px solid #e3e8f3; border-radius:24px; padding:18px; margin:0; box-shadow:0 14px 36px rgba(15,23,42,.06); }
.px-yield-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
.px-yield-grid.compact { grid-template-columns:repeat(5,minmax(0,1fr)); }
.px-yield-card { border:1px solid #dfe7f3; border-radius:16px; padding:14px; background:linear-gradient(180deg,#fff,#fbfcff); min-height:94px; }
.px-yield-card span { display:block; color:#65728a; font-weight:800; margin-bottom:8px; font-size:13px; }
.px-yield-card b { display:block; font-size:22px; line-height:1.15; color:#111827; }
.px-yield-card small { display:block; margin-top:8px; color:#65728a; font-weight:700; }
.px-yield-card.hero { border-color:#c9dcff; background:linear-gradient(180deg,#f8fbff,#fff); }
.px-yield-card.positive b, .px-yield-card.positive .text-success { color:#079669 !important; }
.px-yield-card.negative b, .px-yield-card.negative .text-danger { color:#e03a4e !important; }
.px-yield-card.warn { border-color:#ffcfd6; background:linear-gradient(180deg,#fff7f8,#fff); }
.px-yield-tables { margin-top:0; }
.px-yield-tables.two-col { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.px-yield-map-card { min-height:100%; }
.px-map-wrap { width:100%; overflow:hidden; }
.px-map-bg { fill:#f8fbff; stroke:#dfe7f3; }
.px-map-land { fill:#eaf0fb; stroke:#d7e1f0; stroke-width:2; opacity:.96; }
.px-map-stroke { fill:none; stroke:#e3e8f3; stroke-width:2; }
.px-country-dot circle { fill-opacity:.78; stroke:#fff; stroke-width:2; filter: drop-shadow(0 6px 10px rgba(15,23,42,.18)); }
.px-country-dot text { font-size:10px; fill:#fff; font-weight:900; pointer-events:none; text-shadow:0 1px 2px rgba(0,0,0,.35); }
.px-map-empty { font-size:18px; fill:#65728a; font-weight:800; }
.px-map-scale { display:flex; align-items:center; gap:10px; color:#65728a; font-size:12px; font-weight:800; margin:8px 8px 0; }
.px-map-scale i { display:block; height:8px; flex:1; border-radius:999px; background:linear-gradient(90deg,#ef4444,#f4d35e,#10a66a); }
.px-rev-trend .px-trend-bars { min-height:220px; }
.px-bars.triple { gap:3px; }
.px-bars .total, .px-legend .total { background:#6d3df4; }
.px-bars.triple i { width:8px; border-radius:8px 8px 0 0; }
@media(max-width:1280px){.px-yield-layout{grid-template-columns:1fr}.px-yield-grid,.px-yield-grid.compact{grid-template-columns:repeat(3,minmax(0,1fr));}.px-yield-tables.two-col{grid-template-columns:1fr;}}
@media(max-width:760px){.px-yield-grid,.px-yield-grid.compact{grid-template-columns:1fr;}.px-exec-summary{flex-direction:column;}}



/* Dashboard yield table refinements */
.px-table-controls{display:flex;align-items:center;gap:14px;margin:8px 0 14px;color:#65718a;font-weight:700}
.px-table-controls select{border:1px solid #dbe4f3;border-radius:10px;padding:7px 28px 7px 10px;background:#fff;font-weight:800;color:#111827}
.px-lift-site-list{display:flex;flex-direction:column;gap:14px;max-height:470px;overflow:auto;padding-right:4px}
.px-lift-site{border:1px solid #e5edf8;border-radius:16px;padding:12px 14px;background:#fff}
.px-lift-site>b{display:block;margin-bottom:8px;color:#111827}
.px-lift-row{display:grid;grid-template-columns:92px 1fr 76px;align-items:center;gap:10px;margin:8px 0;color:#111827}
.px-lift-row i{height:16px;background:#edf2f9;border-radius:999px;overflow:hidden;display:block}
.px-lift-row i em{display:block;height:100%;background:linear-gradient(90deg,#a78bfa,#6d35f8);border-radius:999px}
.px-lift-row b.good{color:#059669}.px-lift-row b.bad{color:#dc2626}

/* 30 Jun follow-up: Trend/Lift fit and ad-unit-type carousel charts */
.px-chart-grid{grid-template-columns:minmax(0,7fr) minmax(280px,3fr)!important;align-items:stretch}
.px-chart-grid>.px-card-wide{grid-column:auto!important}
.px-trend-tabs{min-width:0}
.px-trend-tabs>input{position:absolute;opacity:0;pointer-events:none}
.px-trend-tabs>label{display:inline-flex;align-items:center;height:34px;padding:0 16px;margin:0 6px 12px 0;border:1px solid #dfe6f3;border-radius:999px;font-weight:900;font-size:12px;color:#566177;cursor:pointer;background:#fff}
#pxTrendEcpm:checked+label,#pxTrendRevenue:checked+label{background:#6f3ff5;color:#fff;border-color:#6f3ff5}
.px-trend-panel{display:none}.px-trend-tabs #pxTrendEcpm:checked~.px-trend-ecpm,.px-trend-tabs #pxTrendRevenue:checked~.px-trend-revenue{display:block}
.px-trend-carousel{overflow:hidden;min-width:0}.px-trend-scroll{display:flex;gap:14px;overflow-x:auto;overflow-y:hidden;padding:8px 4px 12px;border-left:1px solid #e8edf6;border-bottom:1px solid #e8edf6;scroll-snap-type:x proximity}
.px-trend-date{flex:0 0 138px;scroll-snap-align:start;text-align:center}.px-trend-pair{height:210px;display:grid;grid-template-columns:1fr 1fr;gap:6px;align-items:end}.px-trend-stack{height:100%;display:flex;flex-direction:column;justify-content:flex-end}.px-trend-stack>span{font-size:10px;color:#667085;margin-bottom:5px}.px-bars.type-bars{height:178px;gap:3px}.px-bars.type-bars i{width:9px;border-radius:7px 7px 0 0;display:block}.px-trend-date small{display:block;font-size:11px;color:#667085;margin-top:5px}.px-trend-date em{display:block;font-style:normal;font-size:11px;font-weight:900;margin-top:2px}.px-type-legend{line-height:1.9;white-space:normal}.px-type-legend span{width:18px;height:7px;margin-left:8px;border-radius:8px;vertical-align:middle}.px-type-legend .native.default,.px-bars .native.default{background:#2563eb}.px-type-legend .native.optimised,.px-bars .native.optimised{background:#93c5fd}.px-type-legend .rewarded.default,.px-bars .rewarded.default{background:#7c3aed}.px-type-legend .rewarded.optimised,.px-bars .rewarded.optimised{background:#c4b5fd}.px-type-legend .interstitial.default,.px-bars .interstitial.default{background:#059669}.px-type-legend .interstitial.optimised,.px-bars .interstitial.optimised{background:#86efac}
.px-lift-carousel{display:flex;gap:14px;overflow-x:auto;overflow-y:hidden;padding:2px 2px 12px;scroll-snap-type:x proximity}.px-lift-carousel .px-lift-site{flex:0 0 260px;scroll-snap-align:start}.px-lift-carousel .px-lift-row{grid-template-columns:78px 1fr 70px}
@media(max-width:1200px){.px-chart-grid{grid-template-columns:1fr!important}.px-trend-date{flex-basis:128px}}

/* Dashboard Yield v2 rebuild - 30 Jun */
.px-inventory-yield-v2{display:flex;flex-direction:column;gap:16px}.px-inventory-yield-v2 .px-yield-grid{display:grid;grid-template-columns:repeat(5,minmax(150px,1fr));gap:12px}.px-yield-card{border:1px solid #dde5f3;border-radius:14px;background:#fff;padding:14px 16px;min-height:86px}.px-yield-card span{display:block;color:#667085;font-size:12px;font-weight:900;margin-bottom:8px}.px-yield-card b{display:block;color:#101827;font-size:24px;line-height:1.1}.px-yield-card small{display:block;color:#667085;font-size:12px;font-weight:800;margin-top:8px}.px-two-col.px-trend-lift-row{display:grid;grid-template-columns:minmax(0,7fr) minmax(320px,3fr);gap:16px;align-items:stretch}.px-trend-card,.px-lift-card{min-height:390px}.px-slide-wrap{position:relative;min-width:0;padding:0 28px 28px}.px-slide-viewport{overflow:hidden;min-width:0}.px-slide-track{display:flex;transition:transform .25s ease;will-change:transform}.px-slide{flex:0 0 100%;min-width:100%;display:flex;gap:14px;align-items:stretch}.px-slide-arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:3;width:34px;height:34px;border:1px solid #dfe6f3;border-radius:50%;background:#fff;color:#111827;font-size:24px;line-height:1;box-shadow:0 6px 16px rgba(16,24,39,.10);cursor:pointer}.px-slide-arrow.left{left:0}.px-slide-arrow.right{right:0}.px-slide-dots{position:absolute;left:0;right:0;bottom:0;display:flex;justify-content:center;gap:7px}.px-slide-dots button{width:9px;height:9px;border:0;border-radius:99px;background:#cbd5e1;padding:0;cursor:pointer}.px-slide-dots button.active{width:22px;background:#6f3ff5}.px-trend-panel .px-slide{height:250px;border-left:1px solid #e8edf6;border-bottom:1px solid #e8edf6;padding:8px 0 8px 8px}.px-trend-date{flex:1 1 0;min-width:94px;text-align:center;display:flex;flex-direction:column;justify-content:flex-end}.px-trend-pair{height:210px;display:grid;grid-template-columns:1fr 1fr;gap:8px;align-items:end}.px-trend-stack{height:100%;display:flex;flex-direction:column;justify-content:flex-end}.px-trend-stack>span{font-size:10px;color:#667085;margin-bottom:5px}.px-bars.type-bars{height:175px;gap:3px;display:flex;align-items:end;justify-content:center}.px-bars.type-bars i{width:9px;border-radius:8px 8px 0 0}.px-trend-date small{font-size:11px;color:#667085;margin-top:7px}.px-type-legend{line-height:1.9;white-space:normal}.px-type-legend span{width:18px;height:7px;margin-left:8px;border-radius:8px;vertical-align:middle}.px-type-legend .native.default,.px-bars .native.default{background:#2563eb}.px-type-legend .native.optimised,.px-bars .native.optimised{background:#93c5fd}.px-type-legend .interstitial.default,.px-bars .interstitial.default{background:#059669}.px-type-legend .interstitial.optimised,.px-bars .interstitial.optimised{background:#86efac}.px-type-legend .rewarded.default,.px-bars .rewarded.default{background:#7c3aed}.px-type-legend .rewarded.optimised,.px-bars .rewarded.optimised{background:#c4b5fd}.px-lift-slideshow{padding-left:22px;padding-right:22px}.px-lift-slideshow .px-slide{display:block}.px-lift-one{border:1px solid #dfe6f3;border-radius:14px;background:#fff;padding:14px;min-height:285px}.px-lift-one h4{margin:0 0 10px;color:#111827;font-size:15px}.px-lift-metric{border-top:1px solid #eef2f8;padding:8px 0}.px-lift-metric:first-of-type{border-top:0}.px-lift-metric>b{display:block;font-size:12px;color:#344054;margin-bottom:5px}.px-lift-type-row{display:grid;grid-template-columns:92px 1fr 64px;gap:7px;align-items:center;font-size:11px;margin:4px 0}.px-type-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:5px}.px-type-dot.native,.px-lift-bar .native{background:#2563eb}.px-type-dot.interstitial,.px-lift-bar .interstitial{background:#059669}.px-type-dot.rewarded,.px-lift-bar .rewarded{background:#7c3aed}.px-lift-bar{height:11px;background:#eef2f8;border-radius:999px;overflow:hidden}.px-lift-bar em{display:block;height:100%;border-radius:999px}.px-lift-type-row strong{text-align:right;font-size:11px}.px-table-shell{min-width:0}.px-table-controls{display:flex;justify-content:space-between;align-items:center;margin:6px 0 10px;color:#667085;font-size:12px}.px-table-controls select{height:30px;border:1px solid #dfe6f3;border-radius:8px;background:#fff;padding:0 8px}.px-table-pager{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin-top:10px;color:#667085;font-size:12px}.px-table-pager button{width:30px;height:30px;border:1px solid #dfe6f3;border-radius:8px;background:#fff;font-size:18px;line-height:1;cursor:pointer}.px-table th{cursor:pointer;user-select:none}.px-table th span{color:#98a2b3;font-size:10px}.px-download-btn{border:1px solid #dfe6f3;border-radius:12px;background:#fff;color:#111827;height:38px;padding:0 14px;font-weight:900;font-size:12px}.px-card-wide{width:100%}@media(max-width:1300px){.px-two-col.px-trend-lift-row{grid-template-columns:1fr}.px-inventory-yield-v2 .px-yield-grid{grid-template-columns:repeat(2,minmax(150px,1fr))}}@media(max-width:900px){.px-inventory-yield-v2 .px-yield-grid{grid-template-columns:1fr}.px-slide{gap:8px}.px-trend-date{min-width:70px}.px-lift-type-row{grid-template-columns:82px 1fr 58px}}

/* Trend chart horizontal date-wise view - 01 Jul 2026 */
.px-trend-horizontal{padding:0 28px 30px;}
.px-trend-horizontal .px-slide{display:block;height:auto;min-height:430px;border-left:1px solid #e8edf6;border-bottom:1px solid #e8edf6;padding:8px 10px 14px 10px;}
.px-htrend{width:100%;min-width:0;display:flex;flex-direction:column;gap:8px;}
.px-htrend-axis,.px-htrend-row{display:grid;grid-template-columns:82px repeat(3,minmax(0,1fr));gap:12px;align-items:center;}
.px-htrend-axis{font-size:11px;color:#667085;font-weight:900;padding:0 4px 2px;border-bottom:1px solid #eef2f8;}
.px-htrend-axis b{text-align:left;}
.px-htrend-row{min-height:52px;padding:2px 4px;border-bottom:1px solid #f3f6fb;}
.px-htrend-row:last-child{border-bottom:0;}
.px-htrend-date{font-size:12px;font-weight:900;color:#344054;white-space:nowrap;}
.px-htrend-type{min-width:0;display:grid;grid-template-columns:42px minmax(0,1fr) minmax(0,1fr);gap:6px;align-items:center;}
.px-htrend-type small{display:none;color:#667085;font-weight:900;}
.px-hbar{position:relative;height:15px;border-radius:999px;background:#eef2f8;overflow:hidden;min-width:0;}
.px-hbar i{display:block;height:100%;border-radius:999px;min-width:0;}
.px-hbar em{position:absolute;right:5px;top:50%;transform:translateY(-50%);font-size:9px;line-height:1;font-style:normal;font-weight:900;color:#344054;text-shadow:0 1px 2px rgba(255,255,255,.8);max-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.px-hbar.native.default i{background:#2563eb}.px-hbar.native.optimised i{background:#93c5fd}
.px-hbar.interstitial.default i{background:#059669}.px-hbar.interstitial.optimised i{background:#86efac}
.px-hbar.rewarded.default i{background:#7c3aed}.px-hbar.rewarded.optimised i{background:#c4b5fd}
.px-custom-date{display:none;}
.px-filter-row-top .px-filter-button{align-self:end;min-width:170px;}
@media(max-width:1200px){.px-htrend-axis,.px-htrend-row{grid-template-columns:76px repeat(3,minmax(0,1fr));gap:8px}.px-hbar em{display:none}.px-htrend-type{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}}
@media(max-width:900px){.px-htrend-axis{display:none}.px-htrend-row{grid-template-columns:1fr}.px-htrend-type small{display:block}.px-htrend-type{grid-template-columns:86px 1fr 1fr}.px-trend-horizontal .px-slide{min-height:560px}.px-htrend-date{font-size:13px}}

/* Sites page action icons - 01 Jul 2026 */
.site-card-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.site-icon-btn{width:46px;height:46px;border:0;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;font-size:20px;font-weight:900;box-shadow:0 8px 20px rgba(17,24,39,.08);cursor:pointer;transition:transform .12s ease,box-shadow .12s ease,filter .12s ease}
.site-icon-btn:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(17,24,39,.14);filter:brightness(.98)}
.site-icon-btn:focus{outline:3px solid rgba(111,63,245,.20);outline-offset:2px}
.site-icon-btn.is-primary{background:#6f3ff5;color:#fff}
.site-icon-btn.is-success{background:#10a66a;color:#fff}
.site-icon-btn.is-warning{background:#ffca2c;color:#111827}
.site-icon-btn.is-dark{background:#111827;color:#fff}
.site-icon-btn.is-danger{background:#df2b22;color:#fff}

/* Site card action buttons - themed icons with visible hover tooltips */
.site-card-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.site-icon-btn{position:relative;width:46px;height:46px;border-radius:14px;display:inline-flex;align-items:center;justify-content:center;font-size:19px;font-weight:900;cursor:pointer;transition:transform .12s ease,box-shadow .12s ease,background .12s ease,border-color .12s ease;color:#6f3ff5;background:#f4efff;border:1px solid #d9ccff;box-shadow:0 8px 18px rgba(111,63,245,.10)}
.site-icon-btn:hover{transform:translateY(-1px);box-shadow:0 12px 24px rgba(111,63,245,.18);background:#ede5ff;border-color:#bfa7ff}
.site-icon-btn:focus{outline:3px solid rgba(111,63,245,.22);outline-offset:2px}
.site-icon-btn.is-primary{background:#6f3ff5;color:#fff;border-color:#6f3ff5}
.site-icon-btn.is-success,.site-icon-btn.is-warning,.site-icon-btn.is-dark{background:#f4efff;color:#6f3ff5;border-color:#d9ccff}
.site-icon-btn.is-danger{background:#fff1f1;color:#dc2626;border-color:#fecaca}
.site-icon-btn.is-danger:hover{background:#fee2e2;border-color:#fca5a5;box-shadow:0 12px 24px rgba(220,38,38,.12)}
.site-icon-btn[data-tooltip]::after{content:attr(data-tooltip);position:absolute;left:50%;bottom:calc(100% + 9px);transform:translateX(-50%) translateY(4px);background:#111827;color:#fff;border-radius:10px;padding:7px 10px;font-size:12px;line-height:1;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease;z-index:30;box-shadow:0 10px 22px rgba(17,24,39,.18)}
.site-icon-btn[data-tooltip]::before{content:"";position:absolute;left:50%;bottom:calc(100% + 3px);transform:translateX(-50%) translateY(4px);border:6px solid transparent;border-top-color:#111827;opacity:0;pointer-events:none;transition:opacity .12s ease,transform .12s ease;z-index:31}
.site-icon-btn[data-tooltip]:hover::after,.site-icon-btn[data-tooltip]:hover::before{opacity:1;transform:translateX(-50%) translateY(0)}


/* AI historical recommender UI */
.ai-recommendation-table td { vertical-align: top; }
.ai-evidence-table { min-width: 420px; font-size: 0.78rem; }
.ai-evidence-table th, .ai-evidence-table td { padding: 0.25rem 0.4rem; white-space: nowrap; }
.ai-recommendation-table small { line-height: 1.25; }
