:root{
  --bg1:#0b1220;
  --bg2:#0f1b33;

  --card:rgba(255,255,255,.08);
  --card2:rgba(255,255,255,.06);
  --line:rgba(255,255,255,.10);

  --text:#eef2ff;
  --muted:rgba(238,242,255,.70);

  --brand:#ef4444;
  --ok:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;

  --radius:18px;
  --shadow:0 24px 80px rgba(0,0,0,.45);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  color:var(--text);
  background:#000;
}

a{color:inherit;text-decoration:none}
.hidden{display:none !important}
.muted{color:var(--muted);font-size:12px;line-height:1.25}
.label{display:block;color:var(--muted);font-size:11px;margin:0 0 6px}

.wrap{max-width:1180px;margin:0 auto;padding:16px 14px 34px}

/* ===== TOPBAR ===== */
.topbar{
  position:sticky;top:0;z-index:10;
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 16px;
  background:rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar__left{display:flex;align-items:center;gap:12px}
.topbar__logo{height:34px;object-fit:contain;filter:drop-shadow(0 10px 24px rgba(0,0,0,.55))}
.topbar__title{display:flex;flex-direction:column;line-height:1.1}
.topbar__title b{letter-spacing:.6px}
.topbar__title span{color:var(--muted);font-size:12px}
.topbar__right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
@media (max-width: 980px){
  .topbar{
    position:static;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
    padding:10px 12px;
  }
  .topbar__left{
    width:100%;
    align-items:center;
  }
  .topbar__logo{
    height:48px;
    max-width:70vw;
    object-fit:contain;
  }
  .topbar__title{
    min-width:0;
  }
  .topbar__title span{
    font-size:11px;
  }
  .topbar__right{
    width:100%;
    gap:8px;
  }
  .topbar__right .pill{
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}
@media (max-width: 640px){
  .topbar__title span{display:none}
  .topbar__logo{height:42px}
}

/* ===== PILLS / CHIP ===== */
.pill{
  display:inline-flex;align-items:center;gap:8px;
  padding:7px 11px;border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  font-size:12px;color:var(--text);
}
.pill--soft{background:rgba(255,255,255,.06);color:var(--muted)}

.chip{
  font-size:12px;
  padding:6px 10px;border-radius:999px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.10);
  color:rgba(238,242,255,.86);
}

/* ===== BUTTONS ===== */
.btn{
  border:0;cursor:pointer;
  padding:9px 11px;border-radius:12px;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  transition:.15s transform,.15s opacity,.15s box-shadow;
  font-size:12.5px;
}
.btn:hover{transform:translateY(-1px);opacity:.96;box-shadow:0 10px 22px rgba(0,0,0,.18)}
.btn:active{transform:translateY(0)}
.btn--primary{
  background:linear-gradient(135deg, rgba(239,68,68,.95), rgba(239,68,68,.70));
  border:1px solid rgba(239,68,68,.35);
}
.btn--ghost{background:transparent}
.btn--ok{background:rgba(34,197,94,.18);border:1px solid rgba(34,197,94,.35)}
.btn--bad{background:rgba(239,68,68,.18);border:1px solid rgba(239,68,68,.35)}
.btn:disabled{opacity:.45;cursor:not-allowed;transform:none !important;box-shadow:none !important}

/* ===== CARDS ===== */
.card{
  background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.05));
  border:1px solid rgba(255,255,255,.10);
  border-radius:var(--radius);
  padding:12px;
  box-shadow:var(--shadow);
  margin-bottom:12px;
}
.card--tight{padding:10px}
.cardHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

/* ===== TABS + SUBBAR ===== */
.tabs{display:flex;gap:8px;flex-wrap:wrap}
.tab{
  padding:9px 13px;border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color:var(--muted);
  cursor:pointer;
  font-size:12.5px;
}
.tab.active{
  background:rgba(239,68,68,.18);
  border-color:rgba(239,68,68,.35);
  color:#fff;
}

.subbar{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid rgba(255,255,255,.08);
}

