* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  font-size: 16px;
}
:root {
  --bg: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
  --surface-0: rgba(255, 255, 255, 0.03);
  --surface-1: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border-0: rgba(255, 255, 255, 0.06);
  --border-1: rgba(255, 255, 255, 0.08);
  --text-0: #ffffff;
  --text-1: rgba(255, 255, 255, 0.7);
  --text-2: rgba(255, 255, 255, 0.5);
  --text-3: rgba(255, 255, 255, 0.35);
  --accent-0: #6366f1;
  --accent-1: #a855f7;
  --ok: #22c55e;
  --warn: #f59e0b;
  --info: #38bdf8;
  --danger: #ef4444;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 14px;
  --radius-sm: 12px;
  --pad: 20px;
  --panel-x: 40px;
  --panel-y: 32px;
  --card-pad: 24px;
  --gap: 20px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
    0 0 100px rgba(99, 102, 241, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
html[data-theme="light"] {
  --bg: linear-gradient(135deg, #f5f7ff 0%, #eef2ff 50%, #f7f7ff 100%);
  --surface-0: rgba(0, 0, 0, 0.04);
  --surface-1: rgba(0, 0, 0, 0.06);
  --surface-2: rgba(0, 0, 0, 0.08);
  --border-0: rgba(0, 0, 0, 0.08);
  --border-1: rgba(0, 0, 0, 0.12);
  --text-0: #0b1220;
  --text-1: rgba(11, 18, 32, 0.8);
  --text-2: rgba(11, 18, 32, 0.65);
  --text-3: rgba(11, 18, 32, 0.55);
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2),
    0 0 80px rgba(99, 102, 241, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
body.is-compact {
  --panel-x: 28px;
  --panel-y: 22px;
  --card-pad: 18px;
  --gap: 14px;
}
html[data-reduced-motion="true"] * {
  transition-duration: 0.01ms !important;
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  scroll-behavior: auto !important;
}
body {
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  overflow-x: hidden;
  color: var(--text-0);
}
.main-container {
  width: 100%;
  max-width: 1320px;
  background: var(--surface-0);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow);
  display: flex;
  overflow: hidden;
  min-height: 600px;
  height: min(920px, calc(100vh - 40px));
}
/* Tabs Navigation */
.tabs-nav {
  width: 280px;
  min-width: 280px;
  background: linear-gradient(
    180deg,
    rgba(15, 15, 30, 0.8) 0%,
    rgba(20, 20, 40, 0.9) 100%
  );
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--border-0);
  position: relative;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.tabs-nav::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(99, 102, 241, 0.5),
    transparent
  );
}
.nav-header {
  padding: 0 12px 20px;
  border-bottom: 1px solid var(--border-0);
}
.nav-brand {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.nav-close {
  display: none;
  flex-shrink: 0;
}
.nav-header h2 {
  color: var(--text-0);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.nav-header p {
  color: var(--text-3);
  font-size: 0.75rem;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.nav-section-title {
  padding: 6px 12px 4px;
  color: var(--text-3);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.nav-footer {
  margin-top: auto;
  padding: 14px 12px 6px;
  border-top: 1px solid var(--border-0);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-footnote {
  color: var(--text-3);
  font-size: 0.75rem;
}
.nav-ghost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-0);
  color: var(--text-1);
  cursor: pointer;
  transition: all 0.3s ease;
}
html[data-theme="light"] .nav-ghost {
  background: rgba(255, 255, 255, 0.7);
}
.nav-ghost:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}
.nav-ghost-text {
  margin-left: auto;
  opacity: 0.8;
  font-weight: 600;
}
.kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-0);
  color: var(--text-1);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: transparent;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  text-align: left;
}
.tab-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15) 0%,
    rgba(168, 85, 247, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 14px;
}
.tab-btn::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, var(--accent-0) 0%, var(--accent-1) 100%);
  border-radius: 0 4px 4px 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.tab-btn:hover::before {
  opacity: 0.5;
}
.tab-btn.active::before {
  opacity: 1;
}
.tab-btn.active::after {
  transform: translateY(-50%) scaleY(1);
}
.tab-btn.active {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.tab-icon {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  transition: all 0.4s ease;
  border: 1px solid var(--border-1);
}
.tab-btn.active .tab-icon {
  background: linear-gradient(135deg, var(--accent-0) 0%, var(--accent-1) 100%);
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}
.tab-icon svg {
  width: 20px;
  height: 20px;
  stroke: rgba(255, 255, 255, 0.5);
  transition: all 0.4s ease;
}
html[data-theme="light"] .tab-icon svg {
  stroke: rgba(11, 18, 32, 0.55);
}
.tab-btn.active .tab-icon svg {
  stroke: #fff;
}
.tab-btn:hover .tab-icon svg {
  stroke: rgba(255, 255, 255, 0.8);
}
.tab-btn:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.7);
  outline-offset: 2px;
}
.tab-text {
  position: relative;
  z-index: 1;
  flex: 1;
}
.tab-title {
  color: var(--text-1);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.4s ease;
  letter-spacing: -0.01em;
}
.tab-btn.active .tab-title,
.tab-btn:hover .tab-title {
  color: var(--text-0);
}
.tab-subtitle {
  color: var(--text-3);
  font-size: 0.75rem;
  margin-top: 2px;
  transition: color 0.4s ease;
}
.tab-btn.active .tab-subtitle {
  color: rgba(255, 255, 255, 0.6);
}
html[data-theme="light"] .tab-btn.active .tab-subtitle {
  color: rgba(11, 18, 32, 0.65);
}
.tab-arrow {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.4s ease;
}
.tab-arrow svg {
  width: 18px;
  height: 18px;
  stroke: rgba(255, 255, 255, 0.6);
}
.tab-btn.active .tab-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Mobile header (shown only on small screens) */
.mobile-header {
  display: none;
}
.mobile-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Mobile nav backdrop */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  z-index: 85;
}
body.is-nav-open .nav-backdrop {
  display: block;
}
/* Content Area */
.tabs-content {
  flex: 1;
  padding: var(--panel-y) var(--panel-x);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
body.is-overlay-open .tabs-content {
  overflow: hidden;
}
.tab-panel {
  position: relative;
  display: none;
  opacity: 0;
  transform: translateX(18px);
}
.tab-panel.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
  animation: panel-in 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scrollbars (subtle, studio-grade) */
.tabs-content,
.tabs-nav,
.table-wrap,
.command-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}
html[data-theme="light"] .tabs-content,
html[data-theme="light"] .tabs-nav,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .command-list {
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
}
.tabs-content::-webkit-scrollbar,
.tabs-nav::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.command-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.tabs-content::-webkit-scrollbar-thumb,
.tabs-nav::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.command-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
html[data-theme="light"] .tabs-content::-webkit-scrollbar-thumb,
html[data-theme="light"] .tabs-nav::-webkit-scrollbar-thumb,
html[data-theme="light"] .table-wrap::-webkit-scrollbar-thumb,
html[data-theme="light"] .command-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border: 2px solid transparent;
  background-clip: content-box;
}
.tabs-content::-webkit-scrollbar-track,
.tabs-nav::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.command-list::-webkit-scrollbar-track {
  background: transparent;
}
.panel-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-1);
}
.panel-badge {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2) 0%,
    rgba(168, 85, 247, 0.2) 100%
  );
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  color: #a78bfa;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}
.panel-title {
  color: var(--text-0);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}
