*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:Arial, sans-serif;
}

body{
  background:#030b18;
  color:white;
  padding:0;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  max-width:100vw;
  overflow-x:hidden;
}

h1{
  display:none;
}

.hidden{
  display:none !important;
}

.auth-screen{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(37,99,235,0.22), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(147,51,234,0.14), transparent 32%),
    #030b18;
}

.auth-card{
  width:min(460px, 100%);
  border:1px solid rgba(59,130,246,0.32);
  border-radius:16px;
  padding:24px;
  background:rgba(7,18,36,0.96);
  box-shadow:0 30px 80px rgba(0,0,0,0.35);
}

.auth-brand{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:22px;
  color:#f8fafc;
}

.auth-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:14px;
}

.auth-tab,
.auth-form button{
  border:1px solid rgba(59,130,246,0.28);
  background:#0f1d34;
  color:#dbeafe;
  border-radius:10px;
  padding:12px 14px;
  cursor:pointer;
  font-weight:700;
}

.auth-tab.active,
.auth-form button[type="submit"]{
  background:linear-gradient(135deg, #1d4ed8, #2563eb);
  color:#fff;
}

.auth-form{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.auth-form label{
  font-size:13px;
  font-weight:700;
  color:#e5e7eb;
}

.auth-form input{
  width:100%;
  border:1px solid #60a5fa;
  border-radius:10px;
  background:#15243a;
  color:#fff;
  padding:13px 14px;
  outline:none;
}

.auth-link{
  background:transparent !important;
  border-color:transparent !important;
  color:#93c5fd !important;
}

.auth-message{
  min-height:22px;
  margin-bottom:8px;
  color:#67e8f9;
  font-size:13px;
}

.auth-message.error{
  color:#fca5a5;
}

.password-rules{
  color:#a5b4fc;
  font-size:12px;
  margin-top:-4px;
}

.container{
  display:flex;
  gap:0;
  flex:1;
  width:100%;
  min-width:0;
}

.sidebar{
  width:275px;
  flex:0 0 275px;
  min-height:100vh;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,0.16), transparent 46%),
    linear-gradient(180deg, #061326 0%, #020916 100%);
  border-radius:0;
  padding:18px 10px;
  border-right:1px solid rgba(59,130,246,0.22);
  box-shadow:14px 0 42px rgba(0,0,0,0.28);
  display:flex;
  flex-direction:column;
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:9px;
  padding:2px 8px 22px;
  color:#f8fafc;
  font-size:15px;
  font-weight:700;
  white-space:nowrap;
}

.brand-mark{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  border-radius:8px;
  color:#3b82f6;
  border:1px solid rgba(59,130,246,0.42);
}

.tabs-nav{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.tab-btn{
  background:none;
  border:none;
  color:white;
  text-align:left;
  padding:14px 16px;
  margin:0;
  border-radius:8px;
  border-left:none;
  cursor:pointer;
  font-weight:normal;
  transition:all 0.2s;
  display:flex;
  align-items:center;
  gap:10px;
  font-size:14px;
  color:#cbd5e1;
}

.tab-btn:hover{
  background:rgba(30,41,59,0.9);
}

.tab-btn.active{
  background:linear-gradient(135deg, #1d4ed8, #2563eb);
  border-left-color:transparent;
  font-weight:bold;
  color:#fff;
  box-shadow:0 12px 30px rgba(37,99,235,0.28);
}

.tab-icon{
  color:#93c5fd;
  width:16px;
  min-width:16px;
  text-align:center;
}

.tab-icon svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.sidebar-profile{
  margin:0 2px 18px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border:1px solid rgba(148,163,184,0.18);
  border-radius:10px;
  background:rgba(15,23,42,0.76);
  color:#fff;
  cursor:pointer;
  text-align:left;
  width:calc(100% - 4px);
}

.profile-avatar{
  display:grid;
  place-items:center;
  width:34px;
  height:34px;
  border-radius:999px;
  background:#059669;
  font-weight:800;
}

.profile-copy{
  display:flex;
  flex-direction:column;
  min-width:0;
  flex:1;
}

.profile-copy strong{
  font-size:12px;
}

.profile-copy small{
  color:#94a3b8;
  font-size:10px;
}

.profile-chevron{
  color:#cbd5e1;
}

.profile-menu{
  margin:-10px 2px 16px;
  border:1px solid rgba(148,163,184,0.2);
  border-radius:10px;
  background:#0b1528;
  padding:8px;
}

.profile-menu button{
  width:100%;
  border:0;
  border-radius:8px;
  background:#ef4444;
  color:#fff;
  padding:9px 10px;
  cursor:pointer;
  font-weight:700;
}

.sidebar-action-wrap{
  padding: 16px;
}

.sidebar-action{
  display:block;
  width:100%;
  text-align:center;
  background:#2563eb;
  color:#fff;
  border-radius:12px;
  padding:14px 12px;
  text-decoration:none;
  font-weight:bold;
  transition: background 0.2s ease;
}

.sidebar-action:hover{
  background:#1d4ed8;
}

.main-content{
  flex:1;
  min-width:0;
  max-width:100%;
  padding:30px 28px 24px;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,0.13), transparent 36%),
    #040b18;
}

.tab-content{
  display:none;
}

.tab-content.active{
  display:block;
}

.top{
  display:flex;
  gap:10px;
  margin-bottom:20px;
  flex-wrap:wrap;
  align-items:center;
}

button{
  background:#2563eb;
  border:none;
  padding:12px 18px;
  border-radius:8px;
  color:white;
  cursor:pointer;
  font-weight:bold;
}

button:hover{
  background:#1d4ed8;
}

.date-range{
  display:flex;
  gap:10px;
  align-items:center;
}

.leads-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:20px;
  flex-wrap:wrap;
}