/* ===== GRIDS ===== */
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px}
@media(max-width:880px){.grid2,.grid3{grid-template-columns:1fr}}

/* ===== INPUTS ===== */
input,select,textarea{
  width:100%;
  padding:11px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
  transition:.15s border-color,.15s box-shadow,.15s transform;
  font-size:13px;
}
input::placeholder{color:rgba(238,242,255,.45)}
select{cursor:pointer}
input:focus,select:focus,textarea:focus{
  border-color:rgba(239,68,68,.45);
  box-shadow:0 0 0 3px rgba(239,68,68,.12);
}
input[type="date"]{padding:10px 12px}

.passWrap{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
}

/* ===== ACTION ROWS ===== */
.actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:10px}
.actions--end{justify-content:flex-end}

/* ===== FILTERS RIGHT ===== */
.filtersRight{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.input--search{min-width:240px}
@media(max-width:560px){.input--search{min-width:0;width:100%}}

/* ===== VENDEDOR LISTA (layout do print) ===== */
.vendListHead{
  align-items:flex-start;
}

.vendFilters{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:8px;
  width:min(580px, 100%);
  margin-left:auto;
}

.miniCal--vend{
  width:fit-content;
  margin-left:auto;
}

.miniCal__item--vend{
  min-width:150px;
}

.miniCal__lbl--vend{
  min-width:18px;
}

.vendSearchRow{
  width:100%;
}

.vendSearchInput{
  width:100%;
  min-width:0;
}

.vendActionsRow{
  display:flex;
  justify-content:flex-start;
}

@media (max-width: 980px){
  .vendFilters{
    margin-left:0;
    width:100%;
  }
  .miniCal--vend{
    width:100%;
    margin-left:0;
  }
  .miniCal__item--vend{
    flex:1 1 180px;
    min-width:0;
  }
}

/* ===== MINI CALENDAR ===== */
.miniCal{
  display:flex;gap:8px;flex-wrap:wrap;
  padding:7px;border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
}
.miniCal__item{display:flex;align-items:center;gap:8px}
.miniCal__lbl{font-size:12px;color:var(--muted);white-space:nowrap}
.miniCal input{padding:9px 10px;border-radius:12px}
.miniCal--dash{padding:6px}
.miniCal--dash input{padding:8px 10px}

/* =========================================================
   TABELAS (DO JEITO DO PRINT)
   ✅ NÃO ACHATA
   ✅ AÇÕES SEMPRE APARECE (sticky à direita)
   ✅ SE PRECISAR, USA SCROLL LATERAL
========================================================= */
.tableWrap{
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);

  /* ✅ volta o scroll lateral (para não achatar) */
  overflow-x:auto;
  overflow-y:auto;

  max-height:52vh;
  -webkit-overflow-scrolling: touch;
}

/* ✅ tabela pode ser maior que o container (não espreme) */
table{
  width:100%;
  border-collapse:collapse;

  /* ✅ não usar fixed, pq isso achata */
  table-layout:auto;

  /* ✅ garante espaço pra Detalhes + Ações */
  min-width:1180px;
}

th{
  position:sticky;
  top:0;
  z-index:3;
  color:var(--muted);
  font-weight:800;
  background:rgba(0,0,0,.30);
  white-space:nowrap;
}

th,td{
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  text-align:left;
  font-size:12.5px;
  vertical-align:top;
  line-height:1.22;
}

td{
  white-space:normal;
  word-break:break-word;
  overflow-wrap:anywhere;
}

tr:hover td{background:rgba(255,255,255,.03)}

/* ===== Colunas (parecido com o print) ===== */
.tableWrap th:nth-child(1),
.tableWrap td:nth-child(1){ width:140px; }

.tableWrap th:nth-child(2),
.tableWrap td:nth-child(2){ width:220px; }

.tableWrap th:nth-child(3),
.tableWrap td:nth-child(3){ width:180px; }

.tableWrap th:nth-child(4),
.tableWrap td:nth-child(4){ width:140px; }