.panel-description {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 600px;
}
.panel-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.tools-left {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.tools-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.panel-content {
  display: grid;
  gap: var(--gap);
}
.content-card {
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  transition: all 0.4s ease;
}
.content-card:hover {
  background: var(--surface-1);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.2) 0%,
    rgba(168, 85, 247, 0.2) 100%
  );
  border-radius: 10px;
}
.card-icon svg {
  width: 18px;
  height: 18px;
  stroke: #a78bfa;
}
.card-title {
  color: var(--text-0);
  font-size: 1rem;
  font-weight: 600;
}
.card-text {
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.7;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}
.stat-item {
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: all 0.4s ease;
}
.stat-item:hover {
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.08);
}
.stat-value {
  color: var(--text-0);
  font-size: 1.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-0) 0%, var(--accent-1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  color: var(--text-2);
  font-size: 0.8rem;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-1);
  font-size: 0.95rem;
}
.feature-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, var(--accent-0) 0%, var(--accent-1) 100%);
  border-radius: 50%;
  flex-shrink: 0;
}
.progress-bar-container {
  margin-top: 20px;
}
.progress-label {
  display: flex;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 0.85rem;
  margin-bottom: 8px;
}
.progress-stack {
  display: grid;
  gap: 12px;
}
.progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--accent-0) 0%, var(--accent-1) 100%);
  border-radius: 10px;
  transition: width 1s ease;
}
/* Toggle Switch */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}
.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  border-radius: 12px;
}
.toggle-info h4 {
  color: var(--text-0);
  font-size: 0.95rem;
  font-weight: 600;
}
.toggle-info p {
  color: var(--text-3);
  font-size: 0.8rem;
  margin-top: 2px;
}
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.4s ease;
}
.toggle-switch.active {
  background: linear-gradient(135deg, var(--accent-0) 0%, var(--accent-1) 100%);
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.toggle-switch.active::after {
  transform: translateX(24px);
}
/* Responsive */
@media (max-width: 1100px) {
  :root {
    --panel-x: 28px;
    --panel-y: 26px;
    --card-pad: 20px;
    --gap: 16px;
  }
  .tabs-nav {
    width: 248px;
    min-width: 248px;
  }
  .tab-btn {
    padding: 14px 16px;
  }
  .panel-title {
    font-size: 1.85rem;
  }
}

@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
    min-height: auto;
    height: auto;
    overflow: visible;
  }
  .tabs-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    min-width: 0;
    transform: translateX(-110%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
    border-right: 1px solid var(--border-0);
    border-bottom: none;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
    padding: 18px 14px;
  }
  body.is-nav-open .tabs-nav {
    transform: translateX(0);
  }
  .tabs-nav::before {
    display: none;
  }
  .nav-close {
    display: inline-flex;
  }
  .tab-btn:hover {
    transform: none;
  }
  .tabs-content {
    overflow: visible;
    padding: calc(16px + env(safe-area-inset-top))
      calc(16px + env(safe-area-inset-right))
      calc(16px + env(safe-area-inset-bottom))
      calc(16px + env(safe-area-inset-left));
  }
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 12px 14px;
    margin: 0 0 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-0);
    backdrop-filter: blur(14px);
  }
  .tools-left,
  .tools-right {
    width: 100%;
  }
  .tools-right {
    flex-wrap: wrap;
  }
  .tools-right .btn {
    flex: 1;
    min-width: 160px;
  }
  .input-group,
  .select-group {
    width: 100%;
  }
  .panel-tools .input {
    width: 100%;
  }
  .tab-panel {
    position: relative;
    inset: auto;
    display: none;
    padding-right: 0;
    overflow: visible;
  }
  .tab-panel.active {
    display: block;
  }
  .panel-tools {
    flex-direction: column;
    align-items: stretch;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .command-root {
    padding-top: 18px;
  }
}
/* Animations */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.shimmer {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Utilities */
[hidden] {
  display: none !important;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
}
.muted {
  color: var(--text-3);
}
.right {
  text-align: right;
}
.w-40 {
  width: 40px;
}

/* Layout grids */
.finance-grid[data-layout="single"] {
  grid-template-columns: 1fr;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
}
@media (max-width: 900px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Buttons */
.btn {
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  transition: transform 0.25s ease, border-color 0.25s ease,
    background 0.25s ease, box-shadow 0.25s ease;
}
html[data-theme="light"] .btn {
  background: rgba(255, 255, 255, 0.65);
}
.btn:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.7);
  outline-offset: 2px;
}
.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-0) 0%, var(--accent-1) 100%);
  color: #fff;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover {
  border-color: transparent;
}
.btn-ghost {
  background: transparent;
}
.btn-full {
  width: 100%;
  margin-top: 14px;
}
.btn-sm {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-0);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-1);
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
.icon-btn:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

