:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-strong: #f1f3f9;
  --surface-hover: #e8ebf4;
  --line: #e4e7ef;
  --line-strong: #cbd1df;
  --text: #171a2b;
  --muted: #737b91;
  --muted-strong: #4e566e;
  --accent: #5548e8;
  --accent-strong: #4338ca;
  --accent-glow: rgba(85, 72, 232, 0.1);
  --danger: #e11d48;
  --danger-soft: #ffe4e6;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --success: #10b981;
  --success-soft: #d1fae5;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08);

  --glass-bg: var(--surface);
  --glass-bg-subtle: var(--surface);
  --glass-bg-strong: var(--surface);
  --glass-border: var(--line);
  --glass-border-highlight: var(--line);
  --glass-shadow: 0 8px 24px rgba(26, 34, 66, 0.045);
  --glass-blur: none;
  --ambient-tint: rgba(85, 72, 232, 0.07);
  --body-ambient: radial-gradient(ellipse at 50% 0%, var(--ambient-tint), transparent 48%);

  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1020;
  --surface: #15192b;
  --surface-strong: #1c2136;
  --surface-hover: #252b43;
  --line: #292e45;
  --line-strong: #3a415e;
  --text: #f1f2fa;
  --muted: #9098b1;
  --muted-strong: #c0c5d7;
  --accent: #958bff;
  --accent-strong: #b2aaff;
  --accent-glow: rgba(149, 139, 255, 0.14);
  --danger: #f43f5e;
  --danger-soft: rgba(244, 63, 94, 0.15);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.15);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.15);
  --shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.6);

  --glass-bg: var(--surface);
  --glass-bg-subtle: var(--surface);
  --glass-bg-strong: var(--surface-strong);
  --glass-border: var(--line);
  --glass-border-highlight: var(--line-strong);
  --glass-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  --glass-blur: none;
  --ambient-tint: rgba(109, 96, 255, 0.16);
}

[data-accent="blue"] {
  --bg: #eff4fd;
  --surface-strong: #e9f0fb;
  --surface-hover: #dce6f6;
  --line: #d8e2f2;
  --line-strong: #bccbe6;
  --accent: #3b63db;
  --accent-strong: #294dbb;
  --accent-glow: rgba(59, 99, 219, 0.12);
  --ambient-tint: rgba(59, 99, 219, 0.12);
}

[data-theme="dark"][data-accent="blue"] {
  --bg: #08111f;
  --surface: #0f1b31;
  --surface-strong: #16243f;
  --surface-hover: #20325a;
  --line: #213352;
  --line-strong: #31497a;
  --accent: #8ca8ff;
  --accent-strong: #adc0ff;
  --accent-glow: rgba(140, 168, 255, 0.16);
  --ambient-tint: rgba(59, 99, 219, 0.22);
}

[data-accent="teal"] {
  --bg: #ecf7f5;
  --surface-strong: #e3f2ef;
  --surface-hover: #d3e9e5;
  --line: #d0e5e1;
  --line-strong: #b0d1cc;
  --accent: #0f8b82;
  --accent-strong: #08736c;
  --accent-glow: rgba(15, 139, 130, 0.12);
  --ambient-tint: rgba(15, 139, 130, 0.13);
}

[data-theme="dark"][data-accent="teal"] {
  --bg: #071513;
  --surface: #0e2220;
  --surface-strong: #153330;
  --surface-hover: #1f4642;
  --line: #1d3d39;
  --line-strong: #2d5c56;
  --accent: #4fd1c5;
  --accent-strong: #7de1d8;
  --accent-glow: rgba(79, 209, 197, 0.16);
  --ambient-tint: rgba(15, 139, 130, 0.24);
}

[data-accent="rose"] {
  --bg: #fcf0f5;
  --surface-strong: #f9e8ef;
  --surface-hover: #f2d8e3;
  --line: #f0d9e3;
  --line-strong: #deb9ca;
  --accent: #c03d70;
  --accent-strong: #a52c5d;
  --accent-glow: rgba(192, 61, 112, 0.12);
  --ambient-tint: rgba(192, 61, 112, 0.12);
}

[data-theme="dark"][data-accent="rose"] {
  --bg: #170b12;
  --surface: #23121b;
  --surface-strong: #301a26;
  --surface-hover: #43263a;
  --line: #3f2433;
  --line-strong: #5d3750;
  --accent: #f27cab;
  --accent-strong: #ff9cc0;
  --accent-glow: rgba(242, 124, 171, 0.16);
  --ambient-tint: rgba(192, 61, 112, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--body-ambient);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

/* ================= Phantom Centered Auth UI ================= */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0a0a0a;
  padding: 1.5rem;
  overflow-y: auto;
}

.auth-screen.hidden {
  display: none;
}

.auth-center-container {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.auth-card-phantom {
  width: 100%;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 2.5rem 2.25rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.auth-header-phantom {
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-header-phantom h2 {
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.auth-header-phantom p {
  font-size: 0.95rem;
  color: #888888;
  margin: 0;
}

.phantom-input-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.phantom-input-group label {
  font-size: 0.88rem;
  font-weight: 500;
  color: #cfcfcf;
}

.phantom-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.phantom-input-box input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: 1px solid #2d2d2d;
  background: #1d1d1d;
  color: #ffffff;
  padding: 0 14px;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.phantom-input-box input:focus {
  border-color: #1A76FD;
  box-shadow: 0 0 0 2px rgba(26, 118, 253, 0.25);
}

.password-wrapper input {
  padding-right: 44px;
}

.password-toggle-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: #777777;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s;
}

.password-toggle-btn:hover {
  color: #ffffff;
}

.remember-row-phantom {
  margin-top: -2px;
}

.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #8c8c8c;
  cursor: pointer;
}

.phantom-primary-btn {
  width: 100%;
  height: 44px;
  background: #1A76FD;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s, transform 0.1s;
  margin-top: 4px;
}

.phantom-primary-btn:hover {
  background: #1565d8;
}

.phantom-primary-btn:active {
  transform: scale(0.99);
}

.phantom-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 0.5rem 0;
  color: #555555;
  font-size: 0.85rem;
}

.phantom-divider::before,
.phantom-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #282828;
}

.phantom-divider span {
  padding: 0 12px;
}

.discord-oauth-btn {
  width: 100%;
  height: 44px;
  background: #24272c;
  border: 1px solid #36393f;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.discord-oauth-btn:hover {
  background: #2c3036;
  border-color: #5865F2;
}

.auth-error {
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid rgba(240, 68, 56, 0.2);
}

.auth-error.hidden {
  display: none;
}

.key-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.75rem;
  color: var(--muted-strong);
  cursor: pointer;
  transition: all 120ms ease;
}

