:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0b1726;
  --ink-2: #1b2b40;
  --muted: #6b7c93;
  --muted-2: #94a3b8;
  --line: #e4eaf2;
  --line-strong: #d5deea;
  --navy: #0b1726;
  --navy-2: #102137;
  --navy-3: #182f4a;
  --accent: #18c98b;
  --accent-dark: #0ba46f;
  --accent-soft: #e6fbf3;
  --blue: #3b82f6;
  --blue-soft: #eaf2ff;
  --amber: #f59e0b;
  --amber-soft: #fff7e5;
  --red: #ef4444;
  --red-soft: #fff0f0;
  --violet: #7c6cf6;
  --shadow-sm: 0 1px 2px rgba(15, 32, 54, 0.04);
  --shadow: 0 12px 34px rgba(15, 32, 54, 0.08);
  --shadow-lg: 0 30px 80px rgba(4, 15, 30, 0.25);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar: 258px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family:
    ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Hiragino Sans GB", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background:
    radial-gradient(500px 300px at 50% 30%, rgba(24, 201, 139, 0.12), transparent 70%),
    var(--navy);
  color: #dbe6f3;
}

.boot-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--accent);
  color: var(--navy);
  font-weight: 900;
  font-size: 24px;
  box-shadow: 0 0 0 8px rgba(24, 201, 139, 0.1);
}

.boot-text {
  font-size: 13px;
  color: #8fa5bd;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------------ *
 * Login
 * ------------------------------------------------------------------ */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(430px, 0.88fr);
  background: #f7f9fc;
}

.auth-story {
  position: relative;
  overflow: hidden;
  padding: 54px clamp(42px, 6vw, 96px) 44px;
  color: #f4f8fc;
  background:
    radial-gradient(800px 500px at 8% 0%, rgba(24, 201, 139, 0.2), transparent 55%),
    radial-gradient(700px 500px at 100% 90%, rgba(59, 130, 246, 0.18), transparent 60%),
    linear-gradient(145deg, #081320 0%, #0c1c2e 55%, #10263d 100%);
  display: flex;
  flex-direction: column;
}

.auth-story::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  pointer-events: none;
}

.auth-story::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -170px;
  bottom: -190px;
  border-radius: 50%;
  border: 1px solid rgba(24, 201, 139, 0.3);
  box-shadow:
    0 0 0 34px rgba(24, 201, 139, 0.035),
    0 0 0 68px rgba(24, 201, 139, 0.025);
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 750;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--accent);
  color: var(--navy);
  font-weight: 900;
  font-size: 18px;
  box-shadow: 0 10px 30px rgba(24, 201, 139, 0.25);
}

.brand-mark.small {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 15px;
}

.auth-story-content {
  position: relative;
  z-index: 1;
  max-width: 650px;
  margin: auto 0;
  padding: 60px 0;
}

.story-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid rgba(24, 201, 139, 0.35);
  border-radius: 999px;
  color: #8ff0cb;
  background: rgba(24, 201, 139, 0.08);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.story-badge .pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(24, 201, 139, 0.12);
}

.auth-story h1 {
  margin: 24px 0 18px;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.auth-story h1 em {
  font-style: normal;
  color: var(--accent);
}

.auth-story p.lead {
  max-width: 540px;
  margin: 0;
  color: #a9bbcf;
  font-size: 16px;
  line-height: 1.8;
}

.story-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 38px;
}

.story-feature {
  padding: 16px 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(8px);
}

.story-feature strong {
  display: block;
  color: #f2f8ff;
  font-size: 14px;
  margin-bottom: 4px;
}

.story-feature span {
  color: #8197ad;
  font-size: 12px;
  line-height: 1.55;
}

.story-footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #6e849b;
  font-size: 12px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px clamp(28px, 5vw, 84px);
  background:
    radial-gradient(600px 380px at 100% 0%, rgba(24, 201, 139, 0.055), transparent 60%),
    #f7f9fc;
}

.auth-card {
  width: 100%;
  max-width: 410px;
}

.auth-card h2 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.auth-card .auth-sub {
  margin: 0 0 30px;
  color: var(--muted);
  font-size: 14px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 17px;
}

.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
}

.field .hint {
  color: var(--muted-2);
  font-size: 11.5px;
  font-weight: 400;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}

.input::placeholder,
.textarea::placeholder {
  color: #a9b6c7;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(24, 201, 139, 0.12);
}

.textarea {
  resize: vertical;
  min-height: 132px;
  line-height: 1.7;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 44px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px;
  border-radius: 7px;
}