/* Inputs */
.label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--text-3);
  margin-bottom: 6px;
}
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 12px;
  width: 18px;
  height: 18px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.input-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
.input {
  width: 320px;
  max-width: 100%;
  padding: 11px 12px 11px 38px;
  border-radius: 12px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-0);
  outline: none;
  transition: border-color 0.25s ease, background 0.25s ease;
}
html[data-theme="light"] .input {
  background: rgba(255, 255, 255, 0.7);
}
.input::placeholder {
  color: var(--text-3);
}
.input:focus {
  border-color: rgba(99, 102, 241, 0.5);
  background: rgba(255, 255, 255, 0.06);
}
.select-group {
  display: flex;
  flex-direction: column;
}
.select {
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-0);
  outline: none;
}
html[data-theme="light"] .select {
  background: rgba(255, 255, 255, 0.7);
}

/* Pills */
.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pill {
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
  padding: 9px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
  transition: all 0.25s ease;
}
.pill:hover {
  border-color: rgba(99, 102, 241, 0.35);
}
.pill.active {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.22) 0%,
    rgba(168, 85, 247, 0.18) 100%
  );
  border-color: rgba(99, 102, 241, 0.35);
  color: var(--text-0);
}

/* Badges */
.badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.badge-row-tight {
  margin-top: 10px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-1);
}
.badge-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: rgba(185, 255, 219, 0.95);
}
.badge-warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: rgba(255, 231, 187, 0.95);
}
.badge-info {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: rgba(200, 245, 255, 0.95);
}
.badge-danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: rgba(255, 205, 205, 0.95);
}

