:root {
  color-scheme: light;
  --ink: #18151f;
  --muted: #706b78;
  --line: #e9e5ed;
  --paper: #fff;
  --canvas: #f7f5f8;
  --purple: #5e2bb8;
  --purple-dark: #3c176f;
  --purple-soft: #f0e8fc;
  --lime: #c9ee65;
  --orange: #f38254;
  --red: #b42318;
  --green: #18764b;
  --shadow: 0 20px 55px rgba(45, 25, 67, .1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 820; letter-spacing: -.04em; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  color: #fff; background: var(--purple); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.brand-mark svg { width: 22px; height: 22px; fill: currentColor; }
.brand-word { font-size: 20px; }
.brand-word span { color: var(--purple); }

.button {
  min-height: 44px; border: 0; border-radius: 12px; padding: 0 18px; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; color: #fff; background: var(--purple); font-weight: 720; text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { background: #4f229f; box-shadow: 0 10px 24px rgba(94,43,184,.22); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .58; transform: none; box-shadow: none; }
.button.secondary { color: var(--ink); background: #fff; border: 1px solid var(--line); }
.button.secondary:hover { background: #faf8fb; box-shadow: none; }
.button.danger { color: var(--red); background: #fff4f2; }
.button.small { min-height: 36px; padding: 0 13px; border-radius: 10px; font-size: 13px; }

.field { display: grid; gap: 8px; }
.field label { font-size: 13px; font-weight: 720; color: #49444f; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid #dcd7e1; border-radius: 12px; padding: 12px 13px; color: var(--ink); background: #fff;
  outline: none; transition: border .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(94,43,184,.1); }
.field-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 750; text-transform: capitalize; }
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-paid, .status-active { color: var(--green); background: #e9f8f0; }
.status-pending { color: #976000; background: #fff4d8; }
.status-cash_due { color: #815316; background: #fff1cd; }
.status-failed, .status-inactive, .status-cancelled { color: var(--red); background: #fff0ee; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 10px; pointer-events: none; }
.toast { max-width: 380px; border: 1px solid var(--line); border-left: 4px solid var(--purple); border-radius: 12px; padding: 13px 16px; color: var(--ink); background: #fff; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.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; }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