.tableWrap th:nth-child(5),
.tableWrap td:nth-child(5){
  /* Detalhes sempre grande */
  min-width:520px;
}

.tableWrap th:nth-child(6),
.tableWrap td:nth-child(6){
  width:90px;
  text-align:center;
}

/* ✅ AÇÕES: largura fixa e SEMPRE VISÍVEL */
.tableWrap th:nth-child(7),
.tableWrap td:nth-child(7){
  width:260px;
  min-width:260px;

  position:sticky;
  right:0;
  z-index:2;

  background:linear-gradient(180deg, rgba(11,18,32,.92), rgba(15,27,51,.92));
  border-left:1px solid rgba(255,255,255,.10);
  box-shadow:-18px 0 30px rgba(0,0,0,.22);
}

/* também deixa o cabeçalho de AÇÕES em cima do sticky */
.tableWrap th:nth-child(7){
  z-index:4;
}

/* botões na tabela */
.btnRow{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:flex-start;
}
.tableWrap .btn{padding:8px 10px;font-size:12px}

/* ===== TABELAS F&I (evita quebra em Data/Cliente/Vendedor) ===== */
#todasFichas,
#todasFichasDash{
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

#todasFichas th:nth-child(1),
#todasFichas td:nth-child(1),
#todasFichasDash th:nth-child(1),
#todasFichasDash td:nth-child(1){
  width: 10%;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

#todasFichas th:nth-child(2),
#todasFichas td:nth-child(2),
#todasFichasDash th:nth-child(2),
#todasFichasDash td:nth-child(2){
  width: 20%;
}

#todasFichas th:nth-child(3),
#todasFichas td:nth-child(3),
#todasFichasDash th:nth-child(3),
#todasFichasDash td:nth-child(3){
  width: 19%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#todasFichas th:nth-child(4),
#todasFichas td:nth-child(4),
#todasFichasDash th:nth-child(4),
#todasFichasDash td:nth-child(4){
  width: 9%;
}

#todasFichas th:nth-child(5),
#todasFichas td:nth-child(5),
#todasFichasDash th:nth-child(5),
#todasFichasDash td:nth-child(5){
  width: 22%;
}

#todasFichas th:nth-child(6),
#todasFichas td:nth-child(6),
#todasFichasDash th:nth-child(6),
#todasFichasDash td:nth-child(6){
  width: 4%;
  text-align: center;
  white-space: nowrap;
}

#todasFichas td:nth-child(2) b,
#todasFichasDash td:nth-child(2) b{
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#todasFichas td:nth-child(2) .muted,
#todasFichasDash td:nth-child(2) .muted{
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

#todasFichas th:nth-child(7),
#todasFichas td:nth-child(7),
#todasFichasDash th:nth-child(7),
#todasFichasDash td:nth-child(7){
  width: 16%;
  min-width: 0;
  position: static;
  right: auto;
  box-shadow: none;
  border-left: 0;
  background: transparent;
}

.fenaiActionsCell .btnRow{
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-items: start;
}

.fenaiActionsCell .btnRow .btn{
  width: 100%;
  padding: 7px 8px;
  font-size: 11.5px;
  white-space: nowrap;
  line-height: 1.1;
  min-height: 36px;
  overflow: visible;
  text-overflow: clip;
}

.fenaiActionsCell .btnRow .btn--wide{
  grid-column: 1;
}

.fenaiDocsCell{
  text-align: center;
}

.fenaiDocsBtn{
  min-width: 38px;
  width: 38px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

#dashBox .tableWrap,
#fenaiBox .tableWrap,
#fenaiSimBox .tableWrap{
  overflow-x: auto;
}

#fenaiSimulacoes,
#minhasSimulacoes{
  min-width: 980px;
  table-layout: auto;
}