.lead-form{
  background:#1f2937;
  border:1px solid #374151;
  border-radius:14px;
  padding:22px;
  margin-top:20px;
}

.form-row{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:16px;
}

.form-row label{
  color:#d1d5db;
  font-size:14px;
}

.form-row input,
.form-row select{
  width:100%;
  padding:12px 14px;
  border-radius:10px;
  border:1px solid #374151;
  background:#111827;
  color:white;
}

.form-actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

button.secondary{
  background:#374151;
}

button.secondary:hover{
  background:#4b5563;
}

.hidden{
  display:none;
}

.lead-success,
.lead-error{
  padding:14px 16px;
  border-radius:12px;
  margin-bottom:16px;
}

.lead-success{
  background:#064e3b;
  color:#d1fae5;
}

.lead-error{
  background:#7f1d1d;
  color:#fee2e2;
}

.vendas-page-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:20px;
  margin:0 0 18px;
}

.vendas-page-header h2{
  font-size:24px;
  margin-bottom:6px;
}

.vendas-page-header p{
  color:#94a3b8;
  font-size:14px;
}

.vendas-add-btn{
  border-radius:8px;
  background:#155dfc;
  box-shadow:0 10px 24px rgba(21,93,252,0.26);
  padding:12px 18px;
}

.vendas-summary-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
  margin-bottom:22px;
}

.vendas-summary-card{
  display:flex;
  align-items:center;
  gap:18px;
  min-height:92px;
  padding:20px 24px;
  border:1px solid rgba(96,165,250,0.18);
  border-radius:12px;
  background:linear-gradient(145deg, rgba(15,23,42,0.94), rgba(10,23,43,0.96));
  box-shadow:0 18px 50px rgba(0,0,0,0.22);
  position:relative;
  overflow:hidden;
}

.vendas-summary-card::after{
  content:"";
  position:absolute;
  right:24px;
  bottom:18px;
  width:96px;
  height:42px;
  opacity:.7;
  background:linear-gradient(135deg, transparent 15%, rgba(96,165,250,0.16) 16%, transparent 18%, transparent 34%, rgba(96,165,250,0.28) 35%, transparent 38%);
}

.summary-icon{
  display:grid;
  place-items:center;
  width:50px;
  height:50px;
  border-radius:999px;
  color:#fff;
  font-weight:800;
}

