/* Usage page
   ------------------------------------------------------------ */

.usage-page {
  max-width: 1100px;
}

/* Shared header styles (consistent with API keys) */

.page-header h1 {
  margin-bottom: 0.25rem;
}

.page-subtext {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Top block: metrics + limit */

.usage-top {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
  gap: 1.75rem;
}

/* Metric cards */

.usage-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.usage-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline);
  padding: 1.25rem 1.4rem;
  box-shadow: 0 0 14px rgba(0, 0, 0, 0.4);
}

.usage-card h3 {
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.usage-number {
  font-size: 1.6rem;
  font-weight: 700;
}

.usage-label {
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Rate limit card */

.usage-limit-card {
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  border: 1px solid var(--outline);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.limit-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
}

.limit-header h2 {
  font-size: 1.05rem;
}

.limit-pill {
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Progress bar */

.progress-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  appearance: none;
  background: transparent;
}

.progress-bar::-webkit-progress-bar {
  background: transparent;
}

.progress-bar::-webkit-progress-value {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  box-shadow: 0 0 12px rgba(255, 102, 0, 0.6);
}

.progress-bar::-moz-progress-bar {
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  box-shadow: 0 0 12px rgba(255, 102, 0, 0.6);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.usage-alert-form { display: grid; gap: 0.9rem; }
.usage-alert-form label { display: grid; gap: 0.35rem; color: var(--text-muted); font-size: 0.9rem; }
.usage-alert-form .alert-checkbox { display: flex; align-items: center; gap: 0.6rem; }
.alert-control { width: 100%; min-height: 44px; border: 1px solid var(--outline); border-radius: var(--radius); padding: 0.6rem 0.75rem; color: var(--text); background: var(--card); }
.usage-alert-form .btn { justify-self: start; }
.alert-history { display: grid; gap: 0.65rem; }
.alert-event { padding: 0.75rem; border: 1px solid var(--outline); border-radius: var(--radius); background: var(--card); }
.alert-event strong { display: block; margin-bottom: 0.2rem; }
.alert-event span { color: var(--text-muted); font-size: 0.82rem; }

/* Responsive */

@media (max-width: 980px) {
  .usage-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .progress-meta {
    flex-direction: column;
    gap: 0.15rem;
  }
  .usage-alert-form .btn { width: 100%; }
}
