:root {
  color-scheme: dark;
  --bg: #08090c;
  --sidebar: #0b0c10;
  --surface: #111319;
  --surface-2: #161922;
  --surface-hover: #1c202b;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f5f8;
  --muted: #9499a6;
  --subtle: #636875;
  --accent: #a78bfa;
  --accent-bright: #c4b5fd;
  --accent-soft: rgba(167, 139, 250, 0.12);
  --cyan: #38bdf8;
  --emerald: #34d399;
  --amber: #fbbf24;
  --rose: #f472b6;
  --red: #fb7185;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.ambient-glow {
  position: fixed;
  top: -220px;
  left: 260px;
  width: 780px;
  height: 440px;
  background: radial-gradient(ellipse at center, rgba(167, 139, 250, 0.08), rgba(56, 189, 248, 0.03) 45%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  transition: transform 140ms ease-out, background 140ms ease-out, border-color 140ms ease-out, opacity 140ms ease-out;
}

button:active:not(:disabled) {
  transform: scale(0.975);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

a {
  color: inherit;
  text-decoration: none;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

/* Layout Shell */
.layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.sidebar {
  width: 248px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 20;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #0b0914;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -1.5px;
  box-shadow: 0 6px 20px rgba(167, 139, 250, 0.25);
}

.brand-logo span {
  font-size: 16px;
}

.brand-text strong {
  display: block;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.4px;
}

.brand-text small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

/* Identity Switcher */
.identity-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
}

.identity-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--subtle);
  margin-bottom: 6px;
  padding: 0 4px;
}

.identity-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border-radius: var(--radius-sm);
  text-align: left;
}

.identity-trigger:hover {
  background: var(--surface-hover);
}

.identity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  flex-shrink: 0;
}

.identity-info {
  flex: 1;
  min-width: 0;
}

.identity-info strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.identity-info small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navigation */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.nav-heading {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 1.2px;
  color: var(--subtle);
  padding: 9px 10px 3px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 12.2px;
  font-weight: 500;
  transition: background 140ms ease-out, color 140ms ease-out;
}

.nav-link:hover {
  background: var(--surface);
  color: var(--text);
}

.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-weight: 600;
}

.nav-badge {
  margin-left: auto;
  background: rgba(251, 191, 36, 0.16);
  color: var(--amber);
  font-size: 10px;
  font-weight: 650;
  padding: 1px 7px;
  border-radius: 99px;
}

.sidebar-foot {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.sync-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  padding: 6px 8px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* Main Content & Topbar */
.main {
  margin-left: 248px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: rgba(8, 9, 12, 0.8);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 15;
}

.ai-bar {
  flex: 1;
  max-width: 760px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  padding: 5px 6px 5px 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ai-bar:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ai-spark {
  color: var(--accent);
  font-size: 14px;
}

.ai-bar input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 12.5px;
  color: var(--text);
}

.ai-bar input::placeholder {
  color: var(--subtle);
}

.btn-ai {
  background: var(--accent-soft);
  color: var(--accent-bright);
  border: 1px solid rgba(167, 139, 250, 0.28);
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.btn-ai:hover {
  background: rgba(167, 139, 250, 0.22);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.segmented {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}

.segmented button {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--muted);
}

.segmented button.active {
  background: var(--surface-hover);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.btn-primary {
  background: var(--text);
  color: #090a0f;
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.btn-primary:hover {
  background: #e2e4ec;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-accent {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #0b0814;
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
}

/* AI CFO Response Drawer */
.ai-drawer {
  margin: 16px 32px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.1), rgba(56, 189, 248, 0.05));
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ai-drawer h4 {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--accent-bright);
  margin-bottom: 4px;
}

.ai-drawer pre {
  font-family: var(--font);
  white-space: pre-wrap;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
}

/* View Container */
.view-root {
  padding: 28px 32px 48px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.7px;
}

.page-header p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* AI Prompt Quick Chips */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-soft);
}

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  min-width: 0;
  container-type: inline-size;
}

