/* ============================================================
   LOSSGUARD — DESIGN SYSTEM
   Tipografia: Syne (display) + DM Sans (corpo)
   Paleta: vermelho-perigo dominante, fundo escuro sofisticado
   ============================================================ */

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

:root {
  --red:        #E63946;
  --red-dark:   #C1121F;
  --red-light:  #FF6B6B;
  --bg:         #0D0F14;
  --bg-2:       #13161E;
  --bg-3:       #1A1E2A;
  --bg-4:       #222736;
  --border:     #2A2F3E;
  --border-2:   #353B4E;
  --text:       #F0F2F8;
  --text-2:     #9BA3BE;
  --text-3:     #6B7494;
  --blue:       #3B82F6;
  --blue-dark:  #2563EB;
  --green:      #22C55E;
  --green-dark: #16A34A;
  --orange:     #F97316;
  --purple:     #A855F7;
  --yellow:     #EAB308;
  --danger:     #E63946;
  --success:    #22C55E;
  --warn:       #F97316;

  --radius:     10px;
  --radius-lg:  16px;
  --shadow:     0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.6);

  --topbar-h:   62px;
  --page-h-h:   72px;
}

html, body { height: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── LOADING ──────────────────────────────────────────────── */
.loading-screen {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOPBAR ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(13,15,20,0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}

.topbar-left { display: flex; align-items: center; gap: 0; }

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  padding-right: 20px;
  border-right: 1px solid var(--border);
  margin-right: 20px;
}

.topbar-product {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.3px;
}

.topbar-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.master-badge {
  background: var(--red);
  color: white;
}

.topbar-nav {
  display: flex;
  gap: 4px;
}

.topbar-nav a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: all 0.15s;
}

.topbar-nav a:hover { color: var(--text); background: var(--bg-3); }
.topbar-nav a.active { color: var(--text); background: var(--bg-4); }

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

.topbar-user {
  font-size: 13px;
  color: var(--text-2);
}

.btn-logout {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.btn-logout:hover { color: var(--text); border-color: var(--border-2); background: var(--bg-4); }

.btn-back-master {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'DM Sans', sans-serif;
}
.btn-back-master:hover { color: var(--red); border-color: var(--red); }

/* Cliente branding na topbar */
.client-brand-sep {
  width: 1px; height: 28px;
  background: var(--border);
  margin: 0 18px;
}

.client-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 20px;
  border-right: 1px solid var(--border);
  margin-right: 20px;
}

.client-logo-topbar {
  height: 30px;
  width: auto;
  max-width: 80px;
  object-fit: contain;
  border-radius: 4px;
}

.client-logo-placeholder-sm {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
}

.client-name-topbar {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}

/* ── PAGE HEADER ──────────────────────────────────────────── */
.page-header {
  height: var(--page-h-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.page-header h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.5px;
}

/* ── MAIN CONTENT ─────────────────────────────────────────── */
.main-content {
  padding: 28px;
  max-width: 1400px;
}

/* ── KPI GRID ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.kpi-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow);
}

.kpi-card.kpi-danger { border-color: rgba(230,57,70,0.25); background: rgba(230,57,70,0.05); }
.kpi-card.kpi-success { border-color: rgba(34,197,94,0.2); background: rgba(34,197,94,0.04); }

.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-red    { background: rgba(230,57,70,0.15); color: var(--red-light); }
.kpi-green  { background: rgba(34,197,94,0.15); color: var(--green); }
.kpi-blue   { background: rgba(59,130,246,0.15); color: var(--blue); }
.kpi-purple { background: rgba(168,85,247,0.15); color: var(--purple); }
.kpi-orange { background: rgba(249,115,22,0.15); color: var(--orange); }

.kpi-data { display: flex; flex-direction: column; gap: 2px; }
.kpi-value {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.5px;
}
.kpi-label { font-size: 12.5px; color: var(--text-2); }

/* ── SECTION HEADER ───────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-header h2 {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
}

/* ── CARDS ────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.card-body { padding: 16px 20px; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ── RANK ITEMS ───────────────────────────────────────────── */
.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }

.rank-pos {
  width: 22px; height: 22px;
  background: var(--bg-4);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  flex-shrink: 0;
}