.summary-green .summary-icon{ background:#16a34a; }
.summary-blue .summary-icon{ background:#2563eb; }
.summary-purple .summary-icon{ background:#9333ea; }
.summary-orange .summary-icon{ background:#c97706; }

.vendas-summary-card small{
  display:block;
  color:#cbd5e1;
  margin-bottom:6px;
}

.vendas-summary-card strong{
  display:block;
  color:#f8fafc;
  font-size:20px;
  margin-bottom:4px;
}

.vendas-summary-card em{
  color:#94a3b8;
  font-size:13px;
  font-style:normal;
}

.top-products-list{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  position:relative;
  z-index:1;
}

.top-product-row{
  display:grid;
  grid-template-columns:24px minmax(0, 1fr) auto;
  align-items:center;
  gap:8px;
  padding:7px 9px;
  border:1px solid rgba(168,85,247,0.22);
  border-radius:8px;
  background:rgba(15,23,42,0.44);
}

.top-product-row span{
  color:#c084fc;
  font-size:12px;
  font-weight:800;
}

.top-product-row strong{
  margin:0;
  font-size:13px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.top-product-row em{
  color:#67e8f9;
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}

.vendas-search-wrap{
  flex:1;
  min-width:280px;
  max-width:none;
}

.vendas-search-wrap input{
  width:100%;
  padding:13px 16px;
  border-radius:10px;
  border:1px solid rgba(96,165,250,0.24);
  background:rgba(15,23,42,0.76);
  color:white;
}

.vendas-filters{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:28px;
  padding:28px;
  border:1px solid rgba(59,130,246,0.18);
  border-radius:12px;
  background:linear-gradient(180deg, rgba(15,23,42,0.92), rgba(12,24,43,0.96));
}

.vendas-filters-label{
  color:#9ca3af;
  font-size:14px;
}

.vendas-filter-btn{
  background:#374151;
  padding:10px 16px;
  font-size:14px;
}

.vendas-filter-btn.active{
  background:#2563eb;
}

.vendas-filter-btn:hover{
  background:#4b5563;
}

.vendas-filter-btn.active:hover{
  background:#1d4ed8;
}

.produto-filter-wrap{
  position:relative;
}

.produto-filter-button,
.produto-filter-clear,
.date-filter-button{
  background:rgba(51,65,85,0.88);
  padding:12px 16px;
  font-size:13px;
  border:1px solid rgba(148,163,184,0.28);
}

.produto-filter-button,
.date-filter-button{
  min-width:150px;
  text-align:left;
}

.produto-filter-button:hover,
.produto-filter-clear:hover,
.date-filter-button:hover{
  background:#4b5563;
}

.produto-filter-panel,
.date-filter-panel{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  z-index:30;
  width:min(360px, calc(100vw - 32px));
  background:#111827;
  border:1px solid #374151;
  border-radius:10px;
  box-shadow:0 16px 40px rgba(0,0,0,0.35);
  padding:10px;
}

.date-filter-wrap{
  position:relative;
}

.date-filter-panel{
  width:310px;
}

.produto-filter-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:8px;
  color:#e5e7eb;
}

.produto-filter-options{
  display:flex;
  flex-direction:column;
  gap:6px;
  max-height:260px;
  overflow-y:auto;
}

.produto-filter-option{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px;
  border-radius:8px;
  color:#f9fafb;
  font-size:14px;
  cursor:pointer;
}

.produto-filter-option:hover{
  background:#1f2937;
}

.produto-filter-option input{
  width:16px;
  height:16px;
  accent-color:#2563eb;
}

.date-filter-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:10px;
  color:#e5e7eb;
  text-transform:capitalize;
}

.calendar-nav-btn{
  padding:8px 10px;
  background:#1e293b;
}

.calendar-weekdays,
.calendar-days{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:6px;
}

.calendar-weekdays{
  color:#94a3b8;
  font-size:12px;
  text-align:center;
  margin-bottom:6px;
}

.calendar-day,
.calendar-empty{
  min-height:34px;
  border-radius:8px;
}

.calendar-day{
  padding:0;
  background:#0f172a;
  border:1px solid #1e293b;
  color:#e5e7eb;
  font-size:13px;
}

.calendar-day:hover{
  background:#1d4ed8;
}

.calendar-day.is-range{
  background:#1e3a8a;
  border-color:#3b82f6;
}

.calendar-day.is-start,
.calendar-day.is-end{
  background:#2563eb;
  color:#fff;
  font-weight:800;
}

.date-filter-actions{
  display:flex;
  justify-content:flex-end;
  margin-top:10px;
}

.btn-editar-lead{
  background:#2563eb;
  padding:8px 16px;
  font-size:13px;
  font-weight:600;
  letter-spacing:0.02em;
  white-space:nowrap;
}

.btn-editar-lead:hover{
  background:#1d4ed8;
}

.btn-excluir-lead{
  background:#dc2626;
  padding:8px 16px;
  font-size:13px;
  font-weight:600;
  letter-spacing:0.02em;
  white-space:nowrap;
}

.btn-excluir-lead:hover{
  background:#b91c1c;
}

.lead-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.btn-enviar-lead{
  background:#16a34a;
  padding:8px 16px;
  font-size:13px;
  font-weight:600;
  letter-spacing:0;
  white-space:nowrap;
}

.btn-enviar-lead:hover{
  background:#15803d;
}

#vendasLeadsTable tbody tr.status-envio-preparando,
#vendasLeadsTable tbody tr.status-envio-etiquetando,
#vendasLeadsTable tbody tr.status-envio-coletado{
  background:rgba(15,23,42,0.58);
}

#vendasLeadsTable tbody tr.status-envio-preparando:hover,
#vendasLeadsTable tbody tr.status-envio-etiquetando:hover,
#vendasLeadsTable tbody tr.status-envio-coletado:hover{
  background:rgba(30,41,59,0.74);
}

.btn-icon-edit,
.btn-icon-delete{
  width:28px;
  height:28px;
  min-width:28px;
  padding:0;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  line-height:1;
  font-weight:800;
}

.btn-icon-edit{
  background:#2563eb;
  color:#fff;
}

.btn-icon-edit:hover{
  background:#1d4ed8;
}

.btn-icon-delete{
  background:#dc2626;
  color:#fff;
}

.btn-icon-delete:hover{
  background:#b91c1c;
}

.table-action-stack{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  white-space:nowrap;
}

.col-row-actions{
  text-align:center;
  vertical-align:middle;
  white-space:nowrap;
}

.status-envio-filter,
.status-envio-select{
  background:rgba(15,23,42,0.86);
  color:#e5e7eb;
  border:1px solid rgba(148,163,184,0.26);
  border-radius:8px;
}

.status-envio-filter{
  padding:12px 16px;
  min-width:170px;
}

.status-envio-select{
  width:100%;
  padding:6px 7px;
  font-size:10px;
  font-weight:700;
  min-height:28px;
  cursor:pointer;
  border-color:transparent;
  color:#fff;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.status-envio-select.status-envio-preparando{
  background:#d8a200;
  color:#fff;
}

.status-envio-select.status-envio-etiquetando{
  background:#f97316;
  color:#fff;
}

.status-envio-select.status-envio-coletado{
  background:#16a34a;
  color:#fff;
}

.status-envio-select option[value="Sem etiqueta"]{ background:#d8a200; color:#fff; }
.status-envio-select option[value="Etiquetado"]{ background:#f97316; color:#fff; }
.status-envio-select option[value="Enviado"]{ background:#16a34a; color:#fff; }

.status-logistica-select{
  width:100%;
  min-height:30px;
  padding:6px 8px;
  border:none;
  border-radius:999px;
  color:#fff;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
  text-align:center;
}

.status-logistica-sem-etiqueta{
  background:#d8a200;
}

.status-logistica-etiquetado{
  background:#f97316;
}

.status-logistica-enviado{
  background:#16a34a;
}

.status-logistica-select option[value="Sem etiqueta"]{ background:#d8a200; color:#fff; }
.status-logistica-select option[value="Etiquetado"]{ background:#f97316; color:#fff; }
.status-logistica-select option[value="Enviado"]{ background:#16a34a; color:#fff; }

.logistica-table-wrapper{
  margin-top:18px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

.logistica-tools{
  display:flex;
  justify-content:flex-end;
  margin:8px 0 12px;
}

.logistica-tools input{
  width:min(340px, 100%);
  padding:10px 12px;
  border:1px solid rgba(96,165,250,0.24);
  border-radius:10px;
  background:rgba(15,23,42,0.76);
  color:#fff;
  font-size:12px;
}

.logistica-filter-th{
  position:relative;
}

.logistica-th-filter{
  padding:0;
  background:transparent;
  color:#fff;
  font-size:inherit;
  line-height:inherit;
  border-radius:0;
}

.logistica-th-filter:hover{
  background:transparent;
  color:#93c5fd;
}

.logistica-filter-panel{
  top:calc(100% + 8px);
}

.logistica-status-panel{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  z-index:35;
  display:flex;
  flex-direction:column;
  width:180px;
  padding:8px;
  border:1px solid #374151;
  border-radius:10px;
  background:#111827;
  box-shadow:0 16px 40px rgba(0,0,0,0.35);
}

.logistica-status-panel.hidden,
.logistica-filter-panel.hidden{
  display:none;
}

.logistica-status-panel button{
  justify-content:flex-start;
  padding:9px 10px;
  border-radius:8px;
  background:transparent;
  font-size:12px;
}

.logistica-status-panel button:hover{
  background:#1f2937;
}

#logisticaTable{
  min-width:1120px;
}

#logisticaTable th,
#logisticaTable td{
  font-size:12px;
}

#logisticaTable th:nth-child(1),
#logisticaTable td:nth-child(1){
  width:20%;
}

#logisticaTable th:nth-child(2),
#logisticaTable td:nth-child(2),
#logisticaTable th:nth-child(3),
#logisticaTable td:nth-child(3){
  width:12%;
}

#logisticaTable th:nth-child(4),
#logisticaTable td:nth-child(4){
  width:13%;
}

#logisticaTable th:nth-child(5),
#logisticaTable td:nth-child(5){
  width:14%;
}

#logisticaTable th:nth-child(6),
#logisticaTable td:nth-child(6),
#logisticaTable th:nth-child(7),
#logisticaTable td:nth-child(7){
  width:16%;
  text-align:center;
}

#logisticaTable th:nth-child(8),
#logisticaTable td:nth-child(8){
  width:9%;
}

