:root {
  color-scheme: light;
  --blue: #1167ff;
  --blue-2: #4fa3ff;
  --ink: #0b1220;
  --muted: #64748b;
  --line: #dce8ff;
  --paper: #f5f8ff;
  --white: #fff;
  --good: #0aa55a;
  --bad: #dc2626;
  --shadow: 0 24px 80px rgba(30, 88, 190, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 163, 255, .18), transparent 32%),
    linear-gradient(180deg, #ffffff, var(--paper));
  color: var(--ink);
  font-family: Inter, Manrope, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.app-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.account-side {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(18px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -.03em;
}

.logo span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
}

.account-side nav {
  display: grid;
  gap: 8px;
  margin-top: 34px;
}

.account-side nav a {
  padding: 13px 14px;
  border-radius: 15px;
  color: #44546c;
  font-weight: 800;
}

.account-side nav a.active,
.account-side nav a:hover {
  color: #fff;
  background: #081225;
}

.side-note {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  padding: 16px;
  border: 1px solid #dce8ff;
  border-radius: 20px;
  background: #f8fbff;
}

.side-note b { color: var(--blue); }
.side-note p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }

.account-main {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 54px;
}

.account-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.account-header span,
.panel-head span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.account-header h1 {
  margin: 8px 0 10px;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1;
  letter-spacing: -.06em;
}

.account-header p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.header-actions a,
.header-actions button,
.panel-head a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--blue);
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.summary-grid article,
.panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
}

.summary-grid article {
  padding: 24px;
}

.summary-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.summary-grid strong {
  display: block;
  margin-top: 12px;
  font-size: 38px;
  letter-spacing: -.06em;
}

.summary-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.balance-card {
  color: #fff;
  background: linear-gradient(135deg, #07152d, #1167ff) !important;
}

.balance-card small,
.balance-card p { color: rgba(255,255,255,.75); }

.panel {
  padding: 24px;
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

.panel-head.compact { align-items: center; }

.panel-head h2 {
  margin: 6px 0 0;
  font-size: 28px;
  letter-spacing: -.04em;
}

.panel-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.package-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.package-card.is-popular {
  border-color: var(--blue);
  box-shadow: 0 18px 46px rgba(17, 103, 255, .15);
}

.package-card small {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--blue);
  font-weight: 900;
}

.package-card h3 { margin: 14px 0 6px; }
.package-card strong { display: block; font-size: 30px; letter-spacing: -.05em; }
.package-card p { min-height: 44px; color: var(--muted); line-height: 1.45; }

.package-card button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.package-card button:disabled { opacity: .6; cursor: wait; }

.inline-status {
  min-height: 22px;
  margin-top: 14px;
  color: var(--muted);
}

.two-col {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 16px;
}

.history-list,
.ledger {
  display: grid;
  gap: 10px;
}

.history-item,
.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid #edf3ff;
  border-radius: 18px;
  background: #fbfdff;
}

.history-item b,
.ledger-row b { display: block; margin-bottom: 4px; }

.history-item span,
.ledger-row span { color: var(--muted); font-size: 13px; line-height: 1.4; }

.status-pill {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: #edf5ff;
  color: var(--blue);
  font-weight: 900;
  font-size: 12px;
}

.status-pill.paid,
.status-pill.success,
.amount-plus { color: var(--good); }

.status-pill.failed,
.amount-minus { color: var(--bad); }

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  background: #fbfdff;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 360px;
  padding: 14px 18px;
  border-radius: 16px;
  background: #081225;
  color: #fff;
  font-size: 14px;
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: .22s;
}

.toast.show {
  transform: none;
  opacity: 1;
}

@media (max-width: 960px) {
  .app-shell { grid-template-columns: 1fr; }
  .account-side { position: static; height: auto; }
  .side-note { position: static; margin-top: 22px; }
  .summary-grid,
  .package-grid,
  .two-col { grid-template-columns: 1fr; }
  .account-header,
  .panel-head { display: block; }
  .header-actions { margin-top: 18px; }
}