#fenaiSimulacoes th:nth-child(1),
#fenaiSimulacoes td:nth-child(1){ width:140px; white-space:nowrap; }
#fenaiSimulacoes th:nth-child(2),
#fenaiSimulacoes td:nth-child(2){ width:180px; }
#fenaiSimulacoes th:nth-child(3),
#fenaiSimulacoes td:nth-child(3){ min-width:280px; }
#fenaiSimulacoes th:nth-child(4),
#fenaiSimulacoes td:nth-child(4){ width:150px; }
#fenaiSimulacoes th:nth-child(5),
#fenaiSimulacoes td:nth-child(5){ min-width:220px; }
#fenaiSimulacoes th:nth-child(6),
#fenaiSimulacoes td:nth-child(6){ width:150px; text-align:center; }

#todasFichas .details2,
#todasFichasDash .details2{
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#todasFichas .detailsLine,
#todasFichasDash .detailsLine{
  line-height: 1.15;
  margin: 2px 0;
}

#todasFichas .fiMiniCard,
#todasFichasDash .fiMiniCard{
  margin-top: 0;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 12px;
  background: rgba(0,0,0,.12);
  height: 100%;
}

#todasFichas .fiMiniTitle,
#todasFichasDash .fiMiniTitle{
  font-size: 11px;
  font-weight: 800;
  color: rgba(238,242,255,.78);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 5px;
}

#todasFichas .fiMiniLine,
#todasFichasDash .fiMiniLine{
  font-size: 12px;
  line-height: 1.2;
  color: rgba(238,242,255,.82);
  margin: 2px 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

#todasFichas .detailsVendSplit,
#todasFichasDash .detailsVendSplit{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#todasFichas .detailsGroup,
#todasFichasDash .detailsGroup{
  min-width: 0;
}

#todasFichas .detailsSubTitle,
#todasFichasDash .detailsSubTitle{
  font-size: 11px;
  font-weight: 800;
  color: rgba(238,242,255,.72);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* ===== BADGES ===== */
.b{
  display:inline-flex;
  align-items:center;
  padding:5px 9px;
  border-radius:999px;
  font-size:11.5px;
  font-weight:900;
  border:1px solid transparent;
  white-space:nowrap;
  line-height:1;
}
.b--nova{background:rgba(245,158,11,.14);border-color:rgba(245,158,11,.25);color:#ffd28a}
.b--analise{background:rgba(99,102,241,.16);border-color:rgba(99,102,241,.28);color:#c7d2fe}
.b--pend{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.14);color:#e5e7eb}
.b--ok{background:rgba(34,197,94,.14);border-color:rgba(34,197,94,.25);color:#bbf7d0}
.b--bad{background:rgba(239,68,68,.14);border-color:rgba(239,68,68,.25);color:#fecaca}

.btn--analise{
  background:rgba(99,102,241,.16);
  border-color:rgba(99,102,241,.28);
  color:#c7d2fe;
}

.btn--pend{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.14);
  color:#e5e7eb;
}

/* =========================================================
   DETALHES (VENDEDOR ESQUERDA / F&I DIREITA) — como no print
========================================================= */
.details2{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:10px;
  align-items:start;
  width:100%;
  min-width:0;
}

.details2__vend,
.details2__fi{
  padding:10px 11px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background: rgba(0,0,0,.10);
  min-width:0;
}

.details2__vend{
  background:linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.16));
}

.details2__fi{
  background:linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.20));
}

.detailsTitle{
  font-weight:900;
  margin-bottom:6px;
  letter-spacing:.2px;
  opacity:.95;
  font-size:12.5px;
}

.detailsLine{
  margin:3px 0;
  line-height:1.18;
  color: rgba(238,242,255,.78);
  font-size:12px;
  word-break:break-word;
  overflow-wrap:anywhere;
}

.detailsSep{
  height:1px;
  background:rgba(255,255,255,.10);
  margin:8px 0;
  border-radius:999px;
}

.fiVendorUpdate{
  padding: 8px 10px;
  border: 1px solid rgba(56,189,248,.28);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(8,145,178,.14), rgba(14,116,144,.08));
}

.fiVendorUpdate__title{
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .35px;
  color: #bae6fd;
}

.fiVendorUpdate__time{
  margin-top: 3px;
  font-size: 12px;
  color: rgba(224,242,254,.92);
}

