/* CoreTrack Hub. Colour tokens follow the validated chart palette: series 1-3 are blue, orange, aqua. */

:root {
  color-scheme: dark;
  --bg: #0b0c14;
  --bg-darker: #07080d;
  --sidebar-bg: #0a0b12;
  --sidebar-border: #181a29;
  --surface: #121320;
  --surface-2: #161828;
  --surface-3: #1c1e33;
  --card-bg: #121320;
  --card-border: #1f2136;
  --text: #ffffff;
  --text-main: #f1f3f9;
  --text-2: #8f94ad;
  --text-3: #6c708a;
  --border: #1f2136;
  --border-strong: #2c2f4d;
  --grid: #18192a;
  --axis: #2a2d45;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-ink: #ffffff;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --accent-glow: rgba(139, 92, 246, 0.4);
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
  --good: #10b981;
  --good-text: #10b981;
  --good-soft: rgba(16, 185, 129, 0.16);
  --warn: #f59e0b;
  --warn-text: #fbbf24;
  --warn-soft: rgba(245, 158, 11, 0.16);
  --bad: #ef4444;
  --bad-text: #f87171;
  --bad-soft: rgba(239, 68, 68, 0.16);
  --cyan: #06b6d4;
  --cyan-soft: rgba(6, 182, 212, 0.16);
  --s1: #8b5cf6;
  --s2: #ec4899;
  --s3: #10b981;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.3);
  --backdrop: rgba(6, 7, 12, 0.8);
  --radius: 12px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --surface-3: #2e2e2b;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #9b9a93;
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.24);
    --grid: #2c2c2a;
    --axis: #383835;
    --accent: #3987e5;
    --accent-hover: #5598e7;
    --accent-ink: #0b0b0b;
    --accent-soft: rgba(57, 135, 229, 0.16);
    --good-text: #3fcf3f;
    --good-soft: rgba(12, 163, 12, 0.18);
    --warn-text: #fab219;
    --warn-soft: rgba(250, 178, 25, 0.16);
    --bad-text: #ee7b7b;
    --bad-soft: rgba(208, 59, 59, 0.2);
    --s1: #3987e5;
    --s2: #d95926;
    --s3: #199e70;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.5);
    --backdrop: rgba(0, 0, 0, 0.6);
  }
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --surface-3: #2e2e2b;
  --text: #f0efec;
  --text-2: #c3c2b7;
  --text-3: #9b9a93;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.24);
  --grid: #2c2c2a;
  --axis: #383835;
  --accent: #3987e5;
  --accent-hover: #5598e7;
  --accent-ink: #0b0b0b;
  --accent-soft: rgba(57, 135, 229, 0.16);
  --good-text: #3fcf3f;
  --good-soft: rgba(12, 163, 12, 0.18);
  --warn-text: #fab219;
  --warn-soft: rgba(250, 178, 25, 0.16);
  --bad-text: #ee7b7b;
  --bad-soft: rgba(208, 59, 59, 0.2);
  --s1: #3987e5;
  --s2: #d95926;
  --s3: #199e70;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.5);
  --backdrop: rgba(0, 0, 0, 0.6);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h2 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 650;
}
h3 {
  font-size: 15px;
  font-weight: 650;
}
a {
  color: var(--accent);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.i {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -3px;
}
.i-fill {
  fill: currentColor;
  stroke-width: 1;
}
.muted {
  color: var(--text-2);
}
.faint {
  color: var(--text-3);
}
.mono {
  font-family: var(--mono);
  font-size: 12.5px;
}
.nowrap {
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.vstack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.noscript {
  padding: 24px;
}

/* ------------------------------ shell ------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
}
.tabs {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  padding: 0 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tab-btn:hover {
  color: var(--text);
}
.tab-btn[aria-selected='true'] {
  color: var(--text);
  border-bottom-color: var(--accent);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.icon-btn .i {
  width: 18px;
  height: 18px;
}
.badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}
.who {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px 0 10px;
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
}
.demo-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn-text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.banner .i {
  margin-top: 3px;
}
.banner-error {
  background: var(--bad-soft);
  color: var(--bad-text);
}
.banner-info {
  background: var(--accent-soft);
  color: var(--text);
}
.banner a {
  color: inherit;
  font-weight: 700;
}
.banner-body {
  flex: 1;
}

.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 16px 72px;
}
.tab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.tab-head p {
  margin-top: 4px;
  max-width: 70ch;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 380px;
}
.search .i {
  position: absolute;
  left: 11px;
  top: 10px;
  color: var(--text-3);
}
.search .input {
  padding-left: 34px;
}
.bulkbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-weight: 600;
}

/* ------------------------------ controls ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}
.btn-danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn-danger:hover {
  background: #b53030;
  border-color: #b53030;
}
.btn-ghost {
  border-color: transparent;
  background: none;
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-color: transparent;
  background: none;
  color: var(--text-2);
}
.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text);
}
.btn-icon.danger:hover {
  color: var(--bad-text);
  background: var(--bad-soft);
}
.btn-icon.good:hover {
  color: var(--good-text);
  background: var(--good-soft);
}
.btn-icon .i {
  width: 17px;
  height: 17px;
}

.input,
.select,
.textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}
.select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23898781' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.select.inline {
  width: auto;
  height: 30px;
  font-size: 13px;
}
.input::placeholder {
  color: var(--text-3);
}
.input:disabled,
.select:disabled {
  opacity: 0.6;
}
.input.invalid {
  border-color: var(--bad);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field > span:first-child,
.field > label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
}
.field .hint {
  font-size: 12.5px;
  color: var(--text-3);
  font-weight: 400;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .span-2 {
  grid-column: 1 / -1;
}
.form-error {
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bad-soft);
  color: var(--bad-text);
  font-weight: 500;
}
.form-error .hintline {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  color: var(--text-2);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  margin: 0;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .track {
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  transition: background 0.15s;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.15s, background 0.15s;
}
.switch input:checked + .track {
  background: var(--accent);
  border-color: var(--accent);
}
.switch input:checked + .track::after {
  transform: translateX(16px);
  background: var(--accent-ink);
}
.switch input:focus-visible + .track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.pill .i {
  width: 12px;
  height: 12px;
}
.pill-good {
  background: var(--good-soft);
  color: var(--good-text);
}
.pill-bad {
  background: var(--bad-soft);
  color: var(--bad-text);
}
.pill-warn {
  background: var(--warn-soft);
  color: var(--warn-text);
}
.pill-info {
  background: var(--accent-soft);
  color: var(--accent);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.flag {
  width: 18px;
  height: 13.5px;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px var(--border);
  vertical-align: -2px;
}

/* ------------------------------ cards / grid ------------------------------ */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--border-strong);
}
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.card-head h3 {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.linkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 3px 3px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.linkbox code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}
.card-stats {
  display: flex;
  gap: 18px;
  color: var(--text-2);
}
.card-stats b {
  color: var(--text);
  font-size: 16px;
  font-weight: 650;
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.card-foot .spacer {
  flex: 1;
}
.split-bar {
  display: flex;
  height: 8px;
  gap: 2px;
  border-radius: 4px;
  overflow: hidden;
}
.split-bar span {
  display: block;
  min-width: 3px;
}
.split-legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12.5px;
  color: var(--text-2);
}
.split-legend div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.split-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex: none;
}
.split-legend b {
  margin-left: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.series-a { background: var(--s1); }
.series-b { background: var(--s2); }
.series-c { background: var(--s3); }
.series-d { background: #eda100; }
.series-e { background: #e87ba4; }
.series-f { background: #6250d6; }

.rot-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0;
}
.rot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr) 92px minmax(0, 0.8fr) 32px;
  gap: 8px;
  align-items: center;
}
.rot-row .weight {
  display: flex;
  align-items: center;
  gap: 4px;
}
.rot-row .weight .input {
  text-align: right;
}
@media (max-width: 700px) {
  .rot-row {
    grid-template-columns: 1fr 92px 32px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
  }
  .rot-row [data-f='url'],
  .rot-row [data-f='param'] {
    grid-column: 1 / -1;
  }
}

.sentinel {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin-top: 8px;
  color: var(--text-3);
}
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 56px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-2);
  text-align: center;
}
.empty > .i {
  width: 28px;
  height: 28px;
  color: var(--text-3);
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-block {
  opacity: 0.55;
  transition: opacity 0.15s;
}

/* ------------------------------ tables ------------------------------ */

.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.tbl {
  width: 100%;
  border-collapse: collapse;
}
.tbl th {
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  color: var(--text-3);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.tbl td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tr:last-child td {
  border-bottom: 0;
}
.tbl tbody tr:hover td {
  background: var(--surface-2);
}
.tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tbl tr.clickable {
  cursor: pointer;
}
.cell-title {
  font-weight: 650;
  overflow-wrap: anywhere;
}
.cell-sub {
  font-size: 12.5px;
  color: var(--text-3);
  overflow-wrap: anywhere;
}
.err-text {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--bad-text);
  max-width: 34ch;
}
.err-text small {
  display: block;
  color: var(--text-2);
}
.actions-cell {
  text-align: right;
  white-space: nowrap;
}
.row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
}
.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  color: var(--text-2);
}

