
:root{
  --bg0:#05070a;
  --bg1:#071015;
  --bg2:#0a1a1f;

  --panel: rgba(7,26,26,.86);
  --card: rgba(8,25,28,.55);
  --card2: rgba(8,25,28,.75);

  --stroke: rgba(180,255,240,.12);
  --stroke2: rgba(180,255,240,.18);

  --text:#dff6f1;
  --muted: rgba(223,246,241,.65);

  --brand:#16e7b3;
  --brand2:#0ea57f;
  --emerald:#10b981;
  --danger:#fb7185;

  --shadow: 0 18px 60px rgba(0,0,0,.55);
  --r:18px;
  --r2:26px;
  --pad:18px;
  --gap:14px;

  --font:'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

/* reset */
*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 70% 10%, rgba(22,231,179,.22), transparent 55%),
    radial-gradient(900px 500px at 15% 35%, rgba(14,165,127,.18), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 35%, var(--bg0) 100%);
}
body.bg{ /* compat com layouts que colocam class="bg" */
  background:
    radial-gradient(1200px 700px at 70% 10%, rgba(22,231,179,.22), transparent 55%),
    radial-gradient(900px 500px at 15% 35%, rgba(14,165,127,.18), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 35%, var(--bg0) 100%);
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; height:auto; }

/* utils */
.hidden{ display:none !important; }
.muted{ color: var(--muted); }
.tiny{ font-size:12px; }
.right{ text-align:right; }
.center{ text-align:center; }
.w100{ width:100%; }

/* scroll */
.custom-scrollbar{
  scrollbar-width: thin;
  scrollbar-color: rgba(22,231,179,.25) rgba(255,255,255,.03);
}
.custom-scrollbar::-webkit-scrollbar{ width:10px; height:10px; }
.custom-scrollbar::-webkit-scrollbar-track{ background: rgba(255,255,255,.02); border-radius: 999px; }
.custom-scrollbar::-webkit-scrollbar-thumb{
  background: rgba(22,231,179,.18);
  border: 1px solid rgba(22,231,179,.10);
  border-radius: 999px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover{ background: rgba(22,231,179,.28); }

/* app layout (compat: .app == .app-shell, .main == .app-main) */
.app, .app-shell{
  display:flex;
  min-height:100vh;
  width:100%;
}
.main, .app-main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}
.content{
  padding: 0 26px 26px;
  overflow:auto;
  min-width:0;
}

@media (max-width: 980px){
  .content{ padding: 0 16px 18px; }
}

/* sidebar */
.sidebar{
  width:280px;
  padding:18px;
  position:sticky;
  top:0;
  height:100vh;
  background: linear-gradient(180deg, rgba(4,10,12,.60), rgba(4,10,12,.36));
  border-right:1px solid var(--stroke);
  backdrop-filter: blur(10px);
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px 10px 16px 10px;
  margin-bottom:10px;
}
.brand-icon, .brand .logo{
  width:44px;height:44px;
  display:grid;place-items:center;
  border-radius:16px;
  background: radial-gradient(circle at 35% 30%, rgba(22,231,179,.45), rgba(22,231,179,.08));
  border:1px solid var(--stroke2);
  box-shadow:0 10px 25px rgba(0,0,0,.35);
  color: rgba(22,231,179,.95);
}
.brand-title, .brand .name{
  font-weight:900;
  letter-spacing:.2px;
}
.brand-sub, .brand .sub{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
  letter-spacing:.5px;
  text-transform:uppercase;
}

.nav{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
  flex:1;
}
.nav a,
.nav-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:11px 12px;
  border-radius:14px;
  color:var(--muted);
  border:1px solid transparent;
  transition: .15s ease;
}
.nav a:hover,
.nav-item:hover{
  background:rgba(22,231,179,.06);
  border-color:rgba(22,231,179,.12);
  color:var(--text);
}
.nav a.active,
.nav-item.active{
  background: linear-gradient(90deg, rgba(22,231,179,.18), rgba(22,231,179,.06));
  border-color:rgba(22,231,179,.18);
  color:var(--text);
}

.sidebar-foot{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.userchip{
  display:flex;
  gap:10px;
  align-items:center;
  padding:12px 14px;
  border-radius:18px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.02);
}
.userchip i{ color: rgba(22,231,179,.92); }
.userchip-name{ font-weight:800; }
.userchip-sub{ font-size:11px; color: var(--muted); }

/* topbar */
.topbar{
  padding: 26px 26px 10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.topbar-left{ display:flex; align-items:center; gap:16px; min-width:0; }
.topbar-right{ display:flex; align-items:center; gap:10px; }

.month-chip{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.02);
  color: rgba(22,231,179,.92);
}
.month-chip input{
  background:transparent;
  border:none;
  color: rgba(223,246,241,.92);
  font-weight:800;
  font-size:12px;
  letter-spacing:1.2px;
  text-transform:uppercase;
  outline:none;
}
.month-chip .month-btn{
  background:transparent;
  border:none;
  color: rgba(223,246,241,.92);
  font-weight:800;
  font-size:12px;
  letter-spacing:1.2px;
  text-transform:uppercase;
  outline:none;
  cursor:pointer;
}