/* responsivo */
@media (max-width: 980px){
  .tableWrap{max-height:56vh}
  .details2{ grid-template-columns: 1fr; }
  table{ min-width:860px; }
  #todasFichas,
  #todasFichasDash{
    min-width:1100px;
    table-layout:auto;
  }
  #minhasFichas{ min-width:980px; }
  #fenaiSimulacoes,
  #minhasSimulacoes{ min-width:860px; }
  .dashControls{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .dashControls > *{
    width:100%;
    min-width:0 !important;
  }
  .dashControls select{
    width:100% !important;
    min-width:0 !important;
  }
  .filtersRight{
    width:100%;
    display:grid;
    grid-template-columns:1fr;
  }
  .filtersRight .btn{width:100%}
}

@media (max-width: 640px){
  .wrap{padding:10px 8px 18px}
  .card{padding:10px}
  .tabs{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
    width:100%;
  }
  .tab{
    width:100%;
    text-align:center;
    padding:10px 8px;
  }
  .subbar{
    gap:6px;
    font-size:11px;
  }
  .dashControls{
    grid-template-columns:1fr;
  }
  .dashControls select{
    width:100% !important;
    min-width:0 !important;
  }
  table{ min-width:760px; }
  #todasFichas,
  #todasFichasDash{
    min-width:0 !important;
    width:100% !important;
    table-layout:auto !important;
    border-collapse:separate;
    border-spacing:0 10px;
  }
  #minhasFichas{ min-width:860px; }
  #fenaiSimulacoes,
  #minhasSimulacoes{ min-width:760px; }
  .kpi__value{font-size:18px}
}

/* ===== TABELA GLOBAL MOBILE COMPACTA (sem zoom/arrasto) ===== */
@media (max-width: 640px){
  #todasFichas,
  #todasFichasDash{
    min-width:0 !important;
    width:100% !important;
    table-layout:fixed !important;
  }
  #todasFichas th,
  #todasFichas td,
  #todasFichasDash th,
  #todasFichasDash td{
    padding:8px 7px;
    font-size:11px;
    vertical-align:top;
  }
  #todasFichas th:nth-child(1),
  #todasFichas td:nth-child(1),
  #todasFichasDash th:nth-child(1),
  #todasFichasDash td:nth-child(1){ width:24%; white-space:nowrap; }
  #todasFichas th:nth-child(2),
  #todasFichas td:nth-child(2),
  #todasFichasDash th:nth-child(2),
  #todasFichasDash td:nth-child(2){ width:44%; }
  #todasFichas th:nth-child(3),
  #todasFichas td:nth-child(3),
  #todasFichasDash th:nth-child(3),
  #todasFichasDash td:nth-child(3){ width:32%; }
  #todasFichas th:nth-child(4),
  #todasFichas td:nth-child(4),
  #todasFichasDash th:nth-child(4),
  #todasFichasDash td:nth-child(4){ display:none; }
  #todasFichas th:nth-child(5),
  #todasFichas td:nth-child(5),
  #todasFichasDash th:nth-child(5),
  #todasFichasDash td:nth-child(5){ display:none; }
  #todasFichas th:nth-child(6),
  #todasFichas td:nth-child(6),
  #todasFichasDash th:nth-child(6),
  #todasFichasDash td:nth-child(6){ display:none; }
  #todasFichas th:nth-child(7),
  #todasFichas td:nth-child(7),
  #todasFichasDash th:nth-child(7),
  #todasFichasDash td:nth-child(7){ display:none; }

  #todasFichas .fiMiniCard,
  #todasFichasDash .fiMiniCard{
    padding:6px 7px;
    border-radius:10px;
  }
  #todasFichas .fiMiniTitle,
  #todasFichasDash .fiMiniTitle{
    font-size:10px;
    margin-bottom:4px;
  }
  #todasFichas .fiMiniLine,
  #todasFichasDash .fiMiniLine{
    font-size:11px;
    line-height:1.2;
    white-space:normal;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
}

