:root {
  --dark: #073b3a;
  --dark-2: #0b514d;
  --cream: #f5f0e6;
  --white: #fff;
  --orange: #f36f3d;
  --yellow: #f4c95d;
  --red: #c0392b;
  --text: #183f3d;
  --muted: #6e8581;
  --line: #e3e8e3;
  --max: 1240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "DM Sans", sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
}

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

button { font: inherit; border: 0; cursor: pointer; }

.logo {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--dark);
}

.logo span { color: var(--yellow); }

/* ================= LOGIN ================= */

.login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 26px;
  padding: 60px 5%;
  background:
    linear-gradient(90deg, rgba(7,59,58,.93) 0%, rgba(7,59,58,.82) 45%, rgba(7,59,58,.6) 100%),
    url("https://images.unsplash.com/photo-1500534623283-312aade485b7?auto=format&fit=crop&w=1800&q=85") center/cover;
}

.login-brand {
  text-align: center;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-brand .logo { color: white; }

.login-tag {
  text-transform: uppercase;
  letter-spacing: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow);
}

.login-card {
  width: 100%;
  max-width: 430px;
  background: var(--white);
  border-radius: 22px;
  padding: 42px 38px;
  box-shadow: 0 30px 70px rgba(0,0,0,.35);
}

.login-header { margin-bottom: 26px; }

.login-header h1 {
  font-family: "Playfair Display", serif;
  font-size: 32px;
  color: var(--dark);
  margin-bottom: 8px;
}

.login-header p {
  color: var(--muted);
  font-size: 14.5px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 7px;
}

.field input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--cream);
  transition: .2s;
}

.field input:focus {
  outline: none;
  border-color: var(--dark-2);
  background: var(--white);
}

.login-error {
  color: var(--red);
  font-size: 13px;
  min-height: 16px;
  margin: 2px 0 10px;
}

.login-btn {
  width: 100%;
  margin-top: 4px;
}

.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: var(--orange);
  color: white;
  padding: 15px 27px;
  border-radius: 40px;
  font-weight: 700;
  transition: .3s;
}

.btn-primary:hover { transform: translateY(-2px); background: #ff8354; }

.login-lock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.login-note {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.login-note a {
  color: var(--dark-2);
  font-weight: 700;
  text-decoration: underline;
}

/* ================= DASHBOARD ================= */

.dash-view { min-height: 100vh; display: flex; flex-direction: column; }

.dash-header {
  background: var(--dark);
  padding: 18px 5%;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
}

.dash-nav {
  max-width: var(--max);
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.dash-nav .logo { color: white; }

.dash-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dash-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--dark);
  display: grid;
  place-items: center;
  font-weight: 800;
}

.dash-user-meta { line-height: 1.2; }

.dash-user-meta strong {
  display: block;
  color: white;
  font-size: 14px;
}

.dash-user-meta span {
  color: rgba(255,255,255,.55);
  font-size: 11.5px;
}

.logout {
  background: rgba(255,255,255,.12);
  color: white;
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  transition: .2s;
}

.logout:hover { background: rgba(255,255,255,.22); }

/* ================= TOAST ================= */

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  background: var(--dark);
  color: white;
  padding: 16px 32px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn .4s cubic-bezier(.16,1,.3,1);
  white-space: nowrap;
}

.toast.visible { display: flex; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(.95); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.toast .toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--yellow);
  color: var(--dark);
  font-size: 13px;
  font-weight: 800;
}

.dash-main {
  flex: 1;
  width: 100%;
  max-width: var(--max);
  margin: auto;
  padding: 48px 5% 40px;
}

.dash-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}

.dash-greeting {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.dash-heading h1 {
  font-family: "Playfair Display", serif;
  font-size: clamp(34px, 5vw, 48px);
  color: var(--dark);
  letter-spacing: -1px;
}

.dash-badge {
  background: var(--dark);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 30px;
  letter-spacing: .5px;
}

/* stats */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 26px;
}

.stat {
  background: var(--white);
  border-radius: 18px;
  padding: 24px;
  border: 1px solid var(--line);
}

.stat-accent { background: var(--dark); border-color: var(--dark); }

.stat-accent .stat-label { color: rgba(255,255,255,.6); }
.stat-accent .stat-value { color: white; }

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.stat-value {
  display: block;
  font-size: 30px;
  font-weight: 800;
  color: var(--dark);
  letter-spacing: -1px;
}

.stat-negative { color: var(--red) !important; }

.stat-sub {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

/* grid */

.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 26px;
}

.card {
  background: var(--white);
  border-radius: 18px;
  padding: 26px;
  border: 1px solid var(--line);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.card-head h2 {
  font-family: "Playfair Display", serif;
  font-size: 20px;
  color: var(--dark);
}

.card-range {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* chart */

.chart {
  width: 100%;
  height: 260px;
}

.chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* activity */

.activity { list-style: none; }

.activity li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.activity li:last-child { border-bottom: 0; }

.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--yellow);
}

.activity-dot.down { background: var(--red); }
.activity-dot.up { background: var(--dark-2); }

.activity-info { flex: 1; }

.activity-info strong {
  display: block;
  font-size: 13.5px;
  color: var(--text);
}

.activity-info span {
  font-size: 12px;
  color: var(--muted);
}

.activity-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
}

.activity-val.neg { color: var(--red); }

/* account */

.account-card { margin-bottom: 26px; }

.pill {
  background: #e7f4ec;
  color: #1d6f42;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 30px;
}

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

.acct-item {
  background: var(--cream);
  border-radius: 12px;
  padding: 16px 18px;
}

.acct-item span {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}

.acct-item strong {
  font-size: 15px;
  color: var(--text);
  word-break: break-word;
}

.portal-contact {
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.portal-contact a {
  color: var(--dark-2);
  font-weight: 700;
  text-decoration: underline;
}

.dash-footer {
  text-align: center;
  padding: 24px 5%;
  color: rgba(255,255,255,.5);
  font-size: 13px;
  background: #042f2e;
}

.withdrawal-card { margin-bottom: 26px; }

.withdrawal-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 18px;
  max-width: 560px;
}

.withdrawal-actions { margin-bottom: 6px; }

.withdrawal-message {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  background: #fff6ec;
  border: 1px solid #f6d7b5;
  color: #8a4b12;
  font-size: 14px;
  line-height: 1.6;
}

.withdrawal-message a {
  color: #1d6f42;
  font-weight: 700;
  text-decoration: underline;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .login-card { padding: 34px 24px; }
  .stats { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .dash-user-meta { display: none; }
  .dash-heading { flex-direction: column; align-items: flex-start; }
}