/* Mini list */
.mini-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.mini-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-1);
  font-size: 0.92rem;
}
.mini-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.03);
}
.mini-dot.ok {
  background: var(--ok);
}
.mini-dot.warn {
  background: var(--warn);
}
.mini-dot.info {
  background: var(--info);
}

/* Key-value */
.kv {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-2);
  font-size: 0.9rem;
}

/* Timeline */
.timeline {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}
.timeline-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.02);
}
.timeline-time {
  color: var(--text-3);
  font-weight: 800;
  font-size: 0.78rem;
  text-align: center;
}
.timeline-title {
  color: var(--text-0);
  font-weight: 800;
  font-size: 0.92rem;
}
.timeline-text {
  color: var(--text-2);
  font-size: 0.86rem;
  margin-top: 2px;
}

/* Tables */
.table-wrap {
  margin-top: 14px;
  border: 1px solid var(--border-0);
  border-radius: 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.02);
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table thead th {
  text-align: left;
  padding: 12px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-3);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border-0);
}
.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-1);
  font-size: 0.92rem;
  vertical-align: middle;
}
html[data-theme="light"] .table tbody td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.table tbody tr:hover td {
  background: rgba(99, 102, 241, 0.06);
}
.table-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: var(--text-3);
  font-size: 0.82rem;
}
.table,
.table-footer {
  min-width: 0;
}
@media (max-width: 900px) {
  .table,
  .table-footer {
    min-width: 720px;
  }
}
.table-hint {
  color: var(--text-3);
}
.table-clickable tbody tr {
  cursor: pointer;
}
.th-btn {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.th-btn.right {
  justify-content: flex-end;
  width: 100%;
}
.table-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}
.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Checkbox */
.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.check-ui {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.04);
  display: inline-block;
  position: relative;
}
.check input:checked + .check-ui {
  background: linear-gradient(135deg, var(--accent-0) 0%, var(--accent-1) 100%);
  border-color: transparent;
}
.check input:checked + .check-ui::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg);
}