.logistica-extra-field{
  width:100%;
  min-height:32px;
  padding:7px 9px;
  border:1px solid rgba(96,165,250,0.34);
  border-radius:8px;
  background:#334155;
  color:#fff;
  font-size:12px;
}

.logistica-extra-text{
  display:block;
  color:#cbd5e1;
  font-size:12px;
  white-space:normal;
  text-align:center;
}

.logistica-extra-cell{
  text-align:center;
}

.logistica-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:wrap;
}

.btn-logistica-add,
.btn-logistica-save{
  min-height:30px;
  padding:7px 12px;
  font-size:12px;
  border-radius:8px;
}

.btn-logistica-add{
  background:#2563eb;
}

.btn-logistica-save{
  background:#16a34a;
}

.btn-logistica-add:hover{
  background:#1d4ed8;
}

.btn-logistica-save:hover{
  background:#15803d;
}

.admin-grid{
  display:grid;
  gap:18px;
}

.admin-panel{
  border:1px solid rgba(59,130,246,0.24);
  border-radius:12px;
  background:rgba(15,23,42,0.55);
  padding:16px;
}

.admin-panel h3{
  margin-bottom:12px;
}

.role-select{
  min-width:150px;
  border:1px solid rgba(96,165,250,0.55);
  border-radius:8px;
  background:#111c30;
  color:#fff;
  padding:8px 10px;
}

