/* ============================================================
   Itaú × Wonderful AI — Dashboard Admin
   ============================================================ */

.hidden { display: none !important; }

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --itau-laranja:     #EC7000;
  --itau-laranja-dark:#C55E00;
  --itau-azul:        #003087;
  --itau-azul-claro:  #0050B3;
  --itau-cinza:       #F5F5F5;
  --itau-texto:       #1A1A1A;
  --itau-borda:       #E0E0E0;
  --sidebar-width:    240px;
  --white:            #FFFFFF;
  --success:          #00875A;
  --danger:           #DE350B;
  --warning:          #FF8B00;
  --badge-bg:         rgba(236,112,0,.12);
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--itau-cinza);
  color: var(--itau-texto);
  min-height: 100vh;
  display: flex;
  font-size: 14px;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--itau-azul);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  box-shadow: 2px 0 12px rgba(0,0,0,.18);
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-logo .logo-brand {
  font-size: 26px;
  font-weight: 800;
  color: var(--itau-laranja);
  letter-spacing: -0.5px;
  line-height: 1;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,.6);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 4px;
}

.sidebar-logo .wonderful-badge {
  margin-top: 8px;
  display: inline-block;
  background: rgba(236,112,0,.2);
  border: 1px solid rgba(236,112,0,.4);
  color: var(--itau-laranja);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.sidebar-nav { flex: 1; padding: 16px 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  color: rgba(255,255,255,.72);
  cursor: pointer;
  transition: all .18s ease;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.nav-item.active {
  background: rgba(236,112,0,.15);
  color: var(--itau-laranja);
  border-left-color: var(--itau-laranja);
}

.nav-item .icon { font-size: 17px; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  color: rgba(255,255,255,.35);
}

/* ── Main Content ── */
.main {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--white);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--itau-borda);
  position: sticky; top: 0; z-index: 50;
}

