:root {
  --bg: #111416;
  --sidebar: #1f2326;
  --panel: #202427;
  --panel-2: #252a2f;
  --text: #f4f7fb;
  --muted: #8e969f;
  --line: #30363c;
  --primary: #f16157;
  --primary-dark: #d94c43;
  --blue: #6bbfff;
  --gold: #6f611d;
  --ok: #62ce72;
  --warn: #f2cb45;
  --danger: #ff645c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
}

a {
  color: inherit;
}

.app-frame {
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  min-height: 100vh;
}

.client-frame {
  min-height: 100vh;
  position: relative;
}

.client-frame::before {
  background:
    radial-gradient(circle at 20% 20%, rgba(107, 191, 255, .14), transparent 28%),
    radial-gradient(circle at 84% 14%, rgba(241, 97, 87, .12), transparent 24%),
    linear-gradient(135deg, rgba(16, 20, 24, .96), rgba(7, 9, 13, .98));
  content: "";
  inset: 0;
  position: fixed;
  z-index: -1;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 14px;
  position: sticky;
  top: 0;
}

.brand {
  align-items: center;
  display: flex;
  min-height: 44px;
  padding: 0 8px 28px;
}

.brand img {
  height: 36px;
  max-width: 166px;
  object-fit: contain;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.side-nav a {
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  font-weight: 700;
  gap: 12px;
  min-height: 42px;
  padding: 0 14px;
  text-decoration: none;
}

.side-nav a:hover,
.side-nav a.active {
  background: #343941;
  color: #fff;
}

.side-nav span {
  color: var(--blue);
  width: 18px;
}

.sidebar-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 18px 12px 0;
}

.status-dot {
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(98, 206, 114, .12);
  height: 10px;
  width: 10px;
}

.workspace {
  min-width: 0;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 22px 38px 0;
}

.client-frame .topbar {
  padding: 26px 38px 0;
}

.client-frame .topbar > div:first-child {
  align-items: flex-start;
  display: grid;
  gap: 7px;
}

.client-logo {
  height: 38px;
  margin-bottom: 10px;
  object-fit: contain;
  width: 170px;
}

.chip-link {
  border-left: 1px solid var(--line);
  color: var(--muted);
  margin-left: 4px;
  padding-left: 10px;
  text-decoration: none;
}

.topbar h1 {
  font-size: 22px;
  margin: 4px 0 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.user-chip {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  gap: 10px;
  min-height: 42px;
  padding: 4px 14px 4px 5px;
}

.avatar {
  align-items: center;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.shell {
  margin: 0 auto;
  max-width: 1640px;
  padding: 24px 38px 38px;
}

.client-frame .shell {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 130px);
  padding-top: 10px;
}

.layout {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(12, 1fr);
}

.span-4 {
  grid-column: span 4;
}

.span-3 {
  grid-column: span 3;
}

.span-6 {
  grid-column: span 6;
}

.span-8 {
  grid-column: span 8;
}

.span-12 {
  grid-column: span 12;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .16);
  padding: 22px;
}

.center-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

.client-panel {
  display: grid;
  gap: 22px;
  max-width: 860px;
  width: min(860px, 100%);
}

.request-card {
  border-color: rgba(107, 191, 255, .38);
  max-width: 780px;
  padding: 28px;
  position: relative;
  width: min(780px, 100%);
}

.request-card::after {
  background: linear-gradient(90deg, var(--primary), var(--blue));
  border-radius: 999px;
  content: "";
  height: 3px;
  left: 28px;
  position: absolute;
  right: 28px;
  top: 0;
}

.request-card h1 {
  font-size: 32px;
}