/* ------------------------------ modal ------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--backdrop);
  overflow-y: auto;
}
.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  max-height: calc(100vh - 32px);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.modal-sm {
  max-width: 440px;
}
.modal-lg {
  max-width: 860px;
}
.modal-xl {
  max-width: 1040px;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  flex: 1;
  font-size: 17px;
}
.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.modal-foot .spacer {
  flex: 1;
}
.confirm-msg {
  line-height: 1.55;
}
.confirm-msg ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-2);
}

/* ------------------------------ toasts ------------------------------ */

.toasts {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: toast-in 0.18s ease-out;
}
.toast .i {
  margin-top: 2px;
}
.toast-success { border-left-color: var(--good); }
.toast-success .i { color: var(--good-text); }
.toast-error { border-left-color: var(--bad); }
.toast-error .i { color: var(--bad-text); }
.toast-info { border-left-color: var(--accent); }
.toast-info .i { color: var(--accent); }
.toast small {
  display: block;
  color: var(--text-2);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ------------------------------ combobox ------------------------------ */

.cb {
  position: relative;
}
.cb-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}
.cb-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.cb-trigger.invalid {
  border-color: var(--bad);
}
.cb-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-value.placeholder {
  color: var(--text-3);
}
.cb-trigger .i {
  color: var(--text-3);
}
.cb-pop {
  position: fixed;
  z-index: 300;
  display: flex;
  flex-direction: column;
  min-width: 240px;
  max-height: 330px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.cb-search {
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.cb-list {
  overflow-y: auto;
  padding: 4px;
}
.cb-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
}
.cb-opt.active {
  background: var(--accent-soft);
}
.cb-opt[aria-selected='true'] {
  font-weight: 650;
}
.cb-opt[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}
.cb-opt .cb-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cb-opt .cb-sub {
  color: var(--text-3);
  font-size: 12.5px;
  white-space: nowrap;
}
.cb-empty {
  padding: 14px;
  text-align: center;
  color: var(--text-3);
}

/* ------------------------------ notifications ------------------------------ */

.notif-pop {
  position: fixed;
  top: 60px;
  right: 12px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 80px));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.notif-list {
  overflow-y: auto;
}
.notif-item {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  text-align: left;
  cursor: pointer;
}
.notif-item:hover {
  background: var(--surface-2);
}
.notif-item.unread {
  background: var(--accent-soft);
}
.notif-item .i {
  margin-top: 2px;
}
.notif-item.error .i { color: var(--bad-text); }
.notif-item.warning .i { color: var(--warn-text); }
.notif-item.info .i { color: var(--accent); }
.notif-title {
  font-weight: 650;
}
.notif-msg,
.notif-hint {
  font-size: 12.5px;
  color: var(--text-2);
}
.notif-hint {
  margin-top: 2px;
}
.notif-time {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}
.notif-count {
  margin-left: 6px;
  color: var(--text-3);
  font-weight: 600;
}