.kpi-card.featured {
  border-color: rgba(167, 139, 250, 0.32);
  background: linear-gradient(145deg, var(--surface), rgba(167, 139, 250, 0.08));
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.kpi-val {
  font-family: var(--mono);
  font-size: clamp(14px, 7.2cqi, 24px);
  font-weight: 600;
  letter-spacing: -0.8px;
  margin: 10px 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.kpi-sub {
  font-size: 11px;
  color: var(--subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Cards & Grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.card-header > div:first-child {
  flex: 1;
  min-width: 180px;
}

.card-header h2 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.card-header p {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px 22px;
  flex: 1;
}

/* Pro Donut / Pie Charts — Engineered so center values NEVER collide with the ring */
.pie-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
}

.pie-canvas {
  position: relative;
  width: 224px;
  height: 224px;
  display: grid;
  place-items: center;
  margin: 0 auto;
  flex-shrink: 0;
}

.pie-svg {
  width: 224px;
  height: 224px;
  overflow: visible;
}

.pie-arc {
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), filter 180ms ease, opacity 180ms ease;
  transform-origin: 112px 112px;
}

.pie-arc:hover {
  transform: scale(1.038);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.22));
}

.pie-center {
  position: absolute;
  width: 124px;
  max-width: 124px;
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 4px;
}

.pie-center span {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--muted);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pie-center strong {
  font-family: var(--mono);
  font-size: clamp(13.5px, 1.25vw, 17.5px);
  font-weight: 700;
  letter-spacing: -0.6px;
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pie-center small {
  font-size: 9.5px;
  font-weight: 550;
  color: var(--emerald);
  line-height: 1.25;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pie-delta-badge {
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
  max-width: 118px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}

.pie-delta-badge.show-up {
  display: inline-block;
  background: rgba(52, 211, 153, 0.16);
  color: var(--emerald);
}

.pie-delta-badge.show-down {
  display: inline-block;
  background: rgba(251, 191, 36, 0.16);
  color: var(--amber);
}

.card.pie-flash-up {
  border-color: var(--emerald);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.18);
  transition: border-color 280ms ease, box-shadow 280ms ease;
}

.card.pie-flash-down {
  border-color: var(--amber);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
  transition: border-color 280ms ease, box-shadow 280ms ease;
}

.legend-item.legend-flash {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.08);
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid transparent;
  cursor: pointer;
  min-width: 0;
  transition: border-color 140ms ease, background 140ms ease;
}

.legend-item:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-name {
  font-size: 12.5px;
  font-weight: 550;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-val {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.legend-pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  min-width: 44px;
  text-align: right;
  flex-shrink: 0;
}

/* Floating Mouse Tooltip for Pie Charts */
.chart-tooltip {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  background: rgba(15, 17, 24, 0.96);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 13px 15px;
  min-width: 240px;
  max-width: 320px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}

.tooltip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.tooltip-head strong {
  font-size: 13px;
  font-weight: 650;
}

.tooltip-head span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-bright);
  font-weight: 600;
}

.tooltip-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--muted);
}

.tooltip-row b {
  font-family: var(--mono);
  color: var(--text);
  font-weight: 550;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th {
  text-align: left;
  padding: 11px 20px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--subtle);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
}

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

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 550;
  background: var(--surface-2);
  color: var(--muted);
}

.badge.green {
  background: rgba(52, 211, 153, 0.13);
  color: var(--emerald);
}

.badge.amber {
  background: rgba(251, 191, 36, 0.14);
  color: var(--amber);
}

.badge.purple {
  background: rgba(167, 139, 250, 0.15);
  color: var(--accent-bright);
}

.badge.cyan {
  background: rgba(56, 189, 248, 0.14);
  color: var(--cyan);
}

.badge.red {
  background: rgba(251, 113, 133, 0.14);
  color: var(--red);
}

/* Sub-CRM Switcher Bar */
.subcrm-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.subcrm-tab {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 15px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
}