.copy-btn:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.drop-zone {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  background: var(--surface-strong);
  cursor: pointer;
  transition: all 140ms ease;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.wide-button {
  width: 100%;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
}

.sidebar {
  grid-row: 1 / 3;
  border-right: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.5rem 0.25rem 1rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  margin-bottom: 0.5rem;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(26, 118, 253, 0.1);
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  border: 0;
  width: 100%;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  padding: 10px 12px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  font-weight: 500;
  transition: all 120ms ease;
}

.nav-item .nav-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  flex-shrink: 0;
  opacity: 0.75;
  transition: transform 120ms ease, opacity 120ms ease;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
  color: var(--accent);
}

.nav-item:hover,
.nav-item.active {
  color: var(--text);
  background: var(--surface-strong);
}

#logoutButton:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  color: #ef4444 !important;
}

.nav-item.active {
  font-weight: 600;
}

.sidebar-card {
  margin-top: auto;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 14px;
  background: var(--glass-bg-subtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sidebar-card strong,
.sidebar-card small {
  display: block;
}

.sidebar-card small {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}

.muted-label,
.metric-label,
.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.main-panel {
  min-width: 0;
  padding: 28px;
}

.signature {
  grid-column: 2;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 1.25rem 28px 1.5rem 0;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  user-select: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s, background 0.2s;
}

.signature:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.signature img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.95;
}

.signature span {
  color: #e2e8f0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.topbar > div:first-child {
  min-width: 240px;
  flex: 1 1 300px;
}

.topbar h1 {
  margin: 5px 0 0;
  font-size: clamp(1.4rem, 2.2vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.eyebrow {
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 0 auto;
}

.search-box {
  height: 42px;
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: var(--glass-bg-subtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
}

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

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  border-radius: 8px;
  min-height: 40px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  color: #ffffff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  color: var(--accent);
  border-color: rgba(15, 118, 110, 0.25);
  background: var(--accent-glow);
}

.secondary-button:hover {
  background: rgba(15, 118, 110, 0.25);
}

.ghost-button {
  color: var(--muted-strong);
  border-color: var(--line);
  background: var(--surface);
}

.ghost-button:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 140ms ease;
  flex-shrink: 0;
}

.theme-toggle-btn:hover {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--line-strong);
}

.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.ping-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--surface-strong);
  color: var(--muted-strong);
  border: 1px solid var(--line);
}

.ping-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.icon-button {
  width: 38px;
  padding: 0;
  color: var(--muted-strong);
  border-color: var(--line);
  background: var(--surface);
  font-size: 1.25rem;
}

.account-menu {
  position: relative;
}

.account-button {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  padding: 4px 12px 4px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.account-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.account-avatar {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #1A76FD 0%, #0d4bb8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(26, 118, 253, 0.3);
}

.avatar-status-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #0f1115;
}

.account-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.15;
}

.account-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #f1f5f9;
}

.account-role-tag {
  font-size: 0.68rem;
  font-weight: 500;
  color: #94a3b8;
}

.account-chevron {
  color: #64748b;
  transition: transform 0.2s;
  margin-left: 2px;
}

.account-button[aria-expanded="true"] .account-chevron {
  transform: rotate(180deg);
}

/* Account Popover */
.account-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 100;
  width: 270px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #141518;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  padding: 12px;
  display: none;
  animation: popoverFadeIn 0.15s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.account-popover.open {
  display: block;
}

.popover-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 12px 6px;
}

.popover-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1A76FD 0%, #0d4bb8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: #ffffff;
  flex-shrink: 0;
}

.popover-user-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.popover-email {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.popover-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #38bdf8;
}

.popover-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 0 8px 0;
}

.popover-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.popover-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.popover-item svg {
  color: #94a3b8;
  flex-shrink: 0;
  transition: color 0.15s;
}

.popover-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.popover-item:hover svg {
  color: #ffffff;
}

.popover-item.popover-danger {
  color: #f87171;
}

.popover-item.popover-danger svg {
  color: #f87171;
}

.popover-item.popover-danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.popover-item.popover-danger:hover svg {
  color: #ef4444;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric-card,
.panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2rem;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.compact-list,
.risk-list,
.activity-feed {
  display: grid;
  gap: 10px;
}

.log-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.log-pagination label,
.log-pagination-buttons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.log-pagination select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--text);
  background: var(--surface);
}

.log-pagination .ghost-button {
  min-height: 36px;
}

.log-pagination .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.compact-item,
.risk-list article,
.flow-list article,
.sync-item,
.activity-item,
.product-card {
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: 13px;
  background: var(--glass-bg-subtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.compact-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.compact-item strong,
.compact-item span,
.activity-item span,
.risk-list span {
  display: block;
}

.compact-item span,
.activity-item span,
.flow-list span,
.sync-item span,
.risk-list span,
.product-card p {
  color: var(--muted);
  margin-top: 3px;
}

.status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-active {
  color: var(--success);
  background: var(--success-soft);
}

.status-suspended {
  color: var(--danger);
  background: var(--danger-soft);
}

.status-expired {
  color: var(--warning);
  background: var(--warning-soft);
}

.segmented-control {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.segmented-control button {
  min-height: 36px;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 12px;
  background: transparent;
  color: var(--muted-strong);
  font-weight: 700;
}

.segmented-control button:last-child {
  border-right: 0;
}

.segmented-control button.active {
  color: var(--text);
  background: var(--surface-strong);
}

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

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

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td {
  color: var(--muted-strong);
}

td strong {
  color: var(--text);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.tiny-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--muted-strong);
  font-weight: 700;
  cursor: pointer;
  transition: all 120ms ease;
}

.tiny-button:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.tiny-button-danger {
  color: var(--danger) !important;
  border-color: rgba(244, 63, 94, 0.25) !important;
  background: var(--danger-soft) !important;
}

.tiny-button-danger:hover {
  background: rgba(244, 63, 94, 0.25) !important;
  border-color: var(--danger) !important;
  color: #ffffff !important;
}

.danger-button {
  border-radius: 8px;
  min-height: 40px;
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 0 16px;
  font-weight: 700;
  color: #ffffff;
  background: var(--danger);
  cursor: pointer;
  transition: all 140ms ease;
}

.danger-button:hover {
  background: #e11d48;
  border-color: #f43f5e;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.35);
}

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

.product-card h3 {
  margin: 0;
  font-size: 1rem;
}

.product-card p {
  margin-bottom: 14px;
}

.product-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

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

.product-meta span {
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted-strong);
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 700;
}

.sync-grid,
.flow-list {
  display: grid;
  gap: 10px;
}

.sync-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.sync-item strong,
.sync-item span {
  display: block;
}

.sync-state {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--accent);
  background: var(--accent-soft, rgba(0, 204, 136, 0.12));
}

.activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.activity-dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.activity-time {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.settings-grid,
.form-grid {
  display: grid;
  gap: 14px;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-row,
.toggle-row,
.form-grid label {
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 13px;
  background: var(--glass-bg-subtle);
}

.field-row,
.form-grid label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.field-row input,
.field-row select,
.form-grid input,
.form-grid select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-weight: 700;
}

.toggle-row small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}

