:root {
  --navy: #071b33;
  --navy-2: #0b2a4a;
  --blue: #0f5ea8;
  --cyan: #17c3d2;
  --red: #d71920;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #132238;
  --muted: #667085;
  --line: #e4eaf1;
  --success: #138a55;
  --danger: #c0342b;
  --shadow: 0 18px 50px rgba(7, 27, 51, 0.08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(23, 195, 210, 0.10), transparent 24rem),
    var(--bg);
}

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

.shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar {
  background: linear-gradient(180deg, var(--navy), #051426 82%);
  color: #fff;
  padding: 26px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .2px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--cyan), #2d78d1);
  box-shadow: 0 10px 25px rgba(23,195,210,.25);
  font-weight: 900;
}
.brand small { display:block; opacity:.66; font-size:11px; margin-top:2px; font-weight:600; }
.nav { display: grid; gap: 8px; margin-top: 38px; }
.nav a, .nav button {
  width: 100%; border: 0; background: transparent; color: rgba(255,255,255,.78);
  padding: 12px 14px; border-radius: 12px; text-align: left; display: flex; align-items:center; gap:10px;
}
.nav a:hover, .nav a.active, .nav button:hover { background: rgba(255,255,255,.09); color:#fff; }
.sidebar-footer { position: absolute; bottom: 22px; left:20px; right:20px; font-size:12px; color:rgba(255,255,255,.55); }

.main { padding: 28px 34px 52px; max-width: 1500px; width:100%; margin:0 auto; }
.topbar { display:flex; justify-content:space-between; gap:20px; align-items:center; margin-bottom:28px; }
.title h1 { margin:0; font-size: clamp(26px, 3vw, 36px); letter-spacing:-.7px; }
.title p { margin:7px 0 0; color:var(--muted); }
.user-chip { background:#fff; border:1px solid var(--line); border-radius:999px; padding:9px 14px; display:flex; gap:9px; align-items:center; box-shadow:var(--shadow); }
.user-dot { width:9px; height:9px; border-radius:50%; background:var(--success); box-shadow:0 0 0 4px rgba(19,138,85,.12); }

.grid { display:grid; grid-template-columns: repeat(12, 1fr); gap:20px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:20px; padding:22px; box-shadow:var(--shadow); }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

.balance-card {
  color:#fff;
  background: linear-gradient(135deg, var(--navy) 0%, #0e4778 62%, #087f9c 100%);
  border:0;
  position:relative;
  overflow:hidden;
}
.balance-card::after { content:""; position:absolute; right:-40px; top:-50px; width:180px; height:180px; border-radius:50%; border:28px solid rgba(255,255,255,.07); }
.eyebrow { text-transform:uppercase; letter-spacing:1.4px; font-size:11px; font-weight:800; opacity:.72; }
.balance { font-size:42px; font-weight:800; margin:14px 0 8px; letter-spacing:-1px; }
.account-number { opacity:.72; font-size:14px; }
.kpi { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.kpi strong { display:block; font-size:26px; margin-top:8px; }
.kpi-icon { width:44px; height:44px; border-radius:14px; background:#ecf7ff; color:var(--blue); display:grid; place-items:center; font-weight:900; }

.section-head { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; }
.section-head h2 { margin:0; font-size:18px; }
.badge { display:inline-flex; align-items:center; gap:6px; padding:6px 9px; border-radius:999px; font-size:12px; font-weight:700; background:#eef6ff; color:var(--blue); }
.badge.success { color:var(--success); background:#eaf8f1; }
.badge.danger { color:var(--danger); background:#fff0ef; }

.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; min-width:680px; }
th, td { text-align:left; padding:13px 12px; border-bottom:1px solid var(--line); font-size:14px; }
th { color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.65px; }
td.amount-out { color:var(--danger); font-weight:750; }
td.amount-in { color:var(--success); font-weight:750; }

.btn { border:0; border-radius:12px; padding:12px 16px; font-weight:750; display:inline-flex; align-items:center; justify-content:center; gap:8px; transition:.15s ease; }
.btn:hover { transform:translateY(-1px); }
.btn-primary { background:linear-gradient(135deg, #0c67b7, #07869e); color:#fff; box-shadow:0 10px 20px rgba(15,94,168,.18); }
.btn-secondary { background:#edf3f9; color:var(--navy); }
.btn-danger { background:#fff0ef; color:var(--danger); }
.btn-block { width:100%; }

.form-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-group { display:grid; gap:7px; }
.form-group.full { grid-column:1/-1; }
label { font-size:13px; font-weight:750; color:#344054; }
input, select {
  width:100%; border:1px solid #d5dde7; border-radius:12px; padding:12px 13px; outline:none; background:#fff; color:var(--text);
}
input:focus, select:focus { border-color:#54a9e5; box-shadow:0 0 0 4px rgba(15,94,168,.08); }
.helper { font-size:12px; color:var(--muted); line-height:1.5; }
.notice { border-radius:14px; padding:13px 14px; font-size:13px; margin-top:14px; display:none; }
.notice.show { display:block; }
.notice.error { background:#fff0ef; color:#8f251f; border:1px solid #ffd4d0; }
.notice.success { background:#eaf8f1; color:#0f6e45; border:1px solid #caeedc; }

.login-page { min-height:100vh; display:grid; grid-template-columns: 1.05fr .95fr; }
.login-hero { padding:60px; color:#fff; background:linear-gradient(145deg, #061629 0%, #0a355d 60%, #0b7082 100%); display:flex; flex-direction:column; justify-content:space-between; position:relative; overflow:hidden; }
.login-hero::before { content:""; position:absolute; width:480px; height:480px; border-radius:50%; border:80px solid rgba(23,195,210,.07); right:-170px; top:-120px; }
.login-copy { position:relative; z-index:1; max-width:620px; }
.login-copy h1 { font-size:clamp(40px, 6vw, 72px); line-height:.98; letter-spacing:-2px; margin:54px 0 22px; }
.login-copy p { color:rgba(255,255,255,.72); font-size:18px; line-height:1.65; max-width:540px; }
.trust-row { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:34px; }
.trust-item { border:1px solid rgba(255,255,255,.13); background:rgba(255,255,255,.05); border-radius:16px; padding:16px; }
.trust-item strong { display:block; margin-bottom:4px; }
.trust-item span { font-size:12px; color:rgba(255,255,255,.6); }
.peru-accent { width:56px; height:6px; border-radius:99px; background:linear-gradient(90deg, var(--red) 0 33%, #fff 33% 66%, var(--red) 66%); margin-top:16px; }
.login-panel { display:grid; place-items:center; padding:32px; background:#f8fafc; }
.login-card { width:min(450px,100%); background:#fff; border:1px solid var(--line); border-radius:24px; padding:30px; box-shadow:var(--shadow); }
.login-card h2 { margin:0 0 6px; font-size:28px; }
.login-card > p { color:var(--muted); margin:0 0 24px; }
.login-card .form-group { margin-bottom:15px; }
.security-note { display:flex; gap:10px; margin-top:18px; color:var(--muted); font-size:12px; line-height:1.5; }

.empty { text-align:center; padding:35px 10px; color:var(--muted); }
.spinner { width:20px; height:20px; border-radius:50%; border:2px solid rgba(255,255,255,.4); border-top-color:#fff; animation:spin .8s linear infinite; display:none; }
.loading .spinner { display:block; }
.loading .btn-text { display:none; }
@keyframes spin { to { transform:rotate(360deg); } }

@media (max-width: 980px) {
  .shell { grid-template-columns:1fr; }
  .sidebar { height:auto; position:relative; padding:16px 18px; display:flex; align-items:center; justify-content:space-between; }
  .nav { margin:0; display:flex; }
  .nav a, .nav button { padding:9px 11px; }
  .sidebar-footer { display:none; }
  .main { padding:24px 18px 40px; }
  .col-4,.col-5,.col-7,.col-8 { grid-column:span 12; }
  .login-page { grid-template-columns:1fr; }
  .login-hero { min-height:360px; padding:34px 28px; }
  .login-copy h1 { margin-top:38px; }
  .trust-row { display:none; }
}

@media (max-width: 640px) {
  .topbar { align-items:flex-start; flex-direction:column; }
  .form-grid { grid-template-columns:1fr; }
  .form-group.full { grid-column:auto; }
  .nav a span, .nav button span { display:none; }
  .balance { font-size:34px; }
  .login-panel { padding:20px; }
}
