:root {
  --bg: #111827;
  --shell: #182231;
  --shell-deep: #121a26;
  --card: #1b2636;
  --card-soft: #202d3f;
  --line: #304157;
  --line-soft: rgba(148, 163, 184, 0.18);
  --text: #f8fbff;
  --muted: #8fa3bd;
  --primary: #14b8a6;
  --primary-dk: #0f766e;
  --blue: #2f8df7;
  --green: #22c55e;
  --yellow: #f59e0b;
  --red: #ef4444;
  --purple: #b455d9;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  --radius: 8px;
}

:root[data-theme="light"] {
  --bg: #f4f7fb;
  --shell: #ffffff;
  --shell-deep: #f8fbff;
  --card: #ffffff;
  --card-soft: #eef4fb;
  --line: #cdd9e8;
  --line-soft: rgba(30, 41, 59, 0.14);
  --text: #0f172a;
  --muted: #58708c;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
}

* { box-sizing: border-box; }

html {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  scroll-behavior: auto;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 272px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  overflow-y: auto;
  padding: 18px 12px;
  background: var(--shell);
  border-right: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  overflow: hidden;
  background: #0b1220;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 999px;
}

.brand-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.side-nav {
  display: grid;
  gap: 3px;
}

.side-nav p {
  margin: 18px 0 7px;
  color: #52667e;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.side-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  color: #91a9c7;
  border-radius: 6px;
  font-weight: 750;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
  color: #fff;
  background: rgba(20, 184, 166, 0.15);
}

.nav-icon {
  width: 21px;
  color: #52667e;
  font-size: 11px;
  font-weight: 900;
}