.btn-approve,
.btn-resolve-reset{
  border:0;
  border-radius:8px;
  padding:9px 12px;
  color:#fff;
  background:#16a34a;
  cursor:pointer;
  font-weight:700;
}

.btn-resolve-reset{
  background:#2563eb;
}

.status-user-pendente{
  color:#facc15;
  font-weight:800;
}

.status-user-ativo{
  color:#22c55e;
  font-weight:800;
}

.col-produtos{
  min-width:0;
  max-width:none;
  font-size:12px;
  color:#d1d5db;
  line-height:1.4;
}

.col-endereco{
  min-width:0;
  max-width:none;
  color:#e5e7eb;
  font-size:9.5px;
  line-height:1.3;
  display:table-cell;
  white-space:normal;
  word-break:keep-all;
  word-break:normal;
  overflow-wrap:normal;
  hyphens:none;
}

#vendasLeadsTable td:nth-child(3),
#vendasLeadsTable td:nth-child(4),
#vendasLeadsTable td:nth-child(5),
#vendasLeadsTable td:nth-child(8),
#vendasLeadsTable td:nth-child(9),
#vendasLeadsTable td:nth-child(10){
  white-space:nowrap;
}

.produto-items{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.produto-item{
  display:grid;
  grid-template-columns:minmax(0, 1fr);
  gap:4px;
  align-items:center;
  padding:6px 8px;
  border:1px solid rgba(96,165,250,0.22);
  border-radius:8px;
  background:rgba(15,31,59,0.78);
}

.produto-item-name{
  color:#f8fafc;
  font-weight:600;
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  font-size:10px;
}

.produto-item-value{
  color:#67e8f9;
  font-weight:700;
  white-space:nowrap;
  font-size:10px;
}

.lead-name-cell{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.lead-avatar{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  min-width:30px;
  border-radius:999px;
  background:linear-gradient(135deg, #2563eb, #a855f7);
  color:#fff;
  font-weight:800;
  font-size:12px;
}

.lead-name-text{
  min-width:0;
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  font-weight:700;
  color:#fff;
}

.btn-icon-edit svg,
.btn-icon-delete svg{
  width:14px;
  height:14px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.th-icon{
  display:inline-flex;
  vertical-align:-3px;
  color:#3b82f6;
  margin-right:6px;
}

.th-icon svg{
  width:14px;
  height:14px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.col-valor-total{
  font-weight:600;
  color:#6ee7b7;
  white-space:nowrap;
}

.lead-badge{
  display:inline-block;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}

.badge-lead{
  background:#374151;
  color:#e5e7eb;
}

.badge-venda{
  background:rgba(5,150,105,0.72);
  color:#d1fae5;
}

.form-section-title{
  margin:22px 0 12px;
  padding-top:8px;
  border-top:1px solid #374151;
  color:#93c5fd;
  font-size:15px;
  font-weight:600;
}

.venda-form-panel.is-editing{
  border-color:#3b82f6;
  box-shadow:0 0 0 1px rgba(59,130,246,0.35);
}

.venda-fields-readonly{
  background:#0a0f1a;
  border:1px solid #1f2937;
  border-radius:12px;
  padding:16px 18px;
  margin-bottom:20px;
  opacity:0.92;
}

.venda-fields-editable{
  background:#1e293b;
  border:1px solid #3b82f6;
  border-radius:12px;
  padding:16px 18px;
  margin-bottom:8px;
}

.form-section-readonly{
  border-top:none;
  padding-top:0;
  margin-top:0;
  color:#6b7280;
}

.form-section-editable{
  border-top:none;
  padding-top:0;
  margin-top:0;
  color:#93c5fd;
}

.form-row-readonly label{
  color:#6b7280;
}

.form-row-readonly input[readonly]{
  background:#05080f;
  color:#6b7280;
  border-color:#1f2937;
  cursor:not-allowed;
  opacity:0.95;
}

.form-row-editable label{
  color:#f3f4f6;
  font-weight:600;
}

.form-row-editable input,
.form-row-editable select{
  background:#334155;
  color:#f9fafb;
  border-color:#60a5fa;
}

.form-row-editable input:focus,
.form-row-editable select:focus{
  outline:none;
  border-color:#93c5fd;
  box-shadow:0 0 0 2px rgba(147,197,253,0.25);
}

.venda-form-note{
  color:#9ca3af;
  font-size:14px;
  margin:0 0 18px;
}

.produto-row{
  border:1px dashed #60a5fa;
  border-radius:12px;
  padding:10px 12px;
  margin-bottom:10px;
  background:#273549;
}

.produto-row-editable{
  display:grid;
  grid-template-columns:minmax(260px, 1fr) 110px 160px auto;
  gap:8px;
  align-items:end;
}

.produto-row-editable .form-row-editable{
  margin-bottom:0;
}

.produto-row-editable .form-row-editable label{
  margin-bottom:4px;
  font-size:13px;
}

.produto-row-editable .form-row-editable input{
  background:#3d4f66;
}

.produto-row-editable .form-row-editable input,
.produto-row-editable .form-row-editable select{
  min-height:38px;
  padding:8px 10px;
}

.add-produto-btn,
.remove-produto-btn{
  margin-top:0;
  margin-bottom:0;
  min-height:38px;
  padding:8px 14px;
}

.lead-cadastro-form.is-editing{
  border-color:#3b82f6;
  box-shadow:0 0 0 1px rgba(59,130,246,0.35);
}

.lead-cadastro-form .lead-fields-editable{
  background:#1e293b;
  border:1px solid #3b82f6;
  border-radius:12px;
  padding:12px 14px;
  margin-bottom:12px;
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  gap:10px 12px;
}

.lead-cadastro-form .form-row{
  margin-bottom:0;
}

.lead-cadastro-form .form-row-editable input,
.lead-cadastro-form .form-row-editable select{
  padding:10px 12px;
  min-height:42px;
}

.lead-cadastro-form .form-row-editable label{
  margin-bottom:6px;
}

.lead-row-nome{ order:1; }
.lead-row-numero{ order:2; }
.lead-row-cep{ order:3; }
.lead-row-endereco{ order:4; }
.lead-row-cpf{ order:5; }
.lead-row-observacao{ order:6; }
.lead-row-status-venda{ order:7; }
.lead-row-vendedor{ order:8; }

#leadProdutosSection{
  order:9;
  grid-column:1 / -1;
}

.lead-cadastro-form .lead-date-readonly{
  margin-bottom:8px;
}

.top input[type="date"]{
  background:#1f2937;
  color:white;
  border:1px solid #374151;
  border-radius:8px;
  padding:12px 14px;
  min-width:160px;
}

.top button,
.top input[type="date"]{
  height:44px;
}

.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:15px;
  margin-bottom:25px;
}

.card{
  background:#1f2937;
  padding:20px;
  border-radius:12px;
}

.card h2{
  font-size:15px;
  color:#9ca3af;
  margin-bottom:10px;
}

.card p{
  font-size:28px;
  font-weight:bold;
}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 7px;
  background:transparent;
  border-radius:0;
  overflow:visible;
  table-layout:fixed;
  border:none;
}

th{
  background:rgba(8,19,39,0.92);
  text-align:left;
  padding:10px 7px;
  font-size:10px;
  line-height:1.2;
  color:#f8fafc;
  border-top:1px solid rgba(59,130,246,0.18);
  border-bottom:1px solid rgba(59,130,246,0.18);
}

td{
  padding:9px 7px;
  border-top:1px solid rgba(59,130,246,0.13);
  border-bottom:1px solid rgba(59,130,246,0.13);
  font-size:10px;
  line-height:1.3;
  overflow:visible;
  text-overflow:clip;
  white-space:normal;
  vertical-align:middle;
  color:#e5e7eb;
  background:rgba(11,27,52,0.86);
}

#vendasLeadsTable td:nth-child(1),
#vendasLeadsTable td:nth-child(2),
#vendasLeadsTable td:nth-child(7){
  vertical-align:top;
}

th:first-child,
td:first-child{
  border-left:1px solid rgba(59,130,246,0.13);
  border-top-left-radius:12px;
  border-bottom-left-radius:12px;
}

th:last-child,
td:last-child{
  border-right:1px solid rgba(59,130,246,0.13);
  border-top-right-radius:12px;
  border-bottom-right-radius:12px;
}

.table-wrapper{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
  padding:0;
}

#vendasLeadsTable th:nth-child(1),
#vendasLeadsTable td:nth-child(1){
  width:10%;
}