.subcrm-tab.active {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.subcrm-tab.locked {
  opacity: 0.45;
}

/* API Wallets Cards */
.wallet-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.wallet-card.low {
  border-color: rgba(251, 191, 36, 0.45);
}

.wallet-bal {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.8px;
}

.meter {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
}

.meter.low > span {
  background: var(--amber);
}

/* Margin Calculator Widget */
.calc-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}

.field input, .field select {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 13px;
  outline: none;
}

.field input:focus, .field select:focus {
  border-color: var(--accent);
}

/* Modal */
.modal {
  margin: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 0;
  width: 500px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.75);
}

.modal::backdrop {
  background: rgba(4, 5, 8, 0.75);
  backdrop-filter: blur(6px);
}

.modal-box {
  padding: 24px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-head h3 {
  font-size: 17px;
  font-weight: 650;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 28px;
  z-index: 120;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 550;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

@media (max-width: 1100px) {
  .kpi-strip, .grid-2, .grid-3, .calc-box {
    grid-template-columns: 1fr;
  }
  .pie-layout {
    grid-template-columns: 1fr;
  }
}

/* Unitflow v3 Live Ticker Animations, LIVE/OFFLINE Status Pills & Telegram Phone Preview */
.conn-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
  color: var(--emerald);
  text-align: left;
}
.conn-pill.offline {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.12);
  color: var(--red);
}
.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
  animation: pulseGlow 1.8s infinite ease-in-out;
}
.conn-pill.offline .conn-dot {
  animation: none;
}
.conn-pill strong {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
}
.conn-pill small {
  margin-left: auto;
  font-size: 10.5px;
  opacity: 0.85;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.55; }
}

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