.toggle-row input {
  width: 42px;
  height: 22px;
  accent-color: var(--accent);
}

.modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(780px, calc(100vw - 28px));
}

.customer-licenses-modal {
  width: min(1180px, calc(100vw - 32px));
  max-width: none;
}

.customer-licenses-modal-card {
  box-sizing: border-box;
  width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.modal::backdrop {
  background: rgba(9, 13, 22, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-highlight);
  border-radius: 14px;
  box-shadow: var(--glass-shadow);
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.modal-header h2,
.modal-header p {
  margin: 0;
}

.modal-header p {
  margin-top: 5px;
  color: var(--muted);
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 600px) {
  .customer-licenses-modal {
    width: calc(100vw - 20px);
  }

  .customer-licenses-modal-card {
    padding: 16px;
  }
}

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

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  padding: 12px 14px;
  background: #101828;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

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

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-row: auto;
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px;
  }

  .brand,
  .sidebar-card {
    display: none;
  }

  .nav-list {
    display: flex;
    overflow-x: auto;
  }

  .nav-item {
    width: auto;
    white-space: nowrap;
  }

  .signature {
    grid-column: 1;
  }

  .metric-grid,
  .split-layout,
  .product-grid,
  .settings-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .main-panel {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions {
    min-width: 0;
  }

  .account-popover {
    left: 0;
    right: auto;
  }

  .metric-grid,
  .split-layout,
  .product-grid,
  .settings-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    overflow-x: auto;
  }
}

/* Documentation View Styles */
.docs-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--glass-border);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.docs-nav::-webkit-scrollbar {
  display: none;
}

.docs-nav-btn {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg-subtle);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--muted-strong);
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 120ms ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.docs-nav-btn:hover {
  background: var(--surface-strong);
  color: var(--text);
  border-color: var(--line-strong);
}

.docs-nav-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(15, 118, 110, 0.3);
}

.docs-section {
  display: none;
}

.docs-section.active {
  display: block;
}

.docs-callout {
  padding: 14px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.9rem;
  line-height: 1.5;
  border-left: 4px solid;
}

.docs-callout.tip {
  background: var(--success-soft);
  border-color: var(--success);
  color: #064e3b;
}

.docs-callout.warning {
  background: var(--warning-soft);
  border-color: var(--warning);
  color: #78350f;
}

.docs-callout.info {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #075985;
}

.code-container {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  margin: 16px 0 24px;
  border: 1px solid #1e293b;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #1e293b;
  font-size: 0.8rem;
  font-family: monospace;
  color: #94a3b8;
}

.code-copy-btn {
  background: #334155;
  border: 0;
  border-radius: 4px;
  color: #f1f5f9;
  font-size: 0.75rem;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 120ms ease;
}

.code-copy-btn:hover {
  background: #475569;
}

.code-container pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
}

.admin-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.admin-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--glass-bg-subtle);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Telemetry & Analytics Chart */
.chart-container {
  padding: 20px 24px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  margin-top: 24px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 0.82rem;
  font-weight: 600;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-valid { background: var(--accent); }
.legend-blocked { background: var(--danger); }

.telemetry-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0 20px;
  padding: 14px 18px;
  background: var(--glass-bg-subtle);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.telemetry-stat-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.telemetry-stat-label {
  font-size: 0.74rem;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.telemetry-stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
}

.telemetry-chart-viewport {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: visible;
}

.telemetry-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--glass-border);
  stroke-dasharray: 4,4;
  stroke-width: 1;
}

.chart-grid-text {
  font-size: 11px;
  fill: var(--muted);
  font-family: ui-monospace, monospace;
}

.chart-axis-labels {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px 0 45px;
  border-top: 1px solid var(--glass-border);
  margin-top: 6px;
}

.chart-axis-label {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.chart-node-circle {
  cursor: pointer;
  transition: r 140ms ease, stroke-width 140ms ease;
}

.chart-node-circle:hover {
  r: 6.5px !important;
  stroke-width: 3.5px !important;
}

.chart-tooltip {
  position: absolute;
  z-index: 30;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border-highlight);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: var(--glass-shadow);
  pointer-events: none;
  font-size: 0.82rem;
  min-width: 180px;
  transform: translate(-50%, -115%);
  transition: opacity 120ms ease;
}

.tooltip-date {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--glass-border);
}

.tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0;
}

.tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.tooltip-meta {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--glass-border);
  padding-top: 4px;
}

@media (max-width: 680px) {
  .telemetry-stats-bar {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* Batch License Output Box */
.batch-output-box {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0;
  max-height: 220px;
  overflow-y: auto;
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  user-select: all;
}

/* Blacklist Management Styles */
.blacklist-table td {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.tiny-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 28px;
}

.tiny-button:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
  color: var(--accent);
}

.tiny-button-danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.tiny-button-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #f87171;
}