/* Address */
.address {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.02);
  margin-top: 12px;
}
.address-value {
  color: var(--text-0);
  font-weight: 800;
}
.address-actions {
  display: flex;
  gap: 8px;
}
.hint {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* Plans */
.plan-card .feature-list {
  margin-top: 14px;
}
.plan-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.plan-name {
  color: var(--text-0);
  font-weight: 900;
  font-size: 1.1rem;
}
.plan-price {
  color: var(--text-0);
  font-weight: 900;
  font-size: 1.15rem;
}
.plan-meta {
  margin-top: 10px;
}

/* Charts */
.chart-shell {
  margin-top: 14px;
}
.chart-bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 8px;
  align-items: end;
  height: 140px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border-0);
  background: rgba(255, 255, 255, 0.02);
}
.bar {
  border-radius: 10px;
  background: linear-gradient(180deg, var(--accent-0), var(--accent-1));
  opacity: 0.85;
  box-shadow: 0 10px 20px rgba(99, 102, 241, 0.12);
}
.bar.h-40 {
  height: 40%;
}
.bar.h-55 {
  height: 55%;
}
.bar.h-62 {
  height: 62%;
}
.bar.h-70 {
  height: 70%;
}
.bar.h-72 {
  height: 72%;
}
.bar.h-78 {
  height: 78%;
}
.bar.h-84 {
  height: 84%;
}
.bar.h-85 {
  height: 85%;
}
.bar.h-88 {
  height: 88%;
}
.bar.h-90 {
  height: 90%;
}
.bar.h-95 {
  height: 95%;
}
.bar.h-100 {
  height: 100%;
}
.chart-legend {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 0.9rem;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-0), var(--accent-1));
}
.legend-note {
  color: var(--text-3);
  margin-left: auto;
}
.pulse-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.pulse-item {
  border: 1px solid var(--border-0);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.pulse-value {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--text-0);
}
.pulse-label {
  margin-top: 4px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.7rem;
  font-weight: 800;
}

/* Toasts */
.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  z-index: 60;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  border-radius: 14px;
  border: 1px solid var(--border-0);
  background: rgba(15, 15, 30, 0.88);
  color: rgba(255, 255, 255, 0.85);
  padding: 12px 14px;
  min-width: 260px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}
html[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.9);
  color: rgba(11, 18, 32, 0.85);
}
.toast-title {
  font-weight: 900;
  font-size: 0.9rem;
}
.toast-text {
  margin-top: 4px;
  font-size: 0.86rem;
  color: var(--text-2);
}

/* Modals */
.modal-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
}
.modal-root[data-open="true"] {
  display: flex;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}
.modal {
  position: relative;
  width: min(680px, calc(100vw - 32px));
  border-radius: 18px;
  border: 1px solid var(--border-0);
  background: rgba(20, 20, 40, 0.85);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  overflow: hidden;
}
html[data-theme="light"] .modal {
  background: rgba(255, 255, 255, 0.92);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-0);
}
.modal-title {
  font-weight: 900;
  color: var(--text-0);
  letter-spacing: -0.02em;
}
.modal-body {
  padding: 16px;
  color: var(--text-2);
}
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-0);
}

/* Command palette */
.command-root {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 90px;
  z-index: 80;
}
.command-root[data-open="true"] {
  display: flex;
}
.command-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
}
.command {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  border-radius: 18px;
  border: 1px solid var(--border-0);
  background: rgba(20, 20, 40, 0.9);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  overflow: hidden;
}
html[data-theme="light"] .command {
  background: rgba(255, 255, 255, 0.92);
}
.command-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-0);
}
.command-header .input {
  width: 100%;
}
.command-list {
  max-height: 360px;
  overflow: auto;
}
.command-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: var(--text-1);
}
.command-item:hover,
.command-item.active {
  background: rgba(99, 102, 241, 0.12);
}
.command-item-title {
  font-weight: 900;
  color: var(--text-0);
}
.command-item-sub {
  color: var(--text-3);
  font-size: 0.86rem;
  margin-top: 2px;
}
.command-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border-0);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-3);
  font-size: 0.82rem;
}
.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* Forms (modal) */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 520px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
.form-field .input,
.form-field .select {
  width: 100%;
}
.input-plain {
  padding-left: 12px;
}