@media (min-width: 641px) and (max-width: 720px){
  th,td{padding:8px 10px;font-size:12px}
  table{ min-width:920px; }
}

/* ===== LOGIN ===== */
.loginScreen{
  min-height:calc(100vh - 72px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:22px 0;
}
.loginCard{
  width:min(720px, 92vw);
  background:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:16px;
}
.loginCard__head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  margin-bottom:6px;
}
.loginCard h2{margin:0}

/* ===== DASHBOARD ===== */
.dashTop{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.dashControls{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.dashControls select{width:auto;min-width:150px}

/* KPIs */
.kpis{
  display:grid;
  grid-template-columns:repeat(5,1fr);
  gap:10px;
  margin-top:10px;
}
@media(max-width:1180px){.kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:980px){.kpis{grid-template-columns:1fr 1fr}}
@media(max-width:560px){.kpis{grid-template-columns:1fr}}
.kpi{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding:10px;
}
.kpi__label{color:var(--muted);font-size:11px}
.kpi__value{font-weight:900;font-size:20px;margin-top:6px}

.dashGrid{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:10px;
  margin-top:10px;
}
@media(max-width:980px){.dashGrid{grid-template-columns:1fr}}
.dashChartWrap{
  height:300px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding:10px;
}
.dashStats{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  border-radius:16px;
  padding:10px;
}
.statRow{
  display:flex;align-items:center;justify-content:space-between;
  padding:9px 0;border-bottom:1px solid rgba(255,255,255,.08);
}
.statRow:last-child{border-bottom:0}
.statRow span{color:var(--muted);font-size:12px}
.statRow b{font-size:15px}

/* ===== MODAL DOCUMENTOS ===== */
.modal{position:fixed;inset:0;z-index:50}
.modal__backdrop{
  position:absolute;inset:0;
  background:rgba(0,0,0,.62);
  backdrop-filter: blur(4px);
}
.modal__panel{
  position:relative;
  width:min(980px, 94vw);
  margin:6vh auto;
  border-radius:22px;
  background:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.06));
  border:1px solid rgba(255,255,255,.14);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.modal__head{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.modal__title{font-weight:900;font-size:16px}
.modal__body{padding:12px 14px}

.docsActions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.docsList{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  max-height:44vh;
  overflow:auto;
  padding-right:4px;
}
.docItem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:11px 12px;
  border-radius:16px;
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.10);
}
.docLeft{min-width:0}
.docName{
  font-weight:900;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:560px;
}
.docPath{font-size:12px;opacity:.9}
.docBtns{display:flex;gap:8px;flex-wrap:wrap}

/* ===== SCROLLBAR (premium) ===== */
*::-webkit-scrollbar{height:10px;width:10px}
*::-webkit-scrollbar-thumb{background:rgba(255,255,255,.16);border-radius:999px}
*::-webkit-scrollbar-track{background:rgba(0,0,0,.18);border-radius:999px}

/* ===== Destaque status clicável do dashboard ===== */
.statRow--click{ cursor:pointer; user-select:none; }
.dashStats .statRow.active{
  outline: 2px solid rgba(99,102,241,.85);
  box-shadow: 0 0 0 3px rgba(99,102,241,.20);
  border-radius: 12px;
}
/* Não quebrar a coluna Data */
#minhasFichas th:first-child,
#minhasFichas td:first-child{
  white-space: nowrap;
  width: 120px;
}

#minhasFichas{
  min-width: 1280px;
}

#minhasFichas th:nth-child(2),
#minhasFichas td:nth-child(2){
  width: 420px;
  min-width: 420px;
}

#minhasFichas th:nth-child(3),
#minhasFichas td:nth-child(3){
  width: 130px;
  min-width: 130px;
}

#minhasFichas th:nth-child(4),
#minhasFichas td:nth-child(4){
  width: 230px;
  min-width: 230px;
}

#minhasFichas th:nth-child(5),
#minhasFichas td:nth-child(5){
  width: 220px;
  min-width: 220px;
}