.rank-info { flex: 1; }
.rank-name { font-size: 13.5px; font-weight: 500; display: block; }
.rank-val { font-size: 13px; font-weight: 600; }
.rank-val.danger, .rank-val.danger { color: var(--red-light); }
.rank-pct { font-size: 11px; color: var(--text-3); }
.rank-pct.danger { color: var(--red-light); }
.rank-vals { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

/* Progress bar */
.progress-bar {
  height: 4px;
  background: var(--bg-4);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.fill-ok { background: var(--green); }
.fill-warn { background: var(--orange); }
.fill-danger { background: var(--red); }

/* ── CLIENTES GRID ────────────────────────────────────────── */
.clientes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.cliente-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cliente-card:hover {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red), var(--shadow);
  transform: translateY(-2px);
}

.cliente-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cliente-logo {
  width: 44px; height: 44px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  padding: 2px;
}

.cliente-logo-placeholder {
  width: 44px; height: 44px;
  border-radius: 8px;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-2);
}

.cliente-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.cliente-card p { font-size: 12.5px; color: var(--text-2); }

.cliente-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.enter-hint {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
}

.cliente-add {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-3);
  min-height: 160px;
}
.cliente-add:hover { border-color: var(--red); color: var(--red); }
.add-icon { opacity: 0.5; }
.cliente-add:hover .add-icon { opacity: 1; }

/* ── LOJAS GRID ───────────────────────────────────────────── */
.lojas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.loja-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.loja-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.loja-card h3 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.loja-cond { font-size: 12px; color: var(--text-2); display: block; margin-top: 2px; }

.loja-info { display: flex; flex-direction: column; gap: 8px; }
.loja-info-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.loja-info-row span { color: var(--text-2); }
.loja-info-row strong { font-weight: 600; }

.loja-actions { margin-top: 4px; }

.loja-add {
  border-style: dashed;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  color: var(--text-3);
  min-height: 180px;
  transition: all 0.18s;
}
.loja-add:hover { border-color: var(--red); color: var(--red); }

/* ── ALERT BANNER ─────────────────────────────────────────── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.3);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 20px;
  color: var(--red-light);
  font-size: 13.5px;
  flex-wrap: wrap;
}

.alert-loja {
  background: rgba(230,57,70,0.2);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
}

/* ── OCORRENCIAS ──────────────────────────────────────────── */
.status-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--border-2); color: var(--text); }
.filter-btn.active { border-color: var(--red); color: var(--red); background: rgba(230,57,70,0.08); }

.ocorrencias-list { display: flex; flex-direction: column; gap: 12px; }

.ocorrencia-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s;
}
.ocorrencia-card:hover { border-color: var(--border-2); }

