:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-soft: #fafbfe;
  --ink: #171b26;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e7ebf2;
  --side: #151922;
  --side-2: #202633;
  --brand: #3157ff;
  --brand-2: #f71757;
  --brand-soft: #eef2ff;
  --good: #10a66a;
  --bad: #e11d48;
  --warn: #d97706;
  --shadow: 0 18px 44px rgba(24, 32, 56, .08);
  --soft-shadow: 0 8px 22px rgba(24, 32, 56, .055);
}

* { box-sizing: border-box; }

[hidden],
.is-filtered-out {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
}

a { color: var(--brand); text-decoration: none; }
button, input, select { font: inherit; letter-spacing: 0; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 14px;
  background: var(--side);
  color: #fff;
}

.logo {
  width: fit-content;
  border-radius: 10px;
  padding: 12px 18px;
  background: #ff0f55;
  box-shadow: 0 12px 28px rgba(247, 23, 87, .28);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .01em;
}

.logo span { opacity: .8; }

.side-action,
.side-search,
.sidebar nav button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.side-action {
  margin-top: 2px;
  background: var(--brand);
  box-shadow: 0 10px 24px rgba(49, 87, 255, .28);
}

.side-search { background: var(--side-2); color: #eef2ff; }

.sidebar nav {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.sidebar nav button {
  background: transparent;
  color: #aeb7c7;
}

.sidebar nav button.active,
.sidebar nav button:hover {
  background: #0f131b;
  color: #fff;
}

.nav-group {
  display: grid;
  gap: 5px;
}

.nav-group-toggle {
  position: relative;
}

.nav-group-toggle::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s ease;
  opacity: .72;
}

.nav-group-toggle.open::after,
.nav-group-toggle.active::after {
  transform: rotate(225deg) translateY(-1px);
}

.nav-submenu {
  display: none;
  gap: 4px;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,.1);
}

.nav-submenu.open {
  display: grid;
}

.sidebar nav .nav-submenu button {
  min-height: 36px;
  border-radius: 9px;
  padding-left: 12px;
  font-size: 13px;
  color: #98a2b3;
}