#minhasFichas th:nth-child(6),
#minhasFichas td:nth-child(6){
  width: 90px;
  min-width: 90px;
  text-align: center;
}

#minhasFichas th:nth-child(7),
#minhasFichas td:nth-child(7){
  width: 170px;
  min-width: 170px;
}
/* ====== TABELA "MINHAS FICHAS" - CLIENTE COMPACTO ====== */
#minhasFichas td:nth-child(2){
  max-width: 420px;
  overflow-wrap: normal;
  word-break: normal;
}

.vCli{
  display:grid;
  grid-template-columns: 160px minmax(0,1fr); /* coluna 1 (nome/tel) | coluna 2 (infos) */
  gap: 10px;
  align-items:start;
  min-width:0;
}

.vCli__main{
  min-width:0;
}
.vCli__name{
  font-weight:900;
  line-height:1.1;
  margin-bottom:4px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.vCli__tel{
  font-size:12px;
  color: rgba(238,242,255,.75);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.vCli__meta{
  min-width:0;
  font-size:12px;
  color: rgba(238,242,255,.72);
  line-height:1.2;
  display:flex;
  flex-wrap:wrap;
  gap: 6px 10px;
  overflow-wrap: normal;
  word-break: normal;
}

.vTag{
  display:inline-flex;
  gap:6px;
  align-items:center;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.14);
  border-radius: 999px;
  max-width: 100%;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

/* ===== VENDEDOR em preto ===== */
#vendedorBox .card{
  background:#000;
}

#vendedorBox .tableWrap{
  background:#000;
}

#vendedorBox .tableWrap th{
  background:#000;
}

#vendedorBox #minhasFichas th:nth-child(7),
#vendedorBox #minhasFichas td:nth-child(7){
  background:#000;
  box-shadow:none;
}

.vTag b{
  color: rgba(238,242,255,.90);
  font-weight:800;
}

.vTag span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width: 260px; /* controla “Carro:” */
}

/* Deixa a linha mais “reta” */
#minhasFichas td{
  vertical-align: top;
}

/* Responsivo: no mobile volta a empilhar */
@media (max-width: 880px){
  #minhasFichas td:nth-child(2){
    width:auto;
    max-width:none;
  }
  .vCli{
    grid-template-columns: 1fr;
  }
  .vTag span{ max-width: 100%; }
}

/* ===== CHAT FIXO (estilo messenger) ===== */
.chatDock{
  position:fixed;
  right:14px;
  bottom:14px;
  z-index:120;
}
.chatDock__panel{
  width:min(390px, calc(100vw - 20px));
  height:min(560px, calc(100vh - 24px));
  border-radius:14px;
  border:1px solid rgba(255,255,255,.12);
  background:#0b0b0b;
  box-shadow:0 22px 48px rgba(0,0,0,.55);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.chatDock__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
}
.chatDock__title{
  font-weight:900;
  font-size:14px;
}
.chatDock__body{
  flex:1;
  min-height:0;
  padding:10px 12px 6px;
}
.chatList{
  display:grid;
  gap:8px;
  overflow:auto;
  align-content:start;
  align-items:start;
  grid-auto-rows:max-content;
}
.chatItem{
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
  padding:6px 9px;
  background:rgba(255,255,255,.03);
  min-height:unset;
}
.chatItem--mine{
  border-color:rgba(34,197,94,.45);
  background:rgba(34,197,94,.14);
}
.chatMeta{
  font-size:10px;
  color:rgba(238,242,255,.68);
  margin-bottom:3px;
}
.chatText{
  font-size:12px;
  line-height:1.25;
  color:rgba(238,242,255,.95);
  white-space:pre-wrap;
  word-break:break-word;
}
.chatBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 5px;
  margin-left:6px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  color:#fff;
  background:#ef4444;
  border:1px solid rgba(255,255,255,.18);
}
.tab .tabBadge{
  margin-left:6px;
  min-width:16px;
  height:16px;
  font-size:10px;
  padding:0 4px;
}
.chatDock__body .chatList{
  margin-top:0;
  max-height:none;
  height:100%;
}
.chatDock__foot{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  align-items:center;
  padding:10px 12px;
  border-top:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.02);
}
.chatDock__foot input{
  min-width:0;
}