.oc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.oc-title-wrap h3 {
  font-family: 'Syne', sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.oc-loja {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  display: block;
}

.oc-badges { display: flex; gap: 6px; flex-wrap: wrap; }

.oc-body { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }

.oc-suspeito {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.oc-valores {
  display: flex;
  gap: 20px;
  font-size: 13px;
  flex-wrap: wrap;
  align-items: center;
}

.oc-date { color: var(--text-3); margin-left: auto; }

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

.btn-whatsapp {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #25D366;
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: background 0.15s;
}
.btn-whatsapp:hover { background: #1DB954; }

/* ── QUICK ACTIONS ────────────────────────────────────────── */
.quick-actions { margin-top: 28px; }
.quick-actions h3 {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-2);
}

.qa-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.qa-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  color: var(--text);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.qa-btn:hover { border-color: var(--red); color: var(--red); }

/* ── RELATÓRIOS ───────────────────────────────────────────── */
.relatorios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.relatorio-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s;
}
.relatorio-card:hover { border-color: var(--border-2); }
.relatorio-card h3 { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; }
.relatorio-card p { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }

/* ── TABLE ────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.lg-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-2);
}

.lg-table thead tr {
  border-bottom: 1px solid var(--border);
}

.lg-table th {
  padding: 13px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.lg-table td {
  padding: 13px 16px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.lg-table tr:last-child td { border-bottom: none; }
.lg-table tbody tr:hover td { background: rgba(255,255,255,0.02); color: var(--text); }

.td-cliente { display: flex; align-items: center; gap: 12px; }
.td-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; border: 1px solid var(--border); background: white; padding: 1px; }
.td-logo-placeholder {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--text-2);
}
.td-cliente strong { display: block; color: var(--text); font-size: 14px; }
.td-cliente small { display: block; color: var(--text-3); font-size: 12px; }

.td-actions { display: flex; gap: 6px; align-items: center; }

.btn-action {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.btn-action:hover { color: var(--text); border-color: var(--border-2); background: var(--bg-4); }
.btn-enter { border-color: var(--red); color: var(--red-light); background: rgba(230,57,70,0.08); }
.btn-enter:hover { background: rgba(230,57,70,0.15); }

/* ── BADGES ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.badge-green  { background: rgba(34,197,94,0.15);  color: #4ADE80; }
.badge-red    { background: rgba(230,57,70,0.15);  color: #FF6B6B; }
.badge-blue   { background: rgba(59,130,246,0.15); color: #60A5FA; }
.badge-orange { background: rgba(249,115,22,0.15); color: #FB923C; }
.badge-purple { background: rgba(168,85,247,0.15); color: #C084FC; }
.badge-gray   { background: rgba(107,116,148,0.2); color: #9BA3BE; }
.badge-gold   { background: rgba(234,179,8,0.15);  color: #FDE047; }

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--red);
  color: white;
  border: none;
  padding: 9px 20px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary.full { width: 100%; justify-content: center; padding: 13px; font-size: 15px; }
.btn-primary.loading { opacity: 0.7; pointer-events: none; }
.btn-primary.btn-sm { padding: 7px 14px; font-size: 12.5px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover { color: var(--text); border-color: var(--border-2); background: var(--bg-4); }
.btn-secondary.btn-sm { padding: 6px 13px; font-size: 12.5px; }

.btn-link {
  background: none;
  border: none;
  color: var(--red-light);
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }

/* ── FORMS ────────────────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--red); }

.form-group select { cursor: pointer; }

.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
}
.form-row.last { margin-bottom: 0; }
.form-group.flex-2 { flex: 2; }

.input-pass-wrap { position: relative; }
.input-pass-wrap input { padding-right: 42px; }
.btn-eye {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 0;
  display: flex;
}

/* ── SEARCH BAR ───────────────────────────────────────────── */
.search-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 14px;
  margin-bottom: 16px;
  max-width: 360px;
  color: var(--text-3);
}

.search-bar-wrap input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  width: 100%;
}
.search-bar-wrap input::placeholder { color: var(--text-3); }

/* ── MODAL ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease;
}

.modal-box.modal-lg { max-width: 720px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

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

.modal-header h2 {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: var(--bg-4);
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 32px; height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { color: var(--text); }

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

.modal-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
  margin-top: 6px;
}

/* Logo preview */
.logo-preview-box {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  display: inline-flex;
  margin-top: 6px;
}
.logo-preview-box img { max-height: 48px; max-width: 160px; object-fit: contain; }

/* ── LOGIN ────────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  min-height: 100vh;
}

.login-left {
  flex: 1;
  background: linear-gradient(135deg, #0D0F14 0%, #1A0A0C 50%, #0D0F14 100%);
  padding: 60px 56px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: -120px; left: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(230,57,70,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-name {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.5;
  max-width: 320px;
}

.login-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  width: 240px;
}

.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--red-light);
}

.stat-label {
  font-size: 12.5px;
  color: var(--text-3);
}

.login-taglines {
  color: var(--text-3);
  font-size: 14px;
  font-style: italic;
}

.login-right {
  width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg);
}

.login-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.elevum-badge {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 8px;
}

.elevum-badge span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.6px; }
.elevum-badge strong { font-size: 13px; color: var(--text-2); font-weight: 600; }

.login-card h1 {
  font-family: 'Syne', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.login-sub { font-size: 13.5px; color: var(--text-2); margin-bottom: 4px; }

.login-forgot { font-size: 13px; text-align: center; }
.login-forgot a { color: var(--text-2); }
.login-forgot a:hover { color: var(--red-light); }

.alert-error {
  background: rgba(230,57,70,0.1);
  border: 1px solid rgba(230,57,70,0.3);
  color: var(--red-light);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13.5px;
}

/* ── UTILIDADES ───────────────────────────────────────────── */
.danger { color: var(--red-light); }
.success { color: var(--green); }
.warn { color: var(--orange); }

.empty-state {
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

.empty-state-full {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-full p { color: var(--text-3); font-size: 15px; }

/* ── IMPORTAÇÃO ───────────────────────────────────────────── */
.import-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 4px;
}

.import-type-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg-3);
}

.import-type-card:hover { border-color: var(--border-2); }
.import-type-card.active {
  border-color: var(--red);
  background: rgba(230,57,70,0.06);
}
.import-type-card.active svg { color: var(--red); }