.side-card {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.side-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.app-main {
  min-width: 0;
  margin-left: 272px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 24px;
  background: var(--shell-deep);
  border-bottom: 1px solid var(--line-soft);
}

.icon-button {
  width: auto;
  min-width: 56px;
  height: 38px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.icon-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.search-box {
  width: min(420px, 42vw);
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  color: var(--muted);
  background: #111827;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.search-box input {
  width: 100%;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.theme-toggle {
  gap: 8px;
  min-width: 136px;
}

.theme-toggle-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 15px;
  line-height: 1;
}

.date-control {
  position: relative;
  margin-inline: auto;
}

.date-toggle {
  min-width: 168px;
  display: grid;
  gap: 1px;
  justify-items: center;
  padding-block: 6px;
  border-color: #3d526d;
  background: rgba(17, 24, 39, 0.9);
}

.date-toggle span {
  font-size: 13px;
}

.date-toggle small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.date-popover {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 30;
  width: min(620px, calc(100vw - 32px));
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
  color: #d6d9dd;
  background: #151918;
  border: 1px solid #323735;
  border-radius: 8px;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
}

.date-popover[hidden] {
  display: none;
}

.date-shortcuts {
  display: grid;
  align-content: start;
  border-right: 1px solid #323735;
}

.date-shortcuts-title {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 10px 16px;
  color: #a9adaa;
  background: #151918;
  border-bottom: 1px solid #323735;
  font-size: 12px;
  font-weight: 900;
}

.date-shortcuts button {
  min-height: 40px;
  padding: 10px 16px;
  color: #c9cbc8;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  text-align: left;
  font-weight: 800;
}

.date-shortcuts button:hover {
  color: #fff;
  background: #1d2221;
}

.date-shortcuts button.active {
  color: #fff;
  background: #202625;
  box-shadow: inset 3px 0 0 var(--primary);
}

.date-picker-panel {
  display: grid;
  gap: 14px;
  padding: 14px 16px;
}

.date-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.date-inputs label {
  color: #a9adaa;
  font-size: 12px;
  font-weight: 800;
}

.date-inputs input {
  min-height: 38px;
  margin-top: 4px;
  color: #e8ece9;
  background: #1c2120;
  border-color: #454b48;
}

.date-inputs > span {
  padding-bottom: 9px;
  color: #a9adaa;
}

.date-calendar {
  display: grid;
  gap: 12px;
}

.date-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date-calendar-head strong {
  color: #d8dad8;
  font-size: 13px;
}

.date-month-actions {
  display: inline-flex;
  gap: 6px;
}

.date-month-actions button {
  width: 30px;
  min-height: 30px;
  display: grid;
  place-items: center;
  color: #cfd4d2;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 24px;
  line-height: 1;
}

.date-month-actions button:hover {
  color: #fff;
  background: #252b29;
}

.date-weekdays,
.date-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.date-weekdays span {
  color: #a7aaa7;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
}

.date-days button,
.date-days span {
  min-height: 32px;
  display: grid;
  place-items: center;
  color: #c9cbc8;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
}

.date-days button:hover {
  color: #fff;
  background: #252b29;
}

.date-days button.selected {
  color: #fff;
  background: #1967d2;
}

.date-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.page-wrapper {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.view-root {
  min-height: calc(100vh - 116px);
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-pretitle {
  margin-bottom: 2px;
  color: #7aa4d9;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.page-header h1 {
  margin-bottom: 6px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.08;
}

.page-header p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.page-actions {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.realtime-users-badge {
  min-width: 142px;
  padding: 12px 14px;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.realtime-users-badge span,
.realtime-users-badge small {
  display: block;
  color: #8db8ea;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.realtime-users-badge strong {
  display: block;
  margin: 4px 0;
  color: #fff;
  font-size: 30px;
  font-weight: 950;
  line-height: 1;
}

.realtime-users-badge.online {
  border-color: rgba(45, 212, 191, 0.56);
  background: linear-gradient(180deg, rgba(19, 78, 74, 0.52), rgba(15, 23, 42, 0.76));
}

.realtime-users-badge.online strong {
  color: #5eead4;
}

.meta-google-switch {
  min-width: min(100%, 360px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
}

.meta-google-switch strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.meta-google-switch span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.meta-google-switch .settings-result {
  grid-column: 1 / -1;
  min-height: 22px;
  font-size: 12px;
}

.segmented-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(54px, 1fr));
  padding: 3px;
  background: #111827;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.segmented-switch button {
  min-height: 34px;
  padding: 6px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-weight: 900;
}

.segmented-switch button.active {
  color: #051b16;
  background: var(--primary);
}

.segmented-switch button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.btn {
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 850;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}

.btn-primary:hover {
  background: #12a594;
}

.btn-outline {
  background: #141e2d;
  border-color: var(--line);
}

.btn-outline:hover {
  background: #1c2a3d;
}

.client-card,
.card,
.stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.client-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
  gap: 20px;
  margin-bottom: 16px;
  padding: 18px;
}

.client-card h2 {
  margin-bottom: 6px;
  font-size: 26px;
}

.client-card p {
  margin-bottom: 0;
  color: var(--muted);
}

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

.source-grid div {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.source-grid dt,
.stat-content span,
th,
label,
.metric-list span {
  color: #9fb4d2;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.source-grid dd {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  min-height: 118px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(42px, 64px);
  gap: 12px;
  align-items: center;
  padding: 18px;
  overflow: hidden;
}

.stat-card .mini-spark {
  width: 100%;
  min-width: 0;
  height: 36px;
  display: flex;
  align-items: end;
  gap: 4px;
  justify-self: end;
  pointer-events: none;
}

.mini-spark span {
  flex: 1;
  min-width: 3px;
  max-width: 8px;
  height: var(--h, 50%);
  border-radius: 999px;
  opacity: 0.9;
}

.mini-spark .teal { background: var(--primary); }
.mini-spark .green { background: var(--green); }
.mini-spark .blue { background: var(--blue); }
.mini-spark .red { background: var(--red); }
.mini-spark .yellow { background: var(--yellow); }
.mini-spark .purple { background: var(--purple); }

.stat-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.teal { color: var(--primary); background: rgba(20, 184, 166, 0.16); }
.green { color: var(--green); background: rgba(34, 197, 94, 0.14); }
.blue { color: var(--blue); background: rgba(47, 141, 247, 0.16); }
.red { color: var(--red); background: rgba(239, 68, 68, 0.16); }
.yellow { color: var(--yellow); background: rgba(245, 158, 11, 0.16); }
.purple { color: var(--purple); background: rgba(180, 85, 217, 0.16); }

.stat-content {
  min-width: 0;
  max-width: 100%;
}

.stat-content strong {
  display: block;
  margin-top: 3px;
  max-width: 100%;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.stat-content small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.spark {
  height: 34px;
  display: flex;
  align-items: end;
  gap: 4px;
}

.spark span {
  flex: 1;
  min-width: 3px;
  height: var(--h, 50%);
  background: var(--primary);
  border-radius: 999px;
  opacity: 0.85;
}

.progress-line {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  background: #142032;
  border-radius: 999px;
}

.progress-line span {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  background: currentColor;
  border-radius: inherit;
}

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

.subtab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.subtab-nav button {
  min-height: 36px;
  padding: 8px 12px;
  color: #9fb4d2;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
}

.subtab-nav button:hover,
.subtab-nav button.active {
  color: #fff;
  background: rgba(20, 184, 166, 0.16);
  border-color: rgba(20, 184, 166, 0.36);
}

.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }

.card {
  min-width: 0;
}

.module-card {
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 184, 166, 0.65);
  background: #1e2b3d;
}

.module-card .card-header {
  min-height: 142px;
  align-items: stretch;
  border-bottom: 0;
}

.module-card .card-header strong {
  align-self: flex-start;
  min-width: 116px;
  padding: 7px 9px;
  color: #dffcf8;
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: 6px;
  text-align: right;
  font-size: 13px;
}

.card-header {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.card-header h2 {
  margin-bottom: 2px;
  font-size: 16px;
}

.card-header p,
.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.card-header-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
}

.network-watch {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.network-watch-main {
  display: flex;
  gap: 6px;
}

.network-pill {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  min-width: 92px;
  padding: 6px 8px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.56);
}

.network-pill strong {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: #b7c7dc;
  background: rgba(148, 163, 184, 0.16);
  font-size: 15px;
  font-weight: 950;
}

.network-pill small {
  color: #9fb4cf;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.network-pill.on {
  border-color: rgba(34, 197, 94, 0.42);
  background: rgba(22, 101, 52, 0.18);
}

.network-pill.on strong {
  color: #0f172a;
  background: #63e6a1;
}

.network-pill.danger {
  border-color: rgba(239, 68, 68, 0.62);
  background: rgba(127, 29, 29, 0.34);
}

.network-pill.danger strong {
  color: #fff;
  background: #ef4444;
}

.network-watch p {
  max-width: 260px;
  color: #ffd27a;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.chart-card {
  min-height: 396px;
}

.chart-card .card-header {
  border-bottom: 0;
  padding-bottom: 8px;
}

#network-total {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.tab-group {
  display: inline-flex;
  padding: 3px;
  background: #121b29;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.tab-group button {
  min-height: 30px;
  padding: 5px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 12px;
}

.tab-group button.active {
  color: var(--text);
  background: #1f2c40;
}

.line-chart {
  position: relative;
  height: 196px;
  margin: 4px 18px 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(to top, rgba(148, 163, 184, 0.1) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(180deg, rgba(20, 184, 166, 0.14), rgba(20, 184, 166, 0.02));
  border-radius: 7px;
  overflow: hidden;
}

.line-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.analytics-trend {
  padding: 14px 16px 16px;
}

.analytics-single-day {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.analytics-day-bars {
  padding: 0;
}

.analytics-trend svg {
  width: 100%;
  min-height: 360px;
  display: block;
  overflow: visible;
}

.analytics-grid line {
  stroke: rgba(148, 163, 184, 0.16);
  stroke-width: 1;
}

.analytics-axis {
  stroke: rgba(226, 232, 240, 0.54);
  stroke-width: 1.4;
}

.analytics-line-total {
  stroke: #2f8df7;
  stroke-width: 3.2;
  fill: none;
}

.analytics-line-new {
  stroke: #22c55e;
  stroke-width: 3.2;
  fill: none;
}

.analytics-point {
  stroke: #07111f;
  stroke-width: 2;
}

.analytics-point-total {
  fill: #2f8df7;
}

.analytics-point-new {
  fill: #22c55e;
}

.analytics-tick-label,
.analytics-date-axis text,
.analytics-axis-title {
  fill: #a9bbd4;
  font-size: 12px;
  font-weight: 800;
}

.analytics-endpoint-label {
  font-size: 13px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(7, 17, 31, 0.92);
  stroke-width: 5px;
  stroke-linejoin: round;
}

.analytics-endpoint-label.total {
  fill: #8ec2ff;
}

.analytics-endpoint-label.new {
  fill: #86efac;
}

.legend-bars {
  display: grid;
  gap: 10px;
  padding: 16px 18px 18px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  background: #132033;
  border-radius: 999px;
}

.bar-fill {
  width: var(--value, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  border-radius: inherit;
}

.activity-list,
.stack-list,
.metric-list,
.projection-list {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
}

.activity-list {
  padding-top: 8px;
}

.mini-card,
.activity-item,
.projection-card,
.metric-list > div {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--primary);
  border-radius: 7px;
}

.activity-item {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  border-left: 0;
}

.activity-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.mini-card strong,
.activity-item strong,
.projection-card strong {
  overflow-wrap: anywhere;
}

.mini-card span,
.projection-card span,
.activity-item span {
  color: #cbd7e8;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mini-card small,
.metric-list small {
  color: var(--muted);
}

.mini-card a,
td a {
  color: var(--primary);
  font-weight: 850;
  text-decoration: none;
}

.mini-card a:hover,
td a:hover {
  text-decoration: underline;
}

.metric-list {
  padding-top: 0;
}

.metric-list > div {
  border-left-color: var(--blue);
}

.ads-visual-grid .card {
  overflow: hidden;
}

.visual-keyword-list {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
}

.visual-keyword {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.9fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.visual-keyword-main {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
}

.visual-keyword-main strong {
  overflow-wrap: anywhere;
}

.visual-keyword-main small {
  grid-column: 2;
  color: var(--muted);
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.good { background: #6ee7a0; }
.status-dot.ok { background: var(--blue); }
.status-dot.bad { background: var(--red); }
.status-dot.muted { background: #64748b; }

.channel-status-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  vertical-align: middle;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.12);
}

.channel-status-dot.on {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.channel-status-dot.off {
  background: #cbd5e1;
  box-shadow: 0 0 0 3px rgba(203, 213, 225, 0.14);
}

.channel-link-arrow {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  color: #f8fafc;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.channel-link-arrow:hover,
.channel-link-arrow:focus-visible {
  color: var(--cyan);
  outline: none;
}

.channel-link-arrow.disabled {
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.65;
}

.channel-row-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  text-transform: uppercase;
}

.visual-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.visual-metrics span {
  min-width: 0;
  padding: 8px;
  background: rgba(17, 24, 39, 0.72);
  border-radius: 6px;
}

.visual-metrics small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.visual-metrics strong {
  display: block;
  margin-top: 2px;
}

.visual-bar {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  background: #132033;
  border-radius: 999px;
}

.visual-bar span {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--primary));
  border-radius: inherit;
}

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

.decision-grid.compact {
  grid-template-columns: 1fr;
}

.decision-card {
  min-height: 96px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--blue);
  border-radius: 7px;
}

.decision-card.good { border-left-color: var(--green); }
.decision-card.ok { border-left-color: var(--blue); }
.decision-card.warn { border-left-color: var(--yellow); }
.decision-card.bad { border-left-color: var(--red); }

.decision-card span {
  color: #cbd7e8;
  font-size: 13px;
}

.term-signal {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.term-signal.good {
  color: #bbf7d0;
  background: rgba(34, 197, 94, 0.14);
}

.term-signal.warn {
  color: #fde68a;
  background: rgba(245, 158, 11, 0.16);
}

.term-signal.muted {
  color: var(--muted);
  background: rgba(148, 163, 184, 0.12);
}

.stacked-visual {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.stacked-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.stacked-track {
  height: 28px;
  display: flex;
  overflow: hidden;
  background: #132033;
  border-radius: 4px;
}

.stacked-fill {
  width: var(--w, 0%);
  min-width: 0;
}

.blue-fill { background: #1454b8; }
.cyan-fill { background: #93c5fd; }
.yellow-fill { background: #d3a100; }

.stacked-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #cbd7e8;
  font-size: 13px;
}

.stacked-legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  border-radius: 2px;
  vertical-align: -1px;
}

.mega-chart-card {
  overflow: hidden;
}

.mega-chart-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.mega-chart-summary div {
  min-width: 0;
  padding: 13px 14px;
  background: rgba(17, 24, 39, 0.72);
}

.mega-chart-summary span,
.share-row span {
  color: #9fb4d2;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.mega-chart-summary strong {
  display: block;
  margin-top: 3px;
  font-size: 21px;
}

.mega-chart-wrap {
  padding: 18px 18px 10px;
}

.mega-chart-wrap.compact svg {
  min-height: 250px;
}

.executive-chart-card {
  overflow: hidden;
}

.executive-chart-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 14px;
  padding: 14px 14px 8px;
}

.executive-chart-plot {
  min-width: 0;
  padding: 12px 14px 8px 12px;
  background:
    linear-gradient(180deg, rgba(47, 141, 247, 0.1), rgba(15, 23, 42, 0.02)),
    radial-gradient(circle at 82% 18%, rgba(34, 197, 94, 0.12), transparent 32%);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.executive-chart-plot svg {
  width: 100%;
  display: block;
  overflow: visible;
}

.executive-grid line {
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 1;
}

.executive-grid text,
.date-axis text,
.axis-title,
.roi-label {
  fill: #a9bbd4;
  font-size: 11px;
  font-weight: 800;
}

.date-axis text {
  fill: #8ea3bf;
}

.click-bar {
  fill: rgba(47, 141, 247, 0.18);
  stroke: rgba(47, 141, 247, 0.32);
  rx: 3px;
}

.cost-area {
  fill: url("#costAreaGradient");
}

.cost-point {
  fill: #07111f;
  stroke: #31df74;
  stroke-width: 2;
}

.click-point {
  fill: #2f8df7;
  stroke: #d7e9ff;
  stroke-width: 1.5;
}

.chart-callout line {
  stroke: rgba(238, 242, 255, 0.72);
  stroke-width: 1;
}

.chart-callout text {
  fill: #f8fbff;
  font-size: 12px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(7, 17, 31, 0.9);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.muted-callout line,
.muted-callout text {
  opacity: 0.75;
}

.click-callout circle {
  fill: none;
  stroke: #8ec5ff;
  stroke-width: 2;
}

.roi-label {
  fill: #e6b7f7;
}

.executive-chart-insights {
  display: grid;
  gap: 1px;
  align-content: start;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--line-soft);
}

.executive-chart-insights div {
  min-width: 0;
  padding: 10px 11px;
  background: rgba(15, 23, 42, 0.82);
}

.executive-chart-insights span {
  display: block;
  color: #9fb4d2;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.executive-chart-insights strong {
  display: block;
  margin-top: 3px;
  color: #f8fbff;
  font-size: 14px;
  line-height: 1.25;
}

.executive-legend {
  padding-top: 3px;
}

.bar-dot {
  background: rgba(47, 141, 247, 0.5);
}

.mega-chart-wrap svg {
  width: 100%;
  min-height: 300px;
  display: block;
  overflow: visible;
  background: linear-gradient(180deg, rgba(47, 141, 247, 0.08), rgba(17, 24, 39, 0.02));
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.chart-grid line {
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 1;
}

.series {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.series.cost { stroke: #22c55e; }
.series.clicks { stroke: #2f8df7; }
.series.impressions { stroke: #f59e0b; opacity: 0.7; }
.series.projection {
  stroke: #f8fbff;
  stroke-width: 2;
  stroke-dasharray: 8 8;
  opacity: 0.86;
}

.roi-line {
  stroke: #b455d9;
  stroke-width: 2;
  stroke-dasharray: 4 7;
}

.mega-chart-axis,
.mega-chart-legend {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.mega-chart-legend {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  padding: 0 18px 14px;
}

.mega-chart-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 999px;
}

.cost-dot { background: #22c55e; }
.click-dot { background: #2f8df7; }
.impression-dot { background: #f59e0b; }
.cpc-dot { background: #22d3ee; }
.projection-dot { background: #f8fbff; }
.roi-dot { background: #b455d9; }

.daily-log-chart-card .card-header {
  border-bottom: 1px solid var(--line-soft);
}

.chart-header-metrics {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.chart-roi-badge {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 27px;
  padding: 5px 9px;
  color: #9fb4d2;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.chart-roi-badge strong {
  color: #63e6a1;
  font-size: 13px;
}

.daily-log-chart-card .mega-chart-summary small {
  display: block;
  margin-top: 3px;
  color: #8ea3bf;
  font-size: 10px;
  font-weight: 800;
}

.daily-log-chart-wrap {
  position: relative;
  padding: 16px 16px 8px;
  overflow-x: hidden;
}

.daily-chart-layout {
  border-top: 1px solid var(--line-soft);
}

.daily-chart-layout .daily-log-chart-wrap {
  border-right: 0;
}

.daily-log-chart-wrap svg {
  width: 100%;
  min-height: 430px;
  background: #0f172a;
  border-color: #334155;
}

.daily-log-chart-wrap svg.daily-chart-light {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.daily-chart-title {
  fill: #f8fbff;
  font-size: 13px;
  font-weight: 900;
}

.daily-chart-subtitle {
  fill: #9fb4d2;
  font-size: 11px;
  font-weight: 800;
}

.daily-log-chart-wrap .chart-grid line {
  stroke: rgba(148, 163, 184, 0.18);
}

.daily-log-chart-wrap .chart-grid text,
.daily-log-chart-wrap .axis-title,
.daily-log-chart-wrap .date-axis text {
  fill: #c7d7ee;
  font-size: 11px;
  font-weight: 800;
}

.daily-vertical-grid {
  stroke: rgba(148, 163, 184, 0.1) !important;
}

.daily-cost { stroke: #2563eb; }
.daily-impressions { stroke: #f97316; }
.daily-clicks { stroke: #22c55e; }
.daily-cpc { stroke: #22d3ee; }

.daily-dot {
  stroke: #0f172a;
  stroke-width: 1.5;
}

.daily-cost-dot { fill: #2563eb; }
.daily-impressions-dot { fill: #f97316; }
.daily-clicks-dot { fill: #22c55e; }
.daily-cpc-dot { fill: #22d3ee; }

.daily-label {
  font-size: 10px;
  font-weight: 900;
  stroke: none;
  paint-order: normal;
  text-shadow:
    0 1px 2px rgba(2, 6, 23, 0.76),
    0 0 4px rgba(2, 6, 23, 0.5);
}

.cost-label { fill: #1d4ed8; }
.impressions-label { fill: #ea580c; }
.clicks-label { fill: #15803d; }
.cpc-label { fill: #0891b2; }

.daily-log-chart-card .cost-dot { background: #2563eb; }
.daily-log-chart-card .impression-dot { background: #f97316; }
.daily-log-chart-card .click-dot { background: #22c55e; }
.daily-log-chart-card .cpc-dot { background: #22d3ee; }

.money-marker text {
  font-size: 30px;
  font-weight: 950;
  paint-order: stroke;
  stroke: rgba(15, 23, 42, 0.96);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.money-legend {
  display: inline-grid;
  place-items: center;
  width: 12px;
  margin-right: 6px;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.chart-scale-control {
  margin-left: auto;
  display: inline-grid;
  grid-template-columns: 24px auto 24px;
  align-items: center;
  gap: 4px;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.chart-scale-control button {
  min-height: 28px;
  color: #dbeafe;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 20px;
  font-weight: 900;
}

.chart-scale-control button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.chart-save-preferences {
  min-height: 30px;
  padding: 5px 12px;
  color: #f8fafc;
  background: transparent;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 0;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.chart-save-preferences:hover,
.chart-save-preferences:focus-visible {
  color: #06111f;
  background: #f8fafc;
  outline: none;
}

.chart-variable-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.9fr);
  gap: 12px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.62);
  border-top: 1px solid var(--line-soft);
}

.chart-variable-column,
.chart-gains-column {
  min-width: 0;
}

.chart-variable-column > div:first-child,
.chart-gains-column > div:first-child {
  padding-bottom: 0;
  border-bottom: 1px solid var(--line-soft);
}

.chart-variable-column > div:first-child strong,
.chart-gains-column > div:first-child strong {
  display: block;
  font-size: 14px;
}

.chart-variable-column > div:first-child span,
.chart-gains-column > div:first-child span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.chart-variable-table-wrap {
  overflow-x: auto;
  display: flex;
  justify-content: flex-start;
  padding-top: 12px;
}

.chart-variable-table {
  width: min(100%, 620px);
  min-width: 0;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  table-layout: auto;
}

.chart-gains-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.chart-gains-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.54);
}

.chart-gains-list b {
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
}

.chart-gains-list span {
  color: #37e67f;
  font-size: 15px;
  font-weight: 900;
}

.chart-gains-list small {
  color: #8ea3bf;
  font-size: 11px;
  font-weight: 900;
}

.chart-gains-list li.empty {
  grid-template-columns: 1fr;
}

.chart-gains-list li.empty span {
  color: var(--muted);
  font-size: 12px;
}

.chart-variable-table th,
.chart-variable-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  color: #d9e8ff;
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
}

.chart-variable-table th:nth-child(1),
.chart-variable-table td:nth-child(1) {
  width: 86px;
}

.chart-variable-table th:nth-child(2),
.chart-variable-table td:nth-child(2) {
  width: 190px;
}

.chart-variable-table th:nth-child(3),
.chart-variable-table td:nth-child(3) {
  width: 118px;
}

.chart-variable-table th:nth-child(4),
.chart-variable-table td:nth-child(4) {
  width: 120px;
}

.chart-variable-table th {
  background: rgba(15, 23, 42, 0.9);
  color: #8ea3bf;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.chart-variable-table tr:last-child td {
  border-bottom: 0;
}

.chart-variable-row {
  background: rgba(17, 24, 39, 0.58);
}

.chart-variable-row:nth-child(even) {
  background: rgba(15, 23, 42, 0.5);
}

.chart-variable-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.chart-variable-row input {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--primary);
}

.chart-variable-row i {
  display: inline-block;
  vertical-align: middle;
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  margin-right: 0;
  border-radius: 999px;
  background: var(--series-color);
}

.money-variable {
  width: 10px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.chart-variable-row strong {
  display: inline;
  vertical-align: middle;
  color: #eef6ff;
  font-size: 12px;
  line-height: 1.15;
}

.chart-variable-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 72px;
  color: #8ea3bf;
  font-size: 11px;
  font-weight: 900;
}

.chart-variable-row.disabled {
  opacity: 0.52;
}

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

.dimension-grid section {
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.dimension-grid h3 {
  margin: 0;
  font-size: 13px;
}

.share-row {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(80px, 1.2fr) 52px;
  gap: 8px;
  align-items: center;
}

.share-track {
  height: 8px;
  overflow: hidden;
  background: #132033;
  border-radius: 999px;
}

.share-track i {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--primary));
  border-radius: inherit;
}

.share-row strong {
  text-align: right;
  font-size: 12px;
}

.empty-chart {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.funnel-list {
  display: grid;
  gap: 12px;
  padding: 16px 18px 18px;
}

.funnel-list div {
  display: grid;
  gap: 5px;
}

.funnel-list span {
  color: #9fb4d2;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.funnel-list strong {
  font-size: 20px;
}

.funnel-list i {
  display: block;
  width: var(--w, 0%);
  height: 8px;
  background: linear-gradient(90deg, var(--primary), var(--blue));
  border-radius: 999px;
}

.agent-card {
  overflow: hidden;
}

.agent-body {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

.agent-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-meta span {
  padding: 6px 8px;
  color: #bdd3ee;
  background: rgba(47, 141, 247, 0.1);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 850;
}

.agent-decision {
  display: grid;
  gap: 6px;
  padding: 13px;
  background: rgba(20, 184, 166, 0.09);
  border: 1px solid rgba(20, 184, 166, 0.32);
  border-left: 4px solid var(--primary);
  border-radius: 7px;
}

.agent-decision strong {
  color: #f8fbff;
  font-size: 16px;
}

.agent-decision span {
  color: #cbd7e8;
}

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

.agent-permissions section {
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.agent-permissions strong {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-permissions span {
  color: #d7e4f5;
  font-size: 13px;
  line-height: 1.45;
}

.compact-list {
  gap: 8px;
}

.operations-group {
  display: grid;
  gap: 8px;
}

.operations-group > strong {
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.operations-group .nested-list {
  padding: 0;
}

.executive-chart-card {
  overflow: hidden;
}

.metric-list strong {
  display: block;
  color: var(--text);
  font-size: 18px;
}

.score-panel {
  text-align: center;
}

.score-panel .card-header {
  text-align: left;
}

.score-ring {
  --score: 0;
  width: 132px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 20px auto 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--card) 58%, transparent 60%),
    conic-gradient(var(--primary) calc(var(--score) * 1%), #27364a 0);
}

.score-ring strong {
  font-size: 36px;
}

.score-panel > strong {
  display: block;
  margin-bottom: 7px;
}

.score-panel > p {
  max-width: 260px;
  margin: 0 auto 18px;
}

.info-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--primary);
  background: rgba(20, 184, 166, 0.12);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.state {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  width: fit-content;
  min-height: 25px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.state-ok { color: #63e6a1; background: rgba(34, 197, 94, 0.16); }
.state-warn { color: #ffd27a; background: rgba(245, 158, 11, 0.15); }
.state-blocked { color: #ff9da3; background: rgba(239, 68, 68, 0.15); }

.severity-high { border-left-color: var(--red); }
.severity-medium { border-left-color: var(--yellow); }
.severity-low { border-left-color: var(--green); }

.table-wrap {
  width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
}

table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 12px;
}

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

th {
  background: #152031;
}

td {
  color: #d7e1ef;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
}

tr:last-child td {
  border-bottom: 0;
}

.keyword-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 5px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.keyword-status-enabled {
  color: #63e6a1;
  background: rgba(34, 197, 94, 0.16);
}

.keyword-status-removed {
  color: #ff9da3;
  background: rgba(239, 68, 68, 0.15);
}

.campaign-settings-card {
  overflow: visible;
}

.campaign-settings-form {
  display: grid;
  gap: 14px;
  padding: 16px 18px 18px;
}

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

.settings-grid input:disabled {
  color: #b9c8dc;
  opacity: 1;
}

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

.switch-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: #d7e1ef;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.switch-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--primary);
}

.schedule-settings-card .settings-grid {
  grid-template-columns: minmax(240px, 1.3fr) minmax(150px, 0.7fr) repeat(3, minmax(130px, 0.6fr)) minmax(220px, 1fr);
}

.day-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-toggle {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #d7e1ef;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.day-toggle input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.mutation-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px) auto;
  gap: 12px;
  align-items: end;
  padding: 12px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: 7px;
}

.mutation-panel p,
.mutation-panel small,
.settings-result {
  margin: 0;
  color: var(--muted);
}

.mutation-panel strong {
  display: block;
  margin-bottom: 3px;
}

.settings-result {
  min-height: 24px;
  padding: 0;
}

.recommendations {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 14px 18px 18px 34px;
}

.recommendations li {
  color: #d7e1ef;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) minmax(160px, 220px);
  gap: 12px;
  padding: 0 18px 16px;
}

label {
  display: grid;
  gap: 6px;
}

input,
select {
  min-height: 40px;
  width: 100%;
  padding: 8px 10px;
  color: var(--text);
  background: #111827;
  border: 1px solid var(--line);
  border-radius: 6px;
}

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

.tool-card {
  display: grid;
  gap: 10px;
  min-height: 250px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line-soft);
  border-radius: 7px;
}

.tool-card h3 {
  margin: 0;
  font-size: 17px;
}

.tool-card p {
  margin-bottom: 0;
  color: #cbd7e8;
}

.tool-card a {
  align-self: end;
  color: var(--primary);
  font-weight: 900;
}

.catalog-panel {
  overflow: hidden;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 420px;
  padding: 32px;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.empty-state h1 {
  margin-bottom: 8px;
}

.empty-state p {
  max-width: 560px;
  color: var(--muted);
}

.card-header > strong {
  color: var(--text);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 7px;
  color: #dbe8f8;
  background: #243348;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
}

.risk-low { color: #63e6a1; background: rgba(34, 197, 94, 0.14); }
.risk-medium { color: #ffd27a; background: rgba(245, 158, 11, 0.14); }
.risk-high { color: #ff9da3; background: rgba(239, 68, 68, 0.14); }

@media (max-width: 1240px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .app-sidebar {
    position: static;
    width: auto;
    height: auto;
  }

  .app-main {
    margin-left: 0;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-nav p,
  .side-card {
    display: none;
  }

  .mega-chart-summary,
  .dimension-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-4,
  .span-3,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: span 6;
  }

  .visual-keyword {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .topbar,
  .page-header,
  .client-card {
    flex-direction: column;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .search-box {
    width: 100%;
  }

  .topbar-actions,
  .page-actions {
    justify-content: flex-start;
    margin-left: 0;
  }

  .chart-variable-panel {
    grid-template-columns: 1fr;
  }

  .meta-google-switch {
    grid-template-columns: 1fr;
  }

  .date-control {
    width: 100%;
    margin-inline: 0;
  }

  .date-toggle {
    width: 100%;
  }

  .date-popover {
    left: 0;
    width: min(100%, calc(100vw - 24px));
    grid-template-columns: 1fr;
    transform: none;
  }

  .date-shortcuts {
    max-height: 190px;
    overflow-y: auto;
    border-right: 0;
    border-bottom: 1px solid #323735;
  }

  .source-grid,
  .stat-grid,
  .mega-chart-summary,
  .dimension-grid,
  .side-nav,
  .tool-grid,
  .controls,
  .decision-grid,
  .agent-permissions,
  .settings-grid,
  .schedule-settings-card .settings-grid,
  .day-grid,
  .switch-grid,
  .mutation-panel {
    grid-template-columns: 1fr;
  }

  .span-4,
  .span-3,
  .span-5,
  .span-6,
  .span-7,
  .span-8 {
    grid-column: 1 / -1;
  }

  .page-wrapper {
    width: min(100% - 24px, 1180px);
    padding-top: 18px;
  }

  .stat-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .stat-card .mini-spark {
    grid-column: 1 / -1;
    width: min(120px, 42%);
    justify-self: end;
    height: 26px;
  }

  .stat-content strong {
    font-size: clamp(22px, 7vw, 30px);
  }

  .visual-metrics,
  .stacked-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .stat-card {
    min-height: 104px;
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 14px;
  }

  .stat-icon {
    width: 42px;
    height: 42px;
  }

  .stat-card .mini-spark {
    display: none;
  }
}

:root[data-theme="light"] .brand-icon {
  background: #fff8ea;
  border-color: rgba(201, 153, 50, 0.5);
}

:root[data-theme="light"] .side-nav p,
:root[data-theme="light"] .nav-icon {
  color: #6f87a3;
}

:root[data-theme="light"] .side-nav a {
  color: #42617f;
}

:root[data-theme="light"] .side-nav a:hover,
:root[data-theme="light"] .side-nav a.active {
  color: #06281f;
  background: rgba(20, 184, 166, 0.14);
}

:root[data-theme="light"] .side-card,
:root[data-theme="light"] .source-grid div,
:root[data-theme="light"] .subtab-nav,
:root[data-theme="light"] .tool-card {
  background: rgba(15, 23, 42, 0.03);
}

:root[data-theme="light"] .search-box,
:root[data-theme="light"] .date-toggle,
:root[data-theme="light"] input,
:root[data-theme="light"] select {
  background: #ffffff;
}

:root[data-theme="light"] .btn-outline {
  color: #17324d;
  background: #ffffff;
  border-color: #bed0e3;
}

:root[data-theme="light"] .btn-outline:hover {
  background: #edf4fb;
}

:root[data-theme="light"] .date-popover {
  color: #17324d;
  background: #ffffff;
  border-color: #cfd9e5;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.18);
}

:root[data-theme="light"] .date-shortcuts {
  border-right-color: #d7e0eb;
}

@media (max-width: 820px) {
  :root[data-theme="light"] .date-shortcuts {
    border-bottom-color: #d7e0eb;
  }
}

:root[data-theme="light"] .date-shortcuts-title {
  color: #58708c;
  background: #f4f7fb;
  border-bottom-color: #d7e0eb;
}

:root[data-theme="light"] .date-shortcuts button {
  color: #314761;
  border-bottom-color: rgba(30, 41, 59, 0.06);
}

:root[data-theme="light"] .date-shortcuts button:hover,
:root[data-theme="light"] .date-shortcuts button.active,
:root[data-theme="light"] .date-month-actions button:hover,
:root[data-theme="light"] .date-days button:hover {
  color: #0f172a;
  background: #eaf2fb;
}

:root[data-theme="light"] .date-inputs label,
:root[data-theme="light"] .date-inputs > span,
:root[data-theme="light"] .date-weekdays span,
:root[data-theme="light"] .date-toggle small {
  color: #64748b;
}

:root[data-theme="light"] .date-inputs input {
  color: #0f172a;
  background: #ffffff;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .date-calendar-head strong,
:root[data-theme="light"] .date-month-actions button,
:root[data-theme="light"] .date-days button,
:root[data-theme="light"] .date-days span {
  color: #334155;
}

:root[data-theme="light"] .date-days button.selected {
  color: #ffffff;
}

:root[data-theme="light"] .realtime-users-badge {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.9));
}

:root[data-theme="light"] .realtime-users-badge strong {
  color: #0f172a;
}

:root[data-theme="light"] .realtime-users-badge.online {
  background: linear-gradient(180deg, rgba(236, 253, 245, 0.95), rgba(255, 255, 255, 0.92));
}

:root[data-theme="light"] .realtime-users-badge.online strong {
  color: #047857;
}

:root[data-theme="light"] .source-grid dt,
:root[data-theme="light"] .stat-content span,
:root[data-theme="light"] th,
:root[data-theme="light"] label,
:root[data-theme="light"] .metric-list span,
:root[data-theme="light"] .subtab-nav button,
:root[data-theme="light"] .chart-variable-table th,
:root[data-theme="light"] .daily-log-chart-card .mega-chart-summary small {
  color: #5f7895;
}

:root[data-theme="light"] .module-card:hover {
  background: #f4f9fd;
}

:root[data-theme="light"] .module-card .card-header strong {
  color: #075c55;
  background: rgba(20, 184, 166, 0.12);
}

:root[data-theme="light"] .subtab-nav button:hover,
:root[data-theme="light"] .subtab-nav button.active {
  color: #06342d;
  background: rgba(20, 184, 166, 0.15);
}

:root[data-theme="light"] .network-pill,
:root[data-theme="light"] .tab-group,
:root[data-theme="light"] .progress-line,
:root[data-theme="light"] .benchmark-row,
:root[data-theme="light"] .chart-variable-table-wrap,
:root[data-theme="light"] .table-wrap {
  background: #eef4fb;
}

:root[data-theme="light"] .network-pill strong {
  color: #334155;
  background: rgba(100, 116, 139, 0.14);
}

:root[data-theme="light"] .network-pill.on strong {
  color: #064e3b;
}

:root[data-theme="light"] .network-watch p {
  color: #9a5c00;
}

:root[data-theme="light"] .daily-log-chart-wrap svg:not(.daily-chart-light) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

:root[data-theme="light"] .daily-chart-title,
:root[data-theme="light"] .chart-variable-table td,
:root[data-theme="light"] .settings-grid input:disabled,
:root[data-theme="light"] table td,
:root[data-theme="light"] .recommendations li {
  color: #0f172a;
}

:root[data-theme="light"] .daily-chart-subtitle,
:root[data-theme="light"] .daily-log-chart-wrap .chart-grid text,
:root[data-theme="light"] .daily-log-chart-wrap .axis-title,
:root[data-theme="light"] .daily-log-chart-wrap .date-axis text {
  fill: #425b76;
}

:root[data-theme="light"] .daily-log-chart-wrap .chart-grid line {
  stroke: rgba(71, 85, 105, 0.18);
}

:root[data-theme="light"] .daily-dot {
  stroke: #f8fafc;
}

:root[data-theme="light"] table thead {
  background: #f8fafc;
}

:root[data-theme="light"] table tr:hover {
  background: rgba(20, 184, 166, 0.06);
}

:root[data-theme="light"] .risk-low {
  color: #047857;
}

:root[data-theme="light"] .risk-medium {
  color: #9a5c00;
}

:root[data-theme="light"] .risk-high {
  color: #b4232b;
}