#vendasLeadsTable th:nth-child(2),
#vendasLeadsTable td:nth-child(2){
  width:12%;
}

#vendasLeadsTable th:nth-child(3),
#vendasLeadsTable td:nth-child(3){
  width:10%;
}

#vendasLeadsTable th:nth-child(4),
#vendasLeadsTable td:nth-child(4){
  width:7%;
}

#vendasLeadsTable th:nth-child(5),
#vendasLeadsTable td:nth-child(5){
  width:6%;
}

#vendasLeadsTable th:nth-child(6),
#vendasLeadsTable td:nth-child(6){
  width:8%;
}

#vendasLeadsTable th:nth-child(7),
#vendasLeadsTable td:nth-child(7){
  width:14%;
}

#vendasLeadsTable th:nth-child(8),
#vendasLeadsTable td:nth-child(8){
  width:9%;
}

#vendasLeadsTable th:nth-child(9),
#vendasLeadsTable td:nth-child(9){
  width:6%;
}

#vendasLeadsTable th:nth-child(10),
#vendasLeadsTable td:nth-child(10){
  width:8%;
}

#vendasLeadsTable th:nth-child(11),
#vendasLeadsTable td:nth-child(11){
  width:10%;
}

#vendasLeadsTable .lead-badge{
  white-space:normal;
}