.import-type-card svg { flex-shrink: 0; margin-top: 2px; color: var(--text-3); }
.import-type-card strong { display: block; font-size: 13.5px; margin-bottom: 4px; }
.import-type-card span { font-size: 12px; color: var(--text-3); line-height: 1.4; }

.upload-area {
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
}
.upload-area:hover { border-color: var(--red); color: var(--text-2); }
.upload-area p { font-size: 14px; font-weight: 500; color: var(--text-2); }
.upload-area span { font-size: 12px; }

.import-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.div-filtros {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.filter-select:focus { border-color: var(--red); }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .login-left { display: none; }
  .login-right { width: 100%; }
  .topbar-nav { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
  .page-header { padding: 0 16px; }
  .main-content { padding: 16px; }
}

/* ── KANBAN ───────────────────────────────────────────────── */
.kanban-main { padding: 20px 28px; max-width: 100%; overflow-x: auto; }

.kanban-board {
  display: flex;
  gap: 14px;
  min-width: 900px;
  align-items: flex-start;
}

.kanban-col {
  flex: 1;
  min-width: 220px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.col-orange .kanban-col-header { border-color: var(--orange); }
.col-blue   .kanban-col-header { border-color: var(--blue); }
.col-purple .kanban-col-header { border-color: var(--purple); }
.col-green  .kanban-col-header { border-color: var(--green); }
.col-red    .kanban-col-header { border-color: var(--red); }

.kanban-col-title { font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700; }
.kanban-col-count {
  background: var(--bg-4);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
}

.kanban-empty {
  text-align: center;
  padding: 24px 12px;
  color: var(--text-3);
  font-size: 12px;
}

.kanban-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kanban-card:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow); }

.kc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kc-div-ref { font-size: 11px; color: var(--text-3); background: var(--bg-4); padding: 2px 6px; border-radius: 4px; }
.kc-valor { font-size: 13px; font-weight: 700; white-space: nowrap; }
.kc-titulo { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.kc-meta { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); }
.kc-suspeito { display: flex; align-items: center; gap: 4px; color: var(--text-2); }
.kc-no-suspeito { color: var(--text-3); font-style: italic; }
.kc-footer { display: flex; align-items: center; justify-content: space-between; }
.kc-date { font-size: 11px; color: var(--text-3); }
.kc-wpp {
  background: #25D366;
  border: none;
  color: white;
  width: 24px; height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.kc-wpp:hover { background: #1aab52; }

/* ── DRAWER ───────────────────────────────────────────────── */
.oc-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
}

.oc-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 520px;
  height: 100vh;
  background: var(--bg-2);
  border-left: 1px solid var(--border-2);
  z-index: 201;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: -8px 0 40px rgba(0,0,0,0.5);
  animation: drawer-in 0.22s ease;
}

@keyframes drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-2);
  z-index: 1;
}

.drawer-header h2 { font-family: 'Syne', sans-serif; font-size: 17px; font-weight: 700; }
.drawer-loja { font-size: 12px; color: var(--text-2); display: block; margin-top: 3px; }

.drawer-status-track {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  background: var(--bg-3);
}

.status-step {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-4);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.status-step:hover { border-color: var(--red); color: var(--text); }
.status-step.active { background: var(--red); border-color: var(--red); color: white; }

.drawer-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 20px; }

.drawer-section h4 {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 12px;
}

.div-resumo-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.div-resumo-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.div-resumo-row span { color: var(--text-2); }
.div-resumo-row strong { font-weight: 600; }

