:root {
  --bg: #f5f7fb;
  --panel: rgba(255,255,255,.88);
  --white: #fff;
  --text: #172033;
  --muted: #7b8497;
  --line: #e6eaf2;
  --brand: #6d5dfc;
  --brand2: #00bcd4;
  --danger: #ff3d63;
  --success: #22c55e;
  --warning: #f59e0b;
  --shadow: 0 18px 50px rgba(21,31,56,.10);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(109,93,252,.20), transparent 35%),
    radial-gradient(circle at top right, rgba(0,188,212,.16), transparent 35%),
    var(--bg);
}

.hidden { display: none !important; }
.w-full { width: 100%; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.logo {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  box-shadow: 0 12px 30px rgba(109,93,252,.32);
}

h1, h2 { margin: 0; }
.login-card h1 { margin-top: 22px; font-size: 30px; }
.login-card p, .topbar p, .card-head p { color: var(--muted); line-height: 1.55; }

.field { display: grid; gap: 8px; margin: 14px 0; }
.field label { color: #586177; font-size: 13px; font-weight: 800; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff;
  color: var(--text);
  outline: none;
  font: inherit;
  transition: .18s ease;
}

textarea { min-height: 96px; resize: vertical; }

input:focus, textarea:focus, select:focus {
  border-color: rgba(109,93,252,.65);
  box-shadow: 0 0 0 4px rgba(109,93,252,.10);
}

button, .link-btn {
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: .18s ease;
}

button:hover, .link-btn:hover { transform: translateY(-1px); }

.btn-primary { color: #fff; background: linear-gradient(135deg, var(--brand), #5144df); box-shadow: 0 12px 28px rgba(109,93,252,.25); }
.btn-dark { color: #fff; background: #172033; }
.btn-soft { color: var(--text); background: #eef2ff; }
.error { color: var(--danger); font-size: 13px; min-height: 18px; }

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #111827;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 24px;
}

.brand strong { font-size: 20px; }
.brand small { color: #9ca3af; display: block; margin-top: 2px; }

.nav { display: grid; gap: 7px; }

.nav button {
  width: 100%;
  justify-content: flex-start;
  gap: 12px;
  color: #cbd5e1;
  background: transparent;
}

.nav button.active, .nav button:hover {
  color: #fff;
  background: rgba(255,255,255,.10);
}

.main { padding: 26px; overflow: hidden; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1 { font-size: 28px; }
.topbar p { margin: 5px 0 0; }

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

.stat, .card, .bank-card {
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: 0 10px 30px rgba(21,31,56,.055);
}

.stat { padding: 18px; border-radius: var(--radius); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 800; }
.stat strong { display: block; margin-top: 7px; font-size: 24px; }

.card { padding: 20px; margin-bottom: 18px; border-radius: var(--radius); }

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.card-head h2 { font-size: 19px; }
.card-head p { margin: 4px 0 0; font-size: 13px; }

.bank-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
}

.bank-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.bank-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  font-weight: 900;
}

.savebar {
  position: sticky;
  bottom: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(230,234,242,.9);
  border-radius: 22px;
  background: rgba(255,255,255,.80);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  min-width: 280px;
  padding: 15px 17px;
  border-radius: 18px;
  color: #fff;
  background: #172033;
  box-shadow: var(--shadow);
  transform: translateY(140%);
  opacity: 0;
  transition: .22s ease;
}

.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .main { padding: 16px; }
  .grid-2, .grid-3, .stats { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
}
