:root {
  --ink: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --surface: rgba(255, 255, 255, 0.94);
  --canvas: #f3f5f7;
  --accent: #5b54e8;
  --accent-dark: #453dc7;
  --success: #087443;
  --warning: #a15c07;
  --danger: #b42318;
  --radius: 22px;
  --shadow: 0 18px 55px rgba(16, 24, 40, 0.09);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 10%, rgba(91, 84, 232, 0.09), transparent 32%),
    radial-gradient(circle at 95% 85%, rgba(29, 193, 152, 0.09), transparent 30%),
    var(--canvas);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
}

.ambient-one {
  top: -180px;
  right: 14%;
  background: #6c63ff;
}

.ambient-two {
  bottom: -220px;
  left: 8%;
  background: #20c997;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.login-card {
  width: min(100%, 430px);
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 15px;
  color: white;
  background: linear-gradient(145deg, #6c63ff, #443bc3);
  box-shadow: 0 9px 24px rgba(91, 84, 232, 0.3);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark-small {
  width: 38px;
  height: 38px;
  margin: 0;
  border-radius: 12px;
  font-size: 12px;
}

.eyebrow,
.section-index {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(31px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.025em;
}

.login-copy,
.hero-row > div > p:last-child {
  color: var(--muted);
  line-height: 1.55;
}

.login-copy {
  margin-bottom: 32px;
}

.stack {
  display: grid;
  gap: 20px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  font-size: 13px;
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-size: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input {
  height: 47px;
  padding: 0 14px;
}

textarea {
  min-height: 112px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(91, 84, 232, 0.1);
}

.money-input {
  position: relative;
}

.money-input input {
  padding-right: 64px;
}

.money-input span {
  position: absolute;
  top: 50%;
  right: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-50%);
}

.button {
  min-height: 42px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  font-weight: 750;
  transition: transform 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

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

.button-primary {
  color: white;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(91, 84, 232, 0.2);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button-wide {
  width: 100%;
  min-height: 48px;
}

.button-ghost {
  border: 1px solid var(--line);
  color: #344054;
  background: white;
}

.button-danger {
  color: white;
  background: var(--danger);
}

.button-danger:hover:not(:disabled) {
  background: #912018;
}

.form-error {
  margin: -5px 0 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.4;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1240px) / 2));
  border-bottom: 1px solid rgba(208, 213, 221, 0.75);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
}

.topbar-brand,
.account {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand > div:last-child,
.account-copy {
  display: grid;
  gap: 2px;
}

.topbar-brand span,
.account-copy span {
  color: var(--muted);
  font-size: 11px;
}

.account-copy {
  text-align: right;
}

.workspace {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 70px;
}

.hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 34px;
}

.hero-row h1 {
  margin-bottom: 10px;
}

.hero-row > div > p:last-child {
  margin-bottom: 0;
}

.stats {
  display: flex;
  gap: 12px;
}

.stat {
  display: grid;
  min-width: 114px;
  gap: 4px;
  padding: 15px 18px;
  border: 1px solid rgba(208, 213, 221, 0.75);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.stat span {
  color: var(--muted);
  font-size: 11px;
}

.stat strong {
  font-size: 23px;
  letter-spacing: -0.04em;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.panel {
  border: 1px solid rgba(208, 213, 221, 0.76);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(16, 24, 40, 0.045);
}

.create-panel {
  padding: 26px;
}

.list-panel {
  min-height: 530px;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.list-heading {
  align-items: center;
  margin: 0;
  padding: 26px;
  border-bottom: 1px solid var(--line);
}

.secure-badge {
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--success);
  background: #ecfdf3;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.notice {
  margin: 18px 22px 0;
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.45;
}

.notice-warning {
  color: #7a2e0e;
  background: #fff4e8;
}

.payout-list {
  display: grid;
}

.payout-row {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr 0.8fr 0.72fr;
  gap: 14px;
  align-items: center;
  padding: 18px 26px;
  border-bottom: 1px solid var(--line);
}

.payout-row:last-child {
  border-bottom: 0;
}

.payout-primary,
.payout-cell {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.payout-primary strong,
.payout-cell strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payout-primary span,
.payout-cell span,
.payout-error-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.payout-purpose {
  overflow: hidden;
  max-width: 230px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-badge {
  justify-self: start;
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pending,
.status-processing {
  color: #694107;
  background: #fff7d6;
}

.status-success {
  color: var(--success);
  background: #ecfdf3;
}

.status-error {
  color: var(--danger);
  background: #fef3f2;
}

.status-neutral {
  color: #475467;
  background: #f2f4f7;
}

.payout-reject-button {
  justify-self: start;
  min-height: 30px;
  margin-top: 3px;
  padding: 0 10px;
  border: 1px solid #fecdca;
  color: var(--danger);
  background: #fff;
  font-size: 11px;
}

.payout-reject-button:hover:not(:disabled) {
  background: #fef3f2;
}

.empty-state {
  display: grid;
  min-height: 370px;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

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

.empty-state span {
  font-size: 13px;
}

.empty-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 5px;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: #eeecff;
  font-size: 22px;
}

.confirm-dialog {
  width: min(92vw, 480px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.28);
}

.confirm-dialog::backdrop {
  background: rgba(16, 24, 40, 0.48);
  backdrop-filter: blur(4px);
}

.admin-dialog {
  width: min(96vw, 1040px);
  max-height: min(92vh, 820px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.28);
}

.admin-dialog::backdrop {
  background: rgba(16, 24, 40, 0.48);
  backdrop-filter: blur(4px);
}

.admin-card {
  padding: 30px;
}

.admin-heading,
.admin-users-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.admin-heading > div > p:last-child,
.admin-users-heading p,
.admin-reset-target {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-close-button {
  flex: 0 0 auto;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 22px;
  margin-top: 28px;
}

.admin-create,
.admin-users {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.admin-create {
  padding: 22px;
}

.admin-create h3,
.admin-users h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.admin-form {
  gap: 16px;
  margin-top: 20px;
}

.admin-users {
  min-height: 390px;
  overflow: hidden;
}

.admin-users-heading {
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.admin-users-heading p {
  max-width: 430px;
}

.admin-users .form-error {
  margin: 16px 22px 0;
}

.admin-users-list {
  display: grid;
}

.admin-users-list[aria-busy="true"] {
  opacity: 0.62;
}

.admin-user-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  gap: 13px 18px;
  align-items: center;
  padding: 17px 22px;
  border-bottom: 1px solid var(--line);
}

.admin-user-row:last-child {
  border-bottom: 0;
}

.admin-user-identity {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.admin-user-identity strong,
.admin-user-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-identity strong {
  font-size: 13px;
}

.admin-user-identity span {
  color: var(--muted);
  font-size: 11px;
}

.admin-user-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-role-badge {
  padding: 6px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.admin-role-admin {
  color: #4338ca;
  background: #eeecff;
}

.admin-role-operator,
.admin-user-active {
  color: var(--success);
  background: #ecfdf3;
}

.admin-user-inactive {
  color: #475467;
  background: #f2f4f7;
}

.admin-user-actions {
  grid-column: 1 / -1;
}

.admin-reset-button {
  min-height: 32px;
  padding: 0 11px;
  font-size: 11px;
}

.admin-users-empty {
  padding: 42px 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.admin-reset-target {
  margin-top: 14px;
}

.confirm-card {
  padding: 30px;
}

.confirm-details {
  display: grid;
  gap: 0;
  margin: 24px 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.confirm-details > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
}

.confirm-details > div:last-child {
  border-bottom: 0;
}

.confirm-details dt {
  color: var(--muted);
  font-size: 12px;
}

.confirm-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 700;
}

.confirm-note {
  color: var(--warning);
  font-size: 12px;
  line-height: 1.45;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 17px;
  border-radius: 12px;
  color: white;
  background: #182230;
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.25);
  font-size: 13px;
  line-height: 1.45;
}

.toast-error {
  background: #912018;
}

@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .create-panel {
    max-width: none;
  }
}

@media (max-width: 650px) {
  .topbar {
    padding: 12px 18px;
  }

  .account-copy,
  .topbar-brand span {
    display: none;
  }

  .workspace {
    width: min(100% - 28px, 1240px);
    padding-top: 34px;
  }

  .hero-row {
    align-items: stretch;
    flex-direction: column;
  }

  .stats {
    width: 100%;
  }

  .stat {
    min-width: 0;
    flex: 1;
  }

  .create-panel,
  .list-heading {
    padding: 21px;
  }

  .secure-badge {
    display: none;
  }

  .payout-row {
    grid-template-columns: 1fr 1fr;
    padding: 17px 21px;
  }

  .payout-purpose {
    max-width: 100%;
  }

  .login-card {
    padding: 30px 24px;
  }

  .admin-card {
    padding: 24px 20px;
  }

  .admin-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-heading .admin-close-button {
    align-self: flex-start;
  }

  .admin-users-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-users-heading .button {
    align-self: flex-start;
  }
}

@media (max-width: 460px) {
  .topbar-brand > div:last-child {
    display: none;
  }

  .account {
    gap: 6px;
  }

  .account .button {
    min-height: 38px;
    padding: 0 10px;
    font-size: 12px;
  }

  .admin-user-row {
    grid-template-columns: 1fr;
  }

  .admin-user-badges {
    justify-content: flex-start;
  }
}