.green{
  color:#22c55e;
  font-weight:bold;
}

.red{
  color:#ef4444;
  font-weight:bold;
}

.disabled-account{
  opacity:.55;
}

.account-sm-btn{
  background:#2563eb;
  border:none;
  padding:6px 12px;
  border-radius:6px;
  color:white;
  cursor:pointer;
  font-size:12px;
  font-weight:bold;
}

.account-sm-btn:hover{
  background:#1d4ed8;
}

.account-sm-btn.off{
  background:#6b7280;
}

.account-sm-btn.off:hover{
  background:#4b5563;
}

.account-note{
  font-size:12px;
  color:#9ca3af;
  margin-top:4px;
}

.dashboard-note{
  background:#1f2937;
  padding:12px 16px;
  border-radius:8px;
  margin-bottom:15px;
  border-left:4px solid #2563eb;
  font-size:14px;
  color:#d1d5db;
}

#accountsTable .original-only,
#accountsTable .brl-only {
  display: table-cell;
}

#accountsTable.show-brl .original-only {
  display: none;
}

#accountsTable:not(.show-brl) .brl-only {
  display: none;
}

.kpi-filter-bar{
  display:flex;
  gap:12px;
  align-items:flex-start;
  margin-bottom:15px;
  flex-wrap:wrap;
}

.filter-toggle{
  background:#111827;
  border:1px solid #374151;
  color:white;
  padding:10px 14px;
  border-radius:10px;
  cursor:pointer;
}

.filter-toggle:hover{
  background:#1f2937;
}

.kpi-filters-panel{
  display:none;
  background:#111827;
  border:1px solid #374151;
  border-radius:12px;
  padding:14px;
  width:100%;
  max-width:720px;
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  gap:10px;
}

.kpi-filters-panel.visible{
  display:grid;
}

.kpi-filter-item{
  display:flex;
  gap:10px;
  align-items:center;
  background:#1f2937;
  padding:10px 12px;
  border-radius:10px;
  font-size:14px;
}

#campaignsTable .kpi-column{
  display:none;
}

#campaignsTable.show-kpi-clicks .kpi-clicks,
#campaignsTable.show-kpi-impressions .kpi-impressions,
#campaignsTable.show-kpi-cpc .kpi-cpc,
#campaignsTable.show-kpi-cpm .kpi-cpm,
#campaignsTable.show-kpi-ctr .kpi-ctr,
#campaignsTable.show-kpi-resultados .kpi-resultados,
#campaignsTable.show-kpi-cpr .kpi-cpr {
  display: table-cell;
}

