/* ----------------------------------------------------------------------- */
/*  VAULT — premium dark theme                                             */
/* ----------------------------------------------------------------------- */
:root {
  --bg:          #0B0E14;
  --bg-grad:     radial-gradient(1200px 600px at 80% -10%, #16203022, transparent),
                 radial-gradient(900px 500px at -10% 10%, #1b243422, transparent);
  --surface:     #121821;
  --surface-2:   #1A2230;
  --surface-3:   #212B3B;
  --border:      #232C3B;
  --border-soft: #1c2533;
  --text:        #E7ECF4;
  --muted:       #8A95A9;
  --faint:       #5d6678;
  --accent:      #34D399;
  --accent-2:    #E5B567;
  --danger:      #F87171;
  --blue:        #60A5FA;
  --radius:      16px;
  --radius-sm:   10px;
  --shadow:      0 10px 30px -12px rgba(0,0,0,.6);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --display:     'Sora', var(--font);
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.r { text-align: right; }

/* ----------------------------------------------------------------------- */
/*  Layout                                                                  */
/* ----------------------------------------------------------------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0e131c, #0b0f16);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 22px;
  color: #0B0E14;
  background: linear-gradient(135deg, var(--accent-2), #c9974a);
  box-shadow: 0 6px 18px -6px var(--accent-2);
}
.brand-mark.big { width: 64px; height: 64px; font-size: 34px; border-radius: 18px; margin: 0 auto 14px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--display); font-weight: 800; letter-spacing: 2px; font-size: 17px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 3px; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: 14.5px;
  transition: all .15s ease;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.nav-item.active .nav-ico { color: var(--accent-2); }
.nav-ico { font-size: 16px; width: 20px; text-align: center; color: var(--faint); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.nw-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.nw-card-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.nw-card-value { font-family: var(--display); font-weight: 700; font-size: 18px; }
.link-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  text-align: left; padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-family: var(--font);
}
.link-btn:hover { color: var(--text); background: var(--surface); }

.main { flex: 1; padding: 28px 34px 60px; max-width: 1180px; margin: 0 auto; width: 100%; }

/* ----------------------------------------------------------------------- */
/*  Headers                                                                 */
/* ----------------------------------------------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -.5px; }
.page-head p { font-size: 14px; margin-top: 2px; }
.page-head-actions { display: flex; gap: 10px; }

/* ----------------------------------------------------------------------- */
/*  Hero                                                                    */
/* ----------------------------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, #141d2b, #10151f);
  border: 1px solid var(--border);
  border-radius: 22px; padding: 30px 32px;
  display: flex; justify-content: space-between; align-items: center; gap: 30px;
  margin-bottom: 22px; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(229,181,103,.10), transparent 65%); pointer-events: none;
}
.hero-main { display: flex; flex-direction: column; gap: 6px; }
.hero-label { font-size: 13px; text-transform: uppercase; letter-spacing: 2px; color: var(--muted); }
.hero-value { font-family: var(--display); font-size: 46px; font-weight: 800; letter-spacing: -1.5px; }
.hero-value.pos { color: var(--text); }
.hero-value.neg { color: var(--danger); }
.hero-change { font-size: 13.5px; font-weight: 500; }
.hero-change.up { color: var(--accent); }
.hero-change.down { color: var(--danger); }

.hero-split { display: flex; gap: 14px; }
.hero-stat {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.025); border: 1px solid var(--border-soft);
  border-radius: 14px; padding: 14px 18px; min-width: 165px;
}
.hero-stat-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.hero-stat-value { display: block; font-family: var(--display); font-size: 20px; font-weight: 700; margin-top: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.asset { background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.dot.liab { background: var(--danger); box-shadow: 0 0 12px var(--danger); }

/* ----------------------------------------------------------------------- */
/*  Cards & grid                                                            */
/* ----------------------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card-head h2 { font-family: var(--display); font-size: 16px; font-weight: 600; }
.card.empty { text-align: center; padding: 50px 30px; }
.card.empty h2 { font-size: 20px; margin-bottom: 8px; }
.card.empty p { margin-bottom: 18px; }

.card.stat { display: flex; flex-direction: column; gap: 6px; margin-bottom: 0; }
.totals { margin-bottom: 18px; }
.stat-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.stat-value { font-family: var(--display); font-size: 26px; font-weight: 700; }

.pos { color: var(--accent); }
.neg { color: var(--danger); }

.pill { font-size: 13px; font-weight: 600; padding: 4px 12px; border-radius: 999px; }
.pill.pos { background: rgba(52,211,153,.12); color: var(--accent); }
.pill.neg { background: rgba(248,113,113,.12); color: var(--danger); }

.link { color: var(--accent-2); font-size: 13.5px; font-weight: 500; }
.link:hover { text-decoration: underline; }

.chart-wrap { position: relative; height: 240px; }

/* ----------------------------------------------------------------------- */
/*  Account lists                                                           */
/* ----------------------------------------------------------------------- */
.acct-list { list-style: none; display: flex; flex-direction: column; }
.acct-list li { display: flex; align-items: center; gap: 13px; padding: 12px 2px; border-bottom: 1px solid var(--border-soft); }
.acct-list li:last-child { border-bottom: none; }
.acct-color { width: 8px; height: 34px; border-radius: 4px; flex-shrink: 0; }
.acct-color.sm { display: inline-block; width: 6px; height: 14px; vertical-align: middle; margin-right: 6px; border-radius: 3px; }
.acct-meta { display: flex; flex-direction: column; flex: 1; }
.acct-name { font-weight: 600; font-size: 14.5px; }
.acct-sub { font-size: 12.5px; color: var(--muted); }
.acct-bal { font-family: var(--display); font-weight: 700; font-size: 15.5px; }
.acct-bal.neg { color: var(--danger); }

/* ----------------------------------------------------------------------- */
/*  Tables                                                                  */
/* ----------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
.acct-table th, .txn-table th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.acct-table td, .txn-table td { padding: 13px 10px; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.acct-table tr:last-child td, .txn-table tr:last-child td { border-bottom: none; }
.acct-table tr:hover td, .txn-table.full tbody tr:hover td { background: rgba(255,255,255,.015); }

.tag {
  display: inline-block; font-size: 11px; color: var(--accent-2);
  background: rgba(229,181,103,.1); padding: 2px 8px; border-radius: 6px; margin-left: 8px; font-weight: 500;
}
.tag.muted { color: var(--faint); background: var(--surface-2); }
.chip {
  display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}

/* transactions */
.txn-table td { padding: 11px 10px; }
.txn-icon-cell { width: 44px; }
.txn-badge {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.txn-badge.income { background: rgba(52,211,153,.13); color: var(--accent); }
.txn-badge.expense { background: rgba(248,113,113,.13); color: var(--danger); }
.txn-badge.transfer { background: rgba(96,165,250,.13); color: var(--blue); }
.txn-desc { font-weight: 600; display: block; }
.txn-sub { font-size: 12.5px; color: var(--muted); display: block; }
.txn-date { color: var(--muted); font-size: 13px; white-space: nowrap; }
.txn-amt { font-family: var(--display); font-weight: 700; white-space: nowrap; }
.txn-amt.income { color: var(--accent); }
.txn-amt.expense { color: var(--text); }
.txn-amt.transfer { color: var(--blue); }

.filters { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.filter-count { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ----------------------------------------------------------------------- */
/*  Buttons & inputs                                                        */
/* ----------------------------------------------------------------------- */
.btn {
  font-family: var(--font); font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 10px 18px; border-radius: 11px; border: 1px solid transparent;
  transition: all .15s ease; display: inline-flex; align-items: center; gap: 7px;
}
.btn.primary { background: linear-gradient(135deg, var(--accent), #25b07e); color: #06120c; }
.btn.primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { background: rgba(248,113,113,.14); color: var(--danger); }
.btn.danger:hover { background: rgba(248,113,113,.22); }
.btn.full { width: 100%; justify-content: center; }
.btn.tiny { padding: 6px 12px; font-size: 12.5px; border-radius: 8px; }

.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 13px;
  transition: all .15s; vertical-align: middle;
}
.icon-btn:hover { color: var(--text); background: var(--surface-3); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.inline { display: inline-block; }

input, select, textarea {
  width: 100%; font-family: var(--font); font-size: 14.5px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px;
  transition: border .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52,211,153,.12);
}
input[type="color"] { padding: 4px; height: 44px; cursor: pointer; }
label { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
label input, label select, label textarea { margin-top: 6px; }
label.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
label.check input { width: auto; margin: 0; }
.row { display: flex; gap: 12px; }
.row > label { flex: 0 0 auto; }
.row > label.grow { flex: 1; }
.hint { font-size: 12.5px; color: var(--faint); margin: -4px 0 12px; }

details.more { margin-bottom: 8px; }
details.more summary { cursor: pointer; color: var(--accent-2); font-size: 13.5px; font-weight: 500; padding: 6px 0; }
details.more[open] summary { margin-bottom: 12px; }

/* ----------------------------------------------------------------------- */
/*  Segmented control                                                       */
/* ----------------------------------------------------------------------- */
.seg { display: flex; background: var(--bg); border: 1px solid var(--border); border-radius: 11px; padding: 4px; margin-bottom: 16px; }
.seg input { display: none; }
.seg label {
  flex: 1; text-align: center; padding: 9px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--muted); margin: 0; transition: all .15s;
}
.seg input:checked + label { background: var(--surface-3); color: var(--text); }
#t-income:checked + label { color: var(--accent); }
#t-expense:checked + label { color: var(--danger); }
#t-transfer:checked + label { color: var(--blue); }

/* ----------------------------------------------------------------------- */
/*  Modals                                                                  */
/* ----------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,8,13,.72); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; padding: 60px 20px; z-index: 50;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  width: 100%; max-width: 460px; padding: 24px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.8);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-family: var(--display); font-size: 18px; font-weight: 700; }
.modal-x { background: none; border: none; color: var(--muted); font-size: 26px; cursor: pointer; line-height: 1; }
.modal-x:hover { color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ----------------------------------------------------------------------- */
/*  Alerts                                                                  */
/* ----------------------------------------------------------------------- */
.alert { padding: 12px 16px; border-radius: 11px; font-size: 13.5px; margin-bottom: 16px; border: 1px solid transparent; }
.alert.success { background: rgba(52,211,153,.1); color: var(--accent); border-color: rgba(52,211,153,.25); }
.alert.error   { background: rgba(248,113,113,.1); color: var(--danger); border-color: rgba(248,113,113,.25); }
.alert.info    { background: rgba(96,165,250,.08); color: #bcd3f7; border-color: rgba(96,165,250,.2); }
.alert.warn    { background: rgba(229,181,103,.1); color: var(--accent-2); border-color: rgba(229,181,103,.25); }
.alert code { background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; }
.sample-banner { display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap; }
.sample-banner form { margin: 0; }

/* ----------------------------------------------------------------------- */
/*  Login                                                                   */
/* ----------------------------------------------------------------------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 40px 36px; width: 100%; max-width: 380px; box-shadow: var(--shadow); text-align: center;
}
.login-brand h1 { font-family: var(--display); font-size: 26px; letter-spacing: 4px; font-weight: 800; }
.login-brand p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.login-form { margin-top: 26px; text-align: left; }
.login-form label { margin-bottom: 16px; }
.login-foot { color: var(--faint); font-size: 12px; margin-top: 18px; }

/* ----------------------------------------------------------------------- */
/*  Responsive                                                              */
/* ----------------------------------------------------------------------- */
@media (max-width: 880px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
  .brand { padding: 4px 8px; }
  .nav { flex-direction: row; margin: 0; flex: 1; }
  .nav-item { padding: 9px 12px; }
  .sidebar-foot { flex-direction: row; align-items: center; margin: 0; }
  .nw-card { margin: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-value { font-size: 36px; }
  .main { padding: 20px; }
}