/* Bulk Actions Floating Toolbar */
.bulk-toolbar {
  position: sticky;
  bottom: 20px;
  margin-top: 14px;
  background: var(--surface-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  z-index: 100;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.bulk-toolbar.hidden {
  display: none !important;
}

.bulk-toolbar-info {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bulk-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Country Chip & Notes */
.country-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-family: ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  border-radius: 4px;
  background: rgba(26, 118, 253, 0.12);
  color: var(--accent);
  border: 1px solid rgba(26, 118, 253, 0.25);
}

.note-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.note-btn:hover {
  color: var(--accent);
}

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

.theme-mode-field,
.theme-accent-field {
  align-content: start;
}

.theme-mode-field small,
.theme-accent-field small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}

.theme-mode-field select,
.theme-display-field select {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.theme-display-field {
  align-content: start;
  gap: 10px;
}

.theme-display-field > label:not(.theme-motion-toggle) {
  display: grid;
  gap: 5px;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 600;
}

.theme-display-field > small {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.45;
}

.theme-motion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 600;
}

.theme-motion-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.theme-secondary-strength {
  display: grid;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.theme-secondary-strength span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.theme-secondary-strength output {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.theme-secondary-strength input {
  width: 100%;
  accent-color: var(--secondary);
}

.theme-accent-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-accent-choice {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted-strong);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.theme-accent-choice:hover,
.theme-accent-choice[aria-pressed="true"] {
  color: var(--text);
  background: var(--accent-glow);
  border-color: var(--accent);
}

.theme-accent-swatch {
  width: 13px;
  height: 13px;
  background: var(--swatch-color);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line);
}

@media (max-width: 760px) {
  .theme-control-grid {
    grid-template-columns: 1fr;
  }
}

.buyers-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.buyers-select {
  height: 42px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.buyers-insights {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.buyers-bars {
  display: grid;
  gap: 12px;
}

.buyers-bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
  font-size: 0.86rem;
}

.buyers-bar-label small {
  color: var(--muted);
  font-weight: 500;
}

.buyers-bar-track {
  height: 8px;
  background: var(--surface-strong);
  border-radius: 999px;
  overflow: hidden;
}

.buyers-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.source-chip {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--accent);
  background: var(--accent-glow);
  border-radius: 999px;
}

.buyer-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.buyer-field {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.buyer-field span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.buyer-section-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.buyer-note {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

.product-files {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.product-files-list {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.product-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  font-size: 0.86rem;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-file-row small {
  display: block;
  color: var(--muted);
}

.product-files-upload {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.product-files-upload input[type="text"] {
  flex: 1;
  min-width: 140px;
}

@media (max-width: 760px) {
  .buyers-insights,
  .buyer-field-grid {
    grid-template-columns: 1fr;
  }
}

.auth-screen {
  background:
    radial-gradient(ellipse at 50% 0%, var(--accent-glow), transparent 58%),
    var(--bg);
}

.auth-card-phantom {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(20, 25, 50, 0.14);
}

[data-theme="dark"] .auth-card-phantom {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.auth-header-phantom h2,
.phantom-input-group label {
  color: var(--text);
}

.auth-header-phantom p,
.remember-row {
  color: var(--muted);
}

.phantom-input-box input {
  background: var(--surface-strong);
  border-color: var(--line);
  color: var(--text);
}

.phantom-input-box input::placeholder {
  color: var(--muted);
}

.phantom-input-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.phantom-primary-btn {
  background: var(--accent);
}

.phantom-primary-btn:hover {
  background: var(--accent-strong);
}

.phantom-divider {
  color: var(--muted);
}

.phantom-divider::before,
.phantom-divider::after {
  border-color: var(--line);
}

.discord-oauth-btn {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}

.discord-oauth-btn:hover {
  background: var(--surface-strong);
  border-color: var(--accent);
}

.brand {
  border-color: var(--line);
}

.brand-logo {
  background: var(--accent-glow);
  border-color: var(--line);
}

.brand-title,
.account-button,
.account-name {
  color: var(--text);
}

.brand-subtitle,
.account-role-tag {
  color: var(--muted);
}

.nav-item.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.sidebar-card,
.search-box,
.field-row,
.toggle-row,
.form-grid label {
  background: var(--surface);
  border-color: var(--line);
}

.sidebar-card,
.metric-card,
.panel,
.chart-container {
  box-shadow: var(--glass-shadow);
}

.account-button:hover {
  background: var(--surface-strong);
}

.account-popover {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

.popover-email,
.popover-item {
  color: var(--text);
}

.popover-role-pill {
  color: var(--accent);
  background: var(--accent-glow);
}

.popover-divider {
  background: var(--line);
}

.popover-item svg {
  color: var(--muted);
}

.popover-item:hover {
  background: var(--surface-strong);
  color: var(--text);
}

.popover-item:hover svg {
  color: var(--accent);
}

.signature {
  color: var(--muted-strong);
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--glass-shadow);
}

.signature span {
  color: var(--text);
}

.signature:hover {
  background: var(--surface-strong);
  border-color: var(--line-strong);
}

.table-wrap tbody tr:hover {
  background: var(--surface-strong);
}

/* Unified product interface */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-strong: #f7f8fc;
  --surface-hover: #edf0f8;
  --line: #e5e8f0;
  --line-strong: #d3d8e5;
  --text: #171d31;
  --muted: #788198;
  --muted-strong: #525d75;
  --accent: #635bdb;
  --accent-strong: #5148c7;
  --accent-glow: rgba(99, 91, 219, 0.1);
  --ambient-tint: rgba(99, 91, 219, 0.07);
  --shadow: 0 12px 32px rgba(29, 39, 70, 0.06);
  --glass-shadow: 0 10px 28px rgba(29, 39, 70, 0.045);
  --body-ambient: radial-gradient(ellipse at 75% -10%, rgba(116, 128, 237, 0.11), transparent 40%);
}

[data-theme="dark"] {
  --bg: #0e1220;
  --surface: #151a2a;
  --surface-strong: #1b2133;
  --surface-hover: #252d43;
  --line: #293149;
  --line-strong: #39445f;
  --text: #edf0fa;
  --muted: #939db5;
  --muted-strong: #c1c9dc;
  --accent: #9c95ff;
  --accent-strong: #b7b1ff;
  --accent-glow: rgba(156, 149, 255, 0.13);
  --ambient-tint: rgba(116, 106, 255, 0.14);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  --glass-shadow: 0 16px 38px rgba(0, 0, 0, 0.2);
}

body {
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--body-ambient);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--bg);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 15px;
  gap: 20px;
  background: #111629;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  color: #e9ecf7;
}

.brand {
  padding: 4px 8px 19px;
  margin: 0;
  border-bottom-color: rgba(255, 255, 255, 0.09);
}

.brand-logo {
  width: 42px;
  height: 42px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.brand-title {
  color: #f7f8ff;
  font-size: 0.96rem;
}

.brand-subtitle {
  color: #99a2bc;
  font-size: 0.73rem;
}

.nav-list {
  gap: 4px;
}

.nav-item {
  min-height: 41px;
  padding: 9px 11px;
  color: #aab2c8;
  border-radius: 9px;
  font-size: 0.88rem;
}

.nav-item .nav-icon {
  width: 17px;
  height: 17px;
  color: #9ca7c3;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(145, 137, 255, 0.14);
}

.nav-item.active {
  box-shadow: inset 2px 0 #a39cff;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  color: #b8b2ff;
}

.main-panel {
  padding: clamp(22px, 3vw, 42px);
}

.topbar {
  align-items: center;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  letter-spacing: -0.045em;
}

.topbar .eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.11em;
}

.topbar-actions {
  gap: 9px;
}

.search-box,
.theme-toggle-btn {
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(26, 34, 66, 0.025);
}

.search-box {
  min-width: 250px;
  height: 42px;
}

.primary-button,
.secondary-button,
.ghost-button,
.icon-button {
  min-height: 40px;
  border-radius: 9px;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 140ms ease;
}

.primary-button {
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(99, 91, 219, 0.17);
}

.primary-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.secondary-button {
  color: var(--accent-strong);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--line));
  background: var(--accent-glow);
}

.secondary-button:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface));
}

.ping-badge {
  min-height: 32px;
  padding: 4px 10px;
  background: var(--surface);
}

.metric-grid {
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card,
.panel,
.chart-container {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--glass-shadow);
}

.metric-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.metric-card::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 72px;
  height: 72px;
  border-radius: 0 0 0 100%;
  background: var(--accent-glow);
  content: "";
}

.metric-card strong {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 2.2rem;
  letter-spacing: -0.055em;
}

.metric-label,
.muted-label,
.eyebrow {
  letter-spacing: 0.085em;
}

.metric-card small {
  font-size: 0.82rem;
}