.drawer-vals { display: flex; gap: 14px; }
.drawer-val-item { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.drawer-val-item span { font-size: 12px; color: var(--text-2); font-weight: 600; }
.drawer-val-item input {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.drawer-val-item input:focus { border-color: var(--red); }

.drawer-section textarea {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  resize: vertical;
  outline: none;
}
.drawer-section textarea:focus { border-color: var(--red); }

/* ── DIV ID BADGE ─────────────────────────────────────────── */
.div-id-badge {
  font-family: 'Syne', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  background: var(--bg-4);
  padding: 2px 7px;
  border-radius: 5px;
  white-space: nowrap;
}

/* ── BTN DANGER ───────────────────────────────────────────── */
.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(230,57,70,0.12);
  color: var(--red-light);
  border: 1px solid rgba(230,57,70,0.3);
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-danger:hover { background: rgba(230,57,70,0.2); }

/* ── CONFIG ───────────────────────────────────────────────── */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 1100px) { .config-grid { grid-template-columns: 1fr; } }

.config-preview {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.config-preview h5 { font-family: 'Syne', sans-serif; font-size: 12px; color: var(--text-2); font-weight: 700; }
.config-preview p { font-size: 13px; color: var(--text-2); }
.sim-val { font-weight: 600; color: var(--red-light); font-size: 13.5px; }

/* ── KANBAN FILTROS ───────────────────────────────────────── */
.kanban-filtros {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── MULTI RESPONSÁVEL ────────────────────────────────────── */
.modal-xl { max-width: 860px; }

.modal-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-add-resp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.3);
  color: var(--blue);
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.btn-add-resp:hover { background: rgba(59,130,246,0.18); }

.responsavel-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.resp-num {
  font-family: 'Syne', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-remove-resp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(230,57,70,0.08);
  border: 1px solid rgba(230,57,70,0.2);
  color: var(--red-light);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.btn-remove-resp:hover { background: rgba(230,57,70,0.15); }

/* Drawer responsáveis */
.resp-count-badge {
  background: var(--bg-4);
  border: 1px solid var(--border);
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
}

.resp-drawer-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resp-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.resp-drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.resp-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.resp-field span { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.resp-field strong { font-size: 13px; color: var(--text); font-weight: 500; }

/* ── RESP VALOR CALC ──────────────────────────────────────── */
.resp-valor-calc {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--bg-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  flex-wrap: wrap;
}

.rvc-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 100px; }
.rvc-field label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.rvc-field input { background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text); padding: 7px 10px; border-radius: 7px; font-size: 13.5px; font-family: 'DM Sans', sans-serif; outline: none; }
.rvc-field input:focus { border-color: var(--red); }
.rvc-sep { font-size: 18px; color: var(--text-3); padding-bottom: 6px; font-weight: 300; }
.rvc-result { min-width: 120px; }
.rvc-total { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 700; padding: 6px 0; display: block; }

/* ── IMPORT AVISO ─────────────────────────────────────────── */
.import-aviso {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  color: #93C5FD;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
}

/* ── BTN VER OC ───────────────────────────────────────────── */
.btn-ver-oc {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.3);
  color: #4ADE80;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.btn-ver-oc:hover { background: rgba(34,197,94,0.15); }

/* Drawer input style */
.dr-input {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 8px 11px;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.dr-input:focus { border-color: var(--red); }

/* ── DASHBOARD ────────────────────────────────────────────── */
.dash-main { max-width: 100%; }

.dash-period-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.period-btn {
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.period-btn.active { border-color: var(--red); color: var(--red); background: rgba(230,57,70,0.08); }
.period-btn:hover:not(.active) { border-color: var(--border-2); color: var(--text); }

.dash-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.dash-card-wide { width: 100%; }

@media (max-width: 900px) { .dash-grid-3 { grid-template-columns: 1fr; } }

/* Funil */
.funnel-item { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.funnel-label { font-size: 12px; color: var(--text-2); width: 100px; flex-shrink: 0; }
.funnel-bar-wrap { flex: 1; background: var(--bg-4); border-radius: 4px; height: 10px; overflow: hidden; }
.funnel-bar { height: 100%; border-radius: 4px; transition: width 0.4s; }
.funnel-count { font-size: 13px; font-weight: 700; width: 28px; text-align: right; color: var(--text); }

/* Recuperação */
.recup-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); }
.recup-row strong { font-size: 15px; }

/* Correção */
.correcao-box { margin-top: 12px; }
.correcao-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
}
.corr-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.corr-item span { font-size: 11px; color: var(--text-3); text-transform: uppercase; font-weight: 600; letter-spacing: 0.3px; }
.corr-item strong { font-size: 15px; font-weight: 700; }
.corr-total { border-color: var(--red); background: rgba(230,57,70,0.06); }
@media (max-width: 600px) { .correcao-grid { grid-template-columns: 1fr 1fr; } }


/* DASHBOARD v2 */
.kpi-5col { grid-template-columns: repeat(5, 1fr) !important; }
.dash-filter-bar { display:flex;align-items:center;gap:14px;margin-bottom:16px;flex-wrap:wrap;padding:12px 16px;background:var(--bg-2);border:1px solid var(--border);border-radius:var(--radius); }
.dash-period-btns { display:flex;align-items:center;gap:6px; }
.dash-date-range { display:flex;align-items:center;gap:8px;margin-left:auto; }
.dash-date-input { background:var(--bg-3);border:1px solid var(--border-2);color:var(--text);padding:6px 10px;border-radius:7px;font-size:12.5px;font-family:DM Sans,sans-serif;outline:none; }
.dash-date-input:focus { border-color:var(--red); }
.dash-grid-equal { display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;margin-bottom:16px; }
.chart-card { min-width:0; }
.btn-icon-sm { background:none;border:1px solid var(--border);color:var(--text-3);width:28px;height:28px;border-radius:7px;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:all 0.15s;flex-shrink:0; }
.btn-icon-sm:hover { color:var(--text);border-color:var(--border-2); }
.layout-panel { background:var(--bg-2);border:1px solid var(--border);border-radius:var(--radius);padding:14px 16px;margin-bottom:14px; }
.layout-toggle-btn { padding:6px 12px;border-radius:7px;border:1px solid var(--border-2);background:var(--bg-3);color:var(--text-2);font-size:12px;cursor:pointer;font-family:DM Sans,sans-serif;transition:all 0.15s; }
.layout-toggle-btn.hidden-chart { border-color:var(--red);color:var(--red-light);background:rgba(230,57,70,0.08); }

/* ── DASHBOARD V2 ─────────────────────────────────────────── */
.dash-filtros-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.dash-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-filter-group label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.dash-filter-group input[type="date"],
.dash-filter-group select {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.dash-filter-group input[type="date"]:focus,
.dash-filter-group select:focus { border-color: var(--red); }

.dash-filter-presets {
  display: flex;
  gap: 6px;
  align-items: flex-end;
}

/* KPIs 5-por-linha */
.kpi-row5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-row5 .kpi-card { padding: 16px; }
.kpi-row5 .kpi-value { font-size: 18px; }
@media (max-width: 1200px) { .kpi-row5 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px)  { .kpi-row5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .kpi-row5 { grid-template-columns: repeat(2, 1fr); } }

/* Controles de gráfico */
.g-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.g-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.g-on  { background: rgba(230,57,70,0.1); border-color: rgba(230,57,70,0.3); color: var(--red-light); }
.g-off { background: var(--bg-3); border-color: var(--border); color: var(--text-3); text-decoration: line-through; }
.g-on:hover  { background: rgba(230,57,70,0.18); }
.g-off:hover { color: var(--text-2); text-decoration: none; }

/* Charts grid */
.dash-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1000px) { .dash-charts-grid { grid-template-columns: 1fr; } }

/* ── DASHBOARD V2 ─────────────────────────────────────────── */
.dash-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.dash-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-filter-group label { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.4px; }
.dash-filter-group input[type="date"],
.dash-filter-group select {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}
.dash-filter-group input[type="date"]:focus,
.dash-filter-group select:focus { border-color: var(--red); }

.dash-period-btns { display: flex; gap: 6px; align-items: flex-end; padding-bottom: 1px; }

/* KPI grid 5 colunas */
.kpi-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 4px;
}
@media (max-width: 1200px) { .kpi-grid-5 { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 800px)  { .kpi-grid-5 { grid-template-columns: repeat(2,1fr); } }

.kpi-emoji { font-size: 22px; flex-shrink: 0; }
.kpi-card { gap: 12px; }

/* Widgets */
.dash-widget { margin-bottom: 16px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-grid-2 { grid-template-columns: 1fr; } }

/* Customizer */
.dash-customizer {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
}
.customizer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
}
.customizer-grid { display: flex; flex-direction: column; gap: 6px; }
.customizer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  cursor: grab;
  user-select: none;
  transition: background 0.1s;
}
.customizer-item:hover { background: var(--bg-4); }
.customizer-item span { flex: 1; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-4);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 2px; bottom: 2px;
  background: var(--text-3);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--red); border-color: var(--red); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); background: white; }