.live-hero-card {
  background: linear-gradient(155deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  min-width: 0;
  container-type: inline-size;
  transition: border-color 280ms ease, box-shadow 280ms ease, transform 220ms ease;
}

.live-hero-card.flash-up {
  border-color: var(--emerald);
  box-shadow: 0 0 28px rgba(52, 211, 153, 0.22);
}

.live-hero-card.flash-down {
  border-color: var(--amber);
  box-shadow: 0 0 28px rgba(251, 191, 36, 0.22);
}

.live-hero-num {
  font-family: var(--mono);
  font-size: clamp(15px, 7.4cqi, 26px);
  font-weight: 700;
  letter-spacing: -0.9px;
  margin: 10px 0 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

.live-hero-num > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

.delta-arrow {
  font-size: 12px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 99px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.delta-arrow.show-up {
  opacity: 1;
  transform: translateY(0);
  background: rgba(52, 211, 153, 0.16);
  color: var(--emerald);
}

.delta-arrow.show-down {
  opacity: 1;
  transform: translateY(0);
  background: rgba(251, 191, 36, 0.16);
  color: var(--amber);
}

.status-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.status-btn.live {
  background: rgba(52, 211, 153, 0.15);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.status-btn.offline {
  background: rgba(251, 113, 133, 0.15);
  color: var(--red);
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.tg-phone-frame {
  width: 370px;
  height: 640px;
  border-radius: 34px;
  border: 8px solid #1e2230;
  background: #0b0d13;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.7);
  margin: 0 auto;
}

/* v1 Settings & Customization Theme Engine (Light, Dark, Midnight, System + 5 Accents + Density + Privacy Blur) */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f9;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --surface-hover: #e8ecf4;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #111827;
  --muted: #525b6c;
  --subtle: #788296;
}

html[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #070d17;
  --sidebar: #091220;
  --surface: #0e1a2d;
  --surface-2: #14233b;
  --surface-hover: #1a2d4a;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.22);
}

html[data-accent="blue"] {
  --accent: #60a5fa;
  --accent-bright: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.14);
}
html[data-accent="emerald"] {
  --accent: #34d399;
  --accent-bright: #6ee7b7;
  --accent-soft: rgba(52, 211, 153, 0.14);
}
html[data-accent="rose"] {
  --accent: #f472b6;
  --accent-bright: #f9a8d4;
  --accent-soft: rgba(244, 114, 182, 0.14);
}
html[data-accent="lime"] {
  --accent: #a3e635;
  --accent-bright: #bef264;
  --accent-soft: rgba(163, 230, 53, 0.14);
}

html[data-density="compact"] td,
html[data-density="compact"] th {
  padding-top: 8px;
  padding-bottom: 8px;
}
html[data-density="compact"] .kpi-card,
html[data-density="compact"] .live-hero-card {
  padding: 14px 16px;
}

html[data-hide-balances="true"] .mono,
html[data-hide-balances="true"] .kpi-val,
html[data-hide-balances="true"] .live-hero-num,
html[data-hide-balances="true"] .legend-val,
html[data-hide-balances="true"] .wallet-bal,
html[data-hide-balances="true"] td.num {
  filter: blur(7px);
  user-select: none;
  transition: filter 150ms ease;
}
html[data-hide-balances="true"] .mono:hover,
html[data-hide-balances="true"] .kpi-val:hover,
html[data-hide-balances="true"] .live-hero-num:hover,
html[data-hide-balances="true"] td.num:hover {
  filter: blur(0);
}

html[data-reduced-motion="true"] *,
html[data-reduced-motion="true"] *::before,
html[data-reduced-motion="true"] *::after {
  animation: none !important;
  transition: none !important;
}

/* Settings Layout & v1 Visual Pickers */
.settings-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.settings-tab-btn {
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
}
.settings-tab-btn.active {
  background: var(--accent-soft);
  color: var(--accent-bright);
  border-color: var(--accent);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:first-child { padding-top: 0; }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.setting-row h3 { font-size: 13.5px; font-weight: 600; }
.setting-row p { font-size: 12px; color: var(--muted); margin-top: 3px; max-width: 580px; }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.theme-card {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  text-align: left;
  background: var(--surface-2);
  position: relative;
}
.theme-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.theme-preview-box {
  height: 88px;
  padding: 10px;
  display: flex;
  gap: 7px;
  background: #0b0c10;
  position: relative;
  overflow: hidden;
}
.theme-preview-box.light { background: #f3f5f9; }
.theme-preview-box.midnight { background: #070d17; }
.theme-preview-box.system { background: linear-gradient(90deg, #f3f5f9 50%, #0b0c10 50%); }
.theme-preview-box.localhost_base {
  background:
    linear-gradient(135deg, rgba(255, 0, 51, 0.35), rgba(5, 0, 8, 0.92)),
    url('/localhost-base-eye.png') center/cover no-repeat;
  border-bottom: 1px solid rgba(255, 23, 68, 0.55);
}
.theme-preview-box.localhost_base::after {
  content: 'CYBERPUNK';
  position: absolute;
  top: 6px;
  right: 6px;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 0, 51, 0.88);
  color: #fff;
  box-shadow: 0 0 10px #ff0033;
}
.theme-preview-box.localhost_base .theme-preview-sidebar {
  background: rgba(255, 0, 51, 0.24);
  border: 1px solid rgba(255, 0, 51, 0.5);
}
.theme-preview-box.localhost_base .theme-preview-bar {
  background: rgba(255, 42, 84, 0.75);
  box-shadow: 0 0 8px #ff0033;
}
.theme-preview-box.localhost_base .theme-preview-card {
  background: rgba(255, 0, 51, 0.22);
  border: 1px solid #ff1744;
  box-shadow: inset 0 0 12px rgba(255, 0, 51, 0.45);
}

.theme-preview-sidebar {
  width: 24%;
  height: 100%;
  border-radius: 5px;
  background: rgba(255,255,255,0.08);
}
.theme-preview-box.light .theme-preview-sidebar { background: #e2e8f0; }

.theme-preview-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.theme-preview-bar {
  height: 9px;
  width: 60%;
  border-radius: 3px;
  background: rgba(255,255,255,0.16);
}
.theme-preview-box.light .theme-preview-bar { background: #cbd5e1; }
.theme-preview-card {
  flex: 1;
  border-radius: 5px;
  background: rgba(167, 139, 250, 0.16);
  border: 1px solid rgba(167, 139, 250, 0.35);
}

.theme-card-foot {
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 550;
  border-top: 1px solid var(--border);
}

.swatch-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
}
.swatch-btn.selected {
  box-shadow: 0 0 0 2px var(--text);
  transform: scale(1.08);
}

.toggle-switch {
  width: 42px;
  height: 24px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 2px;
  position: relative;
}
.toggle-switch::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}
.toggle-switch.on {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.toggle-switch.on::after {
  transform: translateX(18px);
  background: var(--accent-bright);
}

/* ============================================================================
   SPECIAL APPEARANCE: "LOCALHOST BASE" (Crimson Noir Cyberpunk Overdrive)
   100% Monochromatic Blood-Red & Pitch-Black Palette + Cyberpunk Fonts & FX
   Hidden by default — activates ONLY when html[data-theme="localhost_base"] is set
   ============================================================================ */
.cyber-stage {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

html[data-theme="localhost_base"] {
  color-scheme: dark;
  --font: 'Rajdhani', 'Inter', -apple-system, sans-serif;
  --mono: 'Share Tech Mono', 'JetBrains Mono', monospace;
  --cyber-display: 'Orbitron', 'Rajdhani', sans-serif;
  --bg: #030001;
  --sidebar: rgba(7, 1, 2, 0.94);
  --surface: rgba(13, 2, 4, 0.88);
  --surface-2: rgba(22, 3, 7, 0.92);
  --surface-hover: rgba(38, 4, 11, 0.95);
  --border: rgba(255, 0, 43, 0.32);
  --border-strong: rgba(255, 15, 55, 0.68);
  --text: #ffeef1;
  --muted: #d46a7e;
  --subtle: #8f2438;
  /* Strict Red-Only Cyberpunk Palette — Zero vibrant green/blue/yellow/purple */
  --accent: #ff002b;
  --accent-bright: #ff385c;
  --accent-soft: rgba(255, 0, 43, 0.22);
  --emerald: #ff1e42;
  --cyan: #ff385c;
  --amber: #cc0022;
  --red: #ff002b;
}

html[data-theme="localhost_base"] body {
  font-family: var(--font);
  letter-spacing: 0.35px;
  font-size: 14px;
  background: radial-gradient(circle at 75% 20%, rgba(120, 0, 20, 0.22), #030001 65%);
}

html[data-theme="localhost_base"] .ambient-glow {
  background: radial-gradient(circle at 50% 0%, rgba(255, 0, 43, 0.22), transparent 65%) !important;
}

html[data-theme="localhost_base"] .cyber-stage {
  display: block;
  contain: strict;
}

/* 1. Hardware-Accelerated 3D Blood-Red Cyberpunk Perspective Grid Floor (Uses transform translate3d instead of background-position) */
html[data-theme="localhost_base"] .cyber-grid-floor {
  position: absolute;
  inset: -40% -25% -25% -25%;
  background-image:
    linear-gradient(to right, rgba(255, 0, 43, 0.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 0, 43, 0.24) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(500px) rotateX(62deg) translate3d(0, 0, 0);
  transform-origin: center 78%;
  will-change: transform;
  animation: cyberGridScrollGpu 3.2s linear infinite;
  mask-image: radial-gradient(ellipse at 55% 78%, rgba(0,0,0,1) 12%, transparent 68%);
  -webkit-mask-image: radial-gradient(ellipse at 55% 78%, rgba(0,0,0,1) 12%, transparent 68%);
}

@keyframes cyberGridScrollGpu {
  0% { transform: perspective(500px) rotateX(62deg) translate3d(0, 0, 0); }
  100% { transform: perspective(500px) rotateX(62deg) translate3d(0, 48px, 0); }
}

/* 2. Digital Red Ember / Matrix Rain Stream (Lightweight GPU translate3d) */
html[data-theme="localhost_base"] .cyber-ember-stream {
  position: absolute;
  inset: -380px 0 0 0;
  background-image:
    radial-gradient(1.5px 12px at 14% 20%, rgba(255, 0, 43, 0.55), transparent),
    radial-gradient(2px 14px at 46% 30%, rgba(255, 0, 43, 0.6), transparent),
    radial-gradient(2px 16px at 81% 38%, rgba(255, 0, 43, 0.65), transparent);
  background-size: 360px 380px;
  will-change: transform;
  animation: cyberDataRainGpu 7s linear infinite;
  opacity: 0.55;
}

@keyframes cyberDataRainGpu {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, 380px, 0); }
}

/* 3. Rotating Crimson Cybernetic Target Reticle Ring (Pure GPU rotation, no heavy box-shadow) */
html[data-theme="localhost_base"] .cyber-reticle {
  position: absolute;
  right: 1.5%;
  bottom: 1.5%;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1px dashed rgba(255, 0, 43, 0.36);
  will-change: transform;
  animation: cyberReticleSpin 28s linear infinite;
}
html[data-theme="localhost_base"] .cyber-reticle::before {
  content: '';
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: rgba(255, 0, 43, 0.72);
  border-bottom-color: rgba(255, 0, 43, 0.42);
  will-change: transform;
  animation: cyberReticleSpin 12s linear infinite reverse;
}

@keyframes cyberReticleSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 4. CRT Scanlines & Crimson Noir Vignette (Static zero-cost layers) */
html[data-theme="localhost_base"] .cyber-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 0, 35, 0.04) 0px,
    rgba(255, 0, 35, 0.04) 1px,
    transparent 2px,
    transparent 4px
  );
  z-index: 2;
}

html[data-theme="localhost_base"] .cyber-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 58%, rgba(0, 0, 0, 0.85) 100%);
  z-index: 4;
}

/* 5. Vertical Blood-Red Laser Radar Sweep (Uses GPU translate3d instead of top %) */
html[data-theme="localhost_base"] .cyber-laser-sweep {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 43, 0.9), #ff8096, rgba(255, 0, 43, 0.9), transparent);
  box-shadow: 0 0 14px rgba(255, 0, 43, 0.75);
  will-change: transform, opacity;
  animation: cyberLaserScanGpu 6.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: 3;
}

@keyframes cyberLaserScanGpu {
  0% { transform: translate3d(0, -2vh, 0); opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { transform: translate3d(0, 102vh, 0); opacity: 0; }
}

/* 6. Glowing Crimson Cyberpunk Eye Hologram Watermark (Animates only transform & opacity, no per-frame filter repaint) */
html[data-theme="localhost_base"] .cyber-eye-watermark {
  position: absolute;
  right: 3%;
  bottom: 3.5%;
  width: 330px;
  height: 330px;
  border-radius: 24px;
  background: url('/localhost-base-eye.png') center/cover no-repeat;
  opacity: 0.22;
  box-shadow: 0 0 40px rgba(255, 0, 43, 0.45);
  will-change: transform, opacity;
  animation: cyberEyePulseGpu 4.5s ease-in-out infinite alternate;
}

@keyframes cyberEyePulseGpu {
  0% { transform: scale3d(0.98, 0.98, 1) translate3d(0, 0, 0); opacity: 0.16; }
  100% { transform: scale3d(1.03, 1.03, 1) translate3d(0, -6px, 0); opacity: 0.28; }
}

/* 7. Floating Cyberpunk HUD Telemetry Ticker */
html[data-theme="localhost_base"] .cyber-hud-telemetry {
  position: fixed;
  bottom: 10px;
  left: 266px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.4px;
  color: #ff2a4f;
  text-shadow: 0 0 8px rgba(255, 0, 43, 0.8);
  z-index: 30;
}

/* 8. Cyberpunk Typography (Orbitron Display + Rajdhani Tech UI + Share Tech Mono) */
html[data-theme="localhost_base"] h1,
html[data-theme="localhost_base"] h2,
html[data-theme="localhost_base"] h3,
html[data-theme="localhost_base"] .brand-text strong,
html[data-theme="localhost_base"] .nav-heading,
html[data-theme="localhost_base"] .identity-label {
  font-family: var(--cyber-display);
  text-transform: uppercase;
  letter-spacing: 1.1px;
}

html[data-theme="localhost_base"] .card-header h2 {
  font-size: 13px;
  color: #fff0f3;
  text-shadow: 0 0 8px rgba(255, 0, 43, 0.45);
}

html[data-theme="localhost_base"] .page-header h1 {
  font-family: var(--cyber-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: 1.6px;
  color: #ffffff;
  text-shadow:
    -2px 0 #ff002b,
    2px 0 #800016,
    0 0 18px rgba(255, 0, 43, 0.75);
}

/* 9. Brand Logo Transforms into the Crimson Cyberpunk Eye */
html[data-theme="localhost_base"] .brand-logo {
  background: url('/localhost-base-eye.png') center/cover no-repeat !important;
  border: 1.5px solid #ff002b;
  box-shadow: 0 0 16px rgba(255, 0, 43, 0.85);
}
html[data-theme="localhost_base"] .brand-logo-text {
  opacity: 0;
}

/* 10. Unified Crimson Badges, Swatches, Pills & Status Buttons */
html[data-theme="localhost_base"] .badge,
html[data-theme="localhost_base"] .badge.green,
html[data-theme="localhost_base"] .badge.cyan,
html[data-theme="localhost_base"] .badge.purple,
html[data-theme="localhost_base"] .badge.amber,
html[data-theme="localhost_base"] .badge.red {
  background: rgba(255, 0, 43, 0.16) !important;
  color: #ff4d6d !important;
  border: 1px solid rgba(255, 0, 43, 0.45) !important;
  font-family: var(--mono);
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

html[data-theme="localhost_base"] .status-btn.live,
html[data-theme="localhost_base"] .conn-pill.live {
  background: rgba(255, 0, 43, 0.2) !important;
  color: #ff385c !important;
  border: 1px solid #ff002b !important;
  box-shadow: 0 0 12px rgba(255, 0, 43, 0.35);
}

html[data-theme="localhost_base"] .status-btn.offline,
html[data-theme="localhost_base"] .conn-pill.offline {
  background: rgba(60, 0, 10, 0.45) !important;
  color: #8f2438 !important;
  border: 1px dashed rgba(255, 0, 43, 0.35) !important;
}

html[data-theme="localhost_base"] .legend-swatch,
html[data-theme="localhost_base"] .identity-dot,
html[data-theme="localhost_base"] .pulse-dot {
  background: #ff002b !important;
  box-shadow: 0 0 10px #ff002b !important;
}

html[data-theme="localhost_base"] .meter > span {
  background: linear-gradient(90deg, #7a0014, #ff002b, #ff5c77) !important;
}

html[data-theme="localhost_base"] .delta-arrow.show-up,
html[data-theme="localhost_base"] .delta-arrow.show-down,
html[data-theme="localhost_base"] .pie-delta-badge.show-up,
html[data-theme="localhost_base"] .pie-delta-badge.show-down {
  background: rgba(255, 0, 43, 0.24) !important;
  color: #ff4d6d !important;
  border: 1px solid rgba(255, 0, 43, 0.55);
}

/* 11. Angular Cyberpunk Chamfered Cards (Zero backdrop-filter & zero per-frame box-shadow repaint for 60fps speed) */
html[data-theme="localhost_base"] .sidebar {
  background: #070102 !important;
  border-right: 1px solid rgba(255, 0, 43, 0.55);
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.85);
}

html[data-theme="localhost_base"] .topbar {
  background: rgba(8, 1, 3, 0.96) !important;
  backdrop-filter: none !important;
  border-bottom: 1px solid rgba(255, 0, 43, 0.5);
}

html[data-theme="localhost_base"] .card,
html[data-theme="localhost_base"] .kpi-card,
html[data-theme="localhost_base"] .live-hero-card,
html[data-theme="localhost_base"] .wallet-card {
  border-radius: 4px;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  border: 1px solid rgba(255, 0, 43, 0.52) !important;
  background: linear-gradient(160deg, #1b0206, #090102) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.85);
  position: relative;
  transition: border-color 180ms ease, transform 180ms ease;
}

html[data-theme="localhost_base"] .card:hover,
html[data-theme="localhost_base"] .kpi-card:hover,
html[data-theme="localhost_base"] .live-hero-card:hover {
  border-color: #ff1e42 !important;
}

/* Lightweight GPU translate3d laser runner on the 3 top hero cards only */
html[data-theme="localhost_base"] .live-hero-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff002b, #ff8096, #ff002b, transparent);
  will-change: transform;
  animation: cyberCardRunnerGpu 3.8s linear infinite;
  pointer-events: none;
}

@keyframes cyberCardRunnerGpu {
  0% { transform: translate3d(-120%, 0, 0); }
  100% { transform: translate3d(260%, 0, 0); }
}

/* 12. Numbers, Donut Charts & Buttons in Pure Crimson Glow */
html[data-theme="localhost_base"] .live-hero-num,
html[data-theme="localhost_base"] .kpi-val,
html[data-theme="localhost_base"] .pie-center strong,
html[data-theme="localhost_base"] .wallet-bal {
  font-family: var(--cyber-display) !important;
  color: #fff0f3 !important;
  text-shadow: 0 0 12px rgba(255, 0, 43, 0.75);
  letter-spacing: -0.3px;
}

html[data-theme="localhost_base"] .live-hero-num,
html[data-theme="localhost_base"] .kpi-val {
  font-size: clamp(13px, 6.4cqi, 22px);
}

html[data-theme="localhost_base"] .pie-svg {
  filter: drop-shadow(0 0 12px rgba(255, 0, 43, 0.42));
}

html[data-theme="localhost_base"] .btn-primary,
html[data-theme="localhost_base"] .btn-accent,
html[data-theme="localhost_base"] .btn-ai {
  font-family: var(--cyber-display);
  background: linear-gradient(135deg, #ff002b, #8a0018) !important;
  color: #ffffff !important;
  border: 1px solid #ff4d6d !important;
  border-radius: 3px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  box-shadow: 0 0 18px rgba(255, 0, 43, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  font-size: 11px;
}

html[data-theme="localhost_base"] .btn-secondary,
html[data-theme="localhost_base"] .chip,
html[data-theme="localhost_base"] .subcrm-tab {
  border-radius: 3px;
  border-color: rgba(255, 0, 43, 0.45) !important;
  background: rgba(26, 3, 8, 0.85) !important;
  color: #ffd6de !important;
  font-family: var(--font);
  letter-spacing: 0.5px;
}

html[data-theme="localhost_base"] .btn-secondary:hover,
html[data-theme="localhost_base"] .chip:hover,
html[data-theme="localhost_base"] .subcrm-tab.active {
  border-color: #ff002b !important;
  background: rgba(255, 0, 43, 0.22) !important;
  box-shadow: 0 0 16px rgba(255, 0, 43, 0.45);
  color: #ffffff !important;
}

html[data-theme="localhost_base"] .nav-link {
  font-family: var(--font);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

html[data-theme="localhost_base"] .nav-link.active {
  background: linear-gradient(90deg, rgba(255, 0, 43, 0.34), rgba(255, 0, 43, 0.04));
  border-left: 3px solid #ff002b;
  color: #ffffff;
  text-shadow: 0 0 14px #ff002b;
  box-shadow: inset 0 0 20px rgba(255, 0, 43, 0.25);
}