.panel,
.chart-container {
  padding: 20px;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header h2,
.panel-header h3 {
  letter-spacing: -0.02em;
}

.status-pill {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 700;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

table th {
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.72rem;
  letter-spacing: 0.065em;
  text-transform: uppercase;
}

table td,
table th {
  border-color: var(--line);
}

.auth-screen {
  background:
    radial-gradient(ellipse at 14% 12%, rgba(101, 91, 225, 0.28), transparent 38%),
    radial-gradient(ellipse at 88% 88%, rgba(54, 138, 197, 0.18), transparent 34%),
    #0c1020;
}

.auth-center-container {
  max-width: 440px;
}

.auth-card-phantom {
  position: relative;
  gap: 1.15rem;
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: rgba(20, 25, 43, 0.94);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.42);
}

.auth-card-phantom::before {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 2px;
  place-items: center;
  border: 1px solid rgba(174, 167, 255, 0.35);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(131, 121, 255, 0.28), rgba(69, 92, 181, 0.14));
  color: #d9d5ff;
  content: "CDM";
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.auth-header-phantom h2 {
  font-size: 1.9rem;
  color: #ffffff;
  letter-spacing: -0.04em;
}

.auth-header-phantom p {
  color: #a4acc1;
}

.phantom-input-group label {
  color: #cbd1e0;
  font-weight: 600;
}

.phantom-input-box input {
  height: 48px;
  border-color: #343c55;
  border-radius: 10px;
  background: #171d30;
}

.phantom-input-box input:focus {
  border-color: #928bff;
  box-shadow: 0 0 0 3px rgba(146, 139, 255, 0.16);
}

.remember-row {
  color: #a4acc1;
}

.phantom-primary-btn {
  height: 48px;
  border-radius: 10px;
  background: #7169e8;
  box-shadow: 0 8px 20px rgba(91, 81, 219, 0.25);
}

.phantom-primary-btn:hover {
  background: #827bfa;
}

.discord-oauth-btn {
  height: 48px;
  border-radius: 10px;
  border-color: #343c55;
  background: #191f32;
  color: #edf0fa;
}

.discord-oauth-btn:hover {
  border-color: #7169e8;
  background: #222a42;
}

.signature {
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted-strong);
  box-shadow: none;
}

.signature span {
  color: var(--muted-strong);
}

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    z-index: 5;
    width: 100%;
    height: auto;
    padding: 12px;
    gap: 12px;
  }

  .brand {
    padding: 2px 6px 12px;
  }

  .nav-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .nav-item {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  .nav-item.active {
    box-shadow: inset 0 -2px #a39cff;
  }

  .main-panel {
    padding: 20px 16px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-card {
    padding: 15px;
  }

  .metric-card strong {
    font-size: 1.8rem;
  }

  .topbar-actions {
    width: 100%;
  }

  .search-box {
    flex-basis: 100%;
    order: 1;
  }

  .auth-screen {
    padding: 16px;
  }

  .auth-card-phantom {
    padding: 30px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.toast {
  background: var(--text);
  color: var(--bg);
}

/* Control-room layout */
:root {
  --bg: #f1f0e9;
  --surface: #fbfaf6;
  --surface-strong: #e8e9df;
  --surface-hover: #e0e4d7;
  --line: #d8dace;
  --line-strong: #bfc6b5;
  --text: #19251f;
  --muted: #788178;
  --muted-strong: #4c5c50;
  --accent: #28714d;
  --accent-strong: #1e5c3d;
  --accent-glow: rgba(68, 139, 90, 0.13);
  --success: #4e9347;
  --success-soft: #e1efda;
  --ambient-tint: rgba(162, 181, 111, 0.13);
  --shadow: 0 16px 40px rgba(34, 48, 36, 0.08);
  --glass-shadow: 0 5px 18px rgba(34, 48, 36, 0.045);
  --body-ambient: none;
}

[data-theme="dark"] {
  --bg: #111915;
  --surface: #19231d;
  --surface-strong: #222e26;
  --surface-hover: #2b3a30;
  --line: #303e34;
  --line-strong: #435448;
  --text: #eef2e8;
  --muted: #9aa493;
  --muted-strong: #c3ccbd;
  --accent: #b9e879;
  --accent-strong: #d0f29d;
  --accent-glow: rgba(185, 232, 121, 0.12);
  --success: #a7d879;
  --success-soft: rgba(167, 216, 121, 0.14);
  --ambient-tint: rgba(136, 176, 89, 0.11);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  --glass-shadow: 0 5px 18px rgba(0, 0, 0, 0.13);
}

body {
  background-color: var(--bg);
  background-image: var(--body-ambient);
  color: var(--text);
  font-family: "DM Sans", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

.app-shell {
  display: block;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0 30px;
  width: 100%;
  height: auto;
  min-height: 72px;
  overflow: hidden;
  padding: 10px clamp(18px, 3.2vw, 56px);
  border: 0;
  border-bottom: 1px solid #29382e;
  background: #19251e;
  box-shadow: 0 6px 24px rgba(22, 32, 25, 0.12);
}

.brand {
  min-width: max-content;
  padding: 0;
  margin: 0;
  border: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: #f6f4ea;
}

.brand-title {
  color: #f4f3e9;
}

.brand-subtitle {
  color: #a0ad9e;
}

.nav-list {
  display: flex;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  padding: 3px 1px;
  scrollbar-width: thin;
  scrollbar-color: #506051 transparent;
}

.nav-item {
  flex: 0 0 auto;
  width: auto;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #bdc7ba;
  font-size: 0.82rem;
  white-space: nowrap;
}

.nav-item .nav-icon {
  width: 16px;
  height: 16px;
  color: #a5b1a3;
}

.nav-item.active,
.nav-item:hover {
  color: #f6f7ed;
  background: var(--accent-glow);
}

.nav-item.active {
  box-shadow: inset 0 -2px var(--accent);
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon {
  color: var(--accent);
}

.main-panel {
  width: min(100%, 1760px);
  margin: 0 auto;
  padding: 28px clamp(18px, 3.2vw, 56px) 42px;
}

.topbar {
  align-items: center;
  padding: 4px 0 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  font-size: clamp(1.7rem, 2.3vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -0.055em;
}

.topbar .eyebrow {
  color: var(--accent);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
}

.topbar-actions {
  gap: 8px;
}

.topbar-actions .ping-badge,
.theme-toggle-btn,
.search-box {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

.ping-badge {
  min-height: 36px;
  border-radius: 9px;
}

.search-box {
  min-width: 225px;
  border-radius: 9px;
}

.primary-button,
.secondary-button,
.ghost-button,
.theme-toggle-btn {
  border-radius: 9px;
}

.primary-button {
  color: var(--accent-contrast, #fff);
  background: var(--accent);
  box-shadow: none;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  color: var(--accent);
  border-color: var(--line-strong);
  background: transparent;
}

.secondary-button:hover {
  background: var(--accent-glow);
}

.view.active#overviewView {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
}

.overview-intro {
  position: relative;
  display: flex;
  grid-column: 1 / -1;
  min-height: 205px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  padding: 28px clamp(26px, 4vw, 54px);
  border: 1px solid #293b30;
  border-radius: 18px;
  background: #1d3126;
  color: #f2f2e7;
  box-shadow: 0 12px 30px rgba(26, 43, 31, 0.13);
}

.overview-intro::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 38%, rgba(196, 228, 149, 0.035) 38.2%, transparent 65%),
    radial-gradient(ellipse at 82% 50%, rgba(174, 218, 112, 0.13), transparent 36%);
  content: "";
  pointer-events: none;
}

.overview-intro-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.overview-kicker {
  color: #b9e879;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.overview-intro h2 {
  margin: 13px 0 8px;
  color: #f4f3e9;
  font-size: clamp(2rem, 3.7vw, 3.35rem);
  font-weight: 650;
  letter-spacing: -0.065em;
  line-height: 0.99;
}

.overview-intro p {
  max-width: 490px;
  margin: 12px 0 0;
  color: #c2cec0;
  font-size: 0.94rem;
  line-height: 1.65;
}

.overview-intro-art {
  position: relative;
  display: grid;
  width: 190px;
  height: 160px;
  flex: 0 0 190px;
  place-items: center;
  margin-right: 5%;
}

.intro-orbit {
  position: absolute;
  display: block;
  border: 1px solid rgba(201, 230, 163, 0.23);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.intro-orbit-outer {
  width: 190px;
  height: 105px;
}

.intro-orbit-inner {
  width: 146px;
  height: 132px;
  transform: rotate(42deg);
}

.intro-core {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(207, 238, 168, 0.48);
  border-radius: 20px;
  background: rgba(184, 232, 121, 0.13);
  box-shadow: 0 0 36px rgba(185, 232, 121, 0.12);
  color: #c8ef91;
  transform: rotate(-8deg);
}

.intro-core svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.intro-art-label {
  position: absolute;
  right: -25px;
  bottom: 1px;
  color: #b6c3b0;
  font-size: 0.57rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1.6;
}

#overviewView > .metric-grid {
  grid-column: 1 / -1;
  gap: 12px;
  margin: 0;
}

#overviewView > .metric-grid .metric-card {
  display: grid;
  min-height: 130px;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: var(--glass-shadow);
}

#overviewView > .metric-grid .metric-card::after {
  display: none;
}

#overviewView > .metric-grid .metric-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
}

#overviewView > .metric-grid .metric-card strong {
  grid-row: 2;
  margin: 10px 0 0;
  color: var(--text);
  font-size: 2rem;
  letter-spacing: -0.065em;
}

#overviewView > .metric-grid .metric-card small {
  grid-column: 1 / -1;
  margin-top: 6px;
  font-size: 0.76rem;
}