.input-action:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  padding: 10px 15px;
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
  transition:
    transform 0.12s,
    background 0.15s,
    border-color 0.15s,
    box-shadow 0.15s;
}

.btn:hover {
  background: var(--surface-soft);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 6px 16px rgba(11, 23, 38, 0.14);
}

.btn-primary:hover {
  background: #16283f;
}

.btn-accent {
  background: var(--accent);
  color: #062117;
  border-color: var(--accent);
  box-shadow: 0 7px 18px rgba(24, 201, 139, 0.22);
}

.btn-accent:hover {
  background: #25d99a;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  background: #fff;
  border-color: #b9c7d9;
}

.btn-danger {
  color: var(--red);
  border-color: #f3caca;
  background: #fff;
}

.btn-danger:hover {
  background: var(--red-soft);
}

.btn-sm {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-icon {
  padding: 9px;
  width: 38px;
  height: 38px;
}

.btn-block {
  width: 100%;
  padding: 12px 16px;
}

.form-error {
  display: none;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #f4cccc;
  background: #fff4f4;
  color: #b42318;
  border-radius: 9px;
  font-size: 12.5px;
}

.form-error.show {
  display: block;
}

.auth-note {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.auth-note strong {
  color: var(--ink-2);
}

.demo-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #eef6ff;
  color: #315c8a;
  font-size: 12px;
  line-height: 1.65;
}

/* ------------------------------------------------------------------ *
 * App shell
 * ------------------------------------------------------------------ */

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(400px 240px at 0% 0%, rgba(24, 201, 139, 0.09), transparent 65%),
    var(--navy);
  color: #dce6f1;
  padding: 24px 16px 18px;
  z-index: 30;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 26px;
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.side-brand .brand-text {
  display: grid;
  line-height: 1.2;
}

.side-brand .brand-text span {
  color: #6f879e;
  font-size: 10px;
  font-weight: 550;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: 3px;
}

.nav-group {
  margin: 0 0 20px;
}

.nav-label {
  padding: 0 12px 8px;
  color: #587087;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 9px;
  color: #96a9bd;
  font-weight: 550;
  font-size: 13px;
  transition:
    background 0.15s,
    color 0.15s;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.85;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f2f7fc;
}

.nav-item.active {
  background: rgba(24, 201, 139, 0.11);
  color: #eafff7;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  width: 3px;
  height: 19px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.nav-item.active svg {
  color: var(--accent);
  opacity: 1;
}

.nav-spacer {
  flex: 1;
}

.side-balance {
  margin: 0 4px 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(24, 201, 139, 0.12), rgba(255, 255, 255, 0.03));
}

.side-balance .label {
  color: #8298ad;
  font-size: 11px;
}

.side-balance .value {
  margin: 3px 0 1px;
  color: #fff;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.side-balance .unit {
  color: #6f879e;
  font-size: 11px;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  background: #223b56;
  color: #cfe4f8;
  font-weight: 700;
  font-size: 13px;
}

.side-user .meta {
  min-width: 0;
  flex: 1;
}

.side-user .name {
  color: #e7eff7;
  font-size: 12.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-user .role {
  color: #6f879e;
  font-size: 10.5px;
}

.side-user .logout {
  border: 0;
  background: transparent;
  color: #6f879e;
  padding: 6px;
  border-radius: 7px;
}

.side-user .logout:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.side-user .logout svg {
  width: 17px;
  height: 17px;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 67px;
  padding: 13px clamp(20px, 3.4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(242, 245, 249, 0.86);
  backdrop-filter: blur(14px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.topbar-title strong {
  color: var(--ink);
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.balance-pill strong {
  color: var(--ink);
  font-size: 13px;
}

.balance-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.content {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: clamp(22px, 3.4vw, 40px) clamp(20px, 3.4vw, 44px) 60px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 31px);
  line-height: 1.18;
  letter-spacing: -0.04em;
}

.page-head p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.mobile-only {
  display: none;
}

/* ------------------------------------------------------------------ *
 * Cards, stats, tables
 * ------------------------------------------------------------------ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  position: relative;
  overflow: hidden;
  padding: 19px 19px 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.kpi::after {
  content: "";
  position: absolute;
  right: -20px;
  top: -25px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(24, 201, 139, 0.09), transparent 67%);
}

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

.kpi-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.kpi-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--muted);
}

.kpi-icon svg {
  width: 17px;
  height: 17px;
}

.kpi-icon.green {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.kpi-icon.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.kpi-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.kpi-icon.violet {
  background: #f0edff;
  color: var(--violet);
}

.kpi-value {
  margin: 11px 0 3px;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 760;
  letter-spacing: -0.045em;
}

.kpi-value small {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0;
  margin-left: 4px;
}

.kpi-meta {
  color: var(--muted-2);
  font-size: 11.5px;
}

.kpi-meta .up {
  color: var(--accent-dark);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 19px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.card-head .sub {
  margin: 3px 0 0;
  color: var(--muted-2);
  font-size: 11.5px;
}

.card-body {
  padding: 19px;
}

.card-body.flush {
  padding: 0;
}

.card-foot {
  padding: 13px 19px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11.5px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

th {
  padding: 10px 16px;
  text-align: left;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid #edf1f6;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfcfe;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cell-main {
  color: var(--ink);
  font-weight: 600;
}

.cell-sub {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 11px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0f3f7;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.green {
  background: var(--accent-soft);
  color: #07825a;
}

.badge.blue {
  background: var(--blue-soft);
  color: #2563c9;
}

.badge.amber {
  background: var(--amber-soft);
  color: #a16207;
}

.badge.red {
  background: var(--red-soft);
  color: #c22a2a;
}

.badge.violet {
  background: #f0edff;
  color: #6550d8;
}

.badge.gray {
  background: #f1f4f8;
  color: #67788d;
}

.avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: #e9f1fb;
  color: #3a6088;
  font-size: 11px;
  font-weight: 750;
}

.user-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search {
  position: relative;
  min-width: 220px;
}

.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%);
  color: var(--muted-2);
}

.search .input {
  padding: 8px 12px 8px 33px;
  font-size: 12.5px;
  border-radius: 8px;
}

.select.sm {
  width: auto;
  padding: 8px 30px 8px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 17px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}

.pager {
  display: flex;
  gap: 4px;
}

.pager button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}

.pager button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--ink);
}

.pager button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.empty {
  padding: 46px 24px;
  text-align: center;
  color: var(--muted-2);
}

.empty .empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-soft);
  color: #a5b3c5;
}

.empty .empty-icon svg {
  width: 22px;
  height: 22px;
}

.empty strong {
  display: block;
  color: var(--ink-2);
  font-size: 13px;
  margin-bottom: 3px;
}

/* ------------------------------------------------------------------ *
 * Dashboard pieces
 * ------------------------------------------------------------------ */

.balance-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 27px 29px;
  border-radius: var(--radius);
  color: #edf7ff;
  background:
    radial-gradient(500px 260px at 90% 0%, rgba(24, 201, 139, 0.32), transparent 60%),
    linear-gradient(135deg, #0b1726 0%, #10253a 62%, #143048 100%);
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.balance-hero::after {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  right: 18%;
  bottom: -180px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 26px rgba(255, 255, 255, 0.025),
    0 0 0 52px rgba(255, 255, 255, 0.018);
}

.balance-hero .eyebrow {
  color: #7f9ab3;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 650;
}

.balance-hero .amount {
  margin: 4px 0 5px;
  font-size: clamp(38px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-weight: 780;
}

.balance-hero .amount small {
  font-size: 14px;
  color: #8ea9c1;
  letter-spacing: 0;
  font-weight: 500;
  margin-left: 7px;
}

.balance-hero .caption {
  color: #8ea9c1;
  font-size: 12px;
}

.balance-hero .hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3f9ff;
  font-size: 12.5px;
  font-weight: 650;
}

.hero-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hero-btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #062117;
}

.hero-btn.accent:hover {
  background: #28d99b;
}

.hero-btn svg {
  width: 15px;
  height: 15px;
}

.provider-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 17px;
  margin-bottom: 18px;
  border: 1px solid #dbece6;
  border-radius: 12px;
  background: linear-gradient(90deg, #f4fdf9, #fbfefd);
}

.provider-strip .left {
  display: flex;
  align-items: center;
  gap: 11px;
}

.provider-strip .icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #dff8ed;
  color: #07825a;
}

.provider-strip .icon svg {
  width: 17px;
  height: 17px;
}

.provider-strip strong {
  display: block;
  font-size: 12.5px;
}

.provider-strip span {
  color: var(--muted);
  font-size: 11.5px;
}

.provider-strip .value {
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.quick-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition:
    border-color 0.15s,
    transform 0.15s,
    box-shadow 0.15s;
}

.quick-card:hover {
  border-color: #c8d5e5;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.quick-card .icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  margin-bottom: 13px;
}

.quick-card .icon svg {
  width: 17px;
  height: 17px;
}

.quick-card strong {
  display: block;
  font-size: 12.5px;
}

.quick-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.5;
}

.amount-pos {
  color: #07825a;
  font-weight: 650;
}

.amount-neg {
  color: #c22a2a;
  font-weight: 650;
}

/* ------------------------------------------------------------------ *
 * Send page
 * ------------------------------------------------------------------ */

.send-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.composer {
  padding: 21px;
}

.composer .textarea {
  min-height: 180px;
  font-size: 14px;
}

.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 11px;
}

.seg-meter {
  display: flex;
  align-items: center;
  gap: 7px;
}

.seg-dots {
  display: flex;
  gap: 3px;
}

.seg-dot {
  width: 12px;
  height: 4px;
  border-radius: 2px;
  background: #e2e9f1;
}

.seg-dot.on {
  background: var(--accent);
}

.schedule-row {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.schedule-row input[type="checkbox"] {
  accent-color: var(--accent);
  width: 15px;
  height: 15px;
}

.schedule-row label {
  font-size: 12px;
  font-weight: 600;
}

.schedule-row .input {
  max-width: 240px;
  margin-left: auto;
  padding: 8px 10px;
  font-size: 12px;
}

.send-summary {
  padding: 21px;
}

.send-summary .summary-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
}

.send-summary .summary-row:last-of-type {
  border-bottom: 0;
}

.send-summary .summary-row span {
  color: var(--muted);
}

.send-summary .summary-row strong {
  font-weight: 650;
}

.send-total {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 18px;
  padding: 16px;
  border-radius: 11px;
  background: var(--surface-soft);
}

.send-total .label {
  color: var(--muted);
  font-size: 11.5px;
}

.send-total .value {
  font-size: 29px;
  line-height: 1.1;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.send-total .value small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
}

.phone-preview {
  margin-top: 16px;
  padding: 18px 15px 22px;
  border-radius: 14px;
  background:
    radial-gradient(300px 200px at 50% 0%, rgba(24, 201, 139, 0.09), transparent 70%),
    #eef3f9;
}

.phone-bubble {
  position: relative;
  max-width: 90%;
  padding: 11px 13px;
  border-radius: 13px 13px 13px 4px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(15, 32, 54, 0.06);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.phone-bubble .sender {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.phone-meta {
  margin-top: 9px;
  color: #8a9bb0;
  font-size: 10px;
  text-align: right;
}

.result-card {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid #cdebdc;
  border-radius: 11px;
  background: #f3fcf8;
}

.result-card strong {
  display: block;
  color: #087a56;
  font-size: 12.5px;
  margin-bottom: 3px;
}

.result-card p {
  margin: 0;
  color: #4e7a6b;
  font-size: 11.5px;
}

/* ------------------------------------------------------------------ *
 * Settings / API
 * ------------------------------------------------------------------ */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:first-child {
  padding-top: 0;
}

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

.setting-row .meta {
  max-width: 430px;
}

.setting-row .meta strong {
  display: block;
  font-size: 12.5px;
  margin-bottom: 3px;
}

.setting-row .meta span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.65;
}

.setting-row .control {
  flex: none;
  min-width: 230px;
}

.status-list {
  display: grid;
  gap: 12px;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.status-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.status-line span {
  color: var(--muted);
}

.status-line strong {
  font-weight: 650;
  text-align: right;
}

.webhook-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.webhook-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  font-size: 10.5px;
}

.copy-btn {
  border: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--muted);
  font-size: 10.5px;
  flex: none;
}

.copy-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.code-block {
  position: relative;
  overflow-x: auto;
  margin: 0;
  padding: 17px;
  border-radius: 11px;
  background: #0c1827;
  color: #cfe2f4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.7;
}

.code-block .k {
  color: #7dd3fc;
}

.code-block .s {
  color: #86efac;
}

.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 17px 0 7px;
}

.code-head:first-child {
  margin-top: 0;
}

.code-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 13px;
  border: 1px solid #f0d9a8;
  border-radius: 10px;
  background: #fffaf0;
}

