:root {
  --primary:#635bff;
  --primary-dark:#5147e5;
  --ink:#17213b;
  --muted:#718096;
  --bg:#f5f7fb;
  --surface:#fff;
  --border:#e6eaf2;
  --success:#138c69;
  --danger:#cd3d55;
  --warning:#a96b12;
  --radius:20px;
  --shadow:0 8px 30px rgba(29,39,69,.045);
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--bg);
  font-synthesis:none
}

* {
  box-sizing:border-box
}

body {
  margin:0;
  font-size:14px;
  line-height:1.55
}

button,input,select,textarea {
  font:inherit
}

button,a,input,select,textarea {
  -webkit-tap-highlight-color:transparent
}

a {
  color:var(--primary);
  text-decoration:none
}

button {
  cursor:pointer
}

button:disabled {
  cursor:wait;
  opacity:.58
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline:3px solid #bcb8ff;
  outline-offset:3px
}

h1,h2,h3,p {
  margin-top:0
}

h1 {
  font-size:30px;
  line-height:1.2;
  letter-spacing:-1px;
  margin-bottom:8px
}

h2 {
  font-size:20px;
  letter-spacing:-.4px;
  margin-bottom:16px
}

h3 {
  font-size:16px;
  margin-bottom:8px
}

p {
  margin-bottom:16px
}

svg {
  width:20px;
  height:20px;
  flex-shrink:0;
  vertical-align:middle
}

button svg {
  pointer-events:none
}

.hidden,[hidden] {
  display:none!important
}

.muted {
  color:var(--muted)
}

.small {
  font-size:12px
}

.mono {
  font-variant-numeric:tabular-nums
}

.card {
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:var(--shadow);
  min-width:0
}

.btn,.button {
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:9px;
  min-height:46px;
  padding:11px 19px;
  border-radius:12px;
  border:1px solid transparent;
  font-weight:650;
  background:var(--primary);
  color:white;
  text-align:center;
  transition:background .15s,transform .15s
}

.btn:hover,.button:hover {
  background:var(--primary-dark)
}

.btn.secondary,.button.secondary {
  background:white;
  border-color:var(--border);
  color:var(--ink)
}

.btn.secondary:hover {
  background:#f1f3f9
}

.btn.ghost {
  background:transparent;
  color:var(--primary)
}

.btn.danger {
  background:#fff0f2;
  color:var(--danger);
  border-color:#ffd4dc
}

.btn.wide {
  width:100%
}

.icon-button {
  height:44px;
  min-width:44px;
  border:1px solid var(--border);
  background:white;
  display:inline-flex;
  justify-content:center;
  align-items:center;
  border-radius:12px;
  color:var(--ink)
}

label {
  display:block;
  font-weight:600;
  font-size:13px;
  margin-bottom:7px
}

input,select,textarea {
  width:100%;
  min-height:46px;
  border:1px solid #dce1ec;
  background:white;
  color:var(--ink);
  border-radius:11px;
  padding:11px 13px;
  transition:border-color .15s;
  min-width:0
}

input:focus,select:focus,textarea:focus {
  border-color:var(--primary);
  outline:3px solid #efedff
}

input::placeholder,textarea::placeholder {
  color:#939caf
}

textarea {
  min-height:90px;
  resize:vertical
}

.field {
  margin-bottom:18px
}

.field small {
  display:block;
  color:var(--muted);
  font-size:12px;
  margin-top:6px
}

.field-error,.form-error {
  color:var(--danger);
  font-size:13px
}

.form-error {
  background:#fff0f2;
  border-radius:10px;
  padding:12px;
  margin-bottom:16px
}

.form-error:empty {
  display:none
}

.form-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0 16px
}

.span-2 {
  grid-column:1/-1
}

.row {
  display:flex;
  align-items:center;
  gap:12px
}

.between {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px
}

.stack {
  display:flex;
  flex-direction:column;
  gap:16px
}

.badge {
  display:inline-flex;
  align-items:center;
  gap:5px;
  border-radius:30px;
  font-size:11px;
  font-weight:700;
  padding:5px 10px;
  background:#f0edff;
  color:#6552ce;
  text-transform:capitalize;
  white-space:nowrap
}

.badge.success,.badge.paid,.badge.active {
  background:#e8f7f0;
  color:var(--success)
}

.badge.pending,.badge.approved {
  background:#fff4df;
  color:var(--warning)
}

.badge.rejected,.badge.suspended {
  background:#ffedf0;
  color:var(--danger)
}

.badge.cancelled {
  background:#eef0f5;
  color:var(--muted)
}

.empty-state {
  text-align:center;
  padding:38px 18px;
  color:var(--muted)
}

.empty-state svg {
  width:32px;
  height:32px;
  margin-bottom:14px;
  color:#a7abc2
}

.empty-state h3 {
  color:var(--ink)
}

.divider {
  border:0;
  border-top:1px solid var(--border);
  margin:22px 0
}

.brand {
  display:inline-flex;
  gap:10px;
  align-items:center;
  font-size:21px;
  letter-spacing:-.8px;
  font-weight:800;
  color:var(--ink)
}

.brand-mark {
  width:35px;
  height:35px;
  background:var(--primary);
  color:#fff;
  border-radius:11px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 5px 14px #635bff30
}

.brand-mark svg {
  width:23px;
  height:23px
}

.toast-region {
  position:fixed;
  bottom:90px;
  left:50%;
  transform:translateX(-50%);
  width:min(440px,calc(100% - 32px));
  z-index:1000;
  display:flex;
  flex-direction:column;
  gap:8px;
  pointer-events:none
}

.toast {
  padding:14px 18px;
  border-radius:13px;
  background:#17213b;
  color:white;
  box-shadow:0 10px 25px #14203b30;
  font-size:13px;
  animation:toast-in .2s ease
}

.toast.error {
  background:#a92d42
}

.loading-state {
  padding:60px 15px;
  text-align:center;
  color:var(--muted)
}

.spinner {
  display:inline-block;
  width:22px;
  height:22px;
  border:2px solid #dedaff;
  border-top-color:var(--primary);
  border-radius:50%;
  animation:spin .65s linear infinite
}

.pagination {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  margin-top:20px
}

.pagination button {
  padding:8px 14px
}

.text-right {
  text-align:right
}

.positive {
  color:var(--success)
}

.negative {
  color:var(--danger)
}

.help-note {
  font-size:12px;
  line-height:1.7;
  color:var(--muted);
  background:#f7f8fc;
  border-radius:12px;
  padding:13px 15px
}

.password-wrap {
  position:relative
}

.password-wrap input {
  padding-right:52px
}

.password-toggle {
  position:absolute;
  right:3px;
  top:2px;
  border:0;
  background:transparent;
  min-height:42px;
  min-width:43px;
  color:var(--muted)
}

@keyframes spin {
  to {
    transform:rotate(360deg)
  }

}

@keyframes toast-in {
  from {
    opacity:0;
    transform:translateY(8px)
  }

  to {
    opacity:1;
    transform:translateY(0)
  }

}

@media(max-width:540px) {
  .card {
    padding:20px;
    border-radius:17px
  }

  .form-grid {
    grid-template-columns:1fr
  }

  .span-2 {
    grid-column:auto
  }

  h1 {
    font-size:26px
  }

}

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

}