.chatDock--min .chatDock__body,
.chatDock--min .chatDock__foot,
.chatDock--min #chatMsg{
  display:none;
}
.chatDock--min .chatDock__panel{
  height:auto;
  min-height:0;
}

@media (max-width: 680px){
  .chatDock{
    right:8px;
    left:8px;
    bottom:8px;
  }
  .chatDock__panel{
    width:100%;
    height:min(560px, calc(100vh - 16px));
  }
}

/* ===== MOBILE CARD MODE (F&I) ===== */
@media (max-width: 640px){
  #fenaiSimulacoes,
  #minhasFichas,
  #minhasSimulacoes{
    min-width:0 !important;
    width:100% !important;
    table-layout:auto !important;
    border-collapse:separate;
    border-spacing:0 10px;
  }

  #fenaiSimulacoes tr:first-child,
  #minhasFichas tr:first-child,
  #minhasSimulacoes tr:first-child{
    display:none;
  }

  #fenaiSimulacoes tr,
  #minhasFichas tr,
  #minhasSimulacoes tr{
    display:block;
    border:1px solid rgba(255,255,255,.10);
    border-radius:14px;
    background:rgba(0,0,0,.18);
    overflow:hidden;
  }

  #fenaiSimulacoes td,
  #minhasFichas td,
  #minhasSimulacoes td{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    position:static !important;
    right:auto !important;
    border-left:0 !important;
    box-shadow:none !important;
    border-bottom:1px solid rgba(255,255,255,.08);
    padding:8px 10px;
    background:transparent !important;
    white-space:normal !important;
    word-break:break-word !important;
    overflow-wrap:anywhere !important;
  }

  #fenaiSimulacoes td:last-child,
  #minhasFichas td:last-child,
  #minhasSimulacoes td:last-child{
    border-bottom:0;
  }

  #fenaiSimulacoes td::before,
  #minhasFichas td::before,
  #minhasSimulacoes td::before{
    display:block;
    font-size:11px;
    font-weight:800;
    color:rgba(238,242,255,.68);
    margin-bottom:4px;
    text-transform:uppercase;
    letter-spacing:.25px;
  }

  #fenaiSimulacoes td:nth-child(1)::before{ content:"Data"; }
  #fenaiSimulacoes td:nth-child(2)::before{ content:"Vendedor"; }
  #fenaiSimulacoes td:nth-child(3)::before{ content:"Dados"; }
  #fenaiSimulacoes td:nth-child(4)::before{ content:"Status"; }
  #fenaiSimulacoes td:nth-child(5)::before{ content:"Resposta"; }
  #fenaiSimulacoes td:nth-child(6)::before{ content:"Ações"; }

  #minhasFichas td:nth-child(1)::before{ content:"Data"; }
  #minhasFichas td:nth-child(2)::before{ content:"Cliente"; }
  #minhasFichas td:nth-child(3)::before{ content:"Status"; }
  #minhasFichas td:nth-child(4)::before{ content:"Detalhes"; }
  #minhasFichas td:nth-child(5)::before{ content:"Docs"; }
  #minhasFichas td:nth-child(6)::before{ content:"Pago"; }
  #minhasFichas td:nth-child(7)::before{ content:"Ações"; }

  #minhasSimulacoes td:nth-child(1)::before{ content:"Data"; }
  #minhasSimulacoes td:nth-child(2)::before{ content:"Dados"; }
  #minhasSimulacoes td:nth-child(3)::before{ content:"Status"; }
  #minhasSimulacoes td:nth-child(4)::before{ content:"Resposta F&I"; }
  #minhasSimulacoes td:nth-child(5)::before{ content:"Ações"; }

  .fenaiActionsCell .btnRow{
    grid-template-columns:1fr 1fr;
  }
  .fenaiActionsCell .btnRow .btn{
    min-height:38px;
    white-space:normal;
  }
}
