:root {
  --paper: #f5f3ee;
  --card: #fffefa;
  --ink: #24231f;
  --muted: #77746d;
  --line: #ddd9d0;
  --accent: #54aa67;
  --accent-soft: #e7f2e7;
  --blue: #3977c8;
  --purple: #7753b3;
  --danger: #a64c42;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; min-height: 100vh; background: var(--paper); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20;
  display: flex; width: 232px; flex-direction: column;
  padding: 34px 24px 24px; border-right: 1px solid var(--line); background: #faf8f3;
}
.brand { display: inline-flex; align-items: center; gap: 13px; width: max-content; color: var(--ink); text-decoration: none; }
.brand-name { font-size: 27px; font-weight: 760; letter-spacing: .035em; }
.brand-large .brand-name { font-size: clamp(32px, 6vw, 48px); }
.brand-dots { display: inline-flex; gap: 5px; }
.brand-dots i { display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.brand-dots i:nth-child(2) { background: var(--blue); }
.brand-dots i:nth-child(3) { background: var(--purple); }
.brand-caption { margin: 8px 0 38px; color: var(--muted); font: 650 9px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2em; }
.main-nav { display: grid; gap: 5px; }
.main-nav a { display: flex; min-height: 46px; align-items: center; padding: 0 15px; border-radius: 14px; color: #68655f; font-size: 14px; font-weight: 650; text-decoration: none; }
.main-nav a:hover { background: #efede7; color: var(--ink); }
.main-nav a.active { background: var(--ink); color: white; }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.text-button { width: max-content; padding: 0; border: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 650; }

.content { width: min(calc(100% - 232px), 1240px); margin-left: 232px; padding: 46px 48px 90px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.page-header h1 { margin: 5px 0 8px; font-size: clamp(36px, 5vw, 58px); font-weight: 680; letter-spacing: -.045em; line-height: 1.08; }
.page-intro, .muted, .message { color: var(--muted); line-height: 1.7; }
.page-intro { margin: 0; font-size: 14px; }
.eyebrow { margin: 0; color: var(--accent); font: 760 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; }
.header-buttons { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 22px; }
.metric-card { min-height: 156px; padding: 21px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); }
.metric-card span { display: block; min-height: 34px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.metric-card strong { display: block; margin-top: 15px; font-size: clamp(26px, 3.2vw, 38px); font-weight: 680; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.metric-primary { border-color: #a9d4ae; background: var(--accent-soft); }
.metric-primary span, .metric-primary small { color: #467b50; }

.panel { margin-bottom: 18px; padding: 26px; border: 1px solid var(--line); border-radius: 26px; background: var(--card); }
.panel h2 { margin: 0; font-size: 24px; font-weight: 680; letter-spacing: -.025em; }
.panel .muted { margin: 6px 0 0; font-size: 12px; }
.danger-panel { border-color: #e5d4cf; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.quiet-link { align-self: center; color: var(--muted); font-size: 12px; font-weight: 650; text-decoration: none; }
.quiet-link:hover { color: var(--ink); }

.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.pricing-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span, .choice-group legend { color: var(--muted); font-size: 12px; font-weight: 650; }
input, select { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--ink); }
input::placeholder { color: #aaa69f; }
input:focus, select:focus { outline: 3px solid color-mix(in srgb, var(--accent), transparent 78%); border-color: var(--accent); }
.toggle-field { display: flex; min-height: 48px; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); font-size: 13px; font-weight: 650; }
.toggle-field input, .choice-group input { width: 18px; min-height: 18px; margin: 0; accent-color: var(--accent); }
.choice-group { display: flex; flex-wrap: wrap; gap: 13px 22px; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 15px; }
.choice-group label { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.full-width { grid-column: 1 / -1; }
.inline-form { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 280px; }
.form-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 6px; }
.stack-form { display: grid; gap: 15px; }
.button { display: inline-flex; min-height: 43px; align-items: center; justify-content: center; padding: 9px 16px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 720; text-decoration: none; white-space: nowrap; }
.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: #000; }
.button-secondary { border-color: var(--line); background: var(--card); color: var(--ink); }
.button-danger { border-color: #dfbbb5; background: #fff8f6; color: var(--danger); }
.button-wide { width: 100%; min-height: 50px; }
.button:disabled { cursor: default; opacity: .45; }
.search-field { width: min(100%, 300px); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; }
table { width: 100%; min-width: 780px; border-collapse: collapse; background: white; }
th, td { padding: 14px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 12px; }
th { color: var(--muted); background: #f8f6f1; font-size: 10px; letter-spacing: .05em; }
tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-actions .button { min-height: 34px; padding: 6px 10px; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; }
.sub { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.status-chip { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #eeece6; font-size: 10px; font-weight: 700; }
.status-chip.good { background: var(--accent-soft); color: #357744; }
.status-chip.warn { background: #fff0d8; color: #8a6324; }
.message { min-height: 1.4em; margin: 13px 0 0; font-size: 12px; }
.message.error { color: var(--danger); }
.message.success { color: #347642; }

.login-body { display: grid; min-height: 100svh; place-items: center; padding: 24px; background: radial-gradient(circle at 18% 16%, #eef5eb 0, transparent 27%), var(--paper); }
.login-shell { display: grid; width: min(100%, 880px); grid-template-columns: .9fr 1.1fr; overflow: hidden; border: 1px solid var(--line); border-radius: 34px; background: var(--card); box-shadow: 0 28px 80px rgba(47,44,38,.08); }
.login-brand { display: flex; min-height: 520px; flex-direction: column; justify-content: space-between; padding: 42px; background: var(--accent-soft); }
.login-brand p { margin: 0; color: #56805d; font: 650 10px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .2em; }
.login-card { align-self: center; padding: 48px; }
.login-card h1 { margin: 8px 0 16px; font-size: clamp(38px, 6vw, 56px); font-weight: 680; letter-spacing: -.055em; line-height: 1.07; }
.login-card .lead { margin: 0 0 28px; color: var(--muted); font-size: 13px; line-height: 1.75; }
.login-note { margin: 14px 0 0; color: var(--muted); font-size: 10px; text-align: center; }

.busy { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; background: rgba(245,243,238,.84); backdrop-filter: blur(6px); }
.busy span { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.busy p { color: var(--muted); font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 980px) {
  .sidebar { position: sticky; inset: 0 0 auto; width: 100%; height: auto; padding: 17px 20px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand-name { font-size: 22px; }
  .brand-caption, .sidebar-foot { display: none; }
  .main-nav { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; }
  .main-nav a { min-width: 70px; min-height: 38px; justify-content: center; padding: 0 13px; border-radius: 999px; font-size: 12px; }
  .content { width: 100%; margin-left: 0; padding: 32px 24px 70px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pricing-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .content { padding: 25px 12px 56px; }
  .page-header { align-items: flex-end; margin-bottom: 24px; }
  .page-header h1 { font-size: 38px; }
  .page-intro { max-width: 250px; }
  .panel { padding: 19px; border-radius: 22px; }
  .metric-grid { gap: 8px; }
  .metric-card { min-height: 132px; padding: 16px; border-radius: 20px; }
  .metric-card strong { font-size: 28px; }
  .form-grid, .pricing-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: center; }
  .search-field { width: 100%; }
  .login-body { padding: 12px; }
  .login-shell { grid-template-columns: 1fr; border-radius: 27px; }
  .login-brand { min-height: 150px; padding: 25px; }
  .login-card { padding: 30px 24px 34px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; } }
