:root {
  --ink: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --surface: #ffffff;
  --bg: #f6f7fb;
  --blue: #1d4ed8;
  --red: #be123c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(246,247,251,.95) 280px), var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
.shell { min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 260px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid var(--line);
}
.brand-row {
  min-height: 74px;
  padding: 0 12px 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #111827;
  color: #fff;
  font-weight: 900;
}
.brand-title { display: block; font-weight: 900; font-size: 18px; line-height: 1.1; }
.brand-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.nav { display: flex; flex-direction: column; gap: 6px; padding: 14px; }
.nav-link {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 9px 11px;
  color: #475569;
  font-size: 14px;
  font-weight: 850;
}
.nav-link:hover, .nav-link.active { background: #eef4ff; color: var(--blue); }
.nav-link.danger { color: var(--red); }
.nav-link.danger:hover { background: #fff1f2; color: var(--red); }
.nav-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #334155;
  font-size: 11px;
  font-weight: 900;
}
.nav-link.active .nav-icon { background: var(--blue); color: #fff; }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--line); }
.user-chip { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; background: #f8fafc; overflow: hidden; }
.content { margin-left: 260px; padding: 24px; min-width: 0; }
.topbar { display: none; position: sticky; top: 0; z-index: 35; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar-inner { min-height: 64px; padding: 0 12px; display: flex; align-items: center; gap: 12px; }
.menu-button, .sidebar-close {
  width: 42px;
  height: 42px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 22px;
  font-weight: 900;
}
.sidebar-close { display: none; }
.sidebar-backdrop { display: none; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 900; text-transform: uppercase; color: #94a3b8; }
h1 { margin: 0; font-size: clamp(24px, 3vw, 34px); line-height: 1.08; font-weight: 950; }
h2 { margin: 0; font-size: 18px; font-weight: 900; }
p { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.payout-grid { grid-template-columns: 390px minmax(0, 1fr); }
.beneficiary-grid { grid-template-columns: 360px minmax(0, 1fr); }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.panel-pad { padding: 18px; }
.panel-header { padding: 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-label { color: #64748b; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.card-value { margin: 8px 0 0; font-size: 30px; line-height: 1.1; font-weight: 950; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.small { font-size: 14px; }
.strong { font-weight: 900; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14px; }
th { padding: 12px; text-align: left; color: #64748b; background: #f8fafc; font-size: 12px; font-weight: 900; text-transform: uppercase; }
td { padding: 13px 12px; border-top: 1px solid #eef2f7; vertical-align: top; }
tr:hover td { background: #fbfdff; }
.right { text-align: right; }
.input, .select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}
.input:focus, .select:focus { outline: 2px solid rgba(29,78,216,.18); border-color: #2563eb; }
.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  background: #111827;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.button:hover { background: #1f2937; }
.button.secondary { background: #eef2ff; color: #1d4ed8; }
.button.danger { background: #be123c; }
.link { color: var(--blue); font-weight: 900; }
.field { display: block; font-size: 14px; font-weight: 900; }
.field > span { display: block; margin-bottom: 7px; }
.stack { display: grid; gap: 14px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.flash { margin-bottom: 16px; border-radius: 8px; padding: 12px 14px; font-size: 14px; font-weight: 850; }
.flash.success { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.flash.error { color: #be123c; background: #fff1f2; border: 1px solid #fecdd3; }
.badge { display: inline-flex; align-items: center; border: 1px solid; border-radius: 6px; padding: 4px 8px; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.badge-blue { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.badge-green { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.badge-red { background: #fff1f2; border-color: #fecdd3; color: #be123c; }
.badge-amber { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.badge-slate { background: #f1f5f9; border-color: #e2e8f0; color: #475569; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, .95fr) minmax(380px, 520px); }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; padding: 40px; }
.auth-copy h1 { font-size: 52px; line-height: 1.02; }
.auth-wrap { display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(255,255,255,.72); border-left: 1px solid var(--line); backdrop-filter: blur(16px); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 26px; box-shadow: 0 24px 60px rgba(15,23,42,.10); }
.auth-stat { border: 1px solid #e2e8f0; border-radius: 10px; padding: 14px; background: rgba(255,255,255,.72); }
.codebox { white-space: pre-wrap; word-break: break-word; border-radius: 8px; background: #0f172a; color: #e2e8f0; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; }
@media (max-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payout-grid { grid-template-columns: 1fr; }
  .beneficiary-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .topbar { display: block; }
  .sidebar {
    width: min(86vw, 300px);
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 20px 0 60px rgba(15,23,42,.18);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 38; background: rgba(15,23,42,.42); border: 0; }
  .sidebar-close { display: inline-block; }
  .content { margin-left: 0; padding: 16px 12px 24px; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .auth-shell { display: flex; flex-direction: column; }
  .auth-brand { padding: 24px 18px 0; gap: 24px; }
  .auth-copy { display: none; }
  .auth-wrap { flex: 1; padding: 18px; border-left: 0; background: transparent; }
  .auth-card { padding: 22px; }
  table { min-width: 680px; }
}