.sidebar nav .nav-submenu button.active,
.sidebar nav .nav-submenu button:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.sidebar nav button.growth-nav {
  margin-top: 4px;
  background: linear-gradient(135deg, #3157ff, #10a66a);
  color: #fff;
  box-shadow: 0 12px 28px rgba(49, 87, 255, .28);
}

.sidebar nav button.growth-nav.active,
.sidebar nav button.growth-nav:hover {
  background: linear-gradient(135deg, #2448e8, #07945d);
  color: #fff;
}

.sidebar-bottom {
  display: grid;
  gap: 7px;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 14px;
}

.sidebar-bottom span { color: #98a2b3; font-size: 12px; }
.sidebar-bottom b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sidebar-bottom small { color: #d0d6e2; line-height: 1.45; }
.sidebar-bottom button { border: 0; background: transparent; color: #ffcf5a; padding: 0; text-align: left; cursor: pointer; font-weight: 800; }

.app { min-height: 100vh; margin-left: 248px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  padding: 12px 22px;
}

.account-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.account-picker span,
label span {
  color: var(--faint);
  font-size: 11px;
  font-weight: 900;
}

select,
input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

select:focus,
input:focus {
  border-color: rgba(49, 87, 255, .55);
  box-shadow: 0 0 0 4px rgba(49, 87, 255, .09);
}

.period-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.period-form label {
  display: grid;
  gap: 5px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 15px;
  font-weight: 900;
  cursor: pointer;
}

.button.small {
  min-height: 36px;
  padding-inline: 13px;
  font-size: 12px;
}

.button.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(49, 87, 255, .22);
}

.button.secondary {
  background: var(--brand-soft);
  color: var(--brand);
}

.button.danger {
  background: #fff1f2;
  color: #e11d48;
}

.messages { margin: 18px 22px 0; }
.message { border: 1px solid #bbf7d0; border-radius: 12px; background: #ecfdf5; padding: 13px 15px; color: #166534; }

.tab-panel { display: none; padding: 22px; }
.tab-panel.active { display: block; }

.summary-strip,
.panel,
.metric-card,
.focus-card,
.empty-state,
.oauth-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--soft-shadow);
}

.summary-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
h3,
p { letter-spacing: 0; }

h1,
h2,
h3 { margin: 0; }
h1 { font-size: 30px; line-height: 1.15; font-weight: 900; }
h2 { font-size: 20px; font-weight: 900; }
h3 { font-size: 16px; font-weight: 900; }

.summary-strip p,
.panel-head p,
.focus-card p,
.action-card p,
.action-card small,
.muted {
  color: var(--muted);
}

.summary-strip p { max-width: 920px; line-height: 1.55; }

.goal-pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 9px 13px;
  font-weight: 900;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 14px;
  margin-top: 16px;
}

.metric-card,
.focus-card { padding: 18px; }

.metric-card span,
.focus-card span {
  display: block;
  color: #596579;
  font-size: 12px;
  font-weight: 900;
}

.metric-card strong,
.focus-card strong {
  display: block;
  margin: 13px 0 7px;
  color: #111827;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 900;
}

.metric-card em { font-style: normal; font-size: 13px; font-weight: 900; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.neutral { color: var(--faint); }

.focus-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-top: 14px;
}

.focus-card p { margin: 8px 0 0; line-height: 1.5; }

.panel {
  margin-top: 18px;
  overflow: hidden;
}

.panel-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}

.panel-head p { margin: 6px 0 0; }

.table-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.table-tools input { min-width: 240px; }

.cards-list {
  display: grid;
  gap: 11px;
  padding: 16px;
}

.action-card {
  display: grid;
  grid-template-columns: 290px minmax(0,1fr) 128px;
  gap: 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.action-card:hover {
  transform: translateY(-1px);
  border-color: #d6def0;
  box-shadow: var(--shadow);
}

.priority-3 { border-left-color: var(--bad); }
.priority-2 { border-left-color: var(--warn); }
.priority-1 { border-left-color: var(--good); }

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.money {
  text-align: right;
  color: var(--brand);
  font-weight: 900;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #fbfcff;
  color: #7c8798;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  user-select: none;
}

tbody tr:hover { background: #fbfcff; }

.copy-id {
  display: inline-flex;
  width: fit-content;
  margin-top: 8px;
  border: 1px solid #d9e1f2;
  border-radius: 999px;
  background: #f6f8ff;
  color: var(--brand);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.copy-id.inline {
  margin: 0 0 0 8px;
  vertical-align: middle;
}

.stack-item { padding: 7px 0; line-height: 1.45; }
.stack-item + .stack-item { border-top: 1px dashed var(--line); }
.actions { white-space: nowrap; }
.actions a + a { margin-left: 12px; }

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 18px;
}

.mini-row {
  display: grid;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
}

.mini-row span,
.mini-row small {
  color: #536078;
  line-height: 1.45;
}

.campaign-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: #344054;
}

.trend-grid { display: grid; gap: 14px; padding: 18px; }
.trend-row { display: grid; gap: 8px; }
.trend-bars { position: relative; height: 28px; overflow: hidden; border-radius: 999px; background: #f1f4f9; }
.trend-bars span,
.trend-bars em { position: absolute; inset: 0 auto 0 0; display: block; border-radius: 999px; }
.trend-bars span { background: rgba(49,87,255,.72); }
.trend-bars em { top: 14px; height: 14px; background: rgba(16,166,106,.86); }
.trend-row small { color: var(--muted); }

.account-grid {
  display: grid;
  grid-template-columns: minmax(300px, 420px) minmax(300px, 430px) 1fr;
  gap: 18px;
  padding: 18px;
}

.oauth-selection {
  display: grid;
  gap: 18px;
  margin: 0 18px 18px;
  border: 1px solid rgba(49,87,255,.14);
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff, #f6f8ff);
  box-shadow: var(--soft-shadow);
  padding: 20px;
}

.oauth-selection-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.oauth-selection-head p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.oauth-selection-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.oauth-selection-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.oauth-selection-form label {
  display: grid;
  gap: 6px;
  color: #4b5565;
  font-weight: 900;
}

.oauth-selection-form .full {
  grid-column: 1 / -1;
}

.oauth-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.oauth-authorization-list {
  display: grid;
  gap: 12px;
  margin: 0 18px 18px;
}

.oauth-authorization-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(49,87,255,.12);
  border-radius: 16px;
  background: linear-gradient(135deg, #ffffff, #f9fbff);
  box-shadow: var(--soft-shadow);
  padding: 16px 18px;
}

.oauth-authorization-copy {
  display: grid;
  gap: 6px;
}

.oauth-authorization-copy p,
.oauth-authorization-copy small {
  color: var(--muted);
  line-height: 1.5;
}

.oauth-card {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
}

.oauth-card p,
.oauth-note {
  color: var(--muted);
  line-height: 1.5;
}

.oauth-note {
  border-radius: 12px;
  background: #fff7ed;
  padding: 12px;
  color: #9a3412;
}

.account-form {
  display: grid;
  gap: 12px;
}

.account-form-intro {
  display: grid;
  gap: 6px;
}

.account-form-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.account-form label {
  display: grid;
  gap: 6px;
  color: #4b5565;
  font-weight: 900;
}

.account-form .full {
  grid-column: 1 / -1;
}

.account-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.account-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

.account-card.active {
  border-color: rgba(49,87,255,.55);
  background: #f6f8ff;
}

.account-card-main {
  display: grid;
  gap: 5px;
  color: var(--ink);
}

.account-card span,
.account-card small { color: var(--muted); }

.account-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-card-actions form {
  margin: 0;
}

.empty,
.empty-state { padding: 28px; color: var(--muted); }

.empty.small { padding: 12px; }
.filter-empty { border-top: 1px solid var(--line); }

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-toggle {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  color: #cbd5e1;
  cursor: pointer;
  transition: background .18s, transform .18s;
}

.sidebar-toggle::before {
  content: "";
  display: block;
  width: 9px;
  height: 9px;
  margin: 0 auto;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .22s ease;
}

.sidebar-toggle:hover { background: rgba(255,255,255,.1); }

.sidebar,
.app,
.sidebar nav button span,
.sidebar-bottom,
.logo span,
.nav-submenu {
  transition: width .22s ease, margin .22s ease, opacity .18s ease, transform .22s ease;
}

body.sidebar-collapsed .sidebar {
  width: 74px;
  padding-inline: 12px;
}

body.sidebar-collapsed .app { margin-left: 74px; }
body.sidebar-collapsed .logo { width: 42px; height: 42px; display: grid; place-items: center; padding: 0; overflow: hidden; }
body.sidebar-collapsed .logo span,
body.sidebar-collapsed .sidebar nav button span,
body.sidebar-collapsed .sidebar-bottom,
body.sidebar-collapsed .nav-submenu { display: none; }
body.sidebar-collapsed .sidebar-toggle::before { transform: rotate(225deg); }
body.sidebar-collapsed .sidebar nav button { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav-group-toggle::after { display: none; }

.status-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px 0;
}

.status-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #fff;
  color: #4b5565;
  padding: 10px 13px;
  cursor: pointer;
  font-weight: 900;
}

.status-filter b {
  border-radius: 999px;
  background: #eef2ff;
  color: var(--brand);
  padding: 2px 8px;
  font-size: 12px;
}

.status-filter.active,
.status-filter:hover {
  background: #f8faff;
  color: var(--brand);
}

.status-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.danger { background: #fff1f2; color: #e11d48; }
.status-pill.warning { background: #fff7ed; color: #d97706; }
.status-pill.success { background: #ecfdf5; color: #059669; }
.status-pill.neutral { background: #f2f4f7; color: #667085; }

.action-list { gap: 12px; }

.action-card {
  grid-template-columns: 150px 280px minmax(0,1fr) 160px;
  align-items: start;
}

.action-card-meta {
  display: grid;
  align-content: start;
  gap: 8px;
}

.rank {
  width: fit-content;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.action-card-title {
  display: grid;
  align-content: start;
  gap: 7px;
}

.action-card-title p { margin: 0; line-height: 1.42; }
.action-card-body { display: grid; gap: 8px; }
.action-card-body strong { font-size: 15px; }
.action-card-body p,
.action-card-body small { margin: 0; line-height: 1.48; }

.action-metrics {
  display: grid;
  gap: 8px;
  border-radius: 12px;
  background: #f8faff;
  padding: 12px;
  color: #667085;
}

.action-metrics span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.action-metrics b { color: var(--ink); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 16px;
  padding: 16px;
}

.trend-tools label {
  display: grid;
  gap: 5px;
}

.chart-card {
  min-height: 270px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
}

.chart-card span {
  color: #596579;
  font-size: 12px;
  font-weight: 900;
}

.chart-card strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.05;
}

.chart-card small { color: var(--muted); }
.chart-plot { min-height: 150px; }
.chart-plot svg { width: 100%; height: 150px; overflow: visible; }
.chart-plot .bars rect { fill: #eef2ff; }
.chart-plot polyline { stroke: var(--brand); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.chart-empty { display: grid; place-items: center; min-height: 150px; color: var(--faint); }

.trend-dashboard {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.trend-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}

.trend-metric-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--soft-shadow);
}

.trend-metric-card.active {
  border-color: rgba(49, 87, 255, .55);
  background: #f8faff;
  box-shadow: 0 16px 32px rgba(49, 87, 255, .12);
}

.trend-metric-card span {
  color: #596579;
  font-size: 12px;
  font-weight: 900;
}

.trend-metric-card strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.05;
}

.trend-metric-card em {
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
}

.trend-main {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.trend-main-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.trend-main-head p { margin: 6px 0 0; color: var(--muted); }

.trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trend-legend i {
  width: 18px;
  height: 4px;
  border-radius: 999px;
  background: var(--brand);
}

.trend-legend span + span i { background: #94a3b8; }

.trend-chart {
  position: relative;
  min-height: 320px;
}

.trend-chart svg { width: 100%; min-height: 320px; display: block; }
.trend-grid-line { stroke: #eef2f7; stroke-width: 1; }
.trend-axis-label,
.trend-x-label { fill: #98a2b3; font-size: 12px; font-weight: 800; }
.trend-average { stroke: #94a3b8; stroke-width: 2; stroke-dasharray: 7 7; }
.trend-bar { fill: #eef2ff; cursor: pointer; transition: fill .16s; }
.trend-bar:hover { fill: #dbe4ff; }
.trend-line { stroke: var(--brand); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.trend-dot { fill: #fff; stroke: var(--brand); stroke-width: 4; cursor: pointer; }

.trend-tooltip {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 4px;
  min-width: 148px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #111827;
  color: #fff;
  padding: 10px 12px;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.trend-tooltip span { color: #cbd5e1; font-size: 12px; }

.trend-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.trend-table { min-width: 760px; }

.growth-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  padding: 16px;
}

.growth-summary-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--soft-shadow);
}

.growth-summary-card span {
  color: #596579;
  font-size: 12px;
  font-weight: 900;
}

.growth-summary-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 28px;
}

.growth-summary-card p { margin: 0; color: var(--muted); line-height: 1.45; }

.growth-table th,
.growth-table td { font-size: 13px; }

.growth-type,
.growth-score {
  display: inline-flex;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
}

.growth-score { background: #eef2ff; color: var(--brand); }

.campaign-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.campaign-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.campaign-card-head {
  display: grid;
  grid-template-columns: minmax(320px,1fr) minmax(520px,1.4fr);
  gap: 18px;
  padding: 18px;
}

.campaign-card-head h3 {
  margin: 9px 0 4px;
  line-height: 1.3;
}

.campaign-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 10px;
}

.campaign-kpis span {
  display: grid;
  gap: 5px;
  border-radius: 12px;
  background: #f8faff;
  padding: 12px;
  color: #667085;
  font-size: 12px;
}

.campaign-kpis b {
  color: var(--ink);
  font-size: 18px;
}

.issue-details {
  border-top: 1px solid var(--line);
  background: #fbfcff;
}

.issue-details summary {
  padding: 14px 18px;
  cursor: pointer;
  color: var(--brand);
  font-weight: 900;
}

.issue-list {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.issue-card {
  position: relative;
  display: grid;
  grid-template-columns: 118px minmax(180px,.8fr) minmax(220px,1fr) minmax(260px,1.2fr) 100px;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.issue-card.priority-3 { border-left-color: var(--bad); }
.issue-card.priority-2 { border-left-color: var(--warn); }
.issue-card.priority-1 { border-left-color: var(--good); }
.issue-card p,
.issue-card small { margin: 0; color: var(--muted); line-height: 1.42; }
.issue-card em { color: var(--brand); font-style: normal; font-weight: 900; text-align: right; }

.segment-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 0;
}

.segment-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #fff;
  color: #667085;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 900;
}

.segment-tabs button.active {
  background: #f8faff;
  color: var(--brand);
}

.segment-tabs b {
  border-radius: 999px;
  background: #eef2ff;
  color: var(--brand);
  padding: 2px 8px;
  font-size: 12px;
}

.segment-panel { display: none; }
.segment-panel.active { display: block; }
.segment-table th,
.segment-table td,
#query-table th,
#query-table td { font-size: 13px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  border-radius: 12px;
  background: #111827;
  box-shadow: var(--shadow);
  color: #fff;
  padding: 10px 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: .2s;
}

.toast.show { opacity: 1; transform: translateY(0); }

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #f6f7fb;
}

.login-card {
  width: min(430px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 32px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #ff0f55;
  color: #fff;
  font-weight: 900;
}

.login-card p { color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.login-card label { display: grid; gap: 6px; color: #4b5565; font-weight: 900; }

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .focus-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .account-grid { grid-template-columns: 1fr 1fr; }
  .account-list { grid-column: 1 / -1; }
  .action-card { grid-template-columns: 130px minmax(220px,.8fr) minmax(0,1fr); }
  .action-metrics { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0,1fr)); }
  .campaign-card-head { grid-template-columns: 1fr; }
  .issue-card { grid-template-columns: 110px minmax(180px,1fr) minmax(260px,1.3fr); }
  .issue-card small,
  .issue-card em { grid-column: 2 / -1; text-align: left; }
}

@media (max-width: 980px) {
  .sidebar { position: static; width: auto; }
  .app { margin-left: 0; }
  body.sidebar-collapsed .app { margin-left: 0; }
  .topbar,
  .summary-strip,
  .panel-head { align-items: stretch; flex-direction: column; }
  .split,
  .account-grid { grid-template-columns: 1fr; }
  .oauth-selection-head,
  .oauth-selection-form { grid-template-columns: 1fr; }
  .oauth-selection-head { flex-direction: column; }
  .oauth-selection-meta { justify-content: flex-start; }
  .oauth-authorization-card { flex-direction: column; align-items: flex-start; }
  .action-card { grid-template-columns: 1fr; }
  .dashboard-grid,
  .campaign-kpis,
  .trend-metric-grid,
  .growth-summary { grid-template-columns: 1fr 1fr; }
  .action-metrics { grid-template-columns: 1fr; }
  .issue-card { grid-template-columns: 1fr; }
  .issue-card small,
  .issue-card em { grid-column: auto; }
  .money { text-align: left; }
}

@media (max-width: 680px) {
  .tab-panel { padding: 14px; }
  .kpi-grid,
  .focus-grid,
  .trend-metric-grid,
  .growth-summary { grid-template-columns: 1fr; }
}
