:root { color-scheme: light dark; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f6f7f9; color: #1f2937;
  font-size: 15px; line-height: 1.5;
}
body.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; max-width: 28rem; padding: 2.5rem; border-radius: 14px;
  box-shadow: 0 1px 3px rgba(16,24,40,.1), 0 1px 2px rgba(16,24,40,.06); width: 92%; }
.login-card h1 { margin: 0 0 .25rem; font-size: 1.4rem; }
.login-card label { display: block; margin: 1rem 0 .25rem; font-weight: 500; }
.login-card input { width: 100%; padding: .6rem .75rem; border: 1px solid #d0d5dd; border-radius: 8px; font-size: 1rem; }
.login-card button { margin-top: 1.25rem; width: 100%; padding: .7rem; font-size: 1rem; }
.alert { background: #fef3f2; color: #b42318; padding: .6rem .8rem; border-radius: 8px; margin: 1rem 0; }
.shell { display: grid; grid-template-columns: 14rem 1fr; min-height: 100vh; align-items: start; }
nav.sidebar {

/* Quota bar (used in billing page + sidebar widget) */
.quota-bar-wrap { margin: 1rem 0; }
.quota-bar-label {
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: #667085; margin-bottom: 4px;
}
.quota-bar-track {
  width: 100%; height: 16px; background: #e4e7ec;
  border-radius: 8px; overflow: hidden;
}
.quota-bar-fill {
  height: 100%; border-radius: 8px; transition: width 0.3s ease;
}
.quota-bar-fill.ok { background: #3b82f6; }
.quota-bar-fill.warning { background: #f59e0b; }
.quota-bar-fill.critical { background: #ef4444; }
.sidebar-quota {
  margin-top: 12px; padding: 8px 10px;
  background: #1f2937; border-radius: 6px;
}
.usage-stats {
  display: flex; gap: 1rem; flex-wrap: wrap;
  font-size: 0.85rem; color: #667085; margin-top: 12px;
}
.usage-stats span { white-space: nowrap; }

/* Plans table */
.plans-table { font-size: 0.85rem; }
.plans-table tr.current { background: #ecfdf5; }
.plans-table tr.current strong { color: #065f46; }
.plan-summary { padding: 1rem 1.25rem; }
.cta-bar {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
  border: 1px solid #10b981;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 1.5rem;
  display: flex; align-items: center; justify-content: center;
}
.btn.big {
  font-size: 1.1rem; padding: 0.75rem 1.5rem;
}


/* Docs page */
.endpoint-card {
  background: #fff; border: 1px solid #e4e7ec;
  border-radius: 8px; padding: 1rem; margin-bottom: 1rem;
}
.endpoint-head {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem;
}
.method-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-family: monospace; font-size: 0.75rem; font-weight: 600;
  color: #fff;
}
.method-get { background: #3b82f6; }
.method-post { background: #10b981; }
.method-put { background: #f59e0b; }
.method-delete { background: #ef4444; }
.endpoint-head code {
  background: #f3f4f6; padding: 2px 6px; border-radius: 4px;
  font-size: 0.85rem;
}
.auth-note { margin-top: 0.25rem; font-size: 0.8rem; }
.code-wrap { position: relative; margin-top: 0.5rem; }
.codeblock {
  background: #1f2937; color: #e5e7eb;
  font-family: ui-monospace, monospace; font-size: 0.8rem;
  padding: 0.75rem; border-radius: 6px; overflow-x: auto;
  white-space: pre-wrap; word-break: break-word;
}
.recipe-card {
  background: #fff; border: 1px solid #e4e7ec;
  border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.recipe-card h3 { margin-top: 0; }
.kv-grid {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 0.25rem 1rem; margin-bottom: 1rem;
}
.kv-grid > div:nth-child(odd) {
  font-family: monospace; font-weight: 600;
}

  background: #111827; color: #cbd5f5; padding: 1.25rem 1rem;
  position: sticky; top: 0; align-self: start;
  min-height: 100vh;
}
nav.sidebar h2 { color: #fff; font-size: .95rem; margin: 0 0 1rem; }
nav.sidebar a { display: block; color: #cbd5f5; padding: .5rem .65rem; border-radius: 6px; text-decoration: none; }
nav.sidebar a.active, nav.sidebar a:hover { background: #1f2937; color: #fff; }
main.content { padding: 1.5rem 2rem; min-width: 0; }
section.page header h1 { margin: 0 0 .25rem; font-size: 1.35rem; }
section.page header p { margin: 0 0 1.25rem; color: #667085; }
.card { background: #fff; border: 1px solid #e4e7ec; border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .5rem .65rem; text-align: left; border-bottom: 1px solid #f0f1f4; vertical-align: top; }
th { font-weight: 600; color: #475467; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
button, .btn { background: #1f2937; color: #fff; border: 0; border-radius: 8px; padding: .55rem .9rem; cursor: pointer; font-size: .9rem; }
button.secondary, .btn.secondary { background: #fff; color: #1f2937; border: 1px solid #d0d5dd; }
button.danger, .btn.danger { background: #b42318; }
button[disabled] { opacity: .55; cursor: not-allowed; }
input, select, textarea { border: 1px solid #d0d5dd; border-radius: 8px; padding: .5rem .65rem; font-size: .9rem; font-family: inherit; width: 100%; }
label { display: block; font-weight: 500; margin: .8rem 0 .25rem; }
.muted { color: #667085; }
.row { display: flex; gap: .5rem; align-items: center; }
.row.between { justify-content: space-between; }
.tag { display: inline-block; padding: .1rem .5rem; border-radius: 999px; background: #f0f1f4; color: #475467; font-size: .75rem; }
.kpi { font-size: 1.6rem; font-weight: 600; }
.statusbar { font-size: .85rem; padding: .15rem .55rem; border-radius: 6px; }
.status-pending, .status-sent { background: #f0f1f4; color: #475467; }
.status-verified, .status-delivered { background: #06764726; color: #067647; }
.status-failed, .status-bounced, .status-rejected, .status-suspended, .status-cancelled { background: #b4231826; color: #b42318; }
.status-active { background: #06764726; color: #067647; }
.error { color: #b42318; }
.success { color: #067647; }
pre.code { background: #0b1020; color: #e6e6e6; padding: .9rem 1rem; border-radius: 8px; overflow: auto; font-size: .8rem; }
.dns-record { background: #f6f7f9; padding: .5rem .65rem; border-radius: 6px; margin: .25rem 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; word-break: break-all; }