.topbar-title{ min-width:0; }
.h1{ font-size:22px; font-weight:950; letter-spacing:.2px; }
.h2{ font-size:18px; font-weight:900; }
.h3{ font-size:16px; font-weight:900; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  letter-spacing:1px;
  text-transform:uppercase;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: rgba(223,246,241,.75);
}
.pill.ok{
  border-color: rgba(22,231,179,.25);
  background: rgba(22,231,179,.09);
  color: rgba(22,231,179,.95);
}
.pill.danger{
  border-color: rgba(251,113,133,.25);
  background: rgba(251,113,133,.09);
  color: rgba(251,113,133,.95);
}
.oktxt{ color: rgba(22,231,179,.95); }
.dngtxt{ color: rgba(251,113,133,.95); }

/* cards */
.card{
  background: linear-gradient(180deg, rgba(8,25,28,.62), rgba(8,25,28,.42));
  border:1px solid var(--stroke);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
  padding: var(--pad);
  backdrop-filter: blur(10px);
}
.card.big{ flex:1; }
.top-cards{
  display:flex;
  gap:14px;
  margin-bottom:18px;
}
@media (max-width: 980px){
  .sidebar{ display:none; }
  .topbar{ padding:18px 16px 8px; }
  .top-cards{ flex-direction:column; }
}

.kicker{ color: var(--muted); font-size:13px; }
.value{ font-size:28px; font-weight:950; margin-top:6px; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 10px;
  border-radius:999px;
  font-size:12px;
  margin-top:10px;
  border:1px solid var(--stroke);
  color: var(--muted);
  background: rgba(255,255,255,.02);
}
.badge.ok{
  color: rgba(22,231,179,.95);
  border-color: rgba(22,231,179,.22);
  background: rgba(22,231,179,.06);
}
.badge.muted{ background: rgba(255,255,255,.02); }
.badge.danger{
  color: rgba(251,113,133,.95);
  border-color: rgba(251,113,133,.25);
  background: rgba(251,113,133,.08);
}

.section-title{
  margin: 22px 0 12px 0;
  font-size:16px;
  color: var(--text);
  letter-spacing:.3px;
}

/* dashboard fund rows */
.fund-row{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.02);
  margin-bottom:10px;
}
.fund-name{ font-weight:900; }
.fund-meta{ color: var(--muted); font-size:13px; margin-top:4px; }

/* page helpers */
.bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:12px 0;
}
.actions{
  display:flex;
  gap:10px;
  margin:10px 0 14px 0;
}
.page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 12px;
}
.page-head h2{ margin:0; }
.page-head p{ margin:6px 0 0; color: var(--muted); }

