/* MIA — Marketing Intelligence for ALL-INKL.COM
   Pink & turquoise modern SaaS design system. Light mode. */

:root {
  --pink: #ec4899;
  --pink-soft: #fce7f3;
  --pink-deep: #db2777;
  --teal: #06b6d4;
  --teal-soft: #cffafe;
  --teal-deep: #0e9aaf;
  --ink: #1e293b;
  --ink-soft: #64748b;
  --ink-faint: #94a3b8;
  --bg: #f7f8fc;
  --card: #ffffff;
  --line: #e9edf5;
  --good: #10b981;
  --bad: #ef4444;
  --pastel-green: #bbf7d0;
  --pastel-yellow: #fde68a;
  --pastel-orange: #fed7aa;
  --pastel-red: #fecaca;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(30, 41, 59, .04), 0 8px 24px -12px rgba(30, 41, 59, .12);
  --grad: linear-gradient(135deg, var(--pink), var(--teal));
  font-size: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
}
a { color: var(--teal-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; }

/* ---------------- shell ---------------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 40;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; background: var(--grad); flex-shrink: 0;
  box-shadow: 0 4px 12px -2px rgba(236, 72, 153, .4);
}
.brand strong { font-size: 19px; display: block; line-height: 1.1; }
.brand small { color: var(--ink-soft); font-size: 10.5px; line-height: 1.25; display: block; }
.sidebar nav { flex: 1; padding: 8px 12px; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--ink-soft); font-weight: 500; font-size: 13.5px; margin-bottom: 2px;
}
.sidebar nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.sidebar nav a.active { background: linear-gradient(135deg, var(--pink-soft), var(--teal-soft)); color: var(--ink); font-weight: 700; }
.ni { width: 20px; text-align: center; opacity: .8; }
.sidebar-foot { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar-foot small { color: var(--ink-soft); display: block; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; }
.logout { margin-left: auto; font-size: 16px; color: var(--ink-faint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 20px 26px 40px; flex: 1; }
.page-title { font-size: 24px; margin: 6px 0 18px; }
.page-title .title-country {
  color: var(--teal-deep); font-size: 19px; vertical-align: 2px; white-space: nowrap;
}
.flag-svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(30, 41, 59, .12); vertical-align: -2px; }
.app-foot { padding: 14px 26px; color: var(--ink-faint); font-size: 12px; border-top: 1px solid var(--line); }

/* ---------------- topbar ---------------- */
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 12px 26px;
  background: rgba(255, 255, 255, .85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.burger { display: none; background: none; border: none; font-size: 20px; cursor: pointer; }
.search-wrap { position: relative; flex: 1; max-width: 480px; }
.search-wrap input {
  width: 100%; padding: 9px 14px 9px 36px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 12px center no-repeat;
  font-size: 13.5px; outline: none;
}
.search-wrap input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-soft); }
.search-results {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); max-height: 340px; overflow-y: auto; z-index: 60;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 9px 14px; font-size: 13px; color: var(--ink); border-bottom: 1px solid var(--line); }
.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--bg); text-decoration: none; }
.search-results a small { color: var(--ink-faint); display: block; font-size: 11px; }
.topbar-actions { display: flex; gap: 8px; margin-left: auto; }
.icon-btn {
  position: relative; background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 7px 11px; cursor: pointer; font-size: 14px;
}
.icon-btn:hover { border-color: var(--teal); }
.alert-dot {
  position: absolute; top: -6px; right: -6px; background: var(--pink); color: #fff; font-size: 10px;
  border-radius: 999px; padding: 1px 5px; font-weight: 700;
}

/* dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 8px); min-width: 300px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 70; padding: 6px;
}
.menu-right { right: 0; }
.dropdown.open .dropdown-menu { display: block; }
.dd-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); padding: 8px 10px 4px; font-weight: 700; }
.dd-item { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--ink); }
.dd-item:hover { background: var(--bg); text-decoration: none; }
.dd-empty { padding: 10px; font-size: 12.5px; color: var(--ink-faint); }
.dd-form { padding: 8px 10px; border-top: 1px solid var(--line); margin-top: 4px; display: grid; gap: 6px; }
.dd-form input[type=text] { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.sev { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sev-high { background: var(--bad); }
.sev-med { background: #f59e0b; }

/* ---------------- filter bar ---------------- */
.filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 26px; background: var(--card); border-bottom: 1px solid var(--line);
}
.filterbar form { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.filterbar label { font-size: 11px; color: var(--ink-faint); font-weight: 600; display: grid; gap: 2px; }
.filterbar select {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg);
  font-size: 13px; color: var(--ink); min-width: 130px;
}
.clear-filters { font-size: 12px; color: var(--pink-deep); align-self: end; padding-bottom: 6px; }
.period-note { font-size: 12px; color: var(--ink-faint); }

/* ---------------- cards & grids ---------------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.card h2 { font-size: 15px; margin: 0 0 4px; }
.card .sub { color: var(--ink-soft); font-size: 12.5px; margin: 0 0 14px; }
.grid { display: grid; gap: 16px; margin-bottom: 18px; }
.grid .card { margin-bottom: 0; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g23 { grid-template-columns: 2fr 1fr; }
.g32 { grid-template-columns: 1fr 2fr; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 17px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--grad); }
.kpi .k-label { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .k-value { font-size: 23px; font-weight: 550; letter-spacing: -.01em; margin: 3px 0 2px; }
.kpi .k-foot { font-size: 12px; color: var(--ink-faint); display: flex; gap: 8px; align-items: center; }
.kpi.accent-pink::before { background: var(--pink); }
.kpi.accent-teal::before { background: var(--teal); }

/* icon KPI tiles with color surround (Executive Overview) */
.kpis-viz { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.kpi-viz {
  padding: 15px 16px 13px;
  border: 1px solid var(--line);
  border: 1px solid color-mix(in srgb, var(--kc, #94a3b8) 28%, #fff);
  background: #fff;
}
.kpi-viz::before { display: none; }
.kpi-viz .kpi-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.kpi-viz .kpi-ic {
  width: 40px; height: 40px; border-radius: 12px; background: var(--kbg, var(--bg)); color: var(--kc, var(--ink));
  display: grid; place-items: center; flex-shrink: 0;
}
.kpi-viz .kpi-ic svg { width: 22px; height: 22px; }
.kpi-viz .k-label { line-height: 1.25; color: var(--ink-soft); }
.kpi-viz .k-value { font-size: 24px; margin: 0 0 2px; }
.kpi-viz .k-foot { margin-bottom: 0; }
.kpi-viz:hover .kpi-ic { transform: scale(1.06); transition: transform .15s; }

/* plain white KPI boxes: no accent bar unless a platform is focused */
.kpis-plain:not(.kpis-plat) .kpi::before { display: none; }

/* KPI row adopts the focused platform's color (Campaign Center) */
.kpis-plat .kpi { border: 1.5px solid var(--pc, var(--line)); }
.kpis-plat .kpi::before,
.kpis-plat .kpi.accent-pink::before,
.kpis-plat .kpi.accent-teal::before { background: var(--pc, var(--grad)); }

/* force a KPI row onto one line regardless of tile count (wraps on small screens) */
.kpis-oneline { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.kpis-oneline .kpi { min-width: 0; padding: 14px 15px; }
.kpis-oneline .k-value { font-size: 20px; white-space: nowrap; }
.kpis-oneline .k-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1150px) { .kpis-oneline { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 620px) { .kpis-oneline { grid-template-columns: repeat(2, 1fr); } }

.delta { font-weight: 700; font-size: 11.5px; padding: 2px 7px; border-radius: 999px; }
.delta.up { color: #067a5b; background: #d9f5ea; }
.delta.down { color: #b91c1c; background: #fee2e2; }
.delta.neutral { color: var(--ink-faint); background: var(--bg); }

/* highlight tiles (best campaign etc.) */
.hero-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.hero-tile {
  border-radius: var(--radius); padding: 16px 18px; color: var(--ink); position: relative; overflow: hidden;
  box-shadow: var(--shadow); background: #fff; border: 1px solid var(--line);
}
.hero-tile.t1 { border-color: #f9a8d4; background: #fdeaf3; }
.hero-tile.t2 { border-color: #67e8f9; background: #e2fbff; }
.hero-tile.t3 { border-color: #c4b5fd; background: #f0ecfe; }
.hero-tile.t1 .ht-label { color: var(--pink-deep); }
.hero-tile.t2 .ht-label { color: var(--teal-deep); }
.hero-tile.t3 .ht-label { color: #7c3aed; }
.hero-tile .ht-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .85; }
.hero-tile .ht-value { font-size: 17px; font-weight: 600; margin: 4px 0 2px; }
.hero-tile .ht-sub { font-size: 12.5px; opacity: .75; }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint);
  padding: 9px 10px; border-bottom: 2px solid var(--line); white-space: nowrap; font-weight: 700;
}
table.data th a { color: inherit; }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data tbody tr:hover { background: #fbfcff; }
table.data tbody tr:nth-child(even) { background: #fafbfe; }
table.data tbody tr:nth-child(even):hover { background: #f4f7fd; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data th.num { text-align: right; }
table.data a.row-link { font-weight: 600; color: var(--ink); }
table.data a.row-link:hover { color: var(--pink-deep); }
.mini { color: var(--ink-faint); font-size: 11.5px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.badge-teal { background: var(--teal-soft); color: var(--teal-deep); }
.badge-pink { background: var(--pink-soft); color: var(--pink-deep); }
.badge-gray { background: var(--bg); color: var(--ink-soft); }
.badge-green { background: var(--pastel-green); color: #14532d; }
.badge-yellow { background: var(--pastel-yellow); color: #713f12; }
.badge-orange { background: var(--pastel-orange); color: #7c2d12; }
.badge-red { background: var(--pastel-red); color: #7f1d1d; }

/* marketing score ring */
.score {
  --deg: 0deg; width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  background: conic-gradient(var(--sc, #86efac) var(--deg), #eef1f7 0);
}
.score i { width: 30px; height: 30px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 11.5px; }
.sc-great { --sc: #6ee7b7; }
.sc-good { --sc: #fcd34d; }
.sc-ok { --sc: #fdba74; }
.sc-low { --sc: #fca5a5; }
.score-lg { width: 74px; height: 74px; }
.score-lg i { width: 56px; height: 56px; font-size: 20px; }

/* ---------------- funnel ---------------- */
.funnel { display: grid; gap: 6px; }
.funnel-stage { display: grid; grid-template-columns: 130px 1fr 110px; align-items: center; gap: 12px; }
.funnel-stage .fs-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-align: right; }
.funnel-stage .fs-bar-wrap { background: var(--bg); border-radius: 10px; height: 34px; overflow: hidden; }
.funnel-stage .fs-bar {
  height: 100%; border-radius: 10px; background: var(--grad); min-width: 2.5%;
  display: flex; align-items: center; justify-content: flex-end; padding-right: 10px;
  color: #fff; font-weight: 700; font-size: 12.5px; text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.funnel-stage .fs-value { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.funnel-conv { text-align: center; font-size: 11.5px; color: var(--ink-faint); padding: 0; margin: -2px 0; }
.funnel-conv b { color: var(--teal-deep); }

/* ---------------- charts ---------------- */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-soft); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* progress bars in tables */
.pbar { background: var(--bg); border-radius: 999px; height: 8px; min-width: 90px; overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }

/* ---------------- tile map ---------------- */
.tilemap { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; max-width: 720px; }
.tile {
  aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; text-align: center;
  font-size: 10.5px; font-weight: 700; cursor: pointer; position: relative; color: var(--ink);
  border: 1px solid rgba(30,41,59,.06); transition: transform .12s;
}
.tile:hover { transform: scale(1.08); z-index: 5; }
.tile small { display: block; font-weight: 600; font-size: 9px; opacity: .7; }
.tile .flag { font-size: 16px; display: block; }
.tile-tip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 11px; font-weight: 500; border-radius: 8px; padding: 7px 10px;
  white-space: nowrap; z-index: 20;
}
.tile:hover .tile-tip { display: block; }
.tile-empty { background: transparent; border: none; cursor: default; }
.tile-empty:hover { transform: none; }

/* ---------------- platform grouping (Campaign Center) ---------------- */
.plat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 18px; }
.plat-card {
  display: block; background: var(--card); border: 1.5px solid var(--pc, var(--line)); border-top-width: 4px;
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
  transition: transform .12s, box-shadow .12s;
}
.plat-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 28px -12px var(--pc, rgba(30, 41, 59, .25)); }
.plat-card.plat-active { outline: 2px solid var(--pc); background: #fbfcff; background: color-mix(in srgb, var(--pc) 5%, #fff); }
.plat-head-line { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 14px; }
.plat-logo {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
  background: var(--pc, var(--teal)); color: #fff; font-size: 11px; font-weight: 800; flex-shrink: 0;
}
.plat-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.plat-numbers small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); font-weight: 700; }
.plat-numbers b { font-size: 13px; }
tr.plat-row td {
  background: #f3f6fb !important;
  background: color-mix(in srgb, var(--pc) 9%, #fff) !important;
  border-left: 3px solid var(--pc); border-bottom: 1px solid var(--line);
  padding: 9px 10px; font-size: 13px;
}
tr.plat-row .plat-logo { width: 22px; height: 22px; font-size: 10px; vertical-align: middle; margin-right: 8px; }
tr.plat-row .plat-row-stats { color: var(--ink-soft); font-size: 12px; margin-left: 10px; }

/* ---------------- creative previews (ad mockups) ---------------- */
.creative {
  width: 100%; max-width: 330px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow); font-size: 12.5px;
}
.creative .cr-head { display: flex; gap: 9px; align-items: center; padding: 9px 11px; }
.creative .cr-head small { display: block; color: var(--ink-faint); font-size: 10.5px; }
.creative .cr-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--grad); flex-shrink: 0; }
.creative .cr-dots { margin-left: auto; color: var(--ink-faint); font-weight: 700; }
.creative .cr-text { padding: 0 11px 9px; color: var(--ink); }
.creative .cr-media {
  aspect-ratio: 1; display: grid; place-items: center; color: #fff; text-align: center;
  padding: 0; position: relative; overflow: hidden;
}
.creative .cr-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.creative .cr-media.cr-banner { aspect-ratio: 1.91; }
.creative .cr-media.cr-video { aspect-ratio: 16/9; }
.creative .cr-media.cr-vert { aspect-ratio: 4/5; text-align: left; }
.creative .cr-media.cr-pin { aspect-ratio: 2/3; border-radius: 0; }
.creative .cr-copy { padding: 16px; }
.creative .cr-copy h4 { margin: 0 0 6px; font-size: 19px; letter-spacing: -.01em; text-shadow: 0 1px 3px rgba(0,0,0,.2); }
.creative .cr-copy p { margin: 0 0 12px; font-size: 12.5px; opacity: .92; }
.creative .cr-cta { background: #fff; color: var(--ink); border-radius: 999px; padding: 5px 13px; font-weight: 800; font-size: 11.5px; display: inline-block; }
.creative .cr-foot { padding: 9px 11px; color: var(--ink-soft); font-size: 11.5px; }
.creative .cr-play {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 32px; background: rgba(0,0,0,.65);
  border-radius: 9px; display: grid; place-items: center; font-size: 15px; color: #fff;
}
.creative .cr-dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.75); border-radius: 4px; padding: 1px 5px; font-size: 10px; }
.creative .cr-yt-ad { position: absolute; left: 8px; bottom: 8px; background: #fbbf24; color: #1e293b; border-radius: 3px; padding: 1px 6px; font-size: 10px; font-weight: 800; }
.creative .cr-tt-rail { position: absolute; right: 8px; bottom: 52px; display: grid; gap: 10px; text-align: center; font-size: 16px; }
.creative .cr-tt-rail small { display: block; font-size: 9px; font-weight: 700; }
.creative .cr-tt-caption { position: absolute; left: 10px; right: 52px; bottom: 10px; font-size: 11px; line-height: 1.45; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.creative .cr-tt-sponsored { background: rgba(255,255,255,.25); border-radius: 4px; padding: 0 6px; font-size: 9.5px; font-weight: 700; }
.creative .cr-pin-save { position: absolute; top: 10px; right: 10px; background: #e11d48; color: #fff; border-radius: 999px; padding: 5px 13px; font-weight: 800; font-size: 11.5px; }
/* search ad mockup */
.creative.cr-search { padding: 13px 15px; max-width: 420px; }
.creative.cr-search .cr-ad-tag { font-weight: 800; font-size: 11px; color: var(--ink); margin-bottom: 4px; }
.creative.cr-search .cr-url { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.creative.cr-search .cr-fav { width: 16px; height: 16px; border-radius: 50%; background: var(--grad); display: inline-block; }
.creative.cr-search .cr-title { color: #1a0dab; font-size: 16px; font-weight: 500; margin: 3px 0; }
.creative.cr-search .cr-desc { color: #4d5156; font-size: 12.5px; line-height: 1.5; }
.creative.cr-search .cr-links { display: flex; gap: 8px; margin-top: 8px; }
.creative.cr-search .cr-links span { color: #1a0dab; font-size: 11.5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
/* thumbnail variant + gallery strip */
.creative.cr-thumb { max-width: 215px; font-size: 10.5px; border-radius: 11px; }
.creative.cr-thumb .cr-copy h4 { font-size: 14px; }
.creative.cr-thumb .cr-copy p { font-size: 10px; margin-bottom: 8px; }
.creative.cr-thumb .cr-cta { font-size: 9.5px; padding: 3px 9px; }
.creative.cr-thumb .cr-title { font-size: 13px; }
.creative.cr-thumb .cr-desc { font-size: 10.5px; }
.creative.cr-thumb .cr-avatar { width: 22px; height: 22px; }
.cr-gallery { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; }
.cr-gallery > a { flex-shrink: 0; text-decoration: none; color: var(--ink); }
.cr-gallery .cr-cap { max-width: 215px; font-size: 11px; font-weight: 600; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-gallery .cr-cap small { display: block; color: var(--ink-faint); font-weight: 500; }
.cr-gallery .cr-cap > span { overflow: hidden; text-overflow: ellipsis; }
.cr-gallery .cr-cap .score { flex-shrink: 0; width: 34px; height: 34px; }
.cr-gallery .cr-cap .score i { width: 25px; height: 25px; font-size: 10px; }
.cr-rank {
  position: absolute; top: -8px; left: -8px; z-index: 5; background: var(--grad); color: #fff;
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 800; box-shadow: var(--shadow);
}
/* uploaded screenshot cards */
.cr-uploads { display: flex; gap: 12px; flex-wrap: wrap; }
.cr-uploads figure { margin: 0; width: 150px; }
.cr-uploads img { width: 150px; height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }

/* ---------------- partner ID podium + creative toggle ---------------- */
.podium { border-top: 3px solid var(--line); }
.podium-0 { border-top-color: #eab308; }
.podium-1 { border-top-color: #94a3b8; }
.podium-2 { border-top-color: #d97706; }
.creative-toggle { margin-top: 10px; }
.creative-toggle summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--teal-deep);
  list-style: none; display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 9px;
}
.creative-toggle summary::-webkit-details-marker { display: none; }
.creative-toggle summary:hover { border-color: var(--teal); background: var(--bg); }
.creative-toggle[open] summary { background: var(--teal-soft); border-color: transparent; color: var(--teal-deep); }
.creative-reveal { margin-top: 10px; }

/* ---------------- bubble map ---------------- */
.bubblemap { position: relative; width: 100%; }
.bubblemap svg { display: block; width: 100%; height: auto; background: linear-gradient(160deg, #fdf7fb, #f3fbfd); border-radius: 14px; }
.bubble { cursor: pointer; }
.bubble circle { transition: r .5s cubic-bezier(.4, 0, .2, 1), fill-opacity .15s; }
.bubble:hover circle { fill-opacity: 1; stroke: var(--ink); }
.bubble text { text-anchor: middle; pointer-events: none; fill: #1e293b; }
.bubble .b-iso { font-size: 13px; font-weight: 800; }
.bubble .b-val { font-size: 11px; font-weight: 600; fill: #475569; }
.bubble-tip {
  display: none; position: absolute; z-index: 30; background: var(--ink); color: #fff;
  font-size: 11.5px; line-height: 1.55; border-radius: 10px; padding: 9px 12px; pointer-events: none;
  max-width: 240px; box-shadow: var(--shadow);
}
.bubble-metrics { display: flex; gap: 5px; flex-wrap: wrap; }
.bubble-metrics button {
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft); cursor: pointer;
}
.bubble-metrics button.active { background: var(--grad); color: #fff; border-color: transparent; }

/* heatmap mock */
.heatmap { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.heatmap i { aspect-ratio: 1.4; border-radius: 3px; display: block; }

/* prominent AI recommendations card (Executive Overview) */
.ai-highlight { border: 1px solid var(--line); background: #fff; }
.ai-highlight .insight { align-items: flex-start; }
.ai-highlight .insight:hover { box-shadow: 0 10px 26px -12px rgba(30, 41, 59, .3); transform: translateY(-2px); transition: all .12s; }

/* ---------------- insights ---------------- */
.insight { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow); }
.insight .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex-shrink: 0; }
.insight.opportunity .ic { background: var(--pastel-green); }
.insight.optimize .ic { background: var(--pastel-yellow); }
.insight.risk .ic { background: var(--pastel-red); }
.insight.alert .ic { background: var(--pastel-orange); }
.insight h3 { margin: 0 0 3px; font-size: 14px; }
.insight p { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.insight .go { margin-left: auto; align-self: center; flex-shrink: 0; }

/* buttons */
.btn {
  display: inline-block; background: var(--grad); color: #fff; border: none; border-radius: 10px;
  padding: 9px 18px; font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.btn:hover { opacity: .92; text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }

/* tabs */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--ink-soft); border-radius: 10px 10px 0 0; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--pink-deep); border-bottom-color: var(--pink); }
.tabs a:hover { text-decoration: none; color: var(--ink); }
.tabs-logo a { display: inline-flex; align-items: center; gap: 7px; }
.tabs-logo .int-logo { border-radius: 5px; }
.tabs-logo .tab-all { font-size: 15px; color: var(--ink-faint); }

/* definition rows */
.def { display: grid; grid-template-columns: 140px 1fr; gap: 4px 14px; font-size: 13px; }
.def dt { color: var(--ink-faint); font-weight: 600; }
.def dd { margin: 0; }

/* integrations */
.integr { display: flex; gap: 12px; align-items: center; }
.integr .logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 15px; flex-shrink: 0; }
.int-logo { flex-shrink: 0; display: block; }
.status-ok { color: #067a5b; font-weight: 700; font-size: 12px; }
.status-plan { color: var(--ink-faint); font-weight: 600; font-size: 12px; }

/* ---------------- login ---------------- */
.login-body {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, #fdf2f8 0%, #f0fdfa 55%, #ecfeff 100%);
}
.login-card { width: min(400px, 92vw); background: var(--card); border-radius: 22px; box-shadow: 0 20px 60px -20px rgba(236, 72, 153, .35); padding: 36px; }
.login-card .brand { padding: 0 0 18px; }
.login-card label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin: 14px 0 5px; }
.login-card input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-soft); }
.login-card .btn { width: 100%; margin-top: 20px; padding: 12px; }
.login-err { background: var(--pastel-red); color: #7f1d1d; border-radius: 10px; padding: 10px 13px; font-size: 13px; margin-top: 14px; }

/* ---------------- responsive ---------------- */
@media (max-width: 1100px) {
  .g3, .hero-tiles { grid-template-columns: 1fr 1fr; }
  .g23, .g32 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .sidebar { position: fixed; left: -260px; transition: left .2s; }
  .sidebar.open { left: 0; box-shadow: 0 0 0 100vmax rgba(0,0,0,.3); }
  .burger { display: block; }
  .g2, .g3, .hero-tiles { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .topbar, .filterbar { padding-left: 14px; padding-right: 14px; }
  .funnel-stage { grid-template-columns: 90px 1fr 80px; }
  .tilemap { grid-template-columns: repeat(6, 1fr); }
}

/* ---------------- print (PDF export) ---------------- */
@media print {
  .sidebar, .topbar, .no-print, .app-foot, .filterbar form { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .card, .kpi { box-shadow: none; break-inside: avoid; }
}