.key-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, monospace;
  font-size: 11.5px;
  color: #8a5a00;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

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

.key-row .key-meta {
  flex: 1;
  min-width: 0;
}

.key-row .key-meta strong {
  display: block;
  font-size: 12px;
}

.key-row .key-meta span {
  color: var(--muted-2);
  font-size: 10.5px;
}

/* ------------------------------------------------------------------ *
 * Modal, toast, misc
 * ------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 13, 24, 0.55);
  backdrop-filter: blur(4px);
  animation: fade-in 0.15s ease;
}

.modal {
  width: min(520px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.18s ease;
}

.modal.wide {
  width: min(760px, 100%);
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 19px 21px 15px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11.5px;
}

.modal-close {
  border: 0;
  background: var(--surface-soft);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}

.modal-close:hover {
  color: var(--ink);
  background: #eef2f7;
}

.modal-body {
  padding: 19px 21px;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 21px 19px;
  border-top: 1px solid var(--line);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.detail-grid > div {
  padding: 11px 13px;
  background: #fff;
}

.detail-grid .label {
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-grid .value {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  word-break: break-word;
}

.detail-body {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-section {
  margin-top: 18px;
}

.modal-section h4 {
  margin: 0 0 8px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.modal-table {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.modal-table table {
  font-size: 11px;
}

.modal-table th,
.modal-table td {
  padding: 8px 10px;
}

.quick-amounts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.quick-amounts button {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
}

.quick-amounts button:hover {
  border-color: var(--accent);
  color: var(--ink);
}

#toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: grid;
  gap: 9px;
  pointer-events: none;
}

.toast {
  min-width: 260px;
  max-width: 390px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  color: var(--ink-2);
  font-size: 12.5px;
  animation: toast-in 0.2s ease;
}

.toast.success {
  border-color: #c7ebdb;
  background: #f5fdf9;
  color: #086c4c;
}

.toast.error {
  border-color: #f0cdcd;
  background: #fff7f7;
  color: #a52525;
}

.toast strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12.5px;
}

.toast span {
  color: inherit;
  opacity: 0.8;
  font-size: 11.5px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-page {
  display: grid;
  gap: 14px;
}

.skeleton {
  border-radius: 12px;
  background: linear-gradient(90deg, #e9eef5 25%, #f4f7fa 37%, #e9eef5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
}

.skeleton.kpi {
  height: 112px;
  border: 0;
}

.skeleton.block {
  height: 300px;
  border: 0;
}

.error-page {
  padding: 50px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.error-page .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--red-soft);
  color: var(--red);
}

.error-page strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.error-page p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
}

.mobile-nav {
  display: none;
}

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

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

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

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

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */

@media (max-width: 1180px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-col,
  .send-grid,
  .settings-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: 340px;
    padding: 30px 28px;
  }

  .auth-story-content {
    padding: 36px 0 10px;
  }

  .auth-story h1 {
    font-size: clamp(32px, 7vw, 46px);
  }

  .story-features,
  .story-footer {
    display: none;
  }

  .auth-panel {
    padding: 38px 24px 54px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    padding: 12px 18px;
  }

  .mobile-only {
    display: inline-flex;
  }

  .content {
    padding: 20px 18px 92px;
  }

  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 40;
    display: flex;
    justify-content: space-around;
    gap: 4px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    background: rgba(11, 23, 38, 0.96);
    box-shadow: 0 14px 40px rgba(4, 13, 24, 0.28);
    backdrop-filter: blur(12px);
  }

  .mobile-nav a {
    flex: 1;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 7px 3px;
    border-radius: 9px;
    color: #7890a7;
    font-size: 9px;
    font-weight: 600;
  }

  .mobile-nav a svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav a.active {
    color: var(--accent);
    background: rgba(24, 201, 139, 0.1);
  }
}

@media (max-width: 720px) {
  .page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .page-actions {
    width: 100%;
  }

  .kpi-grid {
    gap: 10px;
  }

  .kpi {
    padding: 15px;
  }

  .kpi-value {
    font-size: 25px;
  }

  .balance-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .balance-hero .hero-actions {
    width: 100%;
  }

  .hero-btn {
    flex: 1;
    justify-content: center;
  }

  .two-col {
    gap: 12px;
  }

  .card-head,
  .card-body,
  .composer,
  .send-summary {
    padding: 15px;
  }

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

  .search {
    width: 100%;
    min-width: 0;
  }

  .toolbar-right {
    width: 100%;
  }

  .toolbar-right .select {
    flex: 1;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .setting-row {
    flex-direction: column;
    gap: 10px;
  }

  .setting-row .control {
    width: 100%;
    min-width: 0;
  }

  .schedule-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .schedule-row .input {
    width: 100%;
    max-width: none;
    margin-left: 0;
  }

  th,
  td {
    padding-left: 12px;
    padding-right: 12px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal {
    max-height: 92vh;
  }

  .auth-story p.lead {
    font-size: 14px;
  }
}