/* ------------------------------ sources ------------------------------ */

.profile {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.profile + .profile {
  margin-top: 16px;
}
.profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
  flex: none;
}
.profile-head .who-block {
  flex: 1;
  min-width: 180px;
}
.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--text);
  margin-bottom: 16px;
}
.notice.warn {
  background: var(--warn-soft);
}
.notice .i {
  margin-top: 3px;
  flex: none;
}

/* ------------------------------ reports ------------------------------ */

.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.seg {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.seg button {
  height: 30px;
  padding: 0 12px;
  white-space: nowrap;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-weight: 600;
  cursor: pointer;
}
.seg button:hover {
  background: var(--surface-2);
}
.seg button[aria-pressed='true'] {
  background: var(--accent-soft);
  color: var(--accent);
}
.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
}
.date-range .input {
  width: auto;
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.tile {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.tile-label {
  font-size: 12.5px;
  color: var(--text-2);
}
.tile-value {
  margin-top: 2px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 650;
}
.tile-sub {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--text-3);
}
.tile.warn .tile-value {
  color: var(--warn-text);
}
.tile.good .tile-value {
  color: var(--good-text);
}
.tile.bad .tile-value {
  color: var(--bad-text);
}
.section-label {
  margin: 20px 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
}
.charts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.chart-head p {
  font-size: 12.5px;
  color: var(--text-3);
}
.chart-box {
  position: relative;
}
.chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.chart-svg text {
  fill: var(--text-3);
  font-size: 11px;
  font-family: var(--font);
}
.chart-svg .gridline {
  stroke: var(--grid);
  stroke-width: 1;
}
.chart-svg .baseline {
  stroke: var(--axis);
  stroke-width: 1;
}
.chart-svg .bar {
  fill: var(--s1);
  transition: opacity 0.12s;
}
.chart-svg .bar.dim {
  opacity: 0.45;
}
.chart-svg .bar.s2 { fill: var(--s2); }
.chart-svg .bar.s3 { fill: var(--s3); }
.chart-svg .hit {
  fill: transparent;
  cursor: default;
}
.chart-tip {
  position: absolute;
  z-index: 5;
  min-width: 96px;
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: none;
  white-space: nowrap;
  transform: translate(-50%, -100%);
}
.chart-tip strong {
  display: block;
  font-size: 15px;
}
.chart-tip span {
  font-size: 12px;
  color: var(--text-2);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.hbars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hbar-row {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 10px;
}
.hbars.wide .hbar-row {
  grid-template-columns: 150px 1fr auto;
}
.hbar-track {
  height: 20px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  border-radius: 0 4px 4px 0;
  min-width: 2px;
}
.hbar-val {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  text-align: right;
  min-width: 90px;
}
.hbar-val small {
  color: var(--text-3);
  font-weight: 500;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover {
  text-decoration: underline;
}

/* ------------------------------ auth ------------------------------ */

.auth-body,
.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-card h1 {
  font-size: 22px;
}
.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-card .brand {
  margin-bottom: 4px;
}
.auth-card .btn {
  height: 40px;
}

/* ------------------------------ responsive ------------------------------ */

@media (max-width: 1000px) {
  .charts {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 860px) {
  .who span {
    display: none;
  }
  .tbl.stack thead {
    display: none;
  }
  .tbl.stack,
  .tbl.stack tbody,
  .tbl.stack tr,
  .tbl.stack td {
    display: block;
    width: 100%;
  }
  .tbl.stack tr {
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
  }
  .tbl.stack td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 12px;
    border: 0;
    text-align: right;
  }
  .tbl.stack .td-body {
    min-width: 0;
    text-align: right;
  }
  .tbl.stack td::before {
    content: attr(data-label);
    flex: none;
    color: var(--text-3);
    font-size: 12px;
    font-weight: 650;
    text-align: left;
  }
  .tbl.stack td[data-label=''] {
    justify-content: flex-end;
    text-align: right;
  }
  .tbl.stack td[data-label='']::before {
    display: none;
  }
  .tbl.stack .row-actions {
    flex-wrap: wrap;
  }
}
@media (max-width: 700px) {
  .topbar {
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 6px 12px 0;
  }
  .brand {
    flex: 1;
  }
  .tabs {
    order: 3;
    flex: 1 1 100%;
    margin: 0 -12px;
    padding: 0 8px;
    border-top: 1px solid var(--border);
  }
  .tab-btn {
    height: 42px;
    padding: 0 12px;
  }
}
@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  .main {
    padding-top: 16px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .hbar-row {
    grid-template-columns: 60px 1fr auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
@media print {
  .topbar,
  .toolbar,
  .filters .seg,
  .toasts {
    display: none;
  }
}

/* ==========================================================================
   CYBER-PURPLE THEME & SIDEBAR LAYOUT (MATCHING SCREENSHOTS)
   ========================================================================== */

body {
  background-color: var(--bg);
  color: var(--text-main);
}

.app-layout {
  display: flex;
  width: 100%;
  min-height: 100vh;
  background: var(--bg);
}

/* --- Sidebar --- */
.sidebar {
  width: 250px;
  min-width: 250px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  z-index: 100;
  transition: width 0.25s ease, min-width 0.25s ease;
}

.sidebar.collapsed {
  width: 72px;
  min-width: 72px;
  padding: 18px 8px;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-group-label,
.sidebar.collapsed .nav-title,
.sidebar.collapsed .encrypted-box span {
  display: none;
}
.sidebar.collapsed .encrypted-box {
  padding: 8px 4px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 6px;
}

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

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 18px var(--accent-glow);
  flex-shrink: 0;
}

.brand-badge svg {
  width: 18px;
  height: 18px;
  stroke: #ffffff;
  fill: none;
}

.brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.sidebar-toggle-btn {
  background: transparent;
  border: none;
  color: #656986;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}

.sidebar-toggle-btn:hover {
  color: #fff;
  background: var(--surface);
}

.nav-group-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #656986;
  letter-spacing: 0.08em;
  padding: 0 10px 10px;
  text-transform: uppercase;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: #8c90ad;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.sidebar .nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar .nav-item[aria-selected='true'] {
  background: rgba(124, 58, 237, 0.18) !important;
  border: 1px solid rgba(139, 92, 246, 0.45) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.22);
}

.nav-icon {
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
}

.encrypted-box {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.22);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.67rem;
  font-weight: 700;
  color: #a78bfa;
  letter-spacing: 0.06em;
}

.shield-icon {
  width: 15px;
  height: 15px;
  stroke: #8b5cf6;
  fill: none;
}

/* --- App Content Wrapper & Topbar --- */
.app-content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg);
}

.app-content-wrapper .topbar {
  height: 60px;
  min-height: 60px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.page-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-btn {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  color: var(--text-2) !important;
}
.theme-btn:hover {
  color: #fff !important;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  color: #c4b5fd;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.user-pill svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.logout-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

/* --- Buttons & Accent Enhancements --- */
.btn-primary,
.btn-purple {
  background: var(--accent-gradient) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.35);
  border-radius: 8px !important;
  font-weight: 600;
}
.btn-primary:hover,
.btn-purple:hover {
  opacity: 0.95;
  box-shadow: 0 4px 18px rgba(124, 58, 237, 0.5);
}

.btn-teal {
  background: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: 0 2px 12px rgba(6, 182, 212, 0.35);
}

/* --- Micro Action Buttons (Row Actions in Images 1-2) --- */
.action-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.act-btn {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.act-btn svg {
  width: 14px;
  height: 14px;
}
.act-btn.green { background: rgba(16, 185, 129, 0.12); color: #10b981; border-color: rgba(16, 185, 129, 0.25); }
.act-btn.green:hover { background: rgba(16, 185, 129, 0.25); }

.act-btn.cyan { background: rgba(6, 182, 212, 0.12); color: #06b6d4; border-color: rgba(6, 182, 212, 0.25); }
.act-btn.cyan:hover { background: rgba(6, 182, 212, 0.25); }

.act-btn.blue { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border-color: rgba(59, 130, 246, 0.25); }
.act-btn.blue:hover { background: rgba(59, 130, 246, 0.25); }

.act-btn.orange { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border-color: rgba(245, 158, 11, 0.25); }
.act-btn.orange:hover { background: rgba(245, 158, 11, 0.25); }

.act-btn.red { background: rgba(239, 68, 68, 0.12); color: #ef4444; border-color: rgba(239, 68, 68, 0.25); }
.act-btn.red:hover { background: rgba(239, 68, 68, 0.25); }

/* --- Table Enhancements --- */
.tbl {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.tbl th {
  background: rgba(255, 255, 255, 0.02);
  color: #71758e;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  font-size: 0.86rem;
}
.tbl tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.skey-tag {
  color: #10b981;
  font-weight: 700;
  font-size: 0.95rem;
}

.pill-running {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.pill-live {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

/* --- Multi Geo Styles (Image 5) --- */
.mg-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mg-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mg-step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.mg-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.2);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.4);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.mg-step-body h4 {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
}
.mg-step-body p {
  margin: 0 0 8px 0;
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.4;
}
.mg-step-link {
  font-size: 0.78rem;
  color: #a78bfa;
  text-decoration: none;
  font-weight: 600;
}
.mg-step-link.muted {
  color: var(--text-3);
  font-weight: 400;
}

.mg-subtabs-bar {
  display: flex;
  gap: 10px;
}
.mg-subtab-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.mg-subtab-btn:hover {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.4);
}
.mg-subtab-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

.mg-main-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mg-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.mg-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.mg-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mg-badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
}
.mg-badge-warn {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.mg-btn-reload {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  cursor: pointer;
}

.mg-counters-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.mg-counter-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.mg-counter-lbl {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.mg-counter-val {
  font-size: 1.7rem;
  font-weight: 700;
  color: #ffffff;
}
.text-green { color: #10b981 !important; }
.text-red { color: #ef4444 !important; }

.mg-notice-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.82rem;
  color: #e2e4f0;
  line-height: 1.5;
}
.mg-notice-icon {
  font-size: 1.1rem;
}

.mg-empty-state {
  padding: 48px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.mg-empty-icon {
  font-size: 2.8rem;
  color: #8b5cf6;
}
.mg-empty-state h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #ffffff;
}
.mg-empty-state p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-2);
}

/* --- Campaigns Mapper Grid (Image 2) --- */
.mapper-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: flex-start;
}
@media (max-width: 1060px) {
  .mapper-layout {
    grid-template-columns: 1fr;
  }
}

.mapper-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mapper-form-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.sub-header-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

.mapper-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

/* --- Detailed Reports Styles (Image 3) --- */
.reports-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.hero-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-stat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-stat-val {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hero-stat-val.cyan { color: #06b6d4; }
.hero-stat-val.green { color: #10b981; }
.hero-stat-val.amber { color: #f59e0b; }

.hero-stat-sub {
  font-size: 0.78rem;
  color: var(--text-2);
}

.buf-queue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}
.buf-queue-card h3 {
  margin: 0 0 16px 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.buf-bar-row {
  margin-bottom: 14px;
}
.buf-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-2);
  margin-bottom: 6px;
}
.buf-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.buf-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: #10b981;
}