.panel-heading {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.quota-badge {
  background: rgba(107, 191, 255, .14);
  border: 1px solid rgba(107, 191, 255, .28);
  border-radius: 999px;
  color: #d9ecff;
  font-weight: 800;
  padding: 7px 12px;
  white-space: nowrap;
}

.account-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.account-tile {
  background: #171b1f;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.account-tile.pending {
  border-color: rgba(242, 203, 69, .32);
}

.tile-top {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.tile-stats {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 14px;
}

.tile-stats span {
  background: rgba(255, 255, 255, .03);
  border-radius: 7px;
  color: var(--muted);
  display: grid;
  gap: 5px;
  padding: 10px;
}

.tile-stats b {
  color: var(--text);
}

.mini-actions {
  margin-top: 18px;
}

.info-box {
  background: rgba(107, 191, 255, .08);
  border: 1px solid rgba(107, 191, 255, .18);
  border-radius: 7px;
  display: grid;
  gap: 5px;
  min-height: 42px;
  padding: 10px 12px;
}

.info-box.full {
  margin-top: 18px;
}

.info-box span {
  color: var(--muted);
}

.metric-card {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  min-height: 96px;
  padding: 20px 22px;
}

.metric-card strong {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
}

.metric-card span {
  color: #e8eef7;
}

.metric-card b {
  align-items: center;
  border-radius: 10px;
  display: inline-flex;
  font-size: 18px;
  height: 52px;
  justify-content: center;
  width: 52px;
}

.metric-card.gold {
  background: #665817;
}

.metric-card.green {
  background: #214f2b;
}

.metric-card.red {
  background: #672a28;
}

.metric-card.neutral {
  background: var(--panel);
}

.metric-card.gold b {
  background: #f2cb45;
  color: #111416;
}

.metric-card.green b {
  background: #62ce72;
  color: #102015;
}

.metric-card.red b {
  background: #ff645c;
  color: #260706;
}

.metric-card.neutral b {
  background: #244328;
  color: var(--ok);
  font-size: 14px;
  width: 70px;
}

.panel h1,
.panel h2,
.panel h3 {
  margin: 0 0 14px;
}

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

.stat {
  display: grid;
  gap: 6px;
}

.stat strong {
  font-size: 28px;
}

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

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

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
select {
  background: #181c1f;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  min-height: 42px;
  padding: 9px 11px;
  width: 100%;
}

button,
.button {
  align-items: center;
  background: var(--primary);
  border: 0;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
}

button:hover,
.button:hover {
  background: var(--primary-dark);
}

.button.secondary {
  background: #26384d;
}

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

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #c7d6e8;
  font-size: 13px;
  text-transform: uppercase;
}

.pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 9px;
}

.pill.ok {
  background: rgba(98, 206, 114, .18);
  color: var(--ok);
}

.pill.warn {
  background: rgba(242, 203, 69, .18);
  color: var(--warn);
}

.pill.danger {
  background: rgba(255, 100, 92, .18);
  color: var(--danger);
}

.alert {
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.alert.success {
  background: rgba(98, 206, 114, .14);
  color: var(--ok);
}

.alert.error {
  background: rgba(255, 100, 92, .14);
  color: var(--danger);
}

.alert.info {
  background: rgba(107, 191, 255, .14);
  color: var(--blue);
}

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

.actions form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions input {
  min-width: 180px;
}

.inline-form {
  align-items: center;
  display: flex;
  gap: 8px;
}

.inline-form input {
  min-width: 170px;
}

.inline-form button {
  min-height: 36px;
  padding: 0 12px;
}

code {
  background: #141719;
  border-radius: 5px;
  color: #d9ecff;
  padding: 2px 5px;
}

.panel:nth-child(3n + 1) {
  border-top: 2px solid rgba(107, 191, 255, .55);
}

.panel:nth-child(3n + 2) {
  border-top: 2px solid rgba(241, 97, 87, .55);
}

.panel:nth-child(3n + 3) {
  border-top: 2px solid rgba(242, 203, 69, .45);
}

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

  .sidebar {
    min-height: auto;
    position: static;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px 16px 0;
  }

  .client-frame .topbar {
    padding: 18px 16px 0;
  }

  .client-frame .shell {
    min-height: auto;
  }

  .shell {
    padding: 16px;
  }

  .span-4,
  .span-3,
  .span-6,
  .span-8,
  .span-12 {
    grid-column: span 12;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .panel-heading,
  .tile-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .tile-stats {
    grid-template-columns: 1fr;
  }
}