/* grids */
.grid2{ display:grid; gap:12px; grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid3{ display:grid; gap:14px; grid-template-columns: repeat(3, minmax(0,1fr)); }
.cards{ display:grid; gap:14px; grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 980px){
  .grid2{ grid-template-columns: 1fr; }
  .grid3, .cards{ grid-template-columns: 1fr; }
}

/* funds cards */
.fund-card{ display:flex; flex-direction:column; gap:10px; }
.fund-top{ display:flex; align-items:center; justify-content:space-between; }
.fund-ico{
  width:40px; height:40px;
  border-radius:14px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
  color: rgba(22,231,179,.92);
}
.fund-title{ margin:0; font-size:16px; font-weight:950; }
.fund-values{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  margin-top:6px;
}
.fund-value .val{ font-weight:950; font-size:16px; }
.fund-value .val.ok{ color: rgba(22,231,179,.95); }
.fund-actions{ margin-top:8px; }

/* accounts cards */
.card-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.badge-ico{
  width:38px;height:38px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
  color: rgba(22,231,179,.92);
}
.card-balance{
  font-size:22px;
  font-weight:950;
  margin-top:10px;
}

/* buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px 14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: rgba(223,246,241,.92);
  font-weight:900;
  cursor:pointer;
  transition:.15s ease;
}
.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(22,231,179,.22);
  background: rgba(22,231,179,.06);
}
.btn.primary,
.btn-primary,
.btn.btn-primary{
  background: rgba(22,231,179,.92);
  color: #041015;
  border-color: rgba(22,231,179,.25);
  box-shadow: 0 18px 40px rgba(22,231,179,.10);
}
.btn.ghost{
  background: rgba(255,255,255,.03);
}
.btn.danger{
  border-color: rgba(251,113,133,.25);
  background: rgba(251,113,133,.08);
  color: rgba(251,113,133,.95);
}
.icon-btn{
  width:38px;height:38px;
  border-radius:14px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.06);
  color: rgba(223,246,241,.85);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

/* forms */
.form{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.label{
  font-size:11px;
  font-weight:900;
  letter-spacing:2px;
  text-transform:uppercase;
  color: rgba(223,246,241,.55);
}
input.input, select.input, textarea.input{
  width:100%;
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(22,231,179,.12);
  background: rgba(255,255,255,.03);
  color: rgba(223,246,241,.92);
  outline:none;
}
input.input:focus, select.input:focus, textarea.input:focus{
  border-color: rgba(22,231,179,.38);
  box-shadow: 0 0 0 4px rgba(22,231,179,.08);
}

/* compat: wrapper .input (antigo) */
.input label{
  font-size:12px;
  color: var(--muted);
  letter-spacing:.3px;
  text-transform:uppercase;
}
.input input, .input select, .input textarea{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.02);
  color: var(--text);
  outline:none;
}

/* alerts + flash */
.alert{
  padding:12px 14px;
  border-radius:16px;
  margin:10px 0;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  font-weight:700;
}
.alert.ok{
  border-color: rgba(22,231,179,.22);
  background: rgba(22,231,179,.08);
  color: rgba(22,231,179,.95);
}
.alert.error{
  border-color: rgba(251,113,133,.25);
  background: rgba(251,113,133,.08);
  color: rgba(251,113,133,.95);
}
.flash{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:16px;
  margin:12px 0;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  font-weight:800;
}
.flash.ok{
  border-color: rgba(22,231,179,.22);
  background: rgba(22,231,179,.08);
  color: rgba(22,231,179,.95);
}
.flash.err{
  border-color: rgba(251,113,133,.25);
  background: rgba(251,113,133,.08);
  color: rgba(251,113,133,.95);
}

/* tables */
.table-wrap{
  overflow:auto;
  border-radius: 22px;
  border:1px solid rgba(22,231,179,.12);
  background: rgba(7,26,26,.60);
}
.table{
  width:100%;
  border-collapse:collapse;
  min-width: 720px;
}
.table thead th{
  text-align:left;
  font-size:11px;
  font-weight:900;
  letter-spacing:2px;
  text-transform:uppercase;
  color: rgba(223,246,241,.55);
  padding:12px 12px;
  border-bottom:1px solid rgba(22,231,179,.12);
}
.table tbody td{
  padding:12px 12px;
  border-bottom:1px solid rgba(22,231,179,.08);
  color: rgba(223,246,241,.90);
}
.table tbody tr:hover{ background: rgba(255,255,255,.03); }

/* modal */
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:999;
}
.modal.hidden,
.modal[aria-hidden="true"]{
  display:none;
}
.modal::before{
  content:'';
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
}
.modal-card{
  position:relative;
  width: min(980px, 100%);
  max-height: 86vh;
  overflow:hidden;
  border-radius: 36px;
  background: rgba(7,26,26,.92);
  border:1px solid rgba(22,231,179,.18);
  box-shadow: var(--shadow);
  display:flex;
  flex-direction:column;
}
.modal-card.modal-wide{ width: min(1100px, 100%); }
.modal-head{
  padding:18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border-bottom:1px solid rgba(22,231,179,.12);
}
.modal-head h3{ margin:0; }
.modal-head p{ margin:6px 0 0; color: rgba(223,246,241,.55); }
.modal-body{
  padding:18px;
  overflow:auto;
}

/* auth */
.auth-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.auth-card{
  width: min(420px, 100%);
  border-radius: 32px;
  background: rgba(7,26,26,.86);
  border:1px solid rgba(22,231,179,.14);
  box-shadow: var(--shadow);
  padding:18px;
}
.auth-head{ display:flex; gap:12px; align-items:center; margin-bottom:14px; }
.auth-logo{
  width:44px; height:44px;
  border-radius:16px;
  background: rgba(22,231,179,.18);
  border:1px solid rgba(22,231,179,.25);
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(22,231,179,.95);
}
.auth-title{ font-weight:950; letter-spacing:.3px; }
.auth-sub{
  font-size:11px;
  color: rgba(22,231,179,.60);
  font-weight:900;
  letter-spacing:2px;
  text-transform:uppercase;
}


/* ===== V2 ajustes ===== */
.brand-icon{
  width:44px;
  height:44px;
  border-radius:14px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(22,231,179,.14);
  overflow:hidden;
}
.brand-icon img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
}
.brand-fallback{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  color: rgba(223,246,241,.92);
  font-size:18px;
}

.userchip-btn{
  width:100%;
  text-align:left;
  cursor:pointer;
  border:1px solid rgba(180,255,240,.10);
  background: rgba(255,255,255,.02);
}
.userchip-btn:hover{
  border-color: rgba(22,231,179,.22);
  background: rgba(255,255,255,.03);
}
.userchip-arrow{
  margin-left:auto;
  opacity:.55;
  font-size:12px;
}

/* Corrige selects "brancos" em alguns browsers */
select.input{
  color-scheme: dark;
}
select.input option{
  background: #071015;
  color: rgba(223,246,241,.92);
}

/* Checkboxes/radios com cor do tema */
input[type="checkbox"], input[type="radio"]{
  accent-color: var(--brand);
}

.badge.api{
  border-color: rgba(56,189,248,.22);
  color: rgba(186,230,253,.92);
  background: rgba(56,189,248,.10);
}
