:root {
  --blue-950: #071a33;
  --blue-900: #0b2444;
  --blue-800: #123a66;
  --blue-700: #15558c;
  --blue-600: #1b6fb8;
  --blue-500: #2d91e6;
  --blue-200: #c9e6ff;
  --blue-100: #e9f5ff;
  --cyan: #42d8ff;
  --ink: #102033;
  --muted: #6d7f92;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --line: rgba(21, 85, 140, 0.16);
  --line-strong: rgba(21, 85, 140, 0.28);
  --ok: #18a66a;
  --warn: #f0a72d;
  --danger: #e04c5f;
  --shadow: 0 20px 70px rgba(7, 26, 51, 0.14);
  --radius-xl: 26px;
  --radius-lg: 18px;
  --radius-md: 12px;
  color: var(--ink);
  background: #eef7ff;
  font-family: "Aptos", "Noto Sans CJK SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 14% -8%, rgba(45, 145, 230, 0.34), transparent 34rem),
    radial-gradient(circle at 86% 10%, rgba(66, 216, 255, 0.28), transparent 32rem),
    linear-gradient(180deg, #e7f4ff 0%, #f7fbff 44%, #edf6ff 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.grid-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(21, 85, 140, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 85, 140, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
}

.app-shell {
  position: relative;
  width: min(1480px, calc(100% - 34px));
  margin: 0 auto;
  padding: 26px 0 46px;
}

.topbar,
.kpi,
.quota-card,
.toolbar,
.table-wrap,
.boot-card,
.error-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 24px;
  margin-bottom: 16px;
  background:
    linear-gradient(135deg, rgba(7, 26, 51, 0.96), rgba(18, 58, 102, 0.92)),
    radial-gradient(circle at 80% 0%, rgba(66, 216, 255, 0.36), transparent 22rem);
  color: white;
}

.topbar h1 {
  margin: 0;
  letter-spacing: -0.04em;
  font-family: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", "Aptos", sans-serif;
  font-size: clamp(40px, 6vw, 78px);
  font-weight: 950;
  line-height: 0.9;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: "DIN Condensed", "Bahnschrift", "Aptos", sans-serif;
  font-size: 12px;
  font-weight: 900;
}

h1,
h2 {
  color: inherit;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: currentColor;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.topbar .status-pill {
  color: #eef8ff;
}

.status-pill.ok {
  color: #dfffee;
  background: rgba(24, 166, 106, 0.18);
}

.status-pill.danger {
  color: #fff0f2;
  background: rgba(224, 76, 95, 0.18);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 5px rgba(24, 166, 106, 0.12);
}

.danger .status-dot {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(224, 76, 95, 0.12);
}

.refresh-button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue-500));
  color: var(--blue-950);
  padding: 10px 18px;
  font-weight: 950;
  box-shadow: 0 12px 30px rgba(45, 145, 230, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.refresh-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(45, 145, 230, 0.34);
}

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

.kpi {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 18px;
}

.kpi::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -38px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(45, 145, 230, 0.1);
}

.kpi-label {
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kpi-value {
  margin-top: 12px;
  color: var(--blue-950);
  font-family: "DIN Condensed", "Bahnschrift", "Aptos", sans-serif;
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 950;
  line-height: 0.9;
}

.kpi-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 28px 0 12px;
}

.section-title .eyebrow {
  color: var(--blue-600);
}

.section-title h2 {
  margin: 0;
  color: var(--blue-950);
  letter-spacing: -0.03em;
  font-family: "Avenir Next Condensed", "DIN Condensed", "Bahnschrift", "Aptos", sans-serif;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 950;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}

.quota-card {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.quota-card.limited {
  border-color: rgba(224, 76, 95, 0.34);
  background: linear-gradient(180deg, #fff, #fff6f8);
}

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

.quota-account {
  color: var(--blue-950);
  font-size: 18px;
  font-weight: 950;
}

.quota-plan,
.quota-source {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--blue-100);
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.window-row {
  margin-top: 16px;
}

.window-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--blue-900);
  font-size: 12px;
  font-weight: 950;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeeff;
}

.bar-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), var(--cyan));
  transition: width 0.4s ease;
}

.limited .bar-fill {
  background: linear-gradient(90deg, var(--warn), var(--danger));
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 14px;
}

.toolbar .status-pill {
  border-color: var(--line);
  color: var(--blue-700);
  background: var(--blue-100);
}

.search-box {
  min-width: min(420px, 100%);
  flex: 1;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface-strong);
  padding: 12px 14px;
  color: var(--blue-950);
  outline: none;
}

.search-box:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 4px rgba(45, 145, 230, 0.14);
}

.table-wrap {
  overflow: auto;
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f0f8ff;
  color: var(--blue-700);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

th button {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-weight: 950;
  text-transform: inherit;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: rgba(45, 145, 230, 0.07);
}

.key-cell {
  color: var(--blue-950);
  font-family: "Cascadia Mono", "SFMono-Regular", "Consolas", monospace;
  font-weight: 950;
  letter-spacing: -0.03em;
}

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

.metric {
  min-width: 96px;
}

.metric strong {
  display: block;
  color: var(--blue-950);
  font-size: 15px;
}

.metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.metric em {
  display: block;
  margin-top: 3px;
  color: var(--blue-600);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.empty,
.boot-card,
.error-card {
  border-radius: var(--radius-xl);
  padding: 32px;
}

.boot-card h1,
.error-card h1 {
  margin: 0;
  color: var(--blue-950);
  font-size: 48px;
}

.error-card {
  border-color: rgba(224, 76, 95, 0.34);
  background: #fff6f8;
}

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

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .section-title {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 22px, 1480px);
    padding-top: 16px;
  }

  .topbar {
    padding: 20px;
    border-radius: 20px;
  }

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

  .status-pill,
  .refresh-button {
    width: 100%;
    justify-content: center;
  }
}
