@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");
@import url("./dashboard-shared.css");

:root {
  color-scheme: light;
  --ink: #101b2d;
  --muted: #58595B;
  --soft: #f7fafd;
  --soft-blue: #e0f4ff;
  --blue: #17479E;
  --navy: #061325;
  --line: #dce7ef;
  --white: #ffffff;
  --green: #16a06b;
  --amber: #F68A46;
  --red: #ED1C24;
  --shadow: 0 18px 42px rgba(16, 27, 45, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--soft);
  color: var(--ink);
  font-family: "Gotham", "Montserrat", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

/* Sidebar, brand, nav, support-panel → dashboard-shared.css */

.dashboard {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(22px, 2.5vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.topbar span {
  display: block;
  max-width: 700px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.top-actions {
  display: flex;
  gap: 12px;
}

.primary-button,
.ghost-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
}

.primary-button {
  border: 0;
  background: var(--blue);
  color: var(--white);
}

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

.ghost-button.compact {
  min-height: 38px;
}

.wallet-overview {
  display: grid;
  grid-template-columns: minmax(0, 320px);
  gap: 14px;
  margin-top: 20px;
}

.wallet-overview article {
  min-height: 112px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.wallet-overview span,
.wallet-overview small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.wallet-overview strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.wallet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

.add-money-card,
.balance-card,
.history-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.add-money-card {
  position: relative;
  padding: 20px;
  border-color: #bfeaff;
  background: linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
}

.card-head,
.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.card-head h2,
.history-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.secure-pill {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--soft-blue);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.amount-field {
  display: block;
  margin-top: 18px;
}

.amount-field span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.amount-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #9fdcf7;
  border-radius: 10px;
  outline: 0;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 0 0 4px rgba(23, 71, 158, 0.06);
}

.amount-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 14px;
}

.amount-chips button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 14px;
  background: #f0f6fa;
  color: #48566b;
  font-size: 14px;
  font-weight: 600;
}

.amount-chips button.active {
  border-color: var(--blue);
  background: var(--soft-blue);
  color: var(--blue);
}

.add-money-button {
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(23, 71, 158, 0.18);
}

.balance-card {
  min-height: 146px;
  padding: 24px;
}

.balance-card p {
  margin: 0;
  font-size: clamp(13px, 1.2vw, 15px);
  line-height: 1.3;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.balance-card strong {
  display: block;
  margin-top: 8px;
  color: var(--blue);
  font-size: 32px;
  line-height: 1;
}

.balance-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.checkout-summary-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.checkout-summary-card h2 {
  margin: 0;
  font-size: 18px;
}

.checkout-summary-card dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.checkout-summary-card div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.checkout-summary-card div:last-child {
  border-bottom: 0;
  color: var(--ink);
  font-weight: 800;
}

.checkout-summary-card dt,
.checkout-summary-card dd {
  margin: 0;
  color: inherit;
  font-size: 14px;
}

.secure-checkout-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  font-size: 14px;
  font-weight: 700;
}

.history-card {
  margin-top: 28px;
  overflow: hidden;
}

.history-head {
  padding: 18px 22px;
}

.history-table {
  border-top: 1px solid var(--line);
}

.history-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 140px 150px 150px 130px;
  min-height: 64px;
  align-items: center;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  color: #77839a;
  font-size: 15px;
  font-weight: 600;
}

.history-header {
  background: #fbfcfe;
}

.history-empty {
  min-height: 118px;
  display: grid;
  place-items: center;
  color: #77839a;
  font-size: 16px;
  font-weight: 500;
}

/* ─── tablet: stack wallet grid ─────────────────────────────── */
@media (max-width: 1024px) {
  .wallet-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .history-card {
    max-width: none;
  }
}

/* ─── mobile ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Checkout sequence stays Step 1 -> Step 2 on mobile */
  .wallet-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 20px;
  }

  .wallet-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .wallet-overview article {
    min-height: 92px;
    padding: 16px;
  }

  .card-head,
  .history-head {
    flex-direction: column;
    gap: 10px;
  }

  /* Full-width action buttons, primary first */
  .top-actions {
    flex-direction: column-reverse;
    width: 100%;
  }

  .amount-chips {
    flex-wrap: wrap;
  }

  .add-money-card,
  .balance-card {
    padding: 18px;
  }

  .history-head {
    padding: 16px 18px;
  }

  .add-money-button {
    min-height: 50px;
    font-size: 15px;
  }

  .history-table {
    overflow-x: auto;
  }

  .history-row {
    min-width: 700px;
  }
}
