@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg: #f3f5f8;
  --bg-accent: #e8eef5;
  --surface: #ffffff;
  --ink: #142033;
  --muted: #5c6b7e;
  --line: #d7e0ea;
  --brand: #0f6e6a;
  --brand-ink: #0a4f4c;
  --brand-soft: #d8f0ee;
  --accent: #c45c26;
  --danger: #b42318;
  --ok: #1f7a4c;
  --sidebar: #101820;
  --sidebar-ink: #c5d0db;
  --sidebar-active: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 32, 51, 0.06);
  --font: 'IBM Plex Sans', 'DM Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #dce9f4 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #e7f3ef 0%, transparent 50%),
    var(--bg);
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-panel {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 2rem 1.75rem 1.75rem;
}

.brand-mark {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 0 0 0.35rem;
}

.brand-sub {
  color: var(--muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.btn-brand {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-brand:hover {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-accent:hover {
  filter: brightness(0.95);
  color: #fff;
}

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #121c26 0%, #0d141c 100%);
  color: var(--sidebar-ink);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar .brand {
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  padding: 0.35rem 0.6rem 1rem;
}

.sidebar a {
  color: var(--sidebar-ink);
  text-decoration: none;
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

.sidebar a:hover,
.sidebar a.active {
  color: var(--sidebar-active);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar .nav-section {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7e8c9a;
}

.sidebar .sidebar-foot {
  margin-top: auto;
  padding-top: 1rem;
}

.content {
  flex: 1;
  padding: 1.75rem 2rem 2.5rem;
  min-width: 0;
}

.page-title {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.page-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.quota-refresh-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
}

.quota-refresh-controls .form-select { width: auto; min-width: 88px; }
.quota-refresh-controls .form-check { white-space: nowrap; }

.page-desc {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}

.stat-tile .label {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.stat-tile .value {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
}

.panel h3 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-wrap {
  position: relative;
  height: 280px;
}

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

.table {
  --bs-table-bg: transparent;
  margin-bottom: 0;
  font-size: 0.92rem;
}

.table thead th {
  color: var(--muted);
  font-weight: 600;
  border-bottom-color: var(--line);
  white-space: nowrap;
}

.badge-soft {
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 600;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.pager .controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.toolbar .form-control,
.toolbar .form-select {
  max-width: 220px;
}

.form-control, .form-select, .btn {
  border-radius: 10px;
}

.empty-hint {
  color: var(--muted);
  padding: 1.25rem 0.25rem;
}

.quota-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.quota-card {
  --quota-accent: var(--brand);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--quota-accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1.25rem 1rem;
}

.quota-teal { --quota-accent: #0f6e6a; }
.quota-orange { --quota-accent: #c45c26; }
.quota-blue { --quota-accent: #3b6ea5; }
.quota-red { --quota-accent: #b42318; }

.quota-card-head,
.quota-section-title,
.quota-window-meta,
.quota-window-foot,
.quota-interface-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.quota-card-head { margin-bottom: 1rem; }
.quota-card h2,
.quota-section-title h2 { margin: 0; font-size: 1.12rem; font-weight: 700; }
.quota-eyebrow { color: var(--quota-accent, var(--brand)); font-size: .68rem; font-weight: 700; letter-spacing: .12em; margin-bottom: .2rem; }
.quota-icon { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; color: #fff; background: var(--quota-accent); font-weight: 700; font-size: .82rem; }
.quota-window + .quota-window { margin-top: 1rem; }
.quota-window-meta { font-size: .9rem; }
.quota-window-meta strong { color: var(--ink); font-size: .92rem; }
.quota-window-meta small,
.quota-interface-row small { color: var(--muted); font-weight: 500; }
.quota-progress { height: .48rem; overflow: hidden; margin: .45rem 0 .35rem; background: #e8edf2; border-radius: 99px; }
.quota-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--quota-accent); transition: width .35s ease; }
.quota-progress-fill.warn { background: #d7902f; }
.quota-progress-fill.danger { background: #b42318; }
.quota-window-foot { color: var(--muted); font-size: .74rem; }

.quota-interface-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.quota-interface-panel { margin-bottom: 0; }
.quota-interface-panel .quota-eyebrow { color: var(--muted); }
.quota-interface-list { border-top: 1px solid var(--line); margin-top: .85rem; }
.quota-interface-row { align-items: flex-start; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.quota-interface-row:last-child { border-bottom: 0; padding-bottom: 0; }
.quota-interface-row code { font-size: .8rem; color: var(--brand-ink); }
.quota-interface-row .small { margin-top: .25rem; line-height: 1.4; }
.quota-interface-row > strong { flex-shrink: 0; color: var(--quota-accent, var(--brand)); font-size: .86rem; }

@media (max-width: 992px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr; }
  .quota-interface-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    min-height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  .sidebar .brand { width: 100%; padding-bottom: 0.35rem; }
  .sidebar .sidebar-foot { width: 100%; margin-top: 0.5rem; }
  .content { padding: 1.25rem 1rem 2rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .quota-grid { grid-template-columns: 1fr; }
  .page-heading-row { flex-direction: column; }
  .quota-refresh-controls { justify-content: flex-start; }
}