/* Bolinha de carregamento pequena */
.loading-dot{
  position:fixed;
  top:24px;
  right:24px;
  width:12px;
  height:12px;
  background:linear-gradient(90deg,#60a5fa,#2563eb);
  border-radius:50%;
  box-shadow:0 0 8px rgba(37,99,235,0.6);
  display:none;
  z-index:9999;
  transform-origin:center;
}

.loading-dot.visible{
  display:block;
  animation: pulseDot 1s infinite ease-in-out;
}

@keyframes pulseDot{
  0%{ transform: scale(0.9); opacity:0.8 }
  50%{ transform: scale(1.3); opacity:1 }
  100%{ transform: scale(0.9); opacity:0.8 }
}

@media (max-width:1200px){
  body{
    padding:12px;
  }

  .container{
    flex-direction:column;
  }

  .sidebar{
    width:100%;
    flex:0 0 auto;
    min-height:auto;
    padding:12px;
    border-right:none;
    border-bottom:1px solid rgba(59,130,246,0.22);
  }

  .sidebar-brand{
    padding:0 4px 12px;
  }

  .tabs-nav{
    flex-direction:row;
    flex-wrap:wrap;
    gap:8px;
  }

  .tab-btn{
    flex:1 1 150px;
    border-left:none;
    border-bottom:3px solid transparent;
    padding:12px 14px;
  }

  .tab-btn.active{
    border-left-color:transparent;
    border-bottom-color:#60a5fa;
  }

  .sidebar-profile{
    margin-top:12px;
  }

  .main-content{
    padding:20px 16px;
  }

  .produto-row-editable{
    grid-template-columns:minmax(220px, 1fr) 100px 140px;
  }

  .produto-row-editable .remove-produto-btn{
    grid-column:1 / -1;
    justify-self:start;
  }

  #vendasLeadsTable th,
  #vendasLeadsTable td{
    padding:8px 6px;
    font-size:9px;
  }

  .vendas-summary-cards{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .vendas-filters{
    padding:18px;
  }
}

@media (max-width:900px){
  .vendas-page-header{
    align-items:stretch;
  }

  .vendas-add-btn{
    width:100%;
  }

  .vendas-search-wrap,
  .produto-filter-wrap,
  .date-filter-wrap,
  .produto-filter-button,
  .date-filter-button,
  .status-envio-filter{
    width:100%;
    min-width:0;
  }

  .produto-filter-panel,
  .date-filter-panel{
    width:100%;
    max-width:none;
  }

  .table-wrapper{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
    padding-bottom:8px;
  }

  #vendasLeadsTable{
    min-width:1180px;
  }

  .col-endereco{
    display:table-cell;
    font-size:9px;
    line-height:1.25;
  }

  .col-produtos{
    font-size:10px;
  }

  .produto-item{
    grid-template-columns:minmax(0, 1fr);
  }

  .table-action-stack{
    justify-content:center;
  }

  .lead-cadastro-form .lead-fields-editable{
    grid-template-columns:1fr;
  }
}

@media (max-width:720px){
  .produto-row-editable{
    grid-template-columns:1fr;
  }

  .produto-row-editable .remove-produto-btn{
    width:100%;
  }

  .vendas-page-header{
    flex-direction:column;
  }

  .vendas-summary-cards{
    grid-template-columns:1fr;
  }

  .vendas-summary-card{
    min-height:82px;
    padding:16px;
  }

  .vendas-summary-card::after{
    right:12px;
    opacity:.45;
  }

  .summary-icon{
    width:44px;
    height:44px;
  }

  .vendas-filters{
    padding:14px;
    gap:10px;
  }

  .vendas-filters-label{
    width:100%;
  }

  .lead-form,
  .venda-fields-readonly,
  .venda-fields-editable{
    padding:14px;
  }
}

@media (max-width:520px){
  body{
    padding:0;
  }

  .main-content{
    padding:16px 10px;
  }

  .sidebar{
    padding:10px;
  }

  .sidebar-brand{
    font-size:14px;
  }

  .tab-btn{
    flex:1 1 calc(50% - 8px);
    padding:10px;
    font-size:12px;
  }

  .sidebar-profile{
    padding:8px;
  }

  .vendas-page-header h2{
    font-size:22px;
  }

  .vendas-add-btn,
  .produto-filter-button,
  .date-filter-button,
  .status-envio-filter,
  .vendas-search-wrap input{
    padding:11px 12px;
    font-size:12px;
  }

  .date-filter-panel{
    position:fixed;
    left:10px;
    right:10px;
    top:96px;
    width:auto;
    max-height:calc(100vh - 116px);
    overflow:auto;
  }

  .calendar-days,
  .calendar-weekdays{
    gap:5px;
  }

  .calendar-day,
  .calendar-empty{
    min-height:32px;
  }

  #vendasLeadsTable td{
    font-size:9px;
    padding:8px 6px;
  }

  .lead-name-cell{
    gap:8px;
  }

  .lead-avatar{
    width:28px;
    height:28px;
    min-width:28px;
    font-size:11px;
  }

  .status-envio-select{
    max-width:180px;
  }

  .produto-item{
    grid-template-columns:minmax(0, 1fr);
  }

  .form-actions{
    flex-direction:column;
  }

  .form-actions button{
    width:100%;
  }
}