#overviewView > .chart-container {
  display: grid;
  grid-column: 1 / span 8;
  grid-template-areas:
    "heading heading"
    "plot stats"
    "axis stats";
  grid-template-columns: minmax(0, 1fr) 205px;
  align-content: start;
  gap: 18px 22px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--glass-shadow);
}

#overviewView .chart-header {
  grid-area: heading;
  align-items: flex-start;
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

#overviewView .chart-header h3 {
  font-size: 1rem !important;
  letter-spacing: -0.025em;
}

#overviewView .chart-header p {
  margin-top: 5px !important;
}

#overviewView .telemetry-stats-bar {
  grid-area: stats;
  display: grid;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 0;
  padding: 0 0 0 18px;
  border: 0;
  border-left: 1px solid var(--line);
}

#overviewView .telemetry-stat-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

#overviewView .telemetry-stat-item:last-child {
  border-bottom: 0;
}

#overviewView .telemetry-stat-label {
  color: var(--muted);
  font-size: 0.63rem;
  letter-spacing: 0.055em;
}

#overviewView .telemetry-stat-value {
  margin-top: 5px;
  color: var(--text) !important;
  font-size: 1.3rem;
}

#overviewView .telemetry-chart-viewport {
  grid-area: plot;
  min-width: 0;
  min-height: 185px;
}

#overviewView .telemetry-svg {
  overflow: visible;
}

#overviewView .chart-axis-labels {
  grid-area: axis;
}

#overviewView > .split-layout {
  display: grid;
  grid-column: 9 / -1;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  margin: 0 !important;
}

#overviewView > .split-layout > .panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--glass-shadow);
}

#overviewView > .split-layout .panel-header {
  align-items: center;
  gap: 10px;
}

#overviewView > .split-layout .panel-header h2 {
  font-size: 0.96rem;
  letter-spacing: -0.03em;
}

#overviewView > .split-layout .panel-header p {
  font-size: 0.78rem;
}

.metric-card,
.panel,
.chart-container {
  border-radius: 14px;
  border-color: var(--line);
  background: var(--surface);
  box-shadow: var(--glass-shadow);
}

.panel {
  padding: 20px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 10px;
}

table th {
  background: var(--surface-strong);
  color: var(--muted-strong);
}

.docs-callout.tip {
  background: var(--success-soft);
  color: var(--muted-strong);
}

.signature {
  margin-right: clamp(18px, 3.2vw, 56px);
}

@media (max-width: 1300px) {
  .sidebar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 9px;
    padding-bottom: 8px;
  }

  .brand {
    display: none;
  }

  #overviewView > .chart-container {
    grid-column: 1 / span 7;
    grid-template-columns: minmax(0, 1fr) 175px;
    gap: 15px;
    padding: 18px;
  }

  #overviewView > .split-layout {
    grid-column: 8 / -1;
  }
}

@media (max-width: 900px) {
  .main-panel {
    padding-top: 22px;
  }

  .view.active#overviewView {
    gap: 13px;
  }

  #overviewView > .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #overviewView > .chart-container {
    grid-column: 1 / -1;
  }

  #overviewView > .split-layout {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .sidebar {
    min-height: 57px;
    padding: 7px 10px;
  }

  .nav-list {
    gap: 2px;
  }

  .nav-item {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 0.78rem;
  }

  .main-panel {
    padding: 17px 13px 28px;
  }

  .topbar {
    gap: 12px;
    margin-bottom: 16px;
  }

  .topbar-actions {
    display: flex;
    flex-direction: row;
  }

  .topbar-actions .search-box {
    flex-basis: 100%;
    order: 2;
  }

  .overview-intro {
    min-height: 190px;
    padding: 22px;
    border-radius: 14px;
  }

  .overview-intro h2 {
    font-size: 2.2rem;
  }

  .overview-intro p {
    max-width: 270px;
    font-size: 0.83rem;
  }

  .overview-intro-art {
    position: absolute;
    right: -83px;
    bottom: -34px;
    width: 170px;
    height: 150px;
    opacity: 0.45;
  }

  .intro-art-label {
    display: none;
  }

  #overviewView > .metric-grid {
    gap: 9px;
  }

  #overviewView > .metric-grid .metric-card {
    min-height: 118px;
    padding: 14px;
  }

  #overviewView > .metric-grid .metric-card strong {
    font-size: 1.8rem;
  }

  #overviewView > .chart-container {
    grid-template-areas:
      "heading"
      "stats"
      "plot"
      "axis";
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  #overviewView .telemetry-stats-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 0;
    border: 0;
  }

  #overviewView .telemetry-stat-item {
    padding: 8px 0;
  }

  #overviewView .telemetry-chart-viewport {
    min-height: 150px;
  }

  #overviewView > .split-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.theme-settings-panel .theme-control-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.theme-settings-panel .theme-accent-field,