.topbar-title { font-size: 17px; font-weight: 700; color: var(--itau-azul); }
.topbar-sub   { font-size: 12px; color: #888; margin-top: 2px; }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-content { padding: 28px 32px; flex: 1; }

/* ── Cards ── */
.cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

@media (max-width: 1100px) { .cards-row { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px)  { .cards-row { grid-template-columns: 1fr; } }

.card {
  background: var(--white);
  border-radius: 12px;
  padding: 22px 24px;
  border: 1px solid var(--itau-borda);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.card-label  { font-size: 11.5px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 10px; }
.card-value  { font-size: 28px; font-weight: 800; color: var(--itau-azul); line-height: 1; }
.card-icon   { font-size: 28px; float: right; opacity: .15; }
.card-sub    { font-size: 11px; color: #aaa; margin-top: 6px; }

.card.accent-orange .card-value { color: var(--itau-laranja); }
.card.accent-green  .card-value { color: var(--success); }

/* ── Tables ── */
.panel {
  background: var(--white);
  border-radius: 12px;
  border: 1px solid var(--itau-borda);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--itau-borda);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--itau-azul);
}

.panel-actions { display: flex; gap: 10px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  background: var(--itau-cinza);
  padding: 10px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: #666;
  border-bottom: 1px solid var(--itau-borda);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--itau-borda);
  transition: background .12s;
}

tbody tr:hover { background: #f9f9fb; }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 12px 16px;
  color: var(--itau-texto);
  vertical-align: middle;
}

.clickable-row { cursor: pointer; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.badge-ativo      { background: rgba(0,135,90,.12);  color: var(--success); }
.badge-quitado    { background: rgba(0,80,179,.1);   color: var(--itau-azul-claro); }
.badge-em_atraso  { background: rgba(222,53,11,.12); color: var(--danger); }
.badge-concluida  { background: rgba(0,135,90,.12);  color: var(--success); }
.badge-pendente   { background: rgba(255,139,0,.12); color: var(--warning); }
.badge-falha      { background: rgba(222,53,11,.12); color: var(--danger); }
.badge-pix        { background: rgba(0,80,179,.1);   color: var(--itau-azul-claro); }
.badge-ted        { background: rgba(236,112,0,.12); color: var(--itau-laranja); }
.badge-debito     { background: rgba(222,53,11,.1);  color: var(--danger); }
.badge-credito    { background: rgba(0,135,90,.1);   color: var(--success); }
.badge-doc        { background: rgba(100,100,100,.1);color: #555; }

.valor-entrada { color: var(--success);  font-weight: 700; }
.valor-saida   { color: var(--danger);   font-weight: 700; }

/* ── Buttons ── */
.btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all .18s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.btn-primary {
  background: var(--itau-azul);
  color: #fff;
}
.btn-primary:hover { background: var(--itau-azul-claro); }

.btn-orange {
  background: var(--itau-laranja);
  color: #fff;
}
.btn-orange:hover { background: var(--itau-laranja-dark); }

.btn-orange-lg {
  background: var(--itau-laranja);
  color: #fff;
  padding: 14px 32px;
  font-size: 15px;
  border-radius: 10px;
}
.btn-orange-lg:hover { background: var(--itau-laranja-dark); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--itau-borda);
  color: var(--itau-texto);
}
.btn-outline:hover { border-color: var(--itau-azul); color: var(--itau-azul); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b52a08; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Filters ── */
.filters-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.filter-select, .filter-input {
  padding: 8px 12px;
  border: 1.5px solid var(--itau-borda);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--itau-texto);
  background: var(--white);
  outline: none;
  transition: border-color .15s;
}
.filter-select:focus, .filter-input:focus { border-color: var(--itau-azul); }

/* ── Drawer / Slide Panel ── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--white);
  z-index: 201;
  box-shadow: -4px 0 32px rgba(0,0,0,.2);
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--itau-borda);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--itau-azul);
  color: #fff;
}

.drawer-title  { font-size: 16px; font-weight: 700; }
.drawer-close  { background: none; border: none; color: rgba(255,255,255,.7); font-size: 22px; cursor: pointer; padding: 4px; line-height: 1; }
.drawer-close:hover { color: #fff; }

.drawer-body   { flex: 1; overflow-y: auto; padding: 24px; }

.drawer-section { margin-bottom: 24px; }
.drawer-section h4 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: #888; margin-bottom: 12px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.info-item label { font-size: 11px; color: #999; font-weight: 600; display: block; margin-bottom: 3px; }
.info-item span  { font-size: 14px; font-weight: 600; color: var(--itau-texto); }
.info-item.full  { grid-column: 1/-1; }

.saldo-box {
  background: var(--itau-azul);
  color: #fff;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.saldo-box label { font-size: 11px; opacity: .7; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.saldo-box .saldo-val { font-size: 30px; font-weight: 800; margin-top: 4px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--white);
  border-radius: 14px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  transform: scale(.95);
  transition: transform .2s;
}
.modal-overlay.open .modal { transform: scale(1); }

.modal h3   { font-size: 18px; font-weight: 800; color: var(--itau-azul); margin-bottom: 10px; }
.modal p    { font-size: 14px; color: #555; margin-bottom: 20px; line-height: 1.6; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 13px 20px;
  border-radius: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: slideInRight .3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
}
.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }
.toast-info    { background: var(--itau-azul-claro); }

@keyframes slideInRight {
  from { transform: translateX(120px); opacity: 0; }
  to   { transform: translateX(0);     opacity: 1; }
}

/* ── Spinner ── */
.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.6);
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.spinner-overlay.visible { opacity: 1; pointer-events: all; }

.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--itau-borda);
  border-top-color: var(--itau-laranja);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Loan Cards ── */
.loan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.loan-card {
  background: var(--white);
  border: 1px solid var(--itau-borda);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.loan-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.loan-card-name  { font-weight: 700; font-size: 15px; color: var(--itau-azul); }
.loan-card-conta { font-size: 11px; color: #999; margin-top: 2px; }

.loan-progress {
  background: var(--itau-borda);
  border-radius: 20px;
  height: 6px;
  margin: 12px 0 6px;
  overflow: hidden;
}
.loan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--itau-azul), var(--itau-laranja));
  border-radius: 20px;
  transition: width .4s;
}

.loan-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #666;
  margin-bottom: 5px;
}
.loan-detail-row strong { color: var(--itau-texto); }

/* ── Reset Page ── */
.reset-page {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 0;
}

.reset-icon { font-size: 64px; margin-bottom: 20px; }
.reset-page h2 { font-size: 24px; font-weight: 800; color: var(--itau-azul); margin-bottom: 12px; }
.reset-page p  { font-size: 14.5px; color: #666; line-height: 1.7; margin-bottom: 24px; }

.reset-list {
  background: var(--white);
  border: 1px solid var(--itau-borda);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: left;
  margin-bottom: 28px;
}
.reset-list li {
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--itau-texto);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.reset-list .ok  { color: var(--success); }
.reset-list .no  { color: var(--danger); }

/* ── Empty ── */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #aaa;
  font-size: 14px;
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 10px; }

/* ── Utils ── */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.fw-700      { font-weight: 700; }
.mt-24       { margin-top: 24px; }
.nowrap      { white-space: nowrap; }