/* ── RELATÓRIOS V2 ────────────────────────────────────────── */
.rel-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #93C5FD;
  line-height: 1.5;
}

.relatorios-grid-v2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) { .relatorios-grid-v2 { grid-template-columns: 1fr; } }

.rel-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.15s;
}
.rel-card:hover { border-color: var(--border-2); }

.rel-card-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rel-card-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.rel-card-body h3 { font-family: 'Syne', sans-serif; font-size: 15px; font-weight: 700; }
.rel-card-body p  { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.rel-card-meta    { display: flex; gap: 6px; flex-wrap: wrap; }

.rel-card-action {
  display: flex;
  justify-content: flex-end;
}

/* ── MINHA CONTA ──────────────────────────────────────────── */
.conta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 900px;
}
@media (max-width: 800px) { .conta-grid { grid-template-columns: 1fr; } }

.conta-senha-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: #93C5FD;
  line-height: 1.5;
}

/* Botão minha conta no topbar */
.btn-minha-conta {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}
.btn-minha-conta:hover { color: var(--text); border-color: var(--red); }

/* ── ONBOARDING ───────────────────────────────────────────── */
.onboarding-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 40px 20px;
}

.onboarding-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-lg);
}

.onboarding-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.onboarding-card h1 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.onboarding-card > p {
  font-size: 14px;
  color: var(--text-2);
  margin-top: -10px;
}