.theme-settings-panel .theme-style-field,
.theme-settings-panel .theme-display-field {
  min-width: 0;
  gap: 12px;
}

html[data-text-size="large"] {
  font-size: 18px;
}

html[data-density="compact"] .panel {
  padding: 14px;
}

html[data-density="compact"] .metric-card {
  padding: 14px;
}

html[data-density="compact"] th,
html[data-density="compact"] td {
  padding-top: 9px;
  padding-bottom: 9px;
}

html[data-density="compact"] .activity-item {
  padding: 9px;
}

html[data-reduce-motion="true"] *,
html[data-reduce-motion="true"] *::before,
html[data-reduce-motion="true"] *::after {
  scroll-behavior: auto !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

.theme-accent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.theme-accent-count {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.theme-accent-search {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.theme-accent-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.theme-accent-search svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.theme-accent-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.84rem;
}

.theme-accent-options {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px;
  max-height: 176px;
  overflow: auto;
  padding: 3px;
  scrollbar-color: var(--line-strong) transparent;
}

.theme-accent-choice,
.theme-accent-choice:hover,
.theme-accent-choice[aria-pressed="true"] {
  background: transparent;
}

.theme-accent-choice {
  display: grid;
  min-width: 0;
  min-height: 30px;
  place-items: center;
  padding: 0;
  border-color: transparent;
  border-radius: 8px;
}

.theme-accent-choice:hover,
.theme-accent-choice[aria-pressed="true"] {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--swatch-color);
}

.theme-accent-choice[hidden] {
  display: none;
}

.theme-accent-swatch {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--swatch-color);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.theme-accent-choice .theme-accent-name {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.theme-custom-color {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-strong);
  font-size: 0.8rem;
  font-weight: 700;
}

.theme-custom-color input {
  width: 38px;
  height: 30px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

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

.theme-style-choice {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted-strong);
  text-align: left;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.theme-style-choice:hover {
  transform: translateY(-2px);
}

.theme-style-choice[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
  color: var(--text);
}

.theme-style-choice > span:last-child {
  display: grid;
  gap: 2px;
}

.theme-style-choice strong {
  font-size: 0.78rem;
}

.theme-style-choice small {
  color: var(--muted);
  font-size: 0.66rem;
}

.style-preview {
  display: flex;
  height: 46px;
  align-items: end;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.style-preview i {
  display: block;
  height: 20px;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.style-preview i:first-child {
  height: 28px;
  background: var(--accent);
}

.style-preview-soft,
[data-theme-style="soft"] .style-preview {
  border-radius: 12px;
}

.style-preview-soft i {
  border-radius: 8px;
}

.style-preview-sharp,
.style-preview-sharp i {
  border-radius: 1px;
}

.style-preview-glass {
  background:
    linear-gradient(135deg, var(--accent-glow), transparent),
    var(--surface);
  backdrop-filter: blur(5px);
}

.style-preview-minimal {
  border-color: transparent;
  background: transparent;
}

[data-style="soft"] .panel,
[data-style="soft"] .metric-card,
[data-style="soft"] .chart-container,
[data-style="soft"] .portal-card,
[data-style="soft"] .docs-card,
[data-style="soft"] .table-wrap {
  border-radius: 22px;
  border-color: color-mix(in srgb, var(--line) 72%, transparent);
  box-shadow: 0 14px 36px rgba(34, 48, 36, 0.07);
}

[data-style="soft"] .primary-button,
[data-style="soft"] .secondary-button,
[data-style="soft"] .ghost-button,
[data-style="soft"] .theme-toggle-btn,
[data-style="soft"] .portal-tab {
  border-radius: 14px;
}

[data-style="soft"] .overview-intro {
  border-radius: 28px;
}

[data-style="sharp"] .panel,
[data-style="sharp"] .metric-card,
[data-style="sharp"] .chart-container,
[data-style="sharp"] .portal-card,
[data-style="sharp"] .docs-card,
[data-style="sharp"] .table-wrap,
[data-style="sharp"] .result-item {
  border-width: 2px;
  border-radius: 3px;
  box-shadow: none;
}

[data-style="sharp"] .primary-button,
[data-style="sharp"] .secondary-button,
[data-style="sharp"] .ghost-button,
[data-style="sharp"] .theme-toggle-btn,
[data-style="sharp"] .portal-tab,
[data-style="sharp"] .header-theme-control {
  border-radius: 3px;
}

[data-style="sharp"] .overview-intro {
  border-radius: 3px;
}

[data-style="glass"] .panel,
[data-style="glass"] .metric-card,
[data-style="glass"] .chart-container,
[data-style="glass"] .portal-card,
[data-style="glass"] .docs-card,
[data-style="glass"] .table-wrap,
[data-style="glass"] .header-theme-control,
[data-style="glass"] .search-box {
  border-color: color-mix(in srgb, var(--line) 70%, transparent);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 16px 38px rgba(20, 32, 24, 0.09);
}

[data-style="glass"] .panel,
[data-style="glass"] .metric-card,
[data-style="glass"] .chart-container,
[data-style="glass"] .portal-card,
[data-style="glass"] .docs-card {
  border-radius: 18px;
}

[data-style="glass"] .overview-intro {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 18px 48px rgba(20, 32, 24, 0.15);
}

[data-style="minimal"] .panel,
[data-style="minimal"] .metric-card,
[data-style="minimal"] .chart-container,
[data-style="minimal"] .portal-card,
[data-style="minimal"] .docs-card {
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
}

[data-style="minimal"] .metric-card {
  border-bottom: 2px solid var(--accent);
}

[data-style="minimal"] .panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

[data-style="minimal"] .overview-intro {
  border-radius: 8px;
  box-shadow: none;
}

[data-style="minimal"] .primary-button,
[data-style="minimal"] .secondary-button,
[data-style="minimal"] .ghost-button,
[data-style="minimal"] .theme-toggle-btn,
[data-style="minimal"] .header-theme-control {
  border-radius: 5px;
  box-shadow: none;
}

@media (max-width: 900px) {
  .theme-settings-panel .theme-control-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .theme-accent-options {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .theme-style-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .theme-accent-options {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .theme-style-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

[data-accent="custom"] {
  --bg: color-mix(in srgb, var(--saved-accent) 12%, #f1f0e9);
  --surface-strong: color-mix(in srgb, var(--saved-accent) 10%, #e9ece6);
  --surface-hover: color-mix(in srgb, var(--saved-accent) 14%, #dde5da);
  --line: color-mix(in srgb, var(--saved-accent) 12%, #d5dfd4);
  --line-strong: color-mix(in srgb, var(--saved-accent) 18%, #c3d0c1);
  --accent: var(--saved-accent);
  --accent-strong: color-mix(in srgb, var(--saved-accent) 82%, #111915);
  --accent-glow: color-mix(in srgb, var(--saved-accent) 13%, transparent);
  --ambient-tint: color-mix(in srgb, var(--saved-accent) 10%, transparent);
  --body-ambient: radial-gradient(ellipse at 88% 90%, var(--secondary-glow), transparent 42%), radial-gradient(ellipse at 50% 0%, var(--ambient-tint), transparent 48%);
}

[data-theme="dark"][data-accent="custom"] {
  --bg: color-mix(in srgb, var(--saved-accent) 20%, #111915);
  --surface-strong: color-mix(in srgb, var(--saved-accent) 16%, #202a23);
  --surface-hover: color-mix(in srgb, var(--saved-accent) 20%, #29352c);
  --line: color-mix(in srgb, var(--saved-accent) 18%, #303b32);
  --line-strong: color-mix(in srgb, var(--saved-accent) 24%, #465448);
  --accent: color-mix(in srgb, var(--saved-accent) 72%, #ffffff);
  --accent-strong: color-mix(in srgb, var(--saved-accent) 58%, #ffffff);
  --accent-glow: color-mix(in srgb, var(--saved-accent) 18%, transparent);
  --ambient-tint: color-mix(in srgb, var(--saved-accent) 15%, transparent);
  --body-ambient: radial-gradient(ellipse at 88% 90%, var(--secondary-glow), transparent 42%), radial-gradient(ellipse at 50% 0%, var(--ambient-tint), transparent 48%);
}

[data-secondary="custom"] {
  --secondary: var(--saved-secondary);
  --secondary-strong: color-mix(in srgb, var(--saved-secondary) 82%, #111915);
  --secondary-glow: color-mix(in srgb, var(--saved-secondary) 13%, transparent);
}

[data-theme="dark"][data-secondary="custom"] {
  --secondary: color-mix(in srgb, var(--saved-secondary) 72%, #ffffff);
  --secondary-strong: color-mix(in srgb, var(--saved-secondary) 58%, #ffffff);
  --secondary-glow: color-mix(in srgb, var(--saved-secondary) 18%, transparent);
}

.app-shell {
  background:
    radial-gradient(ellipse at 88% 90%, var(--secondary-glow), transparent 42%),
    var(--bg);
}

.secondary-button {
  color: var(--secondary);
  border-color: color-mix(in srgb, var(--secondary) 28%, var(--line));
  background: var(--secondary-glow);
}

.secondary-button:hover {
  background: color-mix(in srgb, var(--secondary) 22%, var(--surface));
}

html[data-secondary-surfaces="true"] .panel,
html[data-secondary-surfaces="true"] .metric-card {
  background-image: linear-gradient(var(--secondary-surface-tint), var(--secondary-surface-tint));
  border-color: color-mix(in srgb, var(--secondary) 22%, var(--glass-border));
}

html[data-secondary-highlights="true"] .segmented-control button.active,
html[data-secondary-highlights="true"] .theme-style-choice[aria-pressed="true"],
html[data-secondary-highlights="true"] .nav-item.active {
  color: var(--secondary);
  border-color: color-mix(in srgb, var(--secondary) 58%, var(--line));
  background-color: var(--secondary-glow);
}

.backup-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.backup-upload-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.portal-container .primary-button,
.docs-sidebar .primary-button {
  color: var(--accent-contrast, #ffffff);
}

[data-style="soft"] .activation-entry,
[data-style="soft"] .result-item,
[data-style="soft"] .reset-box,
[data-style="soft"] .docs-nav-link,
[data-style="soft"] .code-container {
  border-radius: 16px;
}

[data-style="sharp"] .activation-entry,
[data-style="sharp"] .result-item,
[data-style="sharp"] .reset-box,
[data-style="sharp"] .docs-nav-link,
[data-style="sharp"] .code-container {
  border-radius: 3px;
  box-shadow: none;
}

[data-style="glass"] .activation-entry,
[data-style="glass"] .result-item,
[data-style="glass"] .reset-box {
  border-color: color-mix(in srgb, var(--line) 75%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

[data-style="minimal"] .activation-entry,
[data-style="minimal"] .result-item,
[data-style="minimal"] .reset-box {
  border-color: var(--line);
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .overview-intro *,
  .nav-list * {
    scroll-behavior: auto;
  }
}

.topbar {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(0, 1.8fr);
  align-items: center;
  gap: 24px;
  padding: 2px 0 18px;
}

.topbar-heading {
  min-width: 0;
}

.topbar-heading .eyebrow {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}

.topbar-heading h1 {
  margin: 0;
  font-size: clamp(1.7rem, 2.2vw, 2.25rem);
  line-height: 1.05;
}

.topbar-actions {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.header-status-group,
.header-command-group {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.header-status-group .ping-badge {
  min-height: 36px;
  padding: 4px 11px;
  border-color: var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted-strong);
  font-size: 0.78rem;
}

.admin-badge {
  gap: 8px;
}

.admin-avatar {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 800;
}

.edge-badge .ping-dot {
  width: 7px;
  height: 7px;
}

.header-theme-control {
  position: relative;
  display: inline-flex;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted-strong);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.header-theme-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.header-theme-control > svg:first-child {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.header-theme-control select {
  width: 75px;
  padding: 0;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.header-theme-control select:focus-visible {
  outline: 0;
}

.theme-select-chevron {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.header-command-group .search-box {
  min-width: 160px;
  flex: 1 1 280px;
  height: 39px;
  border-radius: 9px;
}

.header-command-group > button {
  min-height: 39px;
  flex: 0 0 auto;
  font-size: 0.79rem;
}

.header-command-group #openCreateLicense {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-inline: 14px;
}

.header-command-group #openCreateLicense svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2;
}

.header-command-group #openCreateLicense:hover svg {
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

@media (max-width: 1050px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .header-status-group,
  .header-command-group {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  #createAdminForm {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #createAdminForm > label,
  #createAdminForm input {
    min-width: 0;
  }

  #createAdminForm input {
    box-sizing: border-box;
    width: 100%;
  }

  .topbar {
    gap: 12px;
  }

  .header-status-group {
    flex-wrap: wrap;
    gap: 6px;
  }

  .header-command-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
  }

  .header-command-group .search-box {
    grid-column: 1 / -1;
    width: 100%;
  }

  .header-command-group #openBatchLicenseBtn {
    grid-column: 1;
  }

  .header-command-group #openCreateLicense {
    grid-column: 2;
  }
}
