:root {
  --container: 1800px;
}

.monitor-shell {
  min-height: 100vh;
}

.app-frame,
.workspace-layout,
.workspace-layout > *,
.content-stack,
.panel,
.hero,
.dashboard-grid,
.chart-grid {
  min-width: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(7, 17, 31, 0.94), rgba(13, 30, 52, 0.9));
  box-shadow: var(--shadow);
}

.top-nav__brand {
  display: grid;
  gap: 6px;
}

.top-nav__brand h1 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 32px);
  font-family: "Fira Code", monospace;
}

.top-nav__brand p {
  margin: 0;
  color: var(--text-dim);
}

.top-nav__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.top-nav__tab {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.42);
  color: var(--text-dim);
}

.top-nav__tab--active {
  background: linear-gradient(135deg, rgba(77, 163, 255, 0.18), rgba(94, 234, 212, 0.08));
  color: var(--text);
  border-color: rgba(94, 234, 212, 0.24);
}

.workspace-layout {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pool-sidebar {
  display: grid;
  gap: 16px;
  align-content: start;
}

.pool-list {
  display: grid;
  gap: 12px;
}

.pool-card-lite {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(10, 24, 41, 0.96), rgba(7, 17, 31, 0.92));
  text-align: left;
  color: var(--text);
  appearance: none;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.pool-card-lite:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.pool-card-lite--active {
  border-color: rgba(94, 234, 212, 0.36);
  background: linear-gradient(135deg, rgba(17, 40, 69, 0.96), rgba(9, 31, 53, 0.96));
}

.pool-card-lite__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.pool-card-lite__meta,
.page-subtitle,
.help-text,
.table-note {
  color: var(--text-dim);
  line-height: 1.6;
}

.pool-card-lite__meta {
  font-size: 13px;
  word-break: break-all;
}

.pool-card-lite__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.pool-mini-stat {
  padding: 10px 11px;
  border-radius: 16px;
  background: rgba(7, 17, 31, 0.42);
  border: 1px solid rgba(122, 162, 221, 0.12);
  color: var(--text);
}

.pool-mini-stat strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 14px;
}

.content-stack,
.panel-stack,
.config-stack {
  display: grid;
  gap: 16px;
}

.hero,
.panel,
.metric-card {
  padding: 16px;
}

.metric-value {
  font-size: clamp(24px, 2.5vw, 34px);
}

.metric-detail {
  margin-top: 8px;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.page-title {
  display: grid;
  gap: 8px;
}

.page-title h2 {
  margin: 0;
  font-size: clamp(22px, 2.8vw, 36px);
  font-family: "Fira Code", monospace;
}

.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.chart-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.table-toolbar {
  display: grid;
  gap: 14px;
}

.table-toolbar__filters,
.table-toolbar__actions,
.inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.table-toolbar__actions {
  justify-content: space-between;
}

.table-toolbar__actions > .inline-fields:last-child {
  margin-left: auto;
}

.toolbar-input {
  min-width: min(280px, 100%);
}

.accounts-table {
  min-width: 1280px;
  table-layout: fixed;
}

.accounts-table th,
.accounts-table td {
  padding: 10px 8px;
}

.accounts-table tbody tr.account-row {
  background: var(--account-row-bg, transparent);
  transition: background 180ms ease, box-shadow 180ms ease;
}

.accounts-table tbody tr.account-row:hover {
  background: var(--account-row-bg, transparent);
  filter: brightness(1.05);
  box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.08);
}

.account-row--free {
  --account-row-bg: linear-gradient(90deg, rgba(100, 116, 139, 0.10), rgba(100, 116, 139, 0.02));
}

.account-row--go {
  --account-row-bg: linear-gradient(90deg, rgba(77, 163, 255, 0.10), rgba(77, 163, 255, 0.02));
}

.account-row--team {
  --account-row-bg: linear-gradient(90deg, rgba(45, 212, 191, 0.10), rgba(45, 212, 191, 0.02));
}

.account-row--plus {
  --account-row-bg: linear-gradient(90deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.03));
}

.account-row--pro5x {
  --account-row-bg: linear-gradient(90deg, rgba(245, 158, 11, 0.13), rgba(245, 158, 11, 0.03));
}

.account-row--pro20x {
  --account-row-bg: linear-gradient(90deg, rgba(251, 113, 133, 0.14), rgba(251, 191, 36, 0.05));
}

