/* ================================================================
   Arteveliz Finance — Design System
   public/css/arteveliz.css
   ================================================================ */

/* ── CSS VARIABLES ── */
:root {
  --bg:       #0c0e13;
  --bg1:      #111420;
  --bg2:      #161a26;
  --bg3:      #1c2130;
  --border:   rgba(255,255,255,0.06);
  --border2:  rgba(255,255,255,0.1);
  --text:     #eef0f6;
  --text2:    #8b96ac;
  --text3:    #4a5568;
  --gold:     #d4a853;
  --gold-l:   #e8c47a;
  --gold-bg:  rgba(212,168,83,0.12);
  --green:    #4ade80;
  --green-bg: rgba(74,222,128,0.1);
  --red:      #f87171;
  --red-bg:   rgba(248,113,113,0.1);
  --blue:     #60a5fa;
  --blue-bg:  rgba(96,165,250,0.1);
  --purple:   #a78bfa;
  --purple-bg:rgba(167,139,250,0.1);
  --orange:   #fb923c;
  --orange-bg:rgba(251,146,60,0.1);
  --sidebar:  244px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
h1, h2, h3, .serif { font-family: 'DM Serif Display', serif; }
.mono { font-family: 'DM Mono', monospace; }
a { text-decoration: none; color: inherit; }
[data-lucide] { width: 18px; height: 18px; stroke-width: 1.6; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── SIDEBAR ── */
#sb {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar); height: 100vh;
  background: var(--bg1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 100; overflow-y: auto;
}
.sb-logo { padding: 20px 18px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.logo-row { display: flex; align-items: center; gap: 10px; }
.logo-ico {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--gold), #a06820);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Serif Display', serif;
  font-size: 17px; color: #0c0e13; font-weight: 700; flex-shrink: 0;
}
.logo-name { font-family: 'DM Serif Display', serif; font-size: 16px; color: var(--text); }
.logo-sub { font-size: 10px; color: var(--text3); letter-spacing: .1em; text-transform: uppercase; margin-top: 1px; }
.nav-scroll { flex: 1; padding: 8px 0; overflow-y: auto; }
.nav-sec {
  font-size: 9px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text3);
  padding: 12px 18px 5px;
}
.ni {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px; cursor: pointer;
  color: var(--text2); font-size: 13px; font-weight: 400;
  transition: all .12s; border-left: 2px solid transparent;
  text-decoration: none;
}
.ni:hover { color: var(--text); background: var(--bg2); }
.ni.active { color: var(--gold); background: var(--gold-bg); border-left-color: var(--gold); font-weight: 500; }
.ni .ico {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  opacity: .7; transition: opacity .12s;
}
.ni .ico i, .ni .ico svg { width: 16px; height: 16px; }
.ni.active .ico { opacity: 1; }
.ni .nbadge {
  margin-left: auto;
  background: var(--red); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 5px; border-radius: 8px;
  min-width: 16px; text-align: center;
}
.sb-foot { padding: 14px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
.u-card { display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.u-card:hover { background: var(--bg2); }
.u-av {
  width: 30px; height: 30px; border-radius: 7px;
  background: linear-gradient(135deg, var(--gold), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.u-name { font-size: 12px; font-weight: 500; color: var(--text); }
.u-role { font-size: 10px; color: var(--text3); }

/* ── MAIN LAYOUT ── */
#main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }
#tb {
  position: sticky; top: 0; z-index: 50;
  background: rgba(12,14,19,.9); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px; height: 54px;
  display: flex; align-items: center; justify-content: space-between;
}
.tb-title { font-family: 'DM Serif Display', serif; font-size: 17px; }
.tb-right { display: flex; align-items: center; gap: 10px; }
.ctx-wrap { display: flex; background: var(--bg2); border-radius: 7px; border: 1px solid var(--border2); overflow: hidden; }
.ctx-btn { padding: 4px 12px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text3); background: transparent; border: none; font-family: 'DM Sans', sans-serif; transition: all .12s; }
.ctx-btn.active { background: var(--gold); color: #0c0e13; }
.ico-btn {
  width: 34px; height: 34px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; transition: background .12s; position: relative;
}
.ico-btn:hover { background: var(--bg3); }
.ndot {
  position: absolute; top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--red); border-radius: 50%;
  border: 2px solid var(--bg);
}

/* ── PAGE CONTENT ── */
.page-content { padding: 24px; }

/* ── CARDS ── */
.card { background: var(--bg1); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.wallet-card { background: var(--bg1); border: 1px solid var(--border2); border-radius: 12px; padding: 18px; transition: border-color .2s; }
.wallet-card:hover { border-color: rgba(255,255,255,0.18); }
.card-sm { padding: 13px 16px; }
.ct { font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text3); margin-bottom: 5px; }
.cv { font-size: 26px; font-family: 'DM Serif Display', serif; color: var(--text); }
.cs { font-size: 11px; color: var(--text2); margin-top: 3px; }

/* ── GRID ── */
.g4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── BADGES ── */
.b { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 500; }
.bg  { background: var(--green-bg);  color: var(--green); }
.br  { background: var(--red-bg);    color: var(--red); }
.bo  { background: var(--orange-bg); color: var(--orange); }
.bb  { background: var(--blue-bg);   color: var(--blue); }
.bp  { background: var(--purple-bg); color: var(--purple); }
.bgo { background: var(--gold-bg);   color: var(--gold); }
.bgr { background: rgba(255,255,255,.05); color: var(--text2); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 7px;
  font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: all .12s;
  border: none; font-family: 'DM Sans', sans-serif;
}
.btn-p  { background: var(--gold); color: #0c0e13; }
.btn-p:hover { background: var(--gold-l); }
.btn-o  { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-o:hover { background: var(--bg2); color: var(--text); }
.btn-d  { background: var(--red-bg); color: var(--red); border: 1px solid rgba(248,113,113,.2); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }
.btn-gh { background: transparent; color: var(--text3); padding: 4px 7px; font-size: 13px; }
.btn-gh:hover { color: var(--text2); }

/* ── FORM INPUTS ── */
.fg { margin-bottom: 14px; }
.fl { display: block; font-size: 11px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.fi, .fs, .fta {
  width: 100%; background: var(--bg2); border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 12px;
  font-size: 13px; color: var(--text);
  font-family: 'DM Sans', sans-serif;
  transition: border-color .12s; outline: none;
}
.fi:focus, .fs:focus, .fta:focus { border-color: var(--gold); }
.fs option { background: var(--bg1); }
.fta { resize: vertical; min-height: 72px; }
.fi-err { border-color: var(--red) !important; }
.err-msg { font-size: 11px; color: var(--red); margin-top: 4px; }

/* ── TABLE ── */
.dt { width: 100%; border-collapse: collapse; }
.dt th {
  text-align: left; font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--text3); padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}
.dt td {
  padding: 11px 12px; font-size: 13px; color: var(--text2);
  border-bottom: 1px solid rgba(255,255,255,.03);
  transition: background .1s;
}
.dt tr:hover td { background: var(--bg2); }
.dt tr:last-child td { border-bottom: none; }
.td-p   { color: var(--text); font-weight: 500; }
.td-in  { color: var(--green);  font-family: 'DM Mono', monospace; font-size: 12px; }
.td-out { color: var(--red);    font-family: 'DM Mono', monospace; font-size: 12px; }
.td-tr  { color: var(--blue);   font-family: 'DM Mono', monospace; font-size: 12px; }

/* ── PROGRESS ── */
.pt { height: 5px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.pf { height: 100%; border-radius: 3px; transition: width .5s ease; }
.pf-g  { background: linear-gradient(90deg, #16a34a, #4ade80); }
.pf-y  { background: linear-gradient(90deg, #ca8a04, #fde047); }
.pf-r  { background: linear-gradient(90deg, #dc2626, #f87171); }
.pf-b  { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.pf-go { background: linear-gradient(90deg, #a06820, var(--gold)); }

/* ── MODAL ── */
.mb {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75); backdrop-filter: blur(6px);
  z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 20px;
}
.mb.open { display: flex; }
.md {
  background: var(--bg1); border: 1px solid var(--border2);
  border-radius: 16px; padding: 22px;
  width: 100%; max-height: 88vh; overflow-y: auto;
  animation: mdIn .2s ease;
}
.md-sm { max-width: 420px; }
.md-md { max-width: 500px; }
.md-lg { max-width: 620px; }
.md-xl { max-width: 760px; }
@keyframes mdIn {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.md-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.md-title { font-family: 'DM Serif Display', serif; font-size: 19px; }
.md-x { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text3); border-radius: 6px; font-size: 17px; transition: all .12s; }
.md-x:hover { background: var(--bg2); color: var(--text); }

/* ── TABS ── */
.tabs { display: flex; gap: 2px; background: var(--bg2); border-radius: 7px; padding: 3px; margin-bottom: 18px; border: 1px solid var(--border); }
.tab  { flex: 1; padding: 6px 12px; border-radius: 5px; font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text3); transition: all .12s; text-align: center; }
.tab.active { background: var(--bg1); color: var(--text); }
hr.div { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── NOTIFICATION PANEL ── */
#np {
  position: fixed; top: 54px; right: 0;
  width: 320px; height: calc(100vh - 54px);
  background: var(--bg1); border-left: 1px solid var(--border);
  z-index: 150; transform: translateX(100%);
  transition: transform .22s ease;
  display: flex; flex-direction: column;
}
#np.open { transform: translateX(0); }
.ni-item { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.03); cursor: pointer; transition: background .1s; }
.ni-item:hover { background: var(--bg2); }
.ni-item.unread { border-left: 3px solid var(--gold); }
.ni-title { font-size: 12.5px; font-weight: 500; color: var(--text); }
.ni-msg   { font-size: 11.5px; color: var(--text2); margin-top: 2px; }
.ni-time  { font-size: 10px; color: var(--text3); margin-top: 3px; }

/* ── TOAST ── */
#toast {
  position: fixed; bottom: 22px; right: 22px; z-index: 999;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 9px; padding: 10px 16px;
  font-size: 12.5px; color: var(--text);
  transform: translateY(70px); opacity: 0;
  transition: all .22s ease; pointer-events: none; max-width: 320px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.t-ok   { border-left: 3px solid var(--green); }
#toast.t-err  { border-left: 3px solid var(--red); }
#toast.t-warn { border-left: 3px solid var(--orange); }

/* ── MISC ── */
.section-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-hd h2 { font-family: 'DM Serif Display', serif; font-size: 18px; }
.upload-z { border: 2px dashed var(--border2); border-radius: 11px; padding: 32px 20px; text-align: center; cursor: pointer; transition: all .18s; color: var(--text3); }
.upload-z:hover { border-color: var(--gold); color: var(--text2); }
.fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 50px; height: 50px; border-radius: 13px;
  background: linear-gradient(135deg, var(--gold), #a06820);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #0c0e13; cursor: pointer;
  box-shadow: 0 6px 20px rgba(212,168,83,.3);
  transition: all .18s; z-index: 89;
}
.fab:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(212,168,83,.4); }

/* ── BATCH BAR ── */
#batch-bar {
  position: fixed; bottom: 80px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 11px; padding: 10px 16px;
  display: flex; align-items: center; gap: 10px;
  z-index: 88; transition: transform .2s ease;
  opacity: 0; pointer-events: none;
}
#batch-bar.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: all; }

/* ── SPECIAL COMPONENTS ── */
.asset-card { background: var(--bg1); border: 1px solid var(--border); border-radius: 11px; padding: 15px; transition: border-color .12s; }
.asset-card:hover { border-color: var(--border2); }
.goal-card { background: var(--bg1); border: 1px solid var(--border); border-radius: 11px; padding: 16px; transition: border-color .12s; }
.goal-card:hover { border-color: var(--border2); }
.debt-card { background: var(--bg1); border: 1px solid var(--border); border-radius: 11px; padding: 16px; }
.debt-card.h { border-top: 3px solid var(--red); }
.debt-card.p { border-top: 3px solid var(--green); }
.bill-row { background: var(--bg1); border: 1px solid var(--border); border-radius: 9px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; transition: border-color .12s; }
.bill-row:hover { border-color: var(--border2); }
.bill-row.ov { border-color: rgba(248,113,113,.3); background: rgba(248,113,113,.03); }
.bill-row.ds { border-color: rgba(251,146,60,.3);  background: rgba(251,146,60,.03); }
.notif-alert { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; }
.na-r { background: rgba(248,113,113,.07); border: 1px solid rgba(248,113,113,.15); }
.na-o { background: rgba(251,146,60,.07);  border: 1px solid rgba(251,146,60,.15); }
.na-g { background: rgba(74,222,128,.07);  border: 1px solid rgba(74,222,128,.15); }
.suggest-card { background: linear-gradient(135deg, rgba(212,168,83,.08), rgba(96,165,250,.05)); border: 1px solid rgba(212,168,83,.2); border-radius: 11px; padding: 14px 16px; }
.chart-wrap { position: relative; }
.rcpt-line { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 12.5px; }
.rcpt-line:last-child { border-bottom: none; font-weight: 600; color: var(--text); }

/* ── PAGINATION ── */
.pgn { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.pgn-pages { display: flex; gap: 4px; }
.pgn-btn { min-width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 6px; font-size: 12px; cursor: pointer; background: var(--bg2); border: 1px solid var(--border); color: var(--text2); transition: all .12s; }
.pgn-btn:hover { background: var(--bg3); color: var(--text); }
.pgn-btn.active { background: var(--gold); color: #0c0e13; border-color: var(--gold); }

/* ── LOGIN ── */
.login-card { background: var(--bg1); border: 1px solid var(--border2); border-radius: 18px; padding: 36px; width: 100%; max-width: 380px; position: relative; overflow: hidden; }
.login-glow { position: absolute; top: -80px; left: 50%; transform: translateX(-50%); width: 260px; height: 260px; background: radial-gradient(circle, rgba(212,168,83,.15), transparent 70%); pointer-events: none; }
.login-wrap { position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center; justify-content: center; z-index: 500; }

/* ── FADE ANIMATION ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .2s ease; }

/* ── ICON UTILS ── */
.li-xs { width: 12px !important; height: 12px !important; }
.li-sm { width: 14px !important; height: 14px !important; }
.li-md { width: 18px !important; height: 18px !important; }
.li-lg { width: 24px !important; height: 24px !important; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar: 0px; }
  #sb { transform: translateX(-101%); transition: transform .3s; }
  #sb.open { transform: translateX(0); }
  #main { margin-left: 0; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .tb-title { font-size: 15px; }
}