.onboarding-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
}

.step-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.step-body h3 { font-size: 13.5px; font-weight: 600; }
.ob-input {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
.ob-input:focus { border-color: var(--red); }

/* ── HISTÓRICO DE CONTATOS ────────────────────────────────── */
.hist-add-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}

.hist-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hist-empty {
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

.hist-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.hist-item:last-child { border-bottom: none; }

.hist-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}

.hist-body { flex: 1; }

.hist-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.hist-tipo {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg-4);
  padding: 2px 8px;
  border-radius: 4px;
}

.hist-resp {
  font-size: 12px;
  color: var(--text-2);
}

.hist-date {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}

.hist-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}

.hist-oper {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── TOAST NOTIFICATIONS ──────────────────────────────────── */
.lg-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(.34,1.56,.64,1);
  max-width: 360px;
}

.lg-toast.lg-toast-show {
  transform: translateY(0);
  opacity: 1;
}

.lg-toast-success { border-color: rgba(34,197,94,0.4); }
.lg-toast-error   { border-color: rgba(230,57,70,0.4); }
.lg-toast-warn    { border-color: rgba(249,115,22,0.4); }

/* ── NAV BADGE ────────────────────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--red);
  color: white;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── NOTIFICAÇÃO POR RESPONSÁVEL ──────────────────────────── */
.notif-ocs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

.notif-oc-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-top: none;
  cursor: pointer;
  transition: background 0.12s;
}
.notif-oc-item:last-child { border-radius: 0 0 8px 8px; }
.notif-oc-item:hover { background: var(--bg-4); }
.notif-oc-item input[type=checkbox] { margin-top: 3px; flex-shrink: 0; cursor: pointer; }

.notif-oc-body { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.notif-oc-titulo { font-size: 13.5px; font-weight: 600; color: var(--text); }
.notif-oc-meta {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.notif-oc-valores {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
  flex-wrap: wrap;
  margin-top: 4px;
}

/* Pendente badge no drawer */
.resp-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
  background: var(--bg-4);
  border: 1px solid var(--border);
}

/* ── TIMELINE DE EVENTOS ──────────────────────────────────── */
.timeline-wrap {
  position: relative;
  margin-top: 14px;
  padding-left: 28px;
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
}

.timeline-line {
  position: absolute;
  left: -20px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-last .timeline-line { display: none; }

.timeline-dot {
  position: absolute;
  left: -26px;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  flex-shrink: 0;
}

.timeline-content {
  flex: 1;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  min-width: 0;
}

.timeline-auto .timeline-content {
  background: var(--bg-2);
  border-color: var(--border);
  opacity: 0.75;
}

.timeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.timeline-tipo {
  font-size: 12px;
  font-weight: 700;
}

.timeline-badge-auto {
  font-size: 10px;
  background: var(--bg-4);
  color: var(--text-3);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.timeline-resp {
  font-size: 12px;
  color: var(--text-2);
}

.timeline-date {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}

.timeline-desc {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

.timeline-oper {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

.timeline-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-3);
  font-size: 13px;
}

.timeline-day-sep {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 0 8px;
  margin-left: -28px;
}

/* ── SORT HEADERS ─────────────────────────────────────────── */
.th-sort {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sort:hover { color: var(--text); }
.th-sort:hover .sort-icon { color: var(--red-light); }

.sort-icon {
  font-size: 11px;
  color: var(--text-3);
  margin-left: 3px;
}

/* ── DATE FILTER INPUT ────────────────────────────────────── */
.filter-date-input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.filter-date-input:focus { border-color: var(--red); }