.account-row--unknown {
  --account-row-bg: linear-gradient(90deg, rgba(122, 162, 221, 0.06), rgba(122, 162, 221, 0.01));
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
}

.accounts-table td:first-child,
.accounts-table th:first-child {
  width: 44px;
}

.accounts-table th:nth-child(2),
.accounts-table td:nth-child(2) {
  width: 240px;
}

.accounts-table th:nth-child(3),
.accounts-table td:nth-child(3) {
  width: 130px;
}

.accounts-table th:nth-child(4),
.accounts-table td:nth-child(4) {
  width: 110px;
}

.accounts-table th:nth-child(5),
.accounts-table td:nth-child(5) {
  width: 150px;
}

.accounts-table th:nth-child(6),
.accounts-table td:nth-child(6) {
  width: 140px;
}

.accounts-table th:nth-child(7),
.accounts-table td:nth-child(7),
.accounts-table th:nth-child(8),
.accounts-table td:nth-child(8) {
  width: 140px;
}

.accounts-table th:nth-child(9),
.accounts-table td:nth-child(9) {
  width: 120px;
}

.account-main {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

.account-main strong {
  word-break: break-all;
  font-size: 14px;
}

.status-stack,
.expiry-stack,
.quota-stack {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.status-badge,
.tag-chip,
.table-subtle {
  line-height: 1.4;
}

.status-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(122, 162, 221, 0.08);
  color: var(--text-dim);
  font-size: 12px;
}

.tag-chip--warn {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

.tag-chip--danger {
  background: rgba(251, 113, 133, 0.12);
  color: #fda4af;
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.plan-pill--free {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

.plan-pill--go {
  background: rgba(77, 163, 255, 0.18);
  border-color: rgba(77, 163, 255, 0.24);
  color: #bfdbfe;
}

.plan-pill--team {
  background: rgba(45, 212, 191, 0.18);
  border-color: rgba(45, 212, 191, 0.24);
  color: #99f6e4;
}

.plan-pill--plus {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.24);
  color: #ddd6fe;
}

.plan-pill--pro5x {
  background: rgba(245, 158, 11, 0.20);
  border-color: rgba(245, 158, 11, 0.28);
  color: #fde68a;
}

.plan-pill--pro20x {
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.22), rgba(251, 191, 36, 0.16));
  border-color: rgba(251, 191, 36, 0.24);
  color: #fef3c7;
}

.plan-pill--unknown {
  background: rgba(122, 162, 221, 0.12);
  border-color: rgba(122, 162, 221, 0.18);
  color: var(--text-dim);
}

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

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

.quota-card,
.pool-config-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(10, 24, 41, 0.92);
}

.quota-card__title,
.pool-config-card__title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quota-card__title h4,
.pool-config-card__title h4 {
  margin: 0;
}

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

.alert-config-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(122, 162, 221, 0.12);
  background: rgba(7, 17, 31, 0.34);
}

.alert-config-panel__header,
.alert-metric-card__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.alert-config-panel__title {
  display: grid;
  gap: 6px;
}

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

.alert-metric-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(122, 162, 221, 0.12);
  background: rgba(10, 24, 41, 0.76);
}

.alert-metric-card--active {
  border-color: rgba(94, 234, 212, 0.28);
  background: linear-gradient(135deg, rgba(17, 40, 69, 0.9), rgba(9, 31, 53, 0.9));
}

.alert-metric-card__config {
  display: grid;
  gap: 10px;
}

.static-field {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(7, 17, 31, 0.4);
  color: var(--text);
}

.field-block {
  display: grid;
  gap: 8px;
}

.field-block--full {
  grid-column: 1 / -1;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.switch-like {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.4);
}

.switch-like input {
  margin: 0;
}

.empty-shell {
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--text-dim);
}

.alert--info {
  background: rgba(77, 163, 255, 0.08);
  border-color: rgba(77, 163, 255, 0.18);
  color: var(--text-dim);
}

@media (max-width: 1280px) {
  .workspace-layout,
  .config-grid,
  .quota-grid,
  .alert-metric-grid,
  .chart-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  :root {
    --container: 1500px;
  }

  .pool-config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .top-nav,
  .page-header,
  .section-actions {
    padding: 16px;
  }

  .top-nav {
    display: grid;
  }

  .pool-card-lite__stats {
    grid-template-columns: 1fr;
  }

  .table-toolbar__actions > .inline-fields:last-child {
    margin-left: 0;
  }

  .accounts-table {
    min-width: 1080px;
  }
}
