/* ═══════════════════════════════════════════════════
   SISTEMA EMPRESARIAL — GLOBAL STYLES
   ═══════════════════════════════════════════════════ */

:root {
  --primary:       #4F46E5;
  --primary-dark:  #3730A3;
  --primary-light: #EEF2FF;
  --success:       #10B981;
  --warning:       #F59E0B;
  --danger:        #EF4444;
  --info:          #3B82F6;
  --purple:        #8B5CF6;
  --orange:        #F97316;

  --bg:            #F1F5F9;
  --surface:       #FFFFFF;
  --border:        #E2E8F0;
  --text:          #1E293B;
  --text-muted:    #64748B;
  --text-light:    #94A3B8;

  --sidebar-w:     260px;
  --topnav-h:      60px;
  --topbar-h:      64px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 4px 24px rgba(0,0,0,.08);
  --shadow-sm:     0 2px 8px rgba(0,0,0,.06);
  --transition:    all .2s ease;
}

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

html {
  min-height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.6;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: none;
  overflow-x: hidden;
  overflow-y: auto;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ───────────────────────────────────────────────────
   AUTH PAGES
   ─────────────────────────────────────────────────── */
/* ═══════════════════════════════════════════════
   AUTH – layout login (35% form | 65% visual)
   ═══════════════════════════════════════════════ */
.auth-body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
  background: none;
}

/* ── Wrapper principal ── */
.login-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  min-height: 100vh;
}

/* ══ LADO ESQUERDO — formulário (50%) ══ */
.login-left {
  width: 50%;
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 32px 24px;
  box-sizing: border-box;
}

/* ══ LADO DIREITO — visual (50%) ══ */
.login-right {
  width: 50%;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f3fae 0%, #1e90ff 60%, #38bdf8 100%);
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 0 5vw;
  overflow: hidden;
  box-sizing: border-box;
}

/* Glow decorativo no fundo */
.login-right::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #60a5fa, transparent 70%);
  filter: blur(120px);
  opacity: 0.35;
  top: 10%;
  right: 5%;
  z-index: 0;
  pointer-events: none;
}

/* ── Conteúdo de texto ── */
.hero-content {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  max-width: 520px;
  padding: 0;
}

.hero-title {
  font-size: clamp(28px, 2.4vw, 42px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin: -5px 0 14px;
  max-width: 420px;
}

.hero-title span {
  color: #60a5fa;
}

.hero-subtitle {
  font-size: clamp(14px, 1.1vw, 18px);
  color: #cbd5f5;
  margin-top: 18px;
  margin-bottom: 55px;
  max-width: 380px;
  line-height: 1.6;
}

/* ── Cards de benefícios ── */
.hero-cards {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 0.8vw, 18px);
  margin-top: 50px;
}

.hero-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: clamp(12px, 1vw, 16px) clamp(18px, 1.4vw, 22px);
  border-radius: 14px;
  color: #ffffff;
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 500;
  max-width: 300px;
  transition: all .25s ease;
  cursor: default;
}

.hero-card:hover {
  transform: scale(1.05);
  background: rgba(255,255,255,.22);
}

/* ── Ícones SVG dos cards ── */
.hero-icon {
  width: 24px;
  height: 24px;
  color: #93c5fd;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(59,130,246,.60));
}

/* ── Wrapper da imagem + halo de luz ── */
.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  z-index: 1;
  height: 100%;
  pointer-events: none;
}

.hero-image::before {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(59,130,246,0.45) 0%, rgba(59,130,246,0.25) 40%, rgba(59,130,246,0.0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  filter: blur(40px);
  z-index: 0;
  pointer-events: none;
}

.hero-image img {
  position: absolute;
  right: 6%;
  bottom: 22%;
  width: 560px;
  max-width: none;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}
}

/* ── Benefícios extras ── */
.hero-extra {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.extra-item {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
}

.extra-icon {
  width: 26px;
  height: 26px;
  color: #93c5fd;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(59,130,246,.60));
}

/* ── Links úteis ── */
.login-links {
  position: absolute;
  bottom: 25px;
  right: 40px;
  color: #ffffff;
  text-align: right;
  z-index: 2;
}

.login-links p {
  font-size: 13px;
  opacity: 0.7;
  margin: 0 0 6px;
}

.links-list {
  display: flex;
  gap: 18px;
  font-size: 13px;
  justify-content: flex-end;
}

.links-list a {
  color: #cbd5f5;
  text-decoration: none;
  transition: color .2s;
}

.links-list a:hover {
  color: #ffffff;
}

/* ── auth-card ── */
.auth-wrapper {
  width: 100%;
  max-width: 400px;
}

/* ── Tela de Cadastro ── */
.register-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
}

.register-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 24px 16px;
}

.auth-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  animation: slideUp .4s ease;
  width: 100%;
  max-width: 400px;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsivo — sem zoom, layout sempre 100vw × 100vh ── */

/* ≥ 1800px — ajustes exclusivos para Full HD */
@media (min-width: 1800px) {
  .hero-features {
    transform: translateY(60px);
  }
  .hero-extra {
    margin-top: 60px;
  }
  .hero-image {
    transform: scale(1.30) translateY(-30px);
  }
  .hero-title {
    margin-top: -20px;
  }
}

/* ≤ 1366px — ajuste para notebooks 1366x768 */
@media (max-width: 1366px) {
  .hero-image {
    transform: translateX(-80px) translateY(-220px) scale(1.40);
  }
  .hero-title {
    font-size: calc(100% + 40px);
    transform: translateY(-30px);
  }
  .auth-body .hero-content {
    transform: scale(0.92);
    transform-origin: top left;
  }
}

/* ≤ 1700px — ajuste do computador em monitores intermediários */
@media (max-width: 1700px) {
  .hero-image img {
    bottom: 18%;
    width: 600px;
    transform: translateX(75px);
  }
  .features-list {
    margin-top: 60px;
  }
  .hero-features {
    transform: translateY(60px);
  }
}

/* ≤ 1400px — compactar hero-content + ajustes visuais */
@media (max-width: 1400px) {
  /* Layout */
  .hero-content  { max-width: 440px; }

  /* Fundo degradê da coluna direita */
  .login-right {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 40%, #38bdf8 100%);
  }

  /* Título */
  .hero-title {
    font-size: 42px;
    line-height: 1.15;
  }

  /* Subtítulo */
  .hero-subtitle { font-size: 18px; }

  /* Cards */
  .hero-card { transform: scale(1.05); transform-origin: left center; }

  /* Imagem do computador */
  .hero-image {
    flex: 1;
    height: 100%;
  }
  .hero-image img {
    width: 360px;
    right: 4%;
    bottom: 4%;
  }

  /* Benefícios */
  .hero-extra { margin-top: 30px; }
}

/* ≤ 1200px — reduzir padding da direita */
@media (max-width: 1200px) {
  .login-right   { padding-left: 44px; }
  .hero-content  { max-width: 400px; }
}

/* ≤ 1024px — padding menor */
@media (max-width: 1024px) {
  .login-right   { padding-left: 32px; }
  .hero-content  { max-width: 360px; }
  .hero-card     { max-width: 260px; }
  .hero-extra    { margin-top: 20px; }
}

/* ≤ 900px → empilhar colunas */
@media (max-width: 900px) {
  .login-layout  { flex-direction: column; height: auto; min-height: 100vh; overflow-y: auto; }
  .login-left    { width: 100%; height: auto; padding: 40px 24px; justify-content: center; }
  .login-right   { width: 100%; height: auto; min-height: 380px; padding: 40px 24px;
                   flex-direction: column; align-items: center; justify-content: center; }
  .hero-content  { text-align: center; align-items: center; display: flex;
                   flex-direction: column; max-width: 100%; padding: 0; }
  .hero-title    { font-size: clamp(22px, 3.5vw, 32px); max-width: 100%; }
  .hero-subtitle { font-size: clamp(13px, 1.8vw, 16px); max-width: 100%; margin-bottom: 20px; }
  .hero-cards    { align-items: center; gap: clamp(8px, 1vw, 12px); }
  .hero-card     { max-width: 300px; }
  .hero-extra    { align-items: center; margin-top: 20px; }
  .hero-image    { flex: none; position: relative; height: auto; margin-top: 20px; }
  .hero-image img{ position: relative; right: auto; bottom: auto;
                   width: clamp(220px, 40vw, 300px); max-height: none; }
  .login-links   { position: relative; right: auto; bottom: auto;
                   text-align: center; margin-top: 16px; padding-bottom: 20px; }
  .links-list    { justify-content: center; }
}

/* ≤ 600px → celular */
@media (max-width: 600px) {
  .login-left    { padding: 24px 16px; }
  .login-right   { min-height: 280px; padding: 28px 16px; }
  .hero-title    { font-size: clamp(20px, 4.5vw, 26px); }
  .hero-image img{ width: clamp(180px, 38vw, 220px); }
  .links-list    { flex-wrap: wrap; gap: 10px; }
}

/* ── Responsivo por altura — compactar conteúdo sem encolher layout ── */
@media (max-height: 750px) {
  .hero-content  { transform: scale(0.90); transform-origin: left center; }
}
@media (max-height: 650px) {
  .hero-content  { transform: scale(0.80); transform-origin: left center; }
}

.auth-logo { text-align: center; margin-bottom: 32px; }

.logo-icon {
  display: none;
}

@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

/* ─── Zyon PDV logo (login screen) ─── */
.auth-title.zyon-logo {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.zyon-logo-zyon {
  color: #1f2937;
}
.zyon-logo-pdv {
  color: #2563eb;
}

.auth-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-top: 4px;
}

/* ─── Alert ─── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-left: 4px solid;
  animation: fadeIn .3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert.hidden { display: none; }
.alert-success { background: #F0FDF4; color: #166534; border-color: var(--success); }
.alert-error   { background: #FEF2F2; color: #991B1B; border-color: var(--danger); }
.alert-warning { background: #FFFBEB; color: #92400E; border-color: var(--warning); }

/* ─── Form ─── */
.auth-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 13px; font-weight: 600; color: var(--text); }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 15px;
  pointer-events: none;
  z-index: 1;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: var(--transition);
  outline: none;
}

.input-wrapper input:focus {
  border: 1px solid #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  transition: all 0.2s ease;
}

.input-wrapper input::placeholder { color: var(--text-light); }

.toggle-password {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  opacity: .6;
  transition: var(--transition);
}
.toggle-password:hover { opacity: 1; }

/* ─── Buttons ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 24px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  text-decoration: none;
}

.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  color: var(--text-muted);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-loader.hidden, .hidden { display: none !important; }

.auth-footer { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }
.auth-footer a { color: #2563eb; }
.auth-footer a:hover { color: #1d4ed8; }

.auth-brand-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.6;
}

/* ─── Separador "ou" ─── */
.auth-or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 16px;
}
.auth-or-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}
.auth-or-text {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* ─── Botão Google ─── */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 20px;
  background: #fff;
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.btn-google:hover:not(:disabled) {
  background: #f8f9ff;
  border-color: #4f46e5;
  box-shadow: 0 2px 8px rgba(79,70,229,.15);
  transform: translateY(-1px);
}
.btn-google:active { transform: translateY(0); }
.btn-google:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ─── Recuperação de senha ─── */

/* Oculta/exibe blocos sem reflow de layout */
.rp-hidden { display: none !important; }

/* Linha da label com o link "Esqueci minha senha" no mesmo nível */
.rp-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.rp-label-row label { margin: 0; }

/* Link "Esqueci minha senha?" — alinhado à direita da label Senha */
.rp-forgot-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;          /* menor que a label (13px) */
  font-weight: 500;
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
  line-height: 1;
}
.rp-forgot-link:hover { color: #1d4ed8; text-decoration: underline; }

/* Cabeçalho do painel de recuperação */
.rp-header {
  text-align: center;
  margin-bottom: 20px;
}
.rp-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 10px;
}
.rp-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.rp-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Link "← Voltar para o login" */
.rp-back-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  padding: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: center;
  transition: color .15s;
}
.rp-back-link:hover { color: var(--primary); }

/* ───────────────────────────────────────────────────
   DASHBOARD LAYOUT
   ─────────────────────────────────────────────────── */
.dashboard-body {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
}

/* ─── Sidebar ─── */
/* ── Sidebar legada: oculta — layout migrado para topnav ─── */
.sidebar { display: none !important; }

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

/* ── Texto "Zyon PDV" na sidebar ─────────────────────────── */
.sidebar-brand-link {
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  user-select: none;
}

.brand-word-dark {
  color: #1f2937;
}

.brand-word-blue {
  color: #2563eb;
}

/* Logo empresa fora da sidebar (preview perfil, outros contextos) */
img.sidebar-company-logo {
  height: 48px;
  max-width: 160px;
  object-fit: contain;
  display: block;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.brand-name { font-size: 15px; font-weight: 700; color: var(--text); }

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 1px 6px;
  border-radius: 4px;
  width: fit-content;
}

.sidebar-close {
  margin-left: auto;
  display: none;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.nav-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.nav-item.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,.3);
}

.nav-icon { font-size: 18px; }

.sidebar-footer { padding: 20px; border-top: 1px solid var(--border); }

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  background: none;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-logout:hover { border-color: var(--danger); color: var(--danger); background: #FEF2F2; }

/* ─── Main Content ─── */
.main-content {
  margin-left: 0;
  margin-top: var(--topnav-h);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--topnav-h));
  max-width: 100%;
  overflow-x: hidden;
  /* centraliza o conteúdo horizontal */
  width: 100%;
}

/* Wrapper de centralização — aplicado ao conteúdo interno de cada página */
.page-content {
  max-width: 1360px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 24px 28px;
  box-sizing: border-box;
}

/* ─── Topbar legado (vazio agora) ─── */
.topbar { display: none; }

/* ═══════════════════════════════════════════════════════════
   TOPNAV — Menu horizontal fixo no topo
   ═══════════════════════════════════════════════════════════ */
.topnav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topnav-h);
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 0;
  z-index: 200;
}

.tnav-brand, .tnav-user, .tnav-hamburger {
  flex-shrink: 0;
}

/* Logo */
.tnav-brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 20px;
  white-space: nowrap;
}

/* Links container — ocupa o espaço central */
.tnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-shrink: 1;
}

/* Item de nav */
.tnav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tnav-item:hover {
  background: #f1f5f9;
  color: #1e293b;
  text-decoration: none;
}
.tnav-active {
  background: #eef2ff;
  color: var(--primary);
  font-weight: 600;
}
.tnav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
}
.tnav-chevron {
  width: 14px; height: 14px;
  margin-left: 2px;
  transition: transform .2s;
}

/* Dropdown Financeiro */
.tnav-dd-wrap {
  position: relative;
}
.tnav-dd-trigger { cursor: pointer; }
.tnav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  min-width: 200px;
  z-index: 300;
  padding: 4px;
}
.tnav-dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border-radius: 7px;
  transition: background .15s, color .15s;
}
.tnav-dd-item:hover {
  background: #f1f5f9;
  color: var(--primary);
  text-decoration: none;
}
.tnav-dd-active {
  background: #eef2ff;
  color: var(--primary);
  font-weight: 600;
}
.tnav-dd-icon { width: 15px; height: 15px; flex-shrink: 0; }

/* Área do usuário */
.tnav-user {
  margin-left: auto;
  flex-shrink: 0;
}

/* Hamburguer mobile */
.tnav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px; height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  flex-shrink: 0;
}
.tnav-hamburger span {
  display: block;
  height: 2px;
  background: #4b5563;
  border-radius: 2px;
  transition: all .2s;
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.topbar-title { font-size: 18px; font-weight: 600; color: var(--text); }

.user-badge { display: flex; align-items: center; gap: 12px; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #e2e8f0;
}

.user-avatar img,
img.client-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-avatar-big {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
}

.user-avatar-big img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.user-info { display: flex; flex-direction: column; }
.user-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.user-role  { font-size: 11px; color: var(--text-muted); }

/* ─── Loading Screen ─── */
.loading-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 15px;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ─── Dashboard Content ─── */
#dashboard-content { padding: 28px; flex: 1; }

/* ─── Expiry Warning ─── */
.expiry-warning {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-left: 4px solid var(--warning);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  animation: fadeIn .4s ease;
}

.warning-icon { font-size: 24px; flex-shrink: 0; }
.warning-text { flex: 1; }
.warning-text strong { display: block; color: #92400E; font-size: 14px; }
.warning-text span   { color: #B45309; font-size: 13px; }

.btn-warning-action {
  padding: 8px 16px;
  background: var(--warning);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: var(--transition);
}
.btn-warning-action:hover { background: #D97706; text-decoration: none; }

/* ─── Section ─── */
.section { display: none; }
.section.active { display: block; }

.section-header { margin-bottom: 24px; }
.section-header h2 { font-size: 22px; font-weight: 700; color: var(--text); }
.section-header p  { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-top: 3px solid transparent;
}

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-blue   { border-top-color: var(--info); }
.stat-green  { border-top-color: var(--success); }
.stat-purple { border-top-color: var(--purple); }
.stat-orange { border-top-color: var(--orange); }

.stat-icon { font-size: 32px; }
.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.stat-value { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Info Card ─── */
.info-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.info-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 20px; color: var(--text); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.info-value { font-size: 14px; font-weight: 600; color: var(--text); }
.info-value.mono  { font-family: monospace; font-size: 12px; word-break: break-all; }
.info-value.small { font-size: 12px; }

/* ─── Company Profile ─── */
.company-profile { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }

.company-avatar {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  flex-shrink: 0;
}

.company-details h3 { font-size: 20px; font-weight: 700; color: var(--text); }
.company-details p  { font-size: 14px; color: var(--text-muted); margin: 4px 0 8px; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-blue   { background: var(--primary-light); color: var(--primary); }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-yellow { background: #FEF9C3; color: #854D0E; }

/* ─── Subscription Card ─── */
.subscription-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.subscription-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.plan-badge {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.status-badge {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.subscription-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.sub-item { display: flex; flex-direction: column; gap: 4px; }
.sub-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }
.sub-value { font-size: 15px; font-weight: 600; color: var(--text); }

/* Progress Bar */
.subscription-progress { margin-bottom: 24px; }

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--purple));
  border-radius: 999px;
  transition: width .6s ease;
}

.subscription-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ─── Expired Overlay ─── */
.expired-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 24px;
  backdrop-filter: blur(8px);
}

.expired-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 48px 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,.4);
  animation: slideUp .4s ease;
}

.expired-icon { font-size: 64px; margin-bottom: 20px; }

.expired-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 12px;
}

.expired-card p {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.expired-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.expired-actions .btn-primary { width: auto; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .main-content { margin-left: 0; }
  #dashboard-content { padding: 16px; }
  .auth-card { padding: 28px 24px; }
  .company-profile { flex-direction: column; text-align: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Topnav mobile */
  .tnav-hamburger { display: flex; }
  .tnav-links {
    display: none;
    position: absolute;
    top: var(--topnav-h);
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: column;
    padding: 8px 12px;
    gap: 2px;
    z-index: 199;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
  }
  .tnav-links.tnav-links-open { display: flex; }
  .tnav-dd-wrap { width: 100%; }
  .tnav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    padding: 0 0 0 16px;
  }
  .tnav-item { width: 100%; }
  .tnav-user { margin-left: 0; }
  .topnav { padding: 0 16px; gap: 8px; }
}

@media (max-width: 1366px) {
  .page-content { padding: 16px 20px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .info-grid   { grid-template-columns: 1fr; }
  .subscription-details { grid-template-columns: 1fr; }
}

/* ───────────────────────────────────────────────────
   UTILITIES
   ─────────────────────────────────────────────────── */
.mt-24   { margin-top: 24px; }
/* .page-content base — centralizado e com max-width; veja bloco .main-content acima */

/* ───────────────────────────────────────────────────
   PRODUTOS — TOOLBAR E CABEÇALHO
   ─────────────────────────────────────────────────── */
.section-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.section-title { font-size: 22px; font-weight: 700; color: var(--text); }
.section-desc  { font-size: 14px; color: var(--text-muted); margin-top: 2px; }

.btn-add {
  width: auto;
  white-space: nowrap;
  padding: 11px 20px;
  font-size: 14px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.filter-select {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  min-width: 180px;
}

.filter-select:focus { border-color: var(--primary); }

/* ── Banner de estoque baixo ────────────────────────── */
.low-stock-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  padding: 13px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  color: #991B1B;
  animation: fadeIn .3s ease;
}

/* ───────────────────────────────────────────────────
   TABELA DE PRODUTOS
   ─────────────────────────────────────────────────── */
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

.products-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.products-table thead {
  background: #F8FAFC;
  border-bottom: 2px solid var(--border);
}

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

.products-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.products-table tbody tr { transition: background .15s ease; }
.products-table tbody tr:last-child td { border-bottom: none; }
.products-table tbody tr:hover { background: #F8FAFC; }

/* Linha de estoque baixo */
.row-low-stock { background: #FFF5F5 !important; }
.row-low-stock:hover { background: #FEE2E2 !important; }

/* Célula do nome do produto */
.product-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.row-low-stock .product-avatar {
  background: linear-gradient(135deg, var(--danger), #F97316);
}

.product-name {
  font-weight: 600;
  color: var(--text);
}

/* Preço */
.price-value { color: var(--success); font-size: 14px; }

/* Estoque numérico */
.stock-number {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.stock-number-low { color: var(--danger); }

.min-stock {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Badge de status do estoque */
.stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.stock-ok  { background: #D1FAE5; color: #065F46; }
.stock-low { background: #FEE2E2; color: #991B1B; animation: pulse-red 2s infinite; }

@keyframes pulse-red {
  0%, 100% { background: #FEE2E2; }
  50%       { background: #FECACA; }
}

.date-cell { color: var(--text-muted); font-size: 13px; }

/* Botões de ação */
.action-btns { display: flex; gap: 6px; }

.btn-action {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-edit   { background: #EEF2FF; }
.btn-edit:hover   { background: #C7D2FE; transform: scale(1.1); }
.btn-delete { background: #FEF2F2; }
.btn-delete:hover { background: #FECACA; transform: scale(1.1); }

/* ── Estados vazios ─────────────────────────────────── */
.empty-state {
  padding: 56px 24px;
  text-align: center;
}

.empty-icon { font-size: 56px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; color: var(--text-muted); }

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

.modal-card {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  animation: slideUp .25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-sm { max-width: 420px; }

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

.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--text); }

.modal-close {
  width: 30px;
  height: 30px;
  background: var(--bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-muted);
}

.modal-close:hover { background: var(--border); color: var(--text); }

.modal-card form { padding: 20px 24px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.full-width { grid-column: 1 / -1; }

.required { color: var(--danger); }

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

.modal-footer .btn-primary  { width: auto; padding: 11px 20px; font-size: 14px; }
.modal-footer .btn-outline  { width: auto; padding: 11px 20px; font-size: 14px; }

/* Modal de exclusão */
.delete-body {
  padding: 24px;
  text-align: center;
}

.delete-icon { font-size: 48px; margin-bottom: 16px; }
.delete-body p  { font-size: 15px; color: var(--text-muted); margin-bottom: 4px; }
.delete-body strong { font-size: 15px; color: var(--text); display: block; margin-bottom: 8px; }
.delete-warn { font-size: 13px; color: var(--danger) !important; margin-top: 8px !important; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-danger:hover { background: #DC2626; transform: translateY(-1px); }
.btn-danger:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Responsive produtos ─────────────────────────── */
@media (max-width: 768px) {
  .section-topbar { flex-direction: column; align-items: stretch; }
  .btn-add        { text-align: center; }
  .toolbar        { flex-direction: column; }
  .filter-select  { min-width: unset; width: 100%; }
  .form-grid      { grid-template-columns: 1fr; }
  .page-content   { padding: 16px; }
  .products-table th:nth-child(6),
  .products-table td:nth-child(6) { display: none; } /* oculta data no mobile */
}

@media (max-width: 480px) {
  .products-table th:nth-child(4),
  .products-table td:nth-child(4) { display: none; } /* oculta estoque mínimo */
}

/* ───────────────────────────────────────────────────
   PRODUTOS — NOVA UI SAAS (prefixo prd-)
   ─────────────────────────────────────────────────── */

/* Cabeçalho da seção */
/* Cabeçalho exclusivo da página de Produtos (coluna: título + botões à esquerda) */
.prd-page-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.prd-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prd-header-icon {
  width: 44px;
  height: 44px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Botão Novo Produto */
/* ── Grupo de ações da página de produtos ─────────────────── */
.prd-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Área de drag & drop para Excel ──────────────────────── */
.excel-drop-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  padding: 22px 24px;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  background: #f9fafb;
  color: #6b7280;
  cursor: pointer;
  transition: background .2s, border-color .2s;
  user-select: none;
}
.excel-drop-area:hover {
  background: #eef2ff;
  border-color: #3b82f6;
}
.excel-drop-area.dragover {
  background: #dbeafe;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Base compartilhada para todos os botões de ação */
.prd-btn-new,
.prd-btn-import {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
  white-space: nowrap;
}

/* Novo Produto — azul primário */
.prd-btn-new {
  background: #2563eb;
  color: #fff;
}
.prd-btn-new:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

/* Importar Excel — verde */
.prd-btn-excel {
  background: #16a34a;
  color: #fff;
}
.prd-btn-excel:hover {
  background: #15803d;
  box-shadow: 0 4px 12px rgba(22,163,74,.35);
  transform: translateY(-1px);
}

/* Importar XML — laranja */
.prd-btn-xml {
  background: #ea580c;
  color: #fff;
}
.prd-btn-xml:hover {
  background: #c2410c;
  box-shadow: 0 4px 12px rgba(234,88,12,.35);
  transform: translateY(-1px);
}

/* Baixar Modelo — cinza neutro */
.prd-btn-download {
  background: #6b7280;
  color: #fff;
}
.prd-btn-download:hover {
  background: #4b5563;
  box-shadow: 0 4px 12px rgba(107,114,128,.35);
  transform: translateY(-1px);
}

.prd-btn-new:active,
.prd-btn-import:active { transform: translateY(0); }

/* Card genérico */
.prd-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04);
  margin-bottom: 20px;
  overflow: hidden;
}

/* Card de busca */
.prd-search-card {
  padding: 16px 20px;
}

.prd-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Campo de busca com ícone */
.prd-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.prd-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #94a3b8;
  pointer-events: none;
}

.prd-search-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color .2s, box-shadow .2s, background .2s;
  box-sizing: border-box;
}
.prd-search-input::placeholder { color: #94a3b8; }
.prd-search-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Filtro de estoque */
.prd-filter-select {
  height: 44px;
  padding: 0 36px 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  white-space: nowrap;
  min-width: 180px;
}
.prd-filter-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background-color: #fff;
}

/* Banner de alerta estoque baixo */
.prd-alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  color: #92400e;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Tabela de produtos */
.prd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.prd-table thead {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.prd-table th {
  padding: 13px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
}
.prd-th-price  { text-align: right; }
.prd-th-stock  { text-align: center; }
.prd-th-actions{ text-align: center; }
.prd-th-date   { white-space: nowrap; }

.prd-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.prd-table tbody tr:last-child td { border-bottom: none; }
.prd-table tbody tr:hover { background: #f8fafc; transition: background .15s; }

/* Linha de estoque crítico */
.prd-row-low  { background: #fff5f5 !important; }
.prd-row-low:hover  { background: #fee2e2 !important; }
.prd-row-warn { background: #fffbeb !important; }
.prd-row-warn:hover { background: #fef3c7 !important; }

/* Célula do nome do produto */
.prd-name-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.prd-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.5px;
}
.prd-row-low .prd-avatar {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.prd-name {
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}
.prd-sku {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 2px;
}

/* Badge de preço */
.prd-price-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  float: right;
}

/* Badge de categoria */
.prd-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: #f1f5f9;
  color: #475569;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

/* Indicador de estoque */
.prd-stock-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.prd-stock-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prd-stock-dot-green  { background: #22c55e; }
.prd-stock-dot-yellow { background: #f59e0b; }
.prd-stock-dot-red    { background: #ef4444; animation: prd-pulse-red 1.8s infinite; }

@keyframes prd-pulse-red {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

.prd-stock-num {
  font-size: 15px;
  font-weight: 700;
}
.prd-stock-num-green  { color: #16a34a; }
.prd-stock-num-yellow { color: #d97706; }
.prd-stock-num-red    { color: #dc2626; }

/* Badge de status */
.prd-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.prd-status-ok  { background: #d1fae5; color: #065f46; }
.prd-status-low { background: #fee2e2; color: #991b1b; }
.prd-status-mid { background: #fef3c7; color: #92400e; }

/* Data */
.prd-date-cell { color: #94a3b8; font-size: 13px; white-space: nowrap; }

/* Botões de ação */
.prd-action-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.prd-btn-action {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, transform .15s;
}
.prd-btn-action:hover { transform: scale(1.12); }

.prd-btn-edit {
  background: #eff6ff;
  color: #2563eb;
}
.prd-btn-edit:hover { background: #dbeafe; }

.prd-btn-del {
  background: #fef2f2;
  color: #dc2626;
}
.prd-btn-del:hover { background: #fee2e2; }

/* Empty states */
.prd-empty {
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.prd-empty-icon {
  width: 56px;
  height: 56px;
  color: #cbd5e1;
}
.prd-empty-title {
  font-size: 17px;
  font-weight: 600;
  color: #475569;
  margin: 0;
}
.prd-empty-desc {
  font-size: 14px;
  color: #94a3b8;
  margin: 0;
}

/* ── Modal de Produtos ── */
.prd-modal-card {
  max-width: 900px;
  width: 100%;
  border-radius: 14px;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 92vh;
  animation: slideUp .22s ease;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
}

.prd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
}

.prd-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prd-modal-icon {
  width: 40px;
  height: 40px;
  background: #eff6ff;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2563eb;
  flex-shrink: 0;
}

.prd-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.prd-modal-subtitle {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 2px 0 0;
}

.prd-modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s;
}
.prd-modal-close:hover { background: #e2e8f0; color: #1e293b; }

/* Corpo do modal (rolagem gerenciada pelo card) */
.prd-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

/* Cards internos do formulário */
.prd-form-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}



.prd-form-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.prd-form-card-icon {
  width: 16px;
  height: 16px;
  color: #2563eb;
}

.prd-form-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.prd-form-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Grids de formulário */
.prd-form-grid {
  display: grid;
  gap: 14px;
}
.prd-form-grid-1 { grid-template-columns: 1fr; }
.prd-form-grid-2 { grid-template-columns: 1fr 1fr; }
.prd-form-grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Campos individuais */
.prd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prd-label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.prd-required { color: #ef4444; margin-left: 2px; }

.prd-input-wrap {
  position: relative;
}

.prd-input-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.prd-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.prd-input.prd-has-icon { padding-left: 38px; }
.prd-input::placeholder { color: #94a3b8; }
.prd-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Rodapé do modal (sticky igual ao modal de clientes) */
.prd-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  border-radius: 0 0 14px 14px;
}

/* Botão Cancelar */
.prd-btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.prd-btn-cancel:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* Botão Salvar */
.prd-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 22px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
}
.prd-btn-save:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37,99,235,.38);
  transform: translateY(-1px);
}
.prd-btn-save:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Botão Excluir (modal delete) */
.prd-btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 22px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
}
.prd-btn-delete:hover {
  background: #b91c1c;
  box-shadow: 0 4px 14px rgba(220,38,38,.38);
  transform: translateY(-1px);
}
.prd-btn-delete:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Modal de confirmação de exclusão */
.prd-delete-body {
  padding: 28px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.prd-delete-icon {
  width: 64px;
  height: 64px;
  background: #fef3c7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.prd-delete-msg {
  font-size: 15px;
  color: #475569;
  margin: 0;
}

.prd-delete-name {
  font-size: 16px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.prd-delete-warn {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

/* ── Select estilizado no modal ── */
.prd-select-wrap {
  position: relative;
}

.prd-select {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
}
.prd-select.prd-has-icon { padding-left: 38px; }
.prd-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.prd-select-arrow {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #94a3b8;
  pointer-events: none;
}

/* ── Textarea no modal ── */
.prd-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  box-sizing: border-box;
  line-height: 1.5;
}

/* Campo Descrição — largura total e espaço inferior garantidos */
.prd-field-desc {
  grid-column: 1 / -1;
  margin-bottom: 20px;
  width: 100%;
}
.prd-textarea::placeholder { color: #94a3b8; }
.prd-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ── Labels auxiliares e hints ── */
.prd-hint-label {
  font-size: 11.5px;
  font-weight: 400;
  color: #94a3b8;
  margin-left: 4px;
}

.prd-hint-text {
  font-size: 11.5px;
  color: #94a3b8;
  margin-top: 4px;
  display: block;
}

/* ── Painel de lucro / margem automático ── */
.prd-profit-panel {
  display: flex;
  align-items: center;
  gap: 0;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 4px;
  transition: border-color 0.2s, background 0.2s;
}
.prd-profit-panel.prd-profit-loss {
  background: #fff1f2;
  border-color: #fecdd3;
}
.prd-profit-panel.prd-profit-neutral {
  background: #f8fafc;
  border-color: #e2e8f0;
}
.prd-profit-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prd-profit-divider {
  width: 1px;
  height: 32px;
  background: #bbf7d0;
  margin: 0 16px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.prd-profit-panel.prd-profit-loss .prd-profit-divider {
  background: #fecdd3;
}
.prd-profit-panel.prd-profit-neutral .prd-profit-divider {
  background: #e2e8f0;
}
.prd-profit-label {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.prd-profit-value {
  font-size: 15px;
  font-weight: 700;
  color: #16a34a;
  line-height: 1.2;
}
.prd-profit-panel.prd-profit-loss .prd-profit-value {
  color: #dc2626;
}
.prd-profit-panel.prd-profit-neutral .prd-profit-value {
  color: #94a3b8;
}

/* ── Badge de status do produto (Ativo / Inativo) ── */
.prd-prod-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
  white-space: nowrap;
}

.prd-prod-ativo {
  background: #d1fae5;
  color: #065f46;
}

.prd-prod-inativo {
  background: #f1f5f9;
  color: #94a3b8;
}

/* ── Linha de produto inativo na tabela ── */
.prd-row-inativo td { opacity: .55; }
.prd-row-inativo .prd-name { text-decoration: line-through; color: #94a3b8; }
.prd-row-inativo .prd-avatar { background: #e2e8f0 !important; color: #94a3b8 !important; }

.prd-avatar-inativo {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
}

/* ── Categoria vazia ── */
.prd-cat-empty { color: #cbd5e1; }

/* Responsividade — tabela e modal */
@media (max-width: 900px) {
  /* Colapso do grid de campos do formulário */
  .prd-form-grid-2 { grid-template-columns: 1fr; }
  .prd-form-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .prd-toolbar { flex-direction: column; align-items: stretch; }
  .prd-search-wrap { min-width: unset; }
  .prd-filter-select { min-width: unset; width: 100%; }

  /* Modal ocupa quase toda a tela em mobile */
  .prd-modal-card {
    max-width: 100%;
    margin: 8px;
    max-height: calc(100vh - 16px);
  }

  /* Oculta coluna de categoria e data no mobile */
  .prd-table th:nth-child(2),
  .prd-table td:nth-child(2),
  .prd-table th:nth-child(6),
  .prd-table td:nth-child(6) { display: none; }
}

@media (max-width: 480px) {
  /* Oculta coluna Mín. em telas muito pequenas */
  .prd-table th:nth-child(4),
  .prd-table td:nth-child(4) { display: none; }

  .prd-modal-header,
  .prd-modal-body,
  .prd-modal-footer { padding-left: 16px; padding-right: 16px; }

  /* Botões do rodapé em coluna no mobile muito pequeno */
  .prd-modal-footer { flex-direction: column-reverse; gap: 8px; }
  .prd-btn-cancel,
  .prd-btn-save { width: 100%; justify-content: center; }
}

/* ───────────────────────────────────────────────────
   CLIENTES — NOVA UI SAAS (prefixo cli-)
   ─────────────────────────────────────────────────── */

/* Cabeçalho da seção */
.cli-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cli-header-icon {
  width: 44px;
  height: 44px;
  background: #eff6ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Botão Novo Cliente */
.cli-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
  white-space: nowrap;
}
.cli-btn-new:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.cli-btn-new:active { transform: translateY(0); }

/* Card genérico */
.cli-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07), 0 0 0 1px rgba(0,0,0,.04);
  margin-bottom: 20px;
  overflow: hidden;
}

/* Card de busca */
.cli-search-card {
  padding: 16px 20px;
}

.cli-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Campo de busca */
.cli-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.cli-search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: #94a3b8;
  pointer-events: none;
}

.cli-search-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 40px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color .2s, box-shadow .2s, background .2s;
  box-sizing: border-box;
}
.cli-search-input::placeholder { color: #94a3b8; }
.cli-search-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* Filtro de tipo */
.cli-filter-select {
  height: 44px;
  padding: 0 36px 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  white-space: nowrap;
  min-width: 200px;
}
.cli-filter-select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background-color: #fff;
}

/* ── Tabela de clientes ── */
.cli-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cli-table thead {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}

.cli-table th {
  padding: 13px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .6px;
  white-space: nowrap;
}

.cli-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.cli-table tbody tr:last-child td { border-bottom: none; }
.cli-table tbody tr:hover { background: #f8fafc; transition: background .15s; }

/* Alinhamento de colunas */
.cli-th-tipo    { white-space: nowrap; }
.cli-th-actions { text-align: center; }
.cli-th-date    { white-space: nowrap; }

/* Célula do nome do cliente */
.cli-name-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.cli-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.3px;
}

.cli-name-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cli-name {
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.cli-name-sub {
  font-size: 12px;
  color: #94a3b8;
}

/* Badge tipo de pessoa */
.cli-tipo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.cli-tipo-pf { background: #dbeafe; color: #1d4ed8; }
.cli-tipo-pj { background: #f3e8ff; color: #7e22ce; }

/* Badge de documento */
.cli-doc-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}

.cli-doc-cpf  { background: #f0fdf4; color: #166534; }
.cli-doc-cnpj { background: #fefce8; color: #854d0e; }
.cli-doc-none { color: #94a3b8; }

/* Telefone, e-mail, data, vazio */
.cli-phone { font-size: 13px; color: #475569; white-space: nowrap; }
.cli-email {
  font-size: 13px;
  color: #2563eb;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
.cli-td-date { color: #94a3b8; font-size: 13px; white-space: nowrap; }
.cli-empty-val { color: #cbd5e1; font-size: 13px; }

/* Botões de ação */
.cli-action-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cli-btn-action {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, transform .15s;
}
.cli-btn-action:hover { transform: scale(1.12); }

.cli-btn-edit { background: #eff6ff; color: #2563eb; }
.cli-btn-edit:hover { background: #dbeafe; }

.cli-btn-del { background: #fef2f2; color: #dc2626; }
.cli-btn-del:hover { background: #fee2e2; }

/* Empty states */
.cli-empty {
  padding: 56px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.cli-empty-icon {
  width: 56px;
  height: 56px;
  color: #cbd5e1;
}
.cli-empty-title {
  font-size: 17px;
  font-weight: 600;
  color: #475569;
  margin: 0;
}
.cli-empty-desc {
  font-size: 14px;
  color: #94a3b8;
  margin: 0;
}

/* ── Modal de Exclusão de Cliente ── */
.cli-delete-modal {
  max-width: 400px;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  padding: 0;
}

.cli-delete-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px 16px 0;
}

.cli-delete-close {
  width: 30px;
  height: 30px;
  border: none;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s, color .18s;
}
.cli-delete-close:hover { background: #e2e8f0; color: #1e293b; }

.cli-delete-body {
  padding: 4px 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.cli-delete-icon-wrap {
  width: 68px;
  height: 68px;
  background: #fee2e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.cli-delete-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.cli-delete-msg {
  font-size: 14px;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}

.cli-delete-warn {
  font-size: 13px;
  color: #94a3b8;
  margin: 0;
}

.cli-delete-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px 24px;
}

/* Botão Cancelar do modal delete */
.cli-btn-cancel-del {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.cli-btn-cancel-del:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* Botão Confirmar Exclusão */
.cli-btn-confirm-del {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 22px;
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
}
.cli-btn-confirm-del:hover {
  background: #b91c1c;
  box-shadow: 0 4px 14px rgba(220,38,38,.38);
  transform: translateY(-1px);
}
.cli-btn-confirm-del:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Responsividade clientes */
@media (max-width: 768px) {
  .cli-toolbar { flex-direction: column; align-items: stretch; }
  .cli-search-wrap { min-width: unset; }
  .cli-filter-select { min-width: unset; width: 100%; }

  /* Oculta e-mail e data no mobile */
  .cli-table th:nth-child(5),
  .cli-table td:nth-child(5),
  .cli-table th:nth-child(6),
  .cli-table td:nth-child(6) { display: none; }
}

@media (max-width: 480px) {
  /* Oculta CPF/CNPJ em telas muito pequenas */
  .cli-table th:nth-child(3),
  .cli-table td:nth-child(3) { display: none; }
}

/* ───────────────────────────────────────────────────
   CLIENTES — ESTILOS ESPECÍFICOS
   ─────────────────────────────────────────────────── */

/* ── Modal largo ──────────────────────────────────── */
.modal-lg { max-width: 680px; }

/* ── Seções dentro do modal ───────────────────────── */
.modal-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ── Grid 3 colunas no modal ─────────────────────── */
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group-2col { grid-column: span 2; }

/* ── Campo CEP com botão ─────────────────────────── */
.cep-search-btn {
  position: absolute;
  right: 10px;
  background: var(--primary-light);
  border: none;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--primary);
  flex-shrink: 0;
}

.cep-search-btn:hover    { background: var(--primary); color: #fff; }
.cep-search-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Feedback do campo ────────────────────────────── */
/* Definições consolidadas no bloco CLIENTES FORMULÁRIO SAAS abaixo */
.field-hint   { font-size: 12px; margin-top: 4px; display: block; min-height: 16px; }
.hint-ok      { color: var(--success); }
.hint-warn    { color: var(--warning); }
.hint-error   { color: var(--danger); }
.hint-info    { color: var(--info); }

/* ── Textarea ─────────────────────────────────────── */
.textarea-field {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: var(--transition);
  line-height: 1.5;
}

.textarea-field:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.textarea-field::placeholder { color: var(--text-light); }

/* ── Avatar do cliente (verde) ────────────────────── */
.customer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Info do cliente na tabela ────────────────────── */
.customer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.customer-obs {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* ── Badges de documento ──────────────────────────── */
.doc-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: monospace;
  white-space: nowrap;
}

.doc-cpf  { background: #EEF2FF; color: var(--primary); }
.doc-cnpj { background: #F0FDF4; color: #065F46; }
.doc-none { background: var(--bg); color: var(--text-muted); font-family: inherit; }

/* ── Telefone / Localização ───────────────────────── */
.phone-value    { font-size: 13px; color: var(--text); white-space: nowrap; }
.location-value { font-size: 13px; color: var(--text-muted); white-space: nowrap; }

/* ── Responsive clientes ──────────────────────────── */
@media (max-width: 900px) {
  .form-grid-3       { grid-template-columns: 1fr 1fr; }
  .form-group-2col   { grid-column: span 2; }
  .modal-lg          { max-width: 100%; }
}

@media (max-width: 600px) {
  .form-grid-3       { grid-template-columns: 1fr; }
  .form-group-2col   { grid-column: span 1; }
  /* Oculta localidade e doc no mobile */
  .products-table th:nth-child(3),
  .products-table td:nth-child(3),
  .products-table th:nth-child(4),
  .products-table td:nth-child(4) { display: none; }
}

/* ── Toast notification ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  z-index: 9999;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width: 320px;
}
.toast.toast-show {
  opacity: 1;
  transform: translateY(0);
}
.toast.toast-success { background: #16a34a; }
.toast.toast-error   { background: #dc2626; }
.toast.toast-info    { background: #2563eb; }
@media (max-width: 600px) {
  .toast { right: 12px; left: 12px; max-width: unset; bottom: 16px; }
}

/* ═══════════════════════════════════════════════
   CUPOM NÃO FISCAL — Impressão Térmica
   ═══════════════════════════════════════════════ */

/* ── Cupom não-fiscal — invisível na tela, visível apenas ao imprimir ── */
/* ════════════════════════════════════════════════════════════
   CUPOM TÉRMICO — 58 mm
   Área de impressão: oculta na tela, visível apenas ao imprimir
════════════════════════════════════════════════════════════ */
#receipt-print-area {
  display: none; /* visível somente via @media print */
}

/* ── Classes utilitárias (usadas pelo JS ao montar o HTML) ── */
.receipt-center      { text-align: center; }
.receipt-divider     { border: none; border-top: 1px dashed #000; margin: 5px 0; }
.receipt-double-line { border: none; border-top: 2px solid #000; margin: 5px 0; }
.receipt-total       { font-weight: bold; text-align: right; }

/* ════════════════════════════════════════════════════════════
   @media print — Impressora térmica 58 mm
   Técnica: visibility:hidden em tudo → visible só no cupom.
   Isso evita que containers com min-height:100vh gerem
   páginas em branco extras.
════════════════════════════════════════════════════════════ */
@media print {

  /* 1 ── Página: rolo 72 mm contínuo, altura automática (sem corte fixo) */
  @page {
    size: 72mm auto;
    margin: 0;
  }

  /* 2 ── html / body: exatamente 72 mm, sem margens */
  html, body {
    width: 72mm !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: hidden !important;
  }

  /* 3 ── Zera alturas de todos os descendentes do body
          (evita página em branco por min-height:100vh) */
  body > *,
  body * {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* 4 ── Oculta TODO o conteúdo da página */
  body * {
    visibility: hidden !important;
  }

  /* 5 ── Revela APENAS o cupom e seus filhos */
  #receipt-print-area,
  #receipt-print-area * {
    visibility: visible !important;
  }

  /* 6 ── Cupom: topo absoluto, isolado, 72 mm
          position:absolute renderiza UMA vez (não repete por página
          como fazia o position:fixed) */
  #receipt-print-area {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 72mm !important;
    max-width: 72mm !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 4mm 3mm 6mm !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
    page-break-inside: avoid !important;
    page-break-before: avoid !important;
    page-break-after:  avoid !important;
    break-inside: avoid !important;
    /* Tipografia base */
    font-family: 'Courier New', Courier, monospace !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* 7 ── Reset global dos filhos */
  #receipt-print-area * {
    font-family: 'Courier New', Courier, monospace !important;
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* ── CABEÇALHO ─────────────────────────────────────────── */
  #receipt-print-area .receipt-header-empresa {
    font-size: 14px !important;
    font-weight: 900 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.3 !important;
    margin-bottom: 1mm !important;
    word-break: break-word !important;
  }
  #receipt-print-area .receipt-header-cnpj {
    font-size: 10px !important;
    font-weight: 400 !important;
    text-align: center !important;
    margin-bottom: 2mm !important;
  }
  #receipt-print-area .receipt-header-titulo {
    font-size: 12px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
    text-align: center !important;
    margin: 1mm 0 0 !important;
  }
  #receipt-print-area .receipt-header-sub {
    font-size: 9px !important;
    font-weight: 400 !important;
    text-align: center !important;
    color: #333 !important;
    margin-bottom: 1mm !important;
  }

  /* ── DIVISORES ──────────────────────────────────────────── */
  #receipt-print-area .receipt-divider {
    border: none !important;
    border-top: 1px dashed #000 !important;
    margin: 4px 0 !important;
    height: 0 !important;
  }
  #receipt-print-area .receipt-double-line {
    border: none !important;
    border-top: 2px solid #000 !important;
    margin: 4px 0 !important;
    height: 0 !important;
  }

  /* ── TABELA: DADOS DO PEDIDO ────────────────────────────── */
  #receipt-print-area .receipt-info-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
    margin: 1mm 0 !important;
  }
  #receipt-print-area .receipt-info-table td {
    padding: 1px 0 !important;
    vertical-align: top !important;
    line-height: 1.4 !important;
  }
  #receipt-print-area .receipt-info-table td:first-child {
    font-weight: 700 !important;
    white-space: nowrap !important;
    padding-right: 4px !important;
    width: 42% !important;
  }
  #receipt-print-area .receipt-info-table td:last-child {
    text-align: right !important;
    font-weight: 400 !important;
    word-break: break-word !important;
  }

  /* ── TÍTULO DE SEÇÃO ────────────────────────────────────── */
  #receipt-print-area .receipt-section-title {
    font-size: 11px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin: 2mm 0 1mm !important;
  }

  /* ── TABELA: ITENS ──────────────────────────────────────── */
  #receipt-print-area .receipt-items-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
  }
  #receipt-print-area .receipt-items-head th {
    font-size: 10px !important;
    font-weight: 900 !important;
    border-bottom: 1px solid #000 !important;
    padding: 1px 0 2px !important;
    text-align: left !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }
  #receipt-print-area .receipt-items-head th:nth-child(2) {
    text-align: right !important;
  }
  #receipt-print-area .receipt-item-name td {
    font-size: 12px !important;
    font-weight: 700 !important;
    padding: 3px 0 1px !important;
    word-break: break-word !important;
    line-height: 1.3 !important;
  }
  #receipt-print-area .receipt-item-detail td {
    font-size: 11px !important;
    font-weight: 400 !important;
    padding: 0 0 4px !important;
    border-bottom: 1px dotted #555 !important;
    vertical-align: top !important;
    white-space: nowrap !important;
  }
  #receipt-print-area .receipt-item-detail td.rid-qty {
    width: 30% !important;
    text-align: left !important;
  }
  #receipt-print-area .receipt-item-detail td.rid-total {
    width: 70% !important;
    text-align: right !important;
  }

  /* ── TABELA: TOTAIS ─────────────────────────────────────── */
  #receipt-print-area .receipt-totals-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
    margin-top: 1mm !important;
  }
  #receipt-print-area .receipt-totals-table td {
    padding: 1px 0 !important;
    vertical-align: middle !important;
  }
  #receipt-print-area .receipt-totals-table td:first-child {
    font-weight: 700 !important;
  }
  #receipt-print-area .receipt-totals-table td:last-child {
    text-align: right !important;
    font-weight: 600 !important;
  }
  #receipt-print-area .receipt-row-discount td {
    font-style: italic !important;
    font-size: 11px !important;
    color: #333 !important;
  }
  #receipt-print-area .receipt-row-total td {
    font-size: 16px !important;
    font-weight: 900 !important;
    padding-top: 2mm !important;
    border-top: 2px solid #000 !important;
    letter-spacing: 0.5px !important;
  }

  /* ── RODAPÉ ─────────────────────────────────────────────── */
  #receipt-print-area .receipt-footer {
    font-size: 10px !important;
    font-weight: 400 !important;
    text-align: center !important;
    margin-top: 3mm !important;
    line-height: 1.6 !important;
    word-break: break-word !important;
  }
  #receipt-print-area .receipt-footer-nf {
    font-size: 9px !important;
    font-weight: 700 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-top: 4mm !important;
    padding-top: 3mm !important;
    border-top: 1px dashed #000 !important;
  }
}


/* ===== SIDEBAR MODERNA ===== */

.sidebar {
  background-color: #f0f1f6;
  padding: 18px 12px;
}

.sidebar a {
  color: #1e293b;
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  background: transparent;
}

.sidebar a:hover {
  background: transparent;
  color: #2563eb;
}

.sidebar a.active {
  background-color: #2563eb;
  color: white;
}

.sidebar h2,
.sidebar .logo {
  margin-bottom: 20px;
}

.sidebar a {
  position: relative;
}

.sidebar a::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: #2563eb;
  transform: scaleY(0);
  transition: transform 0.2s ease;
  border-radius: 4px;
}

.sidebar a:hover::before {
  transform: scaleY(1);
}

.sidebar a.active::before {
  transform: scaleY(1);
}

/* ===== TOPBAR USER MENU ===== */

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.user-profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
  border-radius: 50%;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

/* ===== LOGO UPLOAD (Perfil) ===== */

.logo-upload-area {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.logo-preview-wrap {
  width: 100px;
  height: 100px;
  border-radius: 12px;
  border: 2px dashed #d1d5db;
  overflow: hidden;
  flex-shrink: 0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.logo-upload-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logo-upload-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.logo-label-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s;
}

.logo-label-btn:hover {
  background: #f1f5f9;
}



/* ═══════════════════════════════════════════════════════════════
   DASHBOARD — LAYOUT PADRÃO (tema claro)
   ═══════════════════════════════════════════════════════════════ */

/* ── Saudação ── */
.dash-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.dash-greeting-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.dash-greeting-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}
.dash-date {
  font-size: 0.82rem;
  color: var(--text-light);
  white-space: nowrap;
}

/* ── Grid de cards ── */
.dash-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .dash-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .dash-cards-grid { grid-template-columns: 1fr; } }

.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
}
.dash-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--primary-light);
}
.dash-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dash-card-icon svg { width: 22px; height: 22px; }
.dash-card-body { flex: 1; min-width: 0; }
.dash-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  display: block;
  margin-bottom: 4px;
}
.dash-card-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  display: block;
  line-height: 1.2;
}
.dash-card-sub {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-top: 4px;
  display: block;
}

/* Variantes de cor dos cards */
.dash-card-blue  .dash-card-icon { background: rgba(79,70,229,.12); color: var(--primary); }
.dash-card-green .dash-card-icon { background: rgba(16,185,129,.12); color: var(--success); }
.dash-card-yellow .dash-card-icon { background: rgba(245,158,11,.12); color: var(--warning); }
.dash-card-purple .dash-card-icon { background: rgba(139,92,246,.12); color: var(--purple); }
.dash-card-teal  .dash-card-icon { background: rgba(20,184,166,.12); color: #14b8a6; }

/* Delta (variação) */
.dash-card-delta {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}
.dash-card-delta.up   { background: rgba(16,185,129,.15); color: var(--success); }
.dash-card-delta.down { background: rgba(239,68,68,.15);  color: var(--danger); }
.dash-card-delta.neu  { background: rgba(100,116,139,.12); color: var(--text-muted); }

/* ── Linha 2: gráfico + alertas ── */
.dash-row-2 {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 900px) { .dash-row-2 { grid-template-columns: 1fr; } }

/* Gráfico */
.dash-chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.dash-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.dash-chart-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.dash-chart-badge {
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(79,70,229,.1);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 20px;
}
.dash-period-selector {
  display: flex;
  gap: 4px;
}
.dash-period-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.dash-period-btn:hover { color: var(--primary); border-color: var(--primary-light); }
.dash-period-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.dash-chart-body {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
}
.dash-chart-placeholder {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: auto;
}
.dash-bar-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.dash-bar-wrap {
  width: 100%;
  height: 100px;
  display: flex;
  align-items: flex-end;
  position: relative;
}
.dash-bar {
  width: 100%;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.7s cubic-bezier(.22,1,.36,1);
  position: relative;
}
.dash-bar:hover { opacity: 0.82; }
.dash-bar.bar-highlight { background: var(--success); }
.dash-bar-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.dash-bar-group:hover .dash-bar-tooltip { display: block; }
.dash-bar-month {
  font-size: 0.68rem;
  color: var(--text-light);
  text-align: center;
}
.dash-bar-val {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 12px;
}

/* Alertas */
.dash-alerts-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-alerts-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-alerts-list { display: flex; flex-direction: column; gap: 6px; }
.dash-alert-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.dash-alert-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
}
a.dash-alert-item:hover { opacity: 0.85; text-decoration: none; }
.dash-alert-item.alert-danger  { background: rgba(239,68,68,.1);  color: #dc2626; border-left: 3px solid #ef4444; }
.dash-alert-item.alert-warning { background: rgba(245,158,11,.1); color: #b45309; border-left: 3px solid #f59e0b; }
.dash-alert-item.alert-info    { background: rgba(59,130,246,.1); color: #2563eb; border-left: 3px solid #3b82f6; }
.dash-alert-item.alert-ok      { background: rgba(16,185,129,.1); color: #059669; border-left: 3px solid #10b981; }
.dash-alert-icon { font-size: 1rem; flex-shrink: 0; }
.dash-alert-arrow { margin-left: auto; font-size: 0.8rem; opacity: .5; }

/* ── Ações Rápidas ── */
.dash-quick-actions {
  margin-bottom: 24px;
}
.dash-quick-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 10px;
}
.dash-quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (max-width: 900px)  { .dash-quick-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .dash-quick-grid { grid-template-columns: 1fr 1fr; } }

.dash-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
}
.dash-quick-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(79,70,229,.05);
  transform: translateY(-1px);
}
.dash-quick-icon {
  font-size: 1.4rem;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(79,70,229,.08);
  border-radius: 10px;
}

/* ── Mini-cards ── */
.dash-row-3 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .dash-row-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px)  { .dash-row-3 { grid-template-columns: 1fr; } }

.dash-mini-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.dash-mini-card:hover { border-color: var(--primary-light); }
.dash-mini-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.dash-mini-icon { font-size: 1.1rem; }
.dash-mini-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.dash-badge-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}
.dash-badge-orange { background: rgba(249,115,22,.15); color: #ea580c; }
.dash-badge-red    { background: rgba(239,68,68,.15);  color: #dc2626; }
.dash-badge-teal   { background: rgba(20,184,166,.15); color: #0d9488; }
.dash-badge-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(16,185,129,.15);
  color: #059669;
}
.dash-badge-status.expired {
  background: rgba(239,68,68,.15);
  color: #dc2626;
}
.dash-mini-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 2px 0;
}
.dash-mini-sub strong { color: var(--text); }
.dash-mini-link {
  font-size: 0.78rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 6px;
}
.dash-mini-link:hover { text-decoration: underline; }

/* ── Spinner mini ── */
.spinner-sm {
  width: 14px; height: 14px;
  border: 2px solid rgba(79,70,229,.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .65s linear infinite;
  flex-shrink: 0;
}

/* ── Badges reutilizáveis ── */
.mt-24 { margin-top: 24px; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px; font-size: 0.73rem; font-weight: 700; }
.badge-blue   { background: rgba(79,70,229,.15);  color: var(--primary); }
.badge-green  { background: rgba(16,185,129,.15); color: var(--success); }
.badge-red    { background: rgba(239,68,68,.15);  color: var(--danger); }
.badge-yellow { background: rgba(245,158,11,.15); color: var(--warning); }

/* ═══════════════════════════════════════════════════════════════
   KPI CARDS — novo layout dashboard
   ═══════════════════════════════════════════════════════════════ */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  background: #ffffff;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 20px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  transition: box-shadow .2s, transform .2s;
}
.kpi-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.09);
  transform: translateY(-2px);
}

.kpi-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 22px; height: 22px; }

.kpi-icon-blue   { background: #eff6ff; color: #2563eb; }
.kpi-icon-purple { background: #f5f3ff; color: #7c3aed; }
.kpi-icon-green  { background: #f0fdf4; color: #16a34a; }
.kpi-icon-orange { background: #fff7ed; color: #ea580c; }

.kpi-body { flex: 1; min-width: 0; }

.kpi-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 4px;
}

.kpi-value {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.kpi-sub {
  display: block;
  font-size: 0.76rem;
  color: #94a3b8;
  margin-top: 3px;
}

.kpi-delta-up   { color: #16a34a; font-weight: 700; font-size: 0.76rem; }
.kpi-delta-down { color: #dc2626; font-weight: 700; font-size: 0.76rem; }

/* ═══════════════════════════════════════════════════════════════
   GRÁFICO DE LINHA — faturamento 7 dias
   ═══════════════════════════════════════════════════════════════ */

.line-chart-card {
  background: #ffffff;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,.05);
  margin-bottom: 24px;
}

.line-chart-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.line-chart-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.line-chart-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 3px 0 0;
}

.line-chart-badge {
  font-size: 0.8rem;
  font-weight: 700;
  background: #eff6ff;
  color: #2563eb;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.line-chart-body {
  position: relative;
  height: 240px;
}
.line-chart-body canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ── Mini-stack lateral (coluna de mini-cards) ── */
.dash-mini-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ═══════════════════════════════════════════════════════════════
   DB — NOVO LAYOUT DASHBOARD (3 linhas)
   ═══════════════════════════════════════════════════════════════ */

.db-page { padding: 24px; }

/* ── Saudação ── */
.db-greeting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.db-greeting-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.db-greeting-sub  { font-size: 0.85rem; color: #64748b; margin: 3px 0 0; }
.db-greeting-date { font-size: 0.8rem;  color: #94a3b8; }

/* ══════════════════════════════════════════════════════════════
   DASHBOARD — LAYOUT SAAS v3
   Linha 1: 4 KPI cards | Linha 2: Vendas + Gráfico c/ filtros
   Linha 3: Contas a Receber | Estoque Baixo | Mais Vendidos
══════════════════════════════════════════════════════════════ */

/* ── LINHA 1: KPI cards ── */
.db-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .db-kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .db-kpi-row { grid-template-columns: 1fr; } }

.db-kpi-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8ecf0;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
  transition: box-shadow .18s, transform .18s;
  position: relative;
  overflow: hidden;
}
.db-kpi-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.10);
  transform: translateY(-2px);
  text-decoration: none;
}

/* ícone quadrado com fundo colorido */
.db-kpi-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.db-kpi-icon-wrap svg { width: 22px; height: 22px; }

.db-kpi-icon-blue   { background: #eff6ff; color: #2563eb; }
.db-kpi-icon-green  { background: #f0fdf4; color: #16a34a; }
.db-kpi-icon-purple { background: #f5f3ff; color: #7c3aed; }
.db-kpi-icon-orange { background: #fff7ed; color: #ea580c; }

/* texto do KPI */
.db-kpi-body { flex: 1; min-width: 0; }
.db-kpi-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748b;
  margin-bottom: 4px;
}
.db-kpi-value {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: #0f172a;
}
.db-kpi-sub {
  display: block;
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* seta indicadora no canto */
.db-kpi-arrow {
  font-size: 1rem;
  color: #cbd5e1;
  flex-shrink: 0;
  transition: color .15s, transform .15s;
}
.db-kpi-card:hover .db-kpi-arrow { color: #94a3b8; transform: translateX(3px); }

/* borda esquerda colorida por variante */
.db-kpi-blue   { border-left: 4px solid #3b82f6; }
.db-kpi-green  { border-left: 4px solid #22c55e; }
.db-kpi-purple { border-left: 4px solid #8b5cf6; }
.db-kpi-orange { border-left: 4px solid #f97316; }

/* ── LINHA 2: Vendas Recentes + Gráfico com filtro ── */
.db-row-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 900px) { .db-row-2 { grid-template-columns: 1fr; } }

/* ── LINHA 3: 3 colunas ── */
.db-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .db-row-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px)  { .db-row-3 { grid-template-columns: 1fr; } }

/* ── Card genérico ── */
.db-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
}

/* header do card */
.db-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}
.db-card-title-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.db-card-title-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.db-card-title-icon svg { width: 14px; height: 14px; }

/* ícones coloridos de card */
.db-icon-blue   { background: #eff6ff; color: #2563eb; }
.db-icon-indigo { background: #eef2ff; color: #4f46e5; }
.db-icon-purple { background: #f5f3ff; color: #7c3aed; }
.db-icon-green  { background: #f0fdf4; color: #16a34a; }
.db-icon-yellow { background: #fefce8; color: #ca8a04; }
.db-icon-orange { background: #fff7ed; color: #ea580c; }
.db-icon-teal   { background: #f0fdfa; color: #0d9488; }

.db-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-card-link {
  font-size: 0.75rem;
  color: #4f46e5;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.db-card-link:hover { text-decoration: underline; }

/* ── Tabela de vendas recentes ── */
.db-table-wrap { overflow-x: auto; }
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.db-table th {
  text-align: left;
  padding: 7px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #94a3b8;
  border-bottom: 1px solid #f1f5f9;
}
.db-table td {
  padding: 10px 10px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
  color: #334155;
}
.db-table tr:last-child td { border-bottom: none; }
.db-table tr:hover td { background: #f8fafc; }
.db-table-date { color: #94a3b8; font-size: 0.78rem; }
.db-empty-row {
  text-align: center;
  color: #94a3b8;
  padding: 28px 12px;
  font-size: 0.83rem;
}
.db-table-client {
  display: flex;
  align-items: center;
  gap: 9px;
}
.db-table-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 0.67rem;
  font-weight: 800;
  flex-shrink: 0;
}
.db-table-name { font-weight: 600; color: #1e293b; font-size: 0.84rem; }

/* ── Status badges ── */
.db-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.db-status-concluida { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.db-status-pendente  { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.db-status-cancelada { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* ── Filtros de período ── */
.db-period-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.db-period-btn {
  padding: 5px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.db-period-btn:hover { border-color: #4f46e5; color: #4f46e5; background: #eef2ff; }
.db-period-active {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}
.db-period-active:hover { background: #4338ca; border-color: #4338ca; color: #fff; }

/* total do período no header */
.db-period-total {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f46e5;
  white-space: nowrap;
}

/* ── Wrapper do gráfico ── */
.db-chart-wrap {
  height: 170px;
  position: relative;
  margin-bottom: 12px;
}
.db-chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* Stats abaixo do gráfico */
.db-week-stats {
  display: flex;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
  flex-wrap: wrap;
}
.db-week-stat { display: flex; flex-direction: column; gap: 2px; }
.db-week-stat-label {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.db-week-stat-value { font-size: 0.88rem; font-weight: 700; color: #0f172a; }
.db-color-green  { color: #16a34a !important; }
.db-color-orange { color: #ea580c !important; }
.db-color-red    { color: #dc2626 !important; }

/* ── Contas a Receber — resumo numérico ── */
.db-recv-summary {
  display: flex;
  gap: 0;
  margin-bottom: 14px;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 14px;
}
.db-recv-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-right: 1px solid #e2e8f0;
  padding: 0 8px;
}
.db-recv-stat:last-child { border-right: none; }
.db-recv-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #94a3b8;
}
.db-recv-stat-value { font-size: 0.92rem; font-weight: 800; color: #0f172a; }

/* ── Listas genéricas (linha 3) ── */
.db-list { display: flex; flex-direction: column; gap: 5px; }
.db-list-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 0.82rem;
  padding: 12px 4px;
}
.db-list-empty {
  color: #94a3b8;
  font-size: 0.82rem;
  padding: 14px 4px;
  text-align: center;
}
.db-list-more {
  font-size: 0.75rem;
  color: #4f46e5;
  font-weight: 600;
  padding: 6px 4px 0;
  text-align: center;
}
.db-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 8px;
  transition: background .12s;
}
.db-list-item:hover { background: #f8fafc; }
.db-list-item-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #ea580c;
}
.db-icon-bg-orange { background: #fff7ed; color: #ea580c; }
.db-list-item-info { flex: 1; min-width: 0; }
.db-list-item-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.db-list-item-sub { font-size: 0.72rem; color: #94a3b8; margin-top: 1px; }
.db-list-item-right {
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
  color: #0f172a;
}
.db-list-item-right.red   { color: #dc2626; }
.db-list-item-right.muted { color: #94a3b8; }

/* ── Barra de progresso de estoque ── */
.db-stock-bar-wrap {
  height: 4px;
  background: #f1f5f9;
  border-radius: 4px;
  margin-top: 4px;
  overflow: hidden;
}
.db-stock-bar {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

/* ── Ranking de produtos mais vendidos ── */
.db-top-rank {
  font-size: 1rem;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Spinner small ── */
.spinner-sm {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid #e2e8f0;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── Alertas label (mantido para compatibilidade) ── */
.db-alerts-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  align-self: center;
  flex-shrink: 0;
}
.db-alerts-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.db-alerts-bar.hidden { display: none; }
.db-alert-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity .15s;
}
.db-alert-pill:hover { opacity: .82; text-decoration: none; }
.db-alert-danger  { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.db-alert-warning { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.db-alert-info    { background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe; }

/* ── Botão de suporte WhatsApp (sidebar) ── */
.support-button {
  display: block;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  padding: 12px 16px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  margin: 12px;
  text-align: center;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}
.support-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  color: white;
  background: linear-gradient(135deg, #16a34a, #15803d);
}

/* ── Botão flutuante WhatsApp (FAB) ── */
.fab-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(37,211,102,.40), 0 2px 6px rgba(0,0,0,.15);
  transition: transform .2s ease, box-shadow .2s ease;
}
.fab-whatsapp:hover {
  transform: scale(1.10);
  box-shadow: 0 8px 24px rgba(37,211,102,.50), 0 4px 10px rgba(0,0,0,.18);
  text-decoration: none;
  color: #fff;
}
.fab-whatsapp svg { flex-shrink: 0; }

/* Tooltip ao hover */
.fab-whatsapp-tooltip {
  position: absolute;
  right: 64px;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity .18s ease, transform .18s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.fab-whatsapp-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #1f2937;
}
.fab-whatsapp:hover .fab-whatsapp-tooltip {
  opacity: 1;
  transform: translateX(0);
}

/* ══════════════════════════════════════════════════════════════
   DETALHES DA VENDA — Modal profissional (prefixo vw-)
══════════════════════════════════════════════════════════════ */

/* ── Modal wrapper ──────────────────────────────────────────── */
.vw-modal-card {
  max-width: 780px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  overflow: hidden;
  animation: slideUp .22s ease;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────── */
.vw-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.vw-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vw-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.vw-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.vw-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  font-family: monospace;
  letter-spacing: .5px;
}

.vw-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}

.vw-modal-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: var(--danger);
}

/* ── Body (scroll area) ─────────────────────────────────────── */
.vw-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  flex: 1;
}

/* ── Cards ───────────────────────────────────────────────────── */
.vw-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  overflow: hidden;
}

.vw-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.vw-card-icon {
  width: 15px;
  height: 15px;
  color: #2563eb;
  flex-shrink: 0;
}

.vw-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  flex: 1;
}

.vw-card-badge {
  font-size: 11px;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 20px;
}

.vw-card-body {
  padding: 18px;
}

.vw-card-table {
  padding: 0;
}

/* ── Grid de informações (CARD 1) ───────────────────────────── */
.vw-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}

.vw-info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
}

.vw-info-item:nth-child(3n) { border-right: none; }
.vw-info-item:nth-last-child(-n+3) { border-bottom: none; }

.vw-info-full {
  grid-column: 1 / -1;
  border-right: none !important;
}

/* ── Lista de parcelas nos detalhes da venda ── */
.vw-parcelas-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}
.vw-parcela-item {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px;
  background: #fff;
}
.vw-parcela-item.vw-parcela-pago    { border-color: #bbf7d0; background: #f0fdf4; }
.vw-parcela-item.vw-parcela-pendente { border-color: #fde68a; background: #fffbeb; }
.vw-parcela-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.vw-parcela-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}
.vw-parcela-valor {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e293b;
}
.vw-parcela-detail {
  margin-top: 2px;
}
.vw-parcela-status {
  font-size: 0.8rem;
  font-weight: 600;
}
.vw-parcela-status.pago    { color: #16a34a; }
.vw-parcela-status.pendente { color: #d97706; }
.vw-parcela-venc {
  font-size: 0.78rem;
  color: #64748b;
}

.vw-info-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  line-height: 1.2;
}

.vw-info-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--text-light);
}

.vw-icon-green { color: #16a34a; }
.vw-icon-yellow { color: #d97706; }

.vw-info-value {
  font-size: 14px;
  color: var(--text);
  line-height: 1.4;
}

.vw-value-strong {
  font-weight: 600;
  color: var(--text);
}

.vw-value-mono {
  font-family: monospace;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--text-muted);
}

.vw-value-paid {
  font-weight: 600;
  color: #16a34a;
}

.vw-value-pending {
  color: var(--text-muted);
}

.vw-obs-value {
  font-size: 13px;
  color: var(--text-muted);
  white-space: pre-wrap;
}

/* ── Tabela de produtos (CARD 2) ────────────────────────────── */
.vw-table-wrap {
  overflow-x: auto;
}

.vw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.vw-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid var(--border);
}

.vw-table th {
  padding: 11px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}

.vw-th-name   { text-align: left; }
.vw-th-center { text-align: center; }
.vw-th-right  { text-align: right; }

.vw-item-row {
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s ease;
}

.vw-item-row:last-child { border-bottom: none; }
.vw-item-row:hover { background: #f8fafc; }

.vw-table td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

.vw-td-name   { text-align: left; }
.vw-td-center { text-align: center; }
.vw-td-right  { text-align: right; }

.vw-product-name {
  font-weight: 500;
  color: var(--text);
}

.vw-qty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

.vw-subtotal-cell strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* ── Resumo financeiro (CARD 3) ─────────────────────────────── */
.vw-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vw-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.vw-summary-label {
  font-size: 14px;
  color: var(--text-muted);
}

.vw-summary-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

.vw-summary-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.vw-summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 4px;
}

.vw-total-label {
  font-size: 15px;
  font-weight: 600;
  color: #1e40af;
}

.vw-total-value {
  font-size: 24px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: -.5px;
}

.vw-discount-applied {
  font-weight: 600;
  color: #16a34a;
}

/* ── Footer / Botões ─────────────────────────────────────────── */
.vw-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
}

.vw-btn-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.vw-btn-close:hover {
  background: var(--bg);
  border-color: #94a3b8;
  color: var(--text);
}

.vw-btn-print {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 24px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(37,99,235,.30);
}

.vw-btn-print:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37,99,235,.40);
  transform: translateY(-1px);
}

.vw-btn-print:active { transform: translateY(0); }

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .vw-modal-card  { max-width: 100%; }
  .vw-info-grid   { grid-template-columns: 1fr 1fr; }
  .vw-info-item:nth-child(3n)     { border-right: 1px solid #f1f5f9; }
  .vw-info-item:nth-child(2n)     { border-right: none; }
  .vw-info-item:nth-last-child(-n+3) { border-bottom: 1px solid #f1f5f9; }
  .vw-info-item:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 600px) {
  .vw-modal-body  { padding: 14px 16px; gap: 12px; }
  .vw-card-body   { padding: 14px; }
  .vw-modal-header { padding: 16px; }
  .vw-modal-footer { padding: 12px 16px; flex-direction: column; }
  .vw-btn-close,
  .vw-btn-print   { width: 100%; justify-content: center; }
  .vw-info-grid   { grid-template-columns: 1fr; }
  .vw-info-item   { border-right: none !important; }
  .vw-info-item:nth-last-child(-n+3) { border-bottom: 1px solid #f1f5f9; }
  .vw-info-item:last-child { border-bottom: none; }
  .vw-total-value { font-size: 20px; }
}

/* ══════════════════════════════════════════════════════════════
   VENDAS — LISTA (prefixo sl-)
   Tabela SaaS-style + header + cards
══════════════════════════════════════════════════════════════ */

/* ── Header ─────────────────────────────────────────────────── */
.sl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  width: 100%;
}
.sl-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.sl-header-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.sl-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}
.sl-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}
.sl-btn-new {
  display: flex; align-items: center; gap: 7px;
  padding: 0 20px;
  height: 44px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
  white-space: nowrap;
}
.sl-btn-new:hover { background: #1d4ed8; transform: translateY(-1px); }

/* ── Search card ─────────────────────────────────────────────── */
.sl-search-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  padding: 16px 20px;
  margin-bottom: 18px;
}
.sl-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.sl-search-icon {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  width: 16px; height: 16px;
}
.sl-search-input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #f8fafc;
  outline: none;
  transition: border-color .2s;
  box-sizing: border-box;
}
.sl-search-input:focus { border-color: #2563eb; background: #fff; }
.sl-search-input::placeholder { color: #94a3b8; }
.sl-filter-select {
  height: 44px;
  padding: 0 36px 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  min-width: 180px;
  transition: border-color .2s;
  white-space: nowrap;
}
.sl-filter-select:focus { border-color: #2563eb; background-color: #fff; }

/* ── Table card ──────────────────────────────────────────────── */
.sl-table-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.08);
  overflow: hidden;
  width: 100%;
}
.sl-table-responsive {
  overflow-x: auto;
  width: 100%;
}
.sl-table {
  width: 100%;
  min-width: 780px;   /* scroll horizontal em telas pequenas */
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: fixed;
}
.sl-th {
  background: #F8FAFC;
  padding: 14px 20px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-bottom: 1.5px solid #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sl-th-order   { width: 90px; }
.sl-th-client  { width: auto; min-width: 200px; }
.sl-th-value   { width: 140px; }
.sl-th-payment { width: 175px; }
.sl-th-status  { width: 140px; }
.sl-th-date    { width: 130px; }
.sl-th-actions { width: 130px; text-align: center; }

.sl-td {
  padding: 16px 20px;
  color: var(--text-dark);
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sl-tr { transition: background .18s ease; }
.sl-tr:last-child .sl-td { border-bottom: none; }
.sl-tr:hover { background: #f8fafc; }

/* Order number badge */
.sl-order-badge {
  display: inline-block;
  padding: 3px 8px;
  background: #eff6ff;
  color: #2563eb;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: .03em;
}

/* Client cell */
.sl-client-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sl-client-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sl-client-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* Value cell */
.sl-value { font-weight: 700; color: #0f172a; }
.sl-discount-tag {
  display: block;
  font-size: 0.72rem;
  color: #dc2626;
  margin-top: 2px;
}

/* Payment cell */
.sl-payment-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sl-payment-label {
  font-size: 0.875rem;
  color: #475569;
}
/* Badge Fiado quitado */
.sl-badge-fiado-quitado {
  display: inline-block;
  padding: 1px 7px;
  background: #dcfce7;
  color: #15803d;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
/* Badge Fiado pendente/em aberto */
.sl-badge-fiado-pendente {
  display: inline-block;
  padding: 1px 7px;
  background: #f1f5f9;
  color: #64748b;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
/* Badge Fiado cancelado / sem pendências */
.sl-badge-fiado-cancelado {
  display: inline-block;
  padding: 1px 7px;
  background: #f8fafc;
  color: #94a3b8;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.sl-td-actions { text-align: center; }
.sl-action-btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sl-btn-action {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.sl-btn-action:hover { transform: scale(1.1); }
.sl-btn-view {
  background: #f0f9ff;
  color: #0369a1;
}
.sl-btn-view:hover { background: #dbeafe; color: #2563eb; }
.sl-btn-edit {
  background: #eff6ff;
  color: #2563eb;
}
.sl-btn-edit:hover { background: #dbeafe; color: #1d4ed8; }
.sl-btn-delete {
  background: #fef2f2;
  color: #dc2626;
}
.sl-btn-delete:hover { background: #fee2e2; color: #b91c1c; }

/* Empty state */
.sl-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px;
  gap: 12px;
  text-align: center;
}
.sl-empty-icon {
  width: 48px; height: 48px;
  color: #cbd5e1;
}
.sl-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: #64748b;
  margin: 0;
}
.sl-empty-desc {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0;
}

/* ── Delete modal (sl-del-) ──────────────────────────────────── */
.sl-del-modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  padding: 40px 32px 32px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  animation: modalIn .2s ease;
}
.sl-del-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: background .15s;
}
.sl-del-modal-close:hover { background: #e2e8f0; }
.sl-del-icon-wrap {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #fef2f2;
  border: 2px solid #fecaca;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.sl-del-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}
.sl-del-msg {
  font-size: 0.9rem;
  color: #475569;
  margin: 0 0 6px;
  line-height: 1.5;
}
.sl-del-warn {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0 0 24px;
}
.sl-del-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.sl-del-btn-cancel {
  flex: 1;
  height: 44px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sl-del-btn-cancel:hover { background: #f8fafc; border-color: #cbd5e1; }
.sl-del-btn-confirm {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s, transform .15s;
}
.sl-del-btn-confirm:hover { background: #b91c1c; transform: translateY(-1px); }
.sl-del-btn-confirm:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Modal de Estorno (cancelamento com pagamento) ─────────── */
.estorno-modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  padding: 40px 32px 32px;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: modalIn .2s ease;
}
.estorno-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  background: #f1f5f9;
  border: none;
  border-radius: 8px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: background .15s;
}
.estorno-modal-close:hover { background: #e2e8f0; }
.estorno-icon-wrap {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #fffbeb;
  border: 2px solid #fde68a;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
}
.estorno-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px;
}
.estorno-desc {
  font-size: 0.9rem;
  color: #475569;
  margin: 0 0 16px;
  line-height: 1.6;
}
.estorno-info-box {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 16px;
  margin: 0 0 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.estorno-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.estorno-info-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}
.estorno-info-value {
  font-size: 0.88rem;
  color: #1e293b;
  font-weight: 700;
}
.estorno-valor { color: #dc2626; }
.estorno-warn {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0 0 24px;
  line-height: 1.5;
}
.estorno-footer {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.estorno-btn-cancel {
  flex: 1;
  height: 44px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: border-color .15s, background .15s;
}
.estorno-btn-cancel:hover { background: #f8fafc; border-color: #cbd5e1; }
.estorno-btn-confirm {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: #f59e0b;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .15s, transform .15s;
}
.estorno-btn-confirm:hover { background: #d97706; transform: translateY(-1px); }
.estorno-btn-confirm:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sl-th-payment, .sl-th-date { width: 130px; }
}
@media (max-width: 768px) {
  .sl-header { flex-wrap: wrap; }
  .sl-search-card { flex-wrap: wrap; padding: 12px 14px; }
  .sl-filter-select { width: 100%; min-width: unset; }
  .sl-hide-mobile { display: none; }
  .sl-client-name { max-width: 160px; }
  .sl-table { min-width: 560px; }
  .sl-td, .sl-th { padding: 12px 14px; }
}
@media (max-width: 480px) {
  .sl-btn-new { padding: 0 14px; font-size: 0.82rem; }
  .sl-title { font-size: 1.05rem; }
  .sl-client-name { max-width: 110px; }
}

/* ══════════════════════════════════════════════════════════════
   VENDAS / PDV — FORMULÁRIO SAAS (prefixo pdv-)
   Modal profissional com cards por seção
══════════════════════════════════════════════════════════════ */

/* ── Modal wrapper ──────────────────────────────────────────── */
.pdv-modal-card {
  max-width: 820px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  animation: slideUp .22s ease;
  max-height: 92vh;
  overflow-y: auto;
  overflow-x: visible;
}

/* ── Header ─────────────────────────────────────────────────── */
.pdv-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.pdv-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdv-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pdv-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.pdv-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.pdv-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}

.pdv-modal-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: var(--danger);
}

/* ── Body ────────────────────────────────────────────────────── */
.pdv-modal-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #f8fafc;
  overflow: visible;
}

/* ── Cards ───────────────────────────────────────────────────── */
.pdv-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  overflow: visible; /* permite dropdown extravasar o card */
}

.pdv-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
}

.pdv-card-icon {
  width: 16px;
  height: 16px;
  color: #2563eb;
  flex-shrink: 0;
}

.pdv-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  flex: 1;
}

.pdv-card-badge {
  font-size: 11px;
  font-weight: 600;
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 20px;
}

.pdv-card-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: visible;
}

.pdv-card-body-list {
  padding: 0;
}

/* ── Grids ───────────────────────────────────────────────────── */
.pdv-grid {
  display: grid;
  gap: 18px;
}

.pdv-grid-1 { grid-template-columns: 1fr; }
.pdv-grid-2 { grid-template-columns: 1fr 1fr; }

/* ── Linha de adição de produto ─────────────────────────────── */
.pdv-add-row {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 16px;
  align-items: end;
}

.pdv-field-product { min-width: 0; }

.pdv-field-qty .pdv-qty-input {
  text-align: center;
}

.pdv-field-add { }

/* ── Campos ──────────────────────────────────────────────────── */
.pdv-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
}

.pdv-field-full {
  grid-column: 1 / -1;
}

.pdv-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.pdv-required { color: var(--danger); }

/* ── Input wrapper ───────────────────────────────────────────── */
.pdv-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pdv-input-icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-light);
  pointer-events: none;
  z-index: 1;
  flex-shrink: 0;
}

/* ── Inputs ──────────────────────────────────────────────────── */
.pdv-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  font-family: inherit;
}

.pdv-input.pdv-has-icon { padding-left: 38px; }

.pdv-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.pdv-input::placeholder { color: var(--text-light); font-size: 13px; }

/* ── Selects ─────────────────────────────────────────────────── */
.pdv-select {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  font-family: inherit;
}

.pdv-select.pdv-has-icon { padding-left: 38px; }

.pdv-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.pdv-select option:disabled {
  color: #9CA3AF;
  cursor: not-allowed;
}

.pdv-select-arrow {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

/* ── Textarea ────────────────────────────────────────────────── */
.pdv-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
  line-height: 1.5;
  min-height: 64px;
}

.pdv-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.pdv-textarea::placeholder { color: var(--text-light); font-size: 13px; }

/* ── Dropdown de busca (cliente / produto) ───────────────────── */
/* ── Dropdown flutuante (body-portal) ───────────────────────── */
/* Anexado ao body para evitar clipping por overflow:hidden      */
.pdv-floating-dropdown {
  position: fixed;  /* fixed = independente de scroll do modal */
  z-index: 99999;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  display: none;    /* controlado por JS */
}

.pdv-dropdown {
  position: absolute;
  z-index: 9999;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,.16);
  max-height: 240px;
  overflow-y: auto;
  padding: 4px;
  isolation: isolate;
}
.pdv-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s;
}
.pdv-dropdown-item:hover { background: #eff6ff; }
.pdv-dd-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.pdv-dd-product-avatar {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  border-radius: 8px;
}
.pdv-dd-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.pdv-dd-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pdv-dd-meta {
  font-size: 0.78rem;
  color: #64748b;
}
.pdv-dropdown-empty {
  padding: 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* ── Item selecionado (tag) ──────────────────────────────────── */
.pdv-selected-item {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 6px 10px;
  background: #eff6ff;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  font-size: 0.82rem;
  font-weight: 500;
  color: #1e40af;
}
.pdv-selected-clear {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  display: flex; align-items: center; justify-content: center;
  padding: 2px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.pdv-selected-clear:hover { color: #dc2626; background: #fee2e2; }

/* ── Botão Adicionar ─────────────────────────────────────────── */
.pdv-btn-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
  width: 100%;
}

.pdv-btn-add:hover {
  background: #1d4ed8;
  box-shadow: 0 3px 10px rgba(37,99,235,.35);
  transform: translateY(-1px);
}

/* ── Lista de Itens ──────────────────────────────────────────── */
.pdv-items-list {
  display: flex;
  flex-direction: column;
}

.pdv-empty-items {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.pdv-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  transition: background .15s ease;
}

.pdv-item-row:last-child { border-bottom: none; }
.pdv-item-row:hover { background: #f8fafc; }

.pdv-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.pdv-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pdv-item-unit {
  font-size: 12px;
  color: var(--text-muted);
}

.pdv-item-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.pdv-item-qty-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pdv-item-qty-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
}

.pdv-item-qty-input {
  width: 64px;
  height: 36px;
  text-align: center;
  padding: 0 6px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: #fff;
  outline: none;
  font-family: inherit;
  transition: border-color .15s ease;
}

.pdv-item-qty-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,.1);
}

.pdv-item-subtotal {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 80px;
  text-align: right;
}

.pdv-item-subtotal strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.pdv-item-remove {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #fff0f0;
  border: 1px solid #fecaca;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  transition: var(--transition);
  flex-shrink: 0;
}

.pdv-item-remove:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  transform: scale(1.05);
}

/* ── Totalizador ─────────────────────────────────────────────── */
.pdv-totals {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.pdv-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}

.pdv-total-main {
  background: #eff6ff;
  border-radius: 10px;
  padding: 12px 16px;
  border: 1px solid #bfdbfe;
}

.pdv-total-label {
  font-size: 15px;
  font-weight: 600;
  color: #1e40af;
}

.pdv-total-value {
  font-size: 22px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: -.5px;
}

/* ── Subtotal e Desconto ─────────────────────────────────────── */
.pdv-subtotal-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.pdv-subtotal-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.pdv-discount-row {
  align-items: center;
  gap: 12px;
}

.pdv-discount-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pdv-discount-input {
  width: 110px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: #fff;
  outline: none;
  text-align: right;
  transition: border-color .18s ease, box-shadow .18s ease;
  font-family: inherit;
}

.pdv-discount-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.pdv-discount-input::placeholder {
  color: var(--text-light);
  font-size: 12px;
}

.pdv-discount-input.pdv-discount-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}

.pdv-discount-applied {
  font-size: 13px;
  font-weight: 600;
  color: #16a34a;
  min-width: 70px;
  text-align: right;
  white-space: nowrap;
}

.pdv-discount-applied.pdv-discount-active {
  color: #16a34a;
}

.pdv-discount-alert {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--danger);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 7px;
  padding: 6px 10px;
  margin-top: 2px;
}

/* ── Parcelamento ─────────────────────────────────────────── */
.pdv-parcelas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.pdv-select-parcelas {
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 72px;
}
.pdv-select-parcelas:focus {
  outline: none;
  border-color: var(--primary);
}
.pdv-parcelas-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pdv-parcela-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 10px;
  background: var(--bg-hover, #f9fafb);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.pdv-parcela-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pdv-parcela-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.pdv-parcela-valor {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}
/* Linha com dois inputs: valor + data */
.pdv-parcela-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pdv-parcela-valor-input {
  width: 100%;
  font-weight: 600;
  color: var(--primary);
}
.pdv-parcela-valor-display {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}
.pdv-parcela-input {
  width: 100%;
}
@media (max-width: 480px) {
  .pdv-parcela-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .pdv-parcela-inputs {
    grid-template-columns: 1fr;
  }
}

.pdv-totals-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ── Footer / Botões ─────────────────────────────────────────── */
.pdv-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.pdv-btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.pdv-btn-cancel:hover {
  background: var(--bg);
  border-color: #94a3b8;
  color: var(--text);
}

.pdv-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 28px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}

.pdv-btn-save:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37,99,235,.45);
  transform: translateY(-1px);
}

.pdv-btn-save:active  { transform: translateY(0); }
.pdv-btn-save:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .pdv-modal-card { max-width: 100%; }
  .pdv-add-row    { grid-template-columns: 1fr 100px auto; }
}

@media (max-width: 600px) {
  .pdv-modal-body    { padding: 14px 16px; gap: 12px; }
  .pdv-card-body     { padding: 14px; }
  .pdv-grid-2        { grid-template-columns: 1fr; }
  .pdv-add-row       { grid-template-columns: 1fr; }
  .pdv-field-add     { }
  .pdv-btn-add       { }
  .pdv-modal-header  { padding: 16px; }
  .pdv-modal-footer  { padding: 12px 16px; flex-direction: column; }
  .pdv-btn-cancel,
  .pdv-btn-save      { width: 100%; justify-content: center; }
  .pdv-item-row      { flex-wrap: wrap; }
  .pdv-item-controls { width: 100%; justify-content: flex-end; }
}

/* ══════════════════════════════════════════════════════════════
   CLIENTES — FORMULÁRIO SAAS (prefixo cust-)
   Modal profissional com cards por seção
══════════════════════════════════════════════════════════════ */

/* ── Modal wrapper ─────────────────────────────────────────── */
.cust-modal-card {
  max-width: 780px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  overflow: hidden;
  animation: slideUp .22s ease;
  max-height: 92vh;
  overflow-y: auto;
}

/* ── Header ──────────────────────────────────────────────── */
.cust-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.cust-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cust-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cust-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.3;
}

.cust-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1;
}

.cust-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
  flex-shrink: 0;
}

.cust-modal-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: var(--danger);
}

/* ── Body (scroll area) ──────────────────────────────────── */
.cust-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

/* ── Cards de seção ─────────────────────────────────────── */
.cust-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  overflow: hidden;
}

.cust-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.cust-card-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.cust-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
}

.cust-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── Grids ───────────────────────────────────────────────── */
.cust-grid {
  display: grid;
  gap: 14px;
}

.cust-grid-1  { grid-template-columns: 1fr; }
.cust-grid-2  { grid-template-columns: 1fr 1fr; }
.cust-grid-3  { grid-template-columns: 1fr 1fr 1fr; }
.cust-grid-cep   { grid-template-columns: 200px 1fr; }
.cust-grid-cidade { grid-template-columns: 1fr 120px; }

/* ── Campos ──────────────────────────────────────────────── */
.cust-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cust-field-cnpj { min-width: 0; }

.cust-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.cust-required { color: var(--danger); }

/* ── Input wrapper ───────────────────────────────────────── */
.cust-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cust-input-icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--text-light);
  pointer-events: none;
  z-index: 1;
  flex-shrink: 0;
}

/* ── Inputs ──────────────────────────────────────────────── */
.cust-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  font-family: inherit;
}

.cust-input.cust-has-icon  { padding-left: 38px; }
.cust-input.cust-has-btn   { padding-right: 44px; }

.cust-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.cust-input::placeholder { color: var(--text-light); font-size: 13px; }

.cust-input:read-only {
  background: #f8fafc;
  color: var(--text-muted);
  cursor: default;
}

/* ── Selects ─────────────────────────────────────────────── */
.cust-select {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s ease, box-shadow .18s ease;
  font-family: inherit;
}

.cust-select.cust-has-icon { padding-left: 38px; }

.cust-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.cust-select-arrow {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

/* ── Botão de busca (CEP / CNPJ) ────────────────────────── */
.cust-search-btn {
  position: absolute;
  right: 8px;
  width: 30px;
  height: 30px;
  background: var(--primary-light);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: var(--transition);
  flex-shrink: 0;
  z-index: 2;
}

.cust-search-btn:hover    { background: var(--primary); color: #fff; }
.cust-search-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Hints / feedback ────────────────────────────────────── */
.cust-hint,
.field-hint {
  font-size: 11.5px;
  min-height: 16px;
  display: block;
  line-height: 1.3;
}

.cust-hint.hint-ok,    .hint-ok    { color: var(--success); }
.cust-hint.hint-error, .hint-error { color: var(--danger); }
.cust-hint.hint-info,  .hint-info  { color: var(--info); }
.cust-hint.hint-warn,  .hint-warn  { color: var(--warning); }

/* ── Textarea ────────────────────────────────────────────── */
.cust-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
  line-height: 1.5;
  min-height: 72px;
}

.cust-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.cust-textarea::placeholder { color: var(--text-light); font-size: 13px; }

/* ── Footer / botões ─────────────────────────────────────── */
.cust-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.cust-btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.cust-btn-cancel:hover {
  background: var(--bg);
  border-color: #94a3b8;
  color: var(--text);
}

.cust-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 24px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(37,99,235,.35);
}

.cust-btn-save:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37,99,235,.45);
  transform: translateY(-1px);
}

.cust-btn-save:active  { transform: translateY(0); }
.cust-btn-save:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .cust-modal-card  { max-width: 100%; }
  .cust-grid-3      { grid-template-columns: 1fr 1fr; }
  .cust-grid-cep    { grid-template-columns: 180px 1fr; }
  .cust-grid-cidade { grid-template-columns: 1fr 100px; }
}

@media (max-width: 600px) {
  .cust-modal-body  { padding: 14px 16px; gap: 12px; }
  .cust-card-body   { padding: 14px; }
  .cust-grid-2,
  .cust-grid-3,
  .cust-grid-cep,
  .cust-grid-cidade { grid-template-columns: 1fr; }
  .cust-modal-header { padding: 16px; }
  .cust-modal-footer { padding: 12px 16px; }
}

/* ══════════════════════════════════════════════════════════════
   SUPER ADMIN — Layout isolado (prefixo sa-)
   Rotas: /admin/login · /admin/dashboard · /admin/empresas
══════════════════════════════════════════════════════════════ */

/* ── Reset do body ── */
.sa-body {
  margin: 0;
  background: #f1f5f9;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  display: flex;
}

/* ══ LOGIN ════════════════════════════════════════════════════ */
.sa-login-wrap {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e40af 100%);
  padding: 24px;
}
.sa-login-card {
  background: #fff;
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.sa-login-header { text-align: center; margin-bottom: 28px; }
.sa-login-badge {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 10px;
}
.sa-login-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0 0 4px;
}
.sa-login-sub { color: #94a3b8; font-size: 0.88rem; margin: 0; }
.sa-login-footer { text-align: center; margin-top: 20px; }
.sa-back-link { color: #94a3b8; font-size: 0.83rem; text-decoration: none; }
.sa-back-link:hover { color: #4f46e5; }

/* ── Form compartilhado ── */
.sa-form { display: flex; flex-direction: column; gap: 16px; }
.sa-form-group { display: flex; flex-direction: column; gap: 6px; }
.sa-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 600px) { .sa-form-row { grid-template-columns: 1fr; } }

.sa-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sa-input-wrap { position: relative; }
.sa-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  pointer-events: none;
}
.sa-input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #1e293b;
  background: #f8fafc;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.sa-input:not(.sa-input-wrap .sa-input) { padding-left: 14px; }
.sa-input:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
  background: #fff;
}
.sa-input[readonly] { background: #f1f5f9; color: #64748b; cursor: not-allowed; }

select.sa-input { padding-left: 14px; cursor: pointer; }

/* ── Botões ── */
.sa-btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  margin-top: 4px;
}
.sa-btn-primary:hover:not(:disabled) { opacity: .9; transform: translateY(-1px); }
.sa-btn-primary:disabled { opacity: .6; cursor: not-allowed; }

.sa-btn-outline {
  padding: 10px 20px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s;
}
.sa-btn-outline:hover { border-color: #4f46e5; color: #4f46e5; }

/* ── Alertas ── */
.sa-alert {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.sa-alert-error   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.sa-alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.sa-alert.hidden  { display: none; }

/* ══ SIDEBAR ══════════════════════════════════════════════════ */
.sa-sidebar {
  width: 240px;
  background: #1e1b4b;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  z-index: 200;
  transition: transform .25s;
}
.sa-sidebar-header {
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sa-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sa-brand-icon { font-size: 1.8rem; }
.sa-brand-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.sa-brand-sub { font-size: 0.72rem; color: #818cf8; }

.sa-nav {
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.sa-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  color: #a5b4fc;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.sa-nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.sa-nav-active { background: rgba(99,102,241,.35) !important; color: #fff !important; }
.sa-nav-icon { font-size: 1rem; }

.sa-sidebar-footer { padding: 14px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sa-btn-logout {
  width: 100%;
  padding: 11px 14px;
  background: rgba(239,68,68,.15);
  border: 1px solid rgba(239,68,68,.25);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  text-align: left;
}
.sa-btn-logout:hover { background: rgba(239,68,68,.28); color: #fff; }

/* Mobile: sidebar oculta */
@media (max-width: 860px) {
  .sa-sidebar { transform: translateX(-100%); }
  .sa-sidebar.open { transform: translateX(0); }
  .sa-main { margin-left: 0 !important; }
}

/* ══ MAIN CONTENT ══════════════════════════════════════════════ */
.sa-main {
  margin-left: 240px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ── */
.sa-topbar {
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.sa-topbar-left { display: flex; align-items: center; gap: 14px; }
.sa-menu-toggle {
  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #64748b;
  display: none;
}
@media (max-width: 860px) { .sa-menu-toggle { display: block; } }
.sa-page-title { font-size: 1rem; font-weight: 700; color: #1e293b; margin: 0; }
.sa-topbar-right { display: flex; align-items: center; gap: 10px; }
.sa-admin-badge {
  background: #eef2ff;
  color: #4f46e5;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.sa-admin-email { font-size: 0.8rem; color: #64748b; }

/* ── Loading ── */
.sa-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  color: #94a3b8;
  font-size: 0.9rem;
  padding: 80px 24px;
}

/* ── Conteúdo ── */
.sa-content { padding: 24px; }
.sa-content.hidden { display: none; }

/* ── KPI grid ── */
.sa-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) { .sa-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .sa-kpi-grid { grid-template-columns: 1fr; } }

.sa-kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  border: 1px solid #e8ecf0;
}
.sa-kpi-icon { font-size: 2rem; flex-shrink: 0; }
.sa-kpi-info { display: flex; flex-direction: column; gap: 3px; }
.sa-kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
}
.sa-kpi-value { font-size: 1.8rem; font-weight: 800; color: #1e293b; line-height: 1.1; }

.sa-kpi-blue   { border-left: 4px solid #3b82f6; }
.sa-kpi-green  { border-left: 4px solid #22c55e; }
.sa-kpi-red    { border-left: 4px solid #ef4444; }
.sa-kpi-yellow { border-left: 4px solid #f59e0b; }

/* ── Card genérico ── */
.sa-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 1px 8px rgba(0,0,0,.05);
  margin-bottom: 20px;
}
.sa-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.sa-card-title { font-size: 0.95rem; font-weight: 700; color: #1e293b; margin: 0; }
.sa-card-link {
  font-size: 0.78rem;
  color: #4f46e5;
  font-weight: 600;
  text-decoration: none;
}
.sa-card-link:hover { text-decoration: underline; }

/* ── Toolbar (busca + filtro) ── */
.sa-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sa-search-wrap { position: relative; flex: 1; min-width: 200px; }
.sa-search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 0.9rem; pointer-events: none;
}
.sa-search-input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  background: #fff;
  box-sizing: border-box;
  transition: border-color .15s;
}
.sa-search-input:focus { outline: none; border-color: #4f46e5; }
.sa-filter-select {
  padding: 10px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.88rem;
  background: #fff;
  cursor: pointer;
}

/* ── Tabela ── */
.sa-table-wrap { overflow-x: auto; }
.sa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.sa-table th {
  text-align: left;
  padding: 9px 12px;
  font-size: 0.71rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #94a3b8;
  border-bottom: 1.5px solid #f1f5f9;
  white-space: nowrap;
}
.sa-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #f8fafc;
  vertical-align: middle;
  color: #334155;
}
.sa-table tr:last-child td { border-bottom: none; }
.sa-table tr:hover td { background: #f8fafc; }
.sa-td-muted { color: #94a3b8; font-size: 0.82rem; }
.sa-empty-row { text-align: center; color: #94a3b8; padding: 28px 12px; }
.sa-empty-state {
  text-align: center; padding: 40px 24px; color: #94a3b8;
}
.sa-empty-icon { font-size: 2.5rem; margin-bottom: 8px; }

/* ── Badges ── */
.sa-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}
.sa-badge-active  { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.sa-badge-expired { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.sa-badge-blocked { background: #fef2f2; color: #9f1239; border: 1px solid #fecaca; }
.sa-badge-test    { background: #fefce8; color: #ca8a04; border: 1px solid #fde68a; }

.sa-plan-tag {
  display: inline-flex;
  padding: 2px 9px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 700;
}

/* ── Botão editar na tabela ── */
.sa-btn-edit {
  padding: 6px 14px;
  background: #eef2ff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.sa-btn-edit:hover { background: #e0e7ff; }

/* ══ MODAL ════════════════════════════════════════════════════ */
.sa-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.sa-modal-overlay.hidden { display: none; }
.sa-modal-card {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
}
.sa-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f1f5f9;
}
.sa-modal-header h3 { margin: 0; font-size: 1rem; font-weight: 700; color: #1e293b; }
.sa-modal-close {
  background: none; border: none; font-size: 1.1rem; cursor: pointer;
  color: #94a3b8; padding: 4px 8px; border-radius: 6px;
  transition: background .12s;
}
.sa-modal-close:hover { background: #f1f5f9; color: #475569; }
.sa-modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.sa-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid #f1f5f9;
}

/* ── Ações rápidas no modal ── */
.sa-quick-actions {
  background: #f8fafc;
  border-radius: 10px;
  padding: 14px;
}
.sa-quick-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: 0 0 10px;
}
.sa-quick-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.sa-quick-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s;
}
.sa-quick-btn:hover { opacity: .82; }
.sa-quick-green { background: #dcfce7; color: #15803d; }
.sa-quick-blue  { background: #dbeafe; color: #1d4ed8; }
.sa-quick-red   { background: #fee2e2; color: #b91c1c; }

/* ═══════════════════════════════════════════════════════════════
   CONTAS A RECEBER — prefixo rc-
   Segue o mesmo padrão visual das telas Produtos / Clientes / Vendas
═══════════════════════════════════════════════════════════════ */

/* ── Cabeçalho da seção ── */
.rc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}
.rc-header-left {
  display: flex;
  align-items: center;
  gap: 12px;                   /* gap solicitado */
}
.rc-header-icon {
  width: 40px; height: 40px;   /* 40×40 solicitado */
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;            /* overflow:hidden solicitado */
}
.rc-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark, #0f172a);
  margin: 0;
}
.rc-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted, #64748b);
  margin: 2px 0 0;
}

/* ── Cards de totalizadores ── */
.rc-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}
.rc-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  border-radius: 12px;                       /* mais arredondado */
  border: 1.5px solid transparent;
  min-width: 110px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.06);    /* sombra suave */
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rc-summary-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.rc-summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.75;
}
.rc-summary-val {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
}
.rc-summary-count {
  font-size: 0.72rem;
  opacity: 0.65;
}
.rc-summary-pending { background: #fefce8; border-color: #fde047; color: #92400e; }
.rc-summary-overdue { background: #fef2f2; border-color: #fca5a5; color: #991b1b; }
.rc-summary-paid    { background: #f0fdf4; border-color: #86efac; color: #166534; }

/* ── Barra de busca + filtro ── */
.rc-search-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 14px;                       /* borda 14px */
  box-shadow: 0 4px 12px rgba(0,0,0,.06);    /* sombra suave */
  padding: 16px 20px;
  margin-bottom: 18px;
}
.rc-search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}
.rc-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: #94a3b8;
  pointer-events: none;
}
.rc-search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #1e293b;
  background: #f8fafc;
  outline: none;
  transition: border-color .15s, background .15s;
  box-sizing: border-box;
}
.rc-search-input:focus { border-color: #2563eb; background: #fff; }
.rc-search-input::placeholder { color: #94a3b8; }
.rc-filter-select {
  padding: 9px 32px 9px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #1e293b;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  min-width: 160px;
  transition: border-color .15s, background-color .15s;
}
.rc-filter-select:focus { border-color: #2563eb; background-color: #fff; }

/* ── Card da tabela ── */
.rc-table-card {
  background: #fff;
  border-radius: 14px;                       /* borda 14px */
  box-shadow: 0 4px 12px rgba(0,0,0,.06);    /* sombra suave */
  overflow: hidden;
}
.rc-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.rc-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

/* ── Cabeçalho da tabela ── */
.rc-th {
  padding: 13px 16px;
  text-align: left;
  font-size: 0.775rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8fafc;
  border-bottom: 1.5px solid #e2e8f0;
  white-space: nowrap;
}
.rc-th-sale    { width: 110px; }
.rc-th-client  { width: auto; min-width: 180px; }
.rc-th-value   { width: 130px; }
.rc-th-due     { width: 130px; }
.rc-th-paid    { width: 140px; }
.rc-th-status  { width: 130px; }
.rc-th-actions { width: 130px; text-align: center; }

/* ── Linhas da tabela ── */
.rc-tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s ease; /* transição suave solicitada */
}
.rc-tr:last-child { border-bottom: none; }
.rc-tr:hover { background: #f0f6ff; }  /* hover azul suave, diferente de #f8fafc */
.rc-tr-overdue { background: #fff8f8; }
.rc-tr-overdue:hover { background: #ffe8e8; }

/* ── Células ── */
.rc-td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: #1e293b;
  vertical-align: middle;
}
.rc-td-actions { text-align: center; }

/* ── Link da venda ── */
.rc-sale-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #2563eb;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: #eff6ff;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}
.rc-sale-link:hover { background: #dbeafe; }
.rc-sale-link-disabled {
  color: #94a3b8;
  font-size: 0.875rem;
}

/* ── Avatar + nome do cliente ── */
.rc-client-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rc-client-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb22, #7c3aed22);
  color: #2563eb;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}
.rc-client-name {
  font-weight: 600;
  color: #0f172a;
  font-size: 0.875rem;
}

/* ── Valor ── */
.rc-value {
  font-weight: 700;
  color: #0f172a;
}
/* Pago — verde */
.rc-value-recebido {
  font-weight: 700;
  color: #16a34a;
}
/* Parcialmente pago — âmbar */
.rc-value-parcial {
  font-weight: 700;
  color: #d97706;
}

/* ── Vencimento em atraso ── */
.rc-due-overdue {
  color: #dc2626;
  font-weight: 600;
}

/* ── Badges de status ── */
.rc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.775rem;
  font-weight: 600;
  white-space: nowrap;
  background: #f1f5f9;
  color: #475569;
  letter-spacing: 0.01em;
}
/* Pendente — amarelo âmbar */
.rc-badge-yellow {
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde68a;
}
/* Atrasado — vermelho */
.rc-badge-red {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}
/* Recebido — verde */
.rc-badge-green {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
/* Cancelado — cinza */
.rc-badge-gray {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* ── Botão Receber (verde) ── */
.rc-btn-pay {
  display: inline-flex;
  align-items: center;
  justify-content: center; /* alinhamento central */
  gap: 6px;
  padding: 7px 15px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(22,163,74,.25); /* sombra verde suave */
}
.rc-btn-pay:hover  {
  background: #15803d;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(22,163,74,.35);
}
.rc-btn-pay:active { transform: translateY(0); box-shadow: none; }

/* ── Indicador "Recebido" ── */
.rc-paid-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #15803d;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 11px;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px solid #86efac;
  white-space: nowrap;
}

/* ── Accordion de grupos por venda ── */
.rc-group-row {
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: pointer;
  transition: background 0.15s;
}
.rc-group-row:hover { background: #eff6ff; }
.rc-group-row.rc-tr-overdue { background: #fff5f5; }
.rc-group-row.rc-tr-overdue:hover { background: #ffe4e4; }

.rc-group-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rc-group-chevron {
  color: #64748b;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.rc-group-parcelas-info {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  font-weight: 400;
  margin-top: 1px;
}

/* Linhas de parcela expandidas */
.rc-parcela-row {
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  animation: rcFadeIn 0.15s ease;
}
.rc-parcela-row:hover { background: #f8faff; }
.rc-parcela-row.rc-tr-overdue { background: #fff8f8; }
.rc-parcela-row.rc-tr-overdue:hover { background: #ffe8e8; }

.rc-parcela-label {
  font-size: 0.8rem;
  color: #475569;
  font-weight: 500;
  padding-left: 24px;  /* recuo para alinhar com chevron */
  white-space: nowrap;
}
.rc-parcela-cliente {
  font-size: 0.82rem;
  color: #64748b;
}
.rc-value-overdue {
  font-weight: 700;
  color: #dc2626;
}

@keyframes rcFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Estado vazio ── */
.rc-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 24px;
  text-align: center;
}
.rc-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: #475569;
  margin: 0;
}
.rc-empty-desc {
  font-size: 0.875rem;
  color: #94a3b8;
  margin: 0;
  max-width: 340px;
}

/* ── Cards accordion de recebíveis (rcc-*) ── */
.rc-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 24px;
}

/* Card de grupo (uma venda) */
.rcc-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow .18s, border-color .18s;
}
.rcc-card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
  border-color: #cbd5e1;
}
.rcc-card--overdue {
  border-color: #fca5a5;
  background: #fff7f7;
}
.rcc-card--paid {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

/* Cabeçalho clicável */
.rcc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
}
.rcc-header:hover {
  background: rgba(99,102,241,.04);
}

/* Esquerda */
.rcc-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.rcc-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.rcc-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.rcc-cliente {
  font-size: 0.97rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rcc-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.rcc-sale-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.78rem;
  color: #6366f1;
  text-decoration: none;
  font-weight: 600;
}
.rcc-sale-link:hover { text-decoration: underline; }
.rcc-sale-disabled { font-size: 0.78rem; color: #94a3b8; }
.rcc-sep { color: #cbd5e1; font-size: 0.75rem; }
.rcc-parcelas-txt { font-size: 0.78rem; color: #64748b; }

/* Direita */
.rcc-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.rcc-valor {
  font-size: 1.05rem;
  font-weight: 800;
  white-space: nowrap;
}
.rcc-valor.pendente { color: #f59e0b; }
.rcc-valor.atrasado { color: #ef4444; }
.rcc-valor.recebido { color: #16a34a; }
.rcc-chevron {
  width: 18px;
  height: 18px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform .2s;
}

/* Parcelas expandidas */
.rcc-parcelas {
  border-top: 1px solid #f1f5f9;
  padding: 4px 0 8px;
  animation: rccFadeIn .15s ease;
}
@keyframes rccFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.rcc-parcela-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  gap: 10px;
  border-bottom: 1px solid #f8fafc;
  transition: background .12s;
}
.rcc-parcela-item:last-child { border-bottom: none; }
.rcc-parcela-item:hover { background: #f8fafc; }
.rcc-parcela-item--over { background: #fff7f7; }
.rcc-parcela-item--over:hover { background: #fee2e2; }

.rcc-p-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.rcc-p-ordem {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}
.rcc-p-details {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.rcc-p-valor {
  font-size: 0.88rem;
  font-weight: 700;
  color: #475569;
}
.rcc-p-valor.recebido { color: #16a34a; }
.rcc-p-valor.atrasado { color: #ef4444; }
.rcc-p-sep { color: #cbd5e1; font-size: 0.75rem; }
.rcc-p-venc { font-size: 0.8rem; color: #64748b; }
.rcc-p-venc.over { color: #ef4444; font-weight: 600; }
.rcc-p-datapag { font-size: 0.77rem; color: #94a3b8; font-style: italic; }

.rcc-p-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.rcc-btn-pay {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: #6366f1;
  color: #fff;
  cursor: pointer;
  transition: background .15s, transform .12s;
}
.rcc-btn-pay:hover { background: #4f46e5; transform: translateY(-1px); }
.rcc-paid-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #dcfce7;
  color: #16a34a;
}

/* Responsividade */
@media (max-width: 520px) {
  .rcc-header { padding: 12px 14px; gap: 8px; }
  .rcc-avatar { width: 34px; height: 34px; font-size: 0.85rem; }
  .rcc-cliente { font-size: 0.88rem; }
  .rcc-valor { font-size: 0.92rem; }
  .rcc-parcela-item { padding: 9px 14px; }
  .rcc-header-right .rc-badge { display: none; }
}

/* ── Modal de Pagamento ── */
.rc-pay-modal-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  width: 100%;
  max-width: 460px;
  overflow: hidden;
  animation: rcModalIn .2s ease;
}
@keyframes rcModalIn {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.rc-pay-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1.5px solid #f1f5f9;
  background: #fff;
}
.rc-pay-modal-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.rc-pay-modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}
.rc-pay-modal-sub {
  font-size: 0.8rem;
  color: #64748b;
  margin: 2px 0 0;
}
.rc-pay-modal-close {
  margin-left: auto;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: #f8fafc;
  color: #64748b;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.rc-pay-modal-close:hover { background: #f1f5f9; color: #0f172a; }

/* ── Corpo do modal ── */
.rc-pay-modal-body {
  padding: 20px 24px;
}
.rc-pay-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.rc-pay-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.rc-pay-info-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.rc-pay-info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}
.rc-pay-value-highlight {
  font-size: 1rem;
  font-weight: 800;
  color: #16a34a;
}

/* ── Seletor de forma de pagamento ── */
.rc-pay-forma-wrap {
  margin-bottom: 16px;
}
.rc-pay-forma-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 7px;
}
.rc-pay-forma-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #1e293b;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 12px center;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
  box-sizing: border-box;
}
.rc-pay-forma-select:focus { border-color: #2563eb; background-color: #fff; }
.rc-pay-forma-error {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 0.8rem;
  color: #dc2626;
  font-weight: 500;
}
.rc-pay-forma-error.hidden { display: none; }
.rc-pay-modal-note {
  font-size: 0.8rem;
  color: #64748b;
  padding: 10px 12px;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px solid #bbf7d0;
  margin: 0;
  line-height: 1.5;
}

/* ── Saldo total em aberto ── */
.rc-pay-saldo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  margin-bottom: 14px;
}
.rc-pay-saldo-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1d4ed8;
}
.rc-pay-saldo-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: #1d4ed8;
}

/* ── Campo valor pago ── */
.rc-pay-amount-wrap {
  margin-bottom: 14px;
}
.rc-pay-amount-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color .15s;
}
.rc-pay-amount-input-wrap:focus-within {
  border-color: #2563eb;
}
.rc-pay-amount-prefix {
  padding: 0 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border-right: 1.5px solid #e2e8f0;
  height: 42px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.rc-pay-amount-input {
  flex: 1;
  padding: 10px 12px;
  border: none;
  outline: none;
  font-size: 1rem;
  font-weight: 700;
  color: #16a34a;
  background: transparent;
  min-width: 0;
}
.rc-pay-amount-input::placeholder { color: #cbd5e1; font-weight: 400; }
.rc-pay-amount-input--error { border-color: #dc2626 !important; box-shadow: 0 0 0 2px rgba(220,38,38,.15) !important; }
.rc-pay-amount-error {
  display: block;
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
  font-weight: 500;
}
.rc-pay-amount-error.hidden { display: none; }

/* ── Preview de resultado ── */
.rc-pay-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.rc-pay-preview-row {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.82rem;
  line-height: 1.4;
}
.rc-pay-preview-text { font-weight: 500; }
.rc-pay-preview-ok   { color: #16a34a; }
.rc-pay-preview-info { color: #2563eb; }
.rc-pay-preview-warn { color: #d97706; }

/* ── Rodapé do modal ── */
.rc-pay-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1.5px solid #f1f5f9;
  background: #fff;
}
.rc-btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.rc-btn-cancel:hover { background: #f8fafc; border-color: #cbd5e1; }
.rc-btn-confirm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.rc-btn-confirm:hover  { background: #15803d; transform: translateY(-1px); }
.rc-btn-confirm:active { transform: translateY(0); }
.rc-btn-confirm:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* ── Classe utilitária (coluna oculta em mobile) ── */
.rc-hide-mobile { /* visível por padrão, oculto em telas pequenas */ }

/* ── Responsividade ── */
@media (max-width: 900px) {
  .rc-header { flex-direction: column; align-items: flex-start; }
  .rc-summary { width: 100%; }
  .rc-summary-item { flex: 1; min-width: 80px; }
  .rc-pay-info-grid { grid-template-columns: 1fr 1fr; }
  .rc-hide-mobile { display: none; }
}
@media (max-width: 600px) {
  .rc-search-card { flex-direction: column; padding: 12px 14px; }
  .rc-search-wrap { width: 100%; }
  .rc-filter-select { width: 100%; }
  .rc-summary { flex-direction: row; }
  .rc-pay-info-grid { grid-template-columns: 1fr; }
  .rc-pay-modal-card { border-radius: 16px 16px 0 0; }
  .rc-btn-pay { padding: 6px 10px; font-size: 0.78rem; }
  .rc-table { min-width: 560px; }
  .rc-td, .rc-th { padding: 12px 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   BACKUP DO SISTEMA — prefixo bk-
   Layout em card moderno, centralizado, max-width 500px
════════════════════════════════════════════════════════════════ */

/* ── Área de conteúdo da página ── */
.bk-page-content {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px;
}

/* ── Card principal ── */
.bk-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.07);
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  border: 1px solid #e8edf3;
}

/* ── Cabeçalho do card ── */
.bk-header {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 6px;
}

.bk-header-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(37,99,235,0.30);
}

.bk-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bk-title {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.bk-subtitle {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
  max-width: 520px;
}

/* ── Divisor ── */
.bk-divider {
  height: 1px;
  background: linear-gradient(90deg, #e2e8f0 0%, transparent 100%);
  margin: 22px 0 18px;
}

/* ── Barra de info (contador + aviso) ── */
.bk-info-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.bk-info-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 500;
}

.bk-info-badge-warn {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}

.bk-info-text {
  font-size: 12.5px;
  font-weight: 500;
}

/* ── Tabela de backups ── */
.bk-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.bk-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-size: 13.5px;
}

.bk-th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.bk-th-action {
  text-align: center;
  width: 140px;
}

.bk-td {
  padding: 16px 18px;
  color: #374151;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 13.5px;
  line-height: 1.45;
}

.bk-tr:last-child .bk-td {
  border-bottom: none;
}

.bk-tr:hover .bk-td {
  background: #f8fafc;
  transition: background 0.15s ease;
}

/* ── Botão restaurar (dentro da tabela) ── */
.bk-btn-restore-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(37,99,235,0.30);
  letter-spacing: 0.01em;
}

.bk-btn-restore-row:hover {
  box-shadow: 0 4px 14px rgba(37,99,235,0.40);
  transform: translateY(-2px);
}

.bk-btn-restore-row:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(37,99,235,0.25);
}

.bk-btn-restore-row:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Badges de resumo do conteúdo (🛒 👥 📦) ── */
.bk-totals {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.bk-total-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  white-space: nowrap;
}

/* ── Estado vazio ── */
.bk-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 52px 16px;
  text-align: center;
}

.bk-empty-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #eff6ff, #e0e7ff);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(37,99,235,0.12);
}

.bk-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px;
}

.bk-empty-desc {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0;
  max-width: 320px;
  line-height: 1.6;
}

/* ── Overlay de loading durante restauração ── */
.bk-restore-loading {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px;
  text-align: center;
  max-width: 360px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.bk-restore-loading-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}

.bk-restore-loading-desc {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
}

/* ── Modal de confirmação de restauração ── */
.bk-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 480px;
  width: 92%;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: bkModalIn 0.22s ease;
}

@keyframes bkModalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.bk-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #fff;
}

.bk-modal-icon {
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bk-modal-title {
  font-size: 16.5px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  letter-spacing: -0.1px;
}

.bk-modal-sub {
  font-size: 12px;
  opacity: 0.82;
  margin: 3px 0 0;
}

.bk-modal-close {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
  flex-shrink: 0;
}

.bk-modal-close:hover { background: rgba(255,255,255,0.28); }

.bk-modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.bk-modal-info-item {
  background: #f8fafc;
  border: 1px solid #e8edf3;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bk-modal-info-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bk-modal-info-value {
  font-size: 13.5px;
  color: #0f172a;
  font-weight: 600;
}

.bk-modal-info-muted {
  color: #374151;
  font-weight: 400;
}

.bk-modal-warning {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 14px 16px;
  color: #9a3412;
}

.bk-modal-warning-text {
  font-size: 13px;
  margin: 0;
  line-height: 1.6;
}

.bk-modal-check-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: #374151;
  cursor: pointer;
  user-select: none;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
}

.bk-modal-check {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
  flex-shrink: 0;
}

.bk-modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.bk-btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #374151;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.2s;
}

.bk-btn-cancel:hover { background: #e2e8f0; }

.bk-btn-restore {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 20px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 2px 6px rgba(37,99,235,0.28);
}

.bk-btn-restore:hover:not(:disabled) {
  box-shadow: 0 4px 14px rgba(37,99,235,0.40);
  transform: translateY(-1px);
}

.bk-btn-restore:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Badge data do backup ── */
.bk-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #1e40af;
  font-size: 13.5px;
  letter-spacing: -0.1px;
}

.bk-tag-recent {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.bk-tag-old {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* ── Colunas ocultas em mobile ── */
.bk-th-hide, .bk-td-hide { /* visível por padrão */ }

/* ── Responsividade ── */
@media (max-width: 640px) {
  .bk-card { padding: 20px 16px; }
  .bk-header-icon { width: 46px; height: 46px; }
  .bk-title { font-size: 18px; }
  .bk-modal-info-grid { grid-template-columns: 1fr; }
  .bk-th-hide, .bk-td-hide { display: none; }
  .bk-modal-footer { flex-direction: column-reverse; }
  .bk-btn-cancel, .bk-btn-restore { width: 100%; justify-content: center; }
  .bk-totals { gap: 4px; }
}

/* ═══════════════════════════════════════════════════════════════
   TRASH – Lixeira de Vendas
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper de página ── */
.tr-page {
  padding: 28px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

/* ── Card principal ── */
.tr-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e8edf3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05), 0 8px 24px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* ── Cabeçalho ── */
.tr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px;
  flex-wrap: wrap;
}

.tr-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tr-header-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, #dc2626 0%, #9f1239 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(220,38,38,0.28);
}

.tr-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 3px;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.tr-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}

/* ── Botão Esvaziar Lixeira ── */
.tr-btn-empty {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px;
  background: #fff1f2;
  color: #be123c;
  border: 1.5px solid #fda4af;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.15s;
  white-space: nowrap;
}

.tr-btn-empty:hover {
  background: #ffe4e6;
  border-color: #fb7185;
  transform: translateY(-1px);
}

.tr-btn-empty:active { transform: translateY(0); }
.tr-btn-empty:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Divisor ── */
.tr-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0;
}

/* ── Wrapper da tabela ── */
.tr-table-wrap {
  overflow-x: auto;
}

/* ── Tabela (herda products-table, sobrescreve detalhes) ── */
.tr-table thead {
  background: #f8fafc;
}

.tr-table thead th {
  padding: 13px 18px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}

.tr-table tbody td {
  padding: 15px 18px;
  font-size: 13.5px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.tr-table tbody tr:last-child td { border-bottom: none; }
.tr-table tbody tr:hover td { background: #fafbfc; transition: background 0.15s; }

/* ── Valor destacado ── */
.tr-valor {
  font-weight: 600;
  color: #0f766e;
  font-size: 14px;
}

/* ── Badge forma de pagamento ── */
.tr-forma-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

/* variantes por forma */
.tr-forma-pix           { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.tr-forma-dinheiro      { background: #fefce8; color: #854d0e; border-color: #fde68a; }
.tr-forma-cartao-credito{ background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.tr-forma-cartao-debito { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.tr-forma-transferencia { background: #faf5ff; color: #6d28d9; border-color: #ddd6fe; }
.tr-forma-boleto        { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.tr-forma-fiado         { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ── Botões de ação ── */
.tr-btn-restore {
  color: #1d4ed8;
}

.tr-btn-restore:hover {
  background: #dbeafe !important;
  transform: scale(1.1);
}

.tr-btn-del {
  color: #dc2626;
}

.tr-btn-del:hover {
  background: #fee2e2 !important;
  transform: scale(1.1);
}

/* ── Colunas ocultas no mobile ── */
.tr-th-hide, .tr-td-hide { /* visível por padrão */ }

/* ── Estado vazio ── */
.tr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 24px;
  text-align: center;
}

.tr-empty-icon {
  width: 76px;
  height: 76px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tr-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 8px;
}

.tr-empty-desc {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0;
  max-width: 340px;
  line-height: 1.6;
}

/* ── Modal de exclusão permanente ── */
.tr-del-modal {
  background: #fff;
  border-radius: 16px;
  max-width: 440px;
  width: 92%;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.18);
  animation: bkModalIn 0.22s ease;
}

.tr-del-header {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 22px;
  background: linear-gradient(135deg, #dc2626, #9f1239);
  color: #fff;
}

.tr-del-icon {
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tr-del-title {
  font-size: 15.5px;
  font-weight: 700;
  margin: 0;
  flex: 1;
  letter-spacing: -0.1px;
}

.tr-del-sub {
  font-size: 12px;
  opacity: 0.8;
  margin: 3px 0 0;
}

.tr-del-close {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: background 0.2s;
  flex-shrink: 0;
}

.tr-del-close:hover { background: rgba(255,255,255,0.28); }

.tr-del-body {
  padding: 20px 22px;
}

.tr-del-warn {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 14px 16px;
  color: #9a3412;
}

.tr-del-warn-text {
  font-size: 13.5px;
  margin: 0;
  line-height: 1.6;
}

.tr-del-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.tr-del-btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #374151;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: background 0.2s;
}

.tr-del-btn-cancel:hover { background: #e2e8f0; }

.tr-del-btn-confirm {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 13.5px;
}

/* ── Responsividade ── */
@media (max-width: 640px) {
  .tr-page { padding: 16px 12px; }
  .tr-header { padding: 18px 16px; gap: 12px; }
  .tr-header-icon { width: 44px; height: 44px; }
  .tr-title { font-size: 17px; }
  .tr-th-hide, .tr-td-hide { display: none; }
  .tr-table thead th, .tr-table tbody td { padding: 12px 14px; }
  .tr-del-footer { flex-direction: column-reverse; }
  .tr-del-btn-cancel, .tr-del-btn-confirm { width: 100%; justify-content: center; }
}


/* ══════════════════════════════════════════════════════════════
   RELATÓRIOS – Dashboard profissional (layout unificado)
══════════════════════════════════════════════════════════════ */

/* ── Reset ───────────────────────────────────────────────────── */
.rpt-dashboard, .rpt-dashboard * { box-sizing: border-box; }

/* ── Dashboard container ─────────────────────────────────────── */
.rpt-dashboard {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 4px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Topbar (título + filtro) ────────────────────────────────── */
.rpt-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}
.rpt-topbar-left { display: flex; flex-direction: column; gap: 2px; }
.rpt-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  line-height: 1.2;
}
.rpt-page-icon { width: 22px; height: 22px; color: #6366f1; flex-shrink: 0; }
.rpt-page-sub  { font-size: 13px; color: #94a3b8; margin: 0; }

/* Botões de período */
.rpt-period-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.rpt-period-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1;
}
.rpt-period-btn:hover { border-color: #6366f1; color: #6366f1; background: #f5f3ff; }
.rpt-period-btn.rpt-period-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37,99,235,.30);
}

/* ── KPI Grid (4 colunas) ────────────────────────────────────── */
.rpt-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.rpt-kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  transition: transform .2s ease, box-shadow .2s ease;
}
.rpt-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.09);
}
.rpt-kpi-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rpt-kpi-icon-wrap i { width: 22px; height: 22px; }
.rpt-icon-green  { background: #f0fdf4; color: #16a34a; }
.rpt-icon-blue   { background: #eff6ff; color: #2563eb; }
.rpt-icon-purple { background: #f5f3ff; color: #7c3aed; }
.rpt-icon-teal   { background: #f0fdfa; color: #0d9488; }
.rpt-icon-amber  { background: #fffbeb; color: #d97706; }
.rpt-kpi-body    { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rpt-kpi-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: #94a3b8; white-space: nowrap;
}
.rpt-kpi-value {
  font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.1; white-space: nowrap;
}
/* Borda colorida lateral */
.rpt-kpi-green  { border-left: 4px solid #22c55e; }
.rpt-kpi-blue   { border-left: 4px solid #3b82f6; }
.rpt-kpi-purple { border-left: 4px solid #8b5cf6; }
.rpt-kpi-teal   { border-left: 4px solid #14b8a6; }
.rpt-kpi-amber  { border-left: 4px solid #f59e0b; }

/* ── Layout 2 colunas (linhas 2 e 3) ────────────────────────── */
.rpt-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ── Cards genéricos ─────────────────────────────────────────── */
.rpt-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.04);
  overflow: hidden;
}
.rpt-card-full { /* ocupa linha inteira – já garantido por estar fora de grid 2col */ }
.rpt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  background: #fafbfc;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}
.rpt-card-header-left { display: flex; align-items: center; gap: 8px; }
.rpt-card-icon { width: 16px; height: 16px; color: #6366f1; flex-shrink: 0; }
.rpt-icon-danger { color: #dc2626 !important; }

/* ── Wrapper de gráfico ──────────────────────────────────────── */
.rpt-chart-wrap {
  padding: 20px;
  position: relative;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rpt-chart-sm { max-height: 260px; }
.rpt-chart-wrap canvas { max-height: 260px; }

/* ── Tabela ──────────────────────────────────────────────────── */
.rpt-table-wrap { overflow-x: auto; }
.rpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rpt-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #94a3b8;
  background: #fafbfc;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.rpt-table tbody tr {
  border-bottom: 1px solid #f8fafc;
  transition: background .12s;
}
.rpt-table tbody tr:last-child { border-bottom: none; }
.rpt-table tbody tr:hover { background: #f8fafc; }
.rpt-table tbody td {
  padding: 11px 16px;
  color: #334155;
  vertical-align: middle;
}
.rpt-td-num    { font-weight: 700; color: #6366f1 !important; white-space: nowrap; font-family: monospace; font-size: 12px; }
.rpt-td-cliente{ max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rpt-td-valor  { font-weight: 700; white-space: nowrap; color: #0f172a !important; }
.rpt-td-forma  { white-space: nowrap; color: #64748b !important; font-size: 12px; }
.rpt-td-status { white-space: nowrap; }
.rpt-td-data   { white-space: nowrap; color: #94a3b8 !important; font-size: 12px; }

.rpt-list-count {
  font-size: 12px; font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 3px 12px;
  border-radius: 20px;
}
.rpt-empty {
  text-align: center;
  color: #cbd5e1;
  padding: 40px 16px !important;
  font-size: 13px;
}

/* ── Badges de status ────────────────────────────────────────── */
.rpt-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.rpt-badge-green  { background: #dcfce7; color: #16a34a; }
.rpt-badge-yellow { background: #fef9c3; color: #a16207; }
.rpt-badge-red    { background: #fee2e2; color: #dc2626; }

/* ── Card estoque crítico ────────────────────────────────────── */
.rpt-card-danger { border-top: 3px solid #fca5a5; }
.rpt-critical-list { padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 8px; }
.rpt-critical-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #fee2e2;
  gap: 12px;
}
.rpt-critical-name { font-size: 13px; font-weight: 600; color: #1e293b; }
.rpt-critical-stocks { display: flex; gap: 8px; flex-wrap: wrap; }
.rpt-critical-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px;
  color: #16a34a;
  font-size: 13px;
  font-weight: 500;
}
.rpt-critical-ok-icon { width: 18px; height: 18px; }

/* ── Badges de estoque ───────────────────────────────────────── */
.badge-red  { background: #fee2e2; color: #dc2626; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }
.badge-gray { background: #f1f5f9; color: #64748b; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 12px; }

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .rpt-kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  .rpt-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .rpt-row-2col { grid-template-columns: 1fr; }
  .rpt-td-forma, .rpt-td-data { display: none; }
  .rpt-kpi-value { font-size: 18px; }
}
@media (max-width: 480px) {
  .rpt-kpi-grid { grid-template-columns: 1fr; }
  .rpt-kpi-card { padding: 14px; gap: 12px; }
  .rpt-topbar { flex-direction: column; align-items: flex-start; }
}

/* ══════════════════════════════════════════════════════════════
   RELATÓRIOS – ajustes finais (tabela scroll, badges, espaçamento)
══════════════════════════════════════════════════════════════ */

/* Tabela com scroll vertical e cabeçalho fixo */
.rpt-table-scroll-wrap {
  max-height: 420px;
  overflow-y: auto;
  overflow-x: auto;
}
.rpt-table-scroll-wrap .rpt-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fafbfc;
  box-shadow: 0 1px 0 #e2e8f0;
}

/* Badges pill perfeito */
.rpt-badge {
  font-size: 11px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
}

/* Espaçamento interno dos gráficos */
.rpt-chart-wrap {
  padding: 16px 20px !important;
}
canvas {
  max-height: 280px !important;
}

/* ── Picker de período personalizado ────────────────────────── */
.rpt-custom-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  margin-top: -8px;
}
.rpt-custom-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
}
.rpt-custom-input {
  padding: 6px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color .15s;
}
.rpt-custom-input:focus { border-color: #6366f1; }
.rpt-custom-sep { font-size: 14px; color: #94a3b8; font-weight: 600; }
.rpt-custom-clear {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}
.rpt-custom-clear:hover { border-color: #ef4444; color: #ef4444; }
/* Botão personalizado destaque sutil */
.rpt-period-custom-btn { border-style: dashed; }
.rpt-period-custom-btn.rpt-period-active { border-style: solid; }

/* ══════════════════════════════════════════════════════════════
   USER MENU – dropdown de perfil no topbar
══════════════════════════════════════════════════════════════ */

/* Wrapper posicionado */
.usr-menu-wrap {
  position: relative;
}

/* Botão trigger */
.usr-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1.5px solid #e2e8f0;
  border-radius: 40px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  max-width: 220px;
}
.usr-trigger:hover {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}

/* Avatar no trigger */
.usr-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.usr-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Nome truncado */
.usr-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

/* Chevron */
.usr-chevron {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  flex-shrink: 0;
  transition: transform .2s ease;
}

/* Dropdown panel */
.usr-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 1000;
  overflow: hidden;
  animation: usrDropIn .15s ease;
}
@keyframes usrDropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Header do dropdown */
.usr-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #f8fafc;
}
.usr-dh-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #e2e8f0;
}
.usr-dh-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.usr-dh-name {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.usr-dh-email {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

/* Divisor */
.usr-dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 2px 0;
}

/* Itens */
.usr-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: background .12s;
  text-align: left;
}
.usr-dropdown-item:hover { background: #f8fafc; color: #1e293b; }
.usr-item-icon { width: 15px; height: 15px; color: #64748b; flex-shrink: 0; }

/* Item Sair */
.usr-dropdown-logout { color: #ef4444; }
.usr-dropdown-logout:hover { background: #fff5f5; color: #dc2626; }
.usr-dropdown-logout .usr-item-icon { color: #ef4444; }

/* ═══════════════════════════════════════════════
   EXPORTAÇÃO PDF – Botão + Overlay de progresso
   ─────────────────────────────────────────────── */

/* Agrupa botão PDF e filtros de período lado a lado */
.rpt-topbar-right {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

/* Layout do topbar com actions + period-bar na mesma linha */
.rpt-topbar-actions {
  display: flex;
  align-items: center;
}

/* Botão Exportar PDF */
.rpt-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(37,99,235,.25);
}
.rpt-pdf-btn:hover:not(:disabled) {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
}
.rpt-pdf-btn:active:not(:disabled) {
  transform: translateY(0);
}
.rpt-pdf-btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
  transform: none;
}

/* Overlay de progresso PDF */
.rpt-pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.rpt-pdf-overlay.hidden { display: none; }

.rpt-pdf-overlay-box {
  background: #fff;
  border-radius: 14px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  min-width: 260px;
}
.rpt-pdf-overlay-icon {
  width: 48px;
  height: 48px;
  color: #2563eb;
  margin: 0 auto 12px;
  animation: rptSpin 1.2s linear infinite;
}
.rpt-pdf-overlay-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 4px;
}
.rpt-pdf-overlay-sub {
  font-size: 12px;
  color: #94a3b8;
}

/* Spinner keyframes */
@keyframes rptSpin {
  to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════
   CUSTOM-ALERT – Alerta flutuante (canto inferior direito)
   Substitui modal-alert inline nos módulos principais
   ─────────────────────────────────────────────── */
.custom-alert {
  position: fixed;
  bottom: 24px;
  right: 24px;
  min-width: 280px;
  max-width: 400px;
  color: #fff;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.22);
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  /* Estado inicial: invisível (a classe -in anima a entrada) */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

/* Entrada */
.custom-alert.custom-alert-in {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Saída */
.custom-alert.custom-alert-out {
  opacity: 0;
  transform: translateY(8px);
}

/* Empilhamento: alertas múltiplos sobem um acima do outro */
.custom-alert + .custom-alert {
  bottom: calc(24px + 72px);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVIDADE GLOBAL — 1366×768 (notebooks comuns)
   Regras COMPLEMENTARES: não removem nem substituem nada acima.
   ═══════════════════════════════════════════════════════════════ */

/* Bloquear scroll horizontal no html (complementa body já existente) */
html { overflow-x: hidden; }

/* Garantir que containers internos não ultrapassem a viewport */
.main-content,
.page-content {
  min-width: 0;        /* impede que flex/grid filhos estourem o container */
}

@media (max-width: 1366px) {
  /* Dashboard: 4 colunas → 2 colunas em notebooks */
  .dash-cards-grid { grid-template-columns: repeat(2, 1fr) !important; }

  /* Tabelas: permitir scroll horizontal interno em vez de cortar */
  .table-container,
  .sl-table-wrap,
  .rpt-table-wrap,
  .os-table-wrap,
  .prod-table-wrap,
  .sup-table-wrap,
  .acc-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Modais: não ultrapassar a viewport */
  .modal-card,
  .modal-lg,
  .pdv-modal-card,
  .rc-pay-modal-card {
    max-width: calc(100vw - 32px) !important;
    box-sizing: border-box;
  }
}

@media (max-width: 900px) {
  /* Dashboard: 2 colunas → 1 coluna em telas pequenas */
  .dash-cards-grid { grid-template-columns: 1fr !important; }

  /* page-content: padding menor para aproveitar espaço */
  .page-content { padding: 12px 14px !important; }
}

/* ═══════════════════════════════════════════════════════════════
   CORREÇÕES PONTUAIS DE OVERFLOW — elementos específicos
   Apenas complementar; nenhuma regra existente foi alterada.
   ═══════════════════════════════════════════════════════════════ */

/* Modais: garantir que não ultrapassem a viewport em qualquer largura */
.vw-modal-card,
.pdv-modal-card,
.estorno-modal-card,
.sl-del-modal,
.rc-pay-modal-card {
  box-sizing: border-box;
  max-width: min(100%, var(--modal-max, 860px));
}

/* Corrigir overflow-x: visible no modal de venda (pode vazar conteúdo) */
.pdv-modal-card { overflow-x: hidden; }

/* Grids do dashboard sem cobertura entre 1100px e 1366px */
@media (max-width: 1366px) {
  .kpi-grid        { grid-template-columns: repeat(2, 1fr) !important; }
  .db-kpi-row      { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-row-3      { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-quick-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Tabela de vendas: garantir scroll interno mesmo fora do media query */
.sl-table-responsive,
.rc-table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   CORREÇÃO FINAL — gap 1101px→1366px para grids sem cobertura
   Apenas complementar; nada existente foi alterado.
   ═══════════════════════════════════════════════════════════════ */

/* Containers principais: garantir que nunca ultrapassem a viewport */
.main-content { max-width: 100%; } /* sidebar removida: ocupa tela toda */

@media (max-width: 1366px) {
  /* db-row-3 (3 colunas) — breakpoint anterior só em ≤1100px */
  .db-row-3     { grid-template-columns: repeat(2, 1fr) !important; }

  /* sa-kpi-grid — breakpoint anterior só em ≤1024px */
  .sa-kpi-grid  { grid-template-columns: repeat(2, 1fr) !important; }

  /* rpt-kpi-grid — 5 cards: cabe 3 por linha em 1366px */
  .rpt-kpi-grid { grid-template-columns: repeat(3, 1fr) !important; }
  /* cp-kpi-grid — mantém 5 colunas em 1366px (desktop largo) */
  .cp-kpi-grid  { grid-template-columns: repeat(5, 1fr) !important; }

  /* prd-form-grid-3 (formulário de produto, 3 colunas) */
  .prd-form-grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ═══════════════════════════════════════════════════════════════
   CORREÇÃO ESTRUTURAL — sidebar fixed + main-content
   Sidebar é position:fixed (fora do fluxo). main-content usa
   margin-left para compensar. Sem max-width correto, o conteúdo
   soma margin + 100vw e estoura a tela horizontalmente.
   ═══════════════════════════════════════════════════════════════ */

/* main-content: sidebar removida — ocupa sempre 100vw */
.main-content {
  max-width: 100vw;
  min-width: 0;
  overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   CONTENÇÃO DE FILHOS — impede que filhos internos estourem
   o limite já definido no .main-content.
   Apenas adições; nada existente foi alterado.
   ═══════════════════════════════════════════════════════════════ */

/* Filhos flex/grid: permitir encolher abaixo do conteúdo natural */
.page-content,
[class*="dash-"],
[class*="-grid"],
[class*="-row"] {
  min-width: 0;
}

/* Imagens e canvas: nunca ultrapassar o container */
img, canvas, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Tabelas sem wrapper: não forçar largura além do container */
table:not([class]) {
  max-width: 100%;
  table-layout: auto;
}

/* ═══════════════════════════════════════════════════════════════
   CORREÇÃO SCROLL VERTICAL — liberar fluxo de altura
   Causa: .dashboard-body display:flex + min-height:100vh prende
   .main-content em 100vh, cortando conteúdo inferior.
   Solução: permitir que os containers cresçam naturalmente.
   NÃO altera largura, grids ou responsividade horizontal.
   ═══════════════════════════════════════════════════════════════ */

/* Container raiz da dashboard: crescer com o conteúdo */
.dashboard-body {
  height: auto;        /* remove o teto implícito de 100vh via flex */
  min-height: 100vh;   /* mantém preenchimento mínimo */
  align-items: stretch;/* filhos esticam, não ficam presos */
}

/* Main content: altura automática — rola via body */
.main-content {
  height: auto;
  min-height: calc(100vh - var(--topnav-h)); /* preenche visual, mas cresce */
  overflow-y: visible; /* deixa o scroll subir para o body */
}

/* Page content: nunca travar altura */
.page-content {
  height: auto;
  overflow-y: visible;
}

/* ═══════════════════════════════════════════════════════════════
   CORREÇÃO SIDEBAR — scroll interno para botão "Sair" acessível
   Causa: sidebar position:fixed sem overflow-y:auto; conteúdo que
   ultrapassa 100vh fica oculto sem scroll.
   NÃO altera largura, layout do sistema ou nenhum JS/HTML.
   ═══════════════════════════════════════════════════════════════ */

.sidebar {
  height: 100vh;       /* altura exata da viewport (já é fixed, trava correto) */
  overflow-y: auto;    /* scroll interno quando conteúdo > 100vh */
  overflow-x: hidden;  /* nunca scroll horizontal */
}

/* Nav cresce e empurra o footer para baixo; footer fica fixo no fundo */
.sidebar-nav {
  flex: 1;             /* já definido — reforça aqui */
  overflow-y: auto;    /* se a nav em si tiver muitos itens, rola só ela */
}

/* Footer sempre acessível via margin-top:auto dentro do flex column */
.sidebar-footer {
  margin-top: auto;    /* empurra para o fim do flex — botão Sair sempre visível */
  flex-shrink: 0;      /* não encolhe quando o espaço é reduzido */
}

/* =========================
   CORREÇÃO DE LINHAS DO DASHBOARD
   ========================= */

/* força linha a alinhar tudo */
.dash-row-3,
.dashboard-row,
.row-cards {
  display: grid !important;
  align-items: stretch !important;
}

/* todos os cards ocupam mesma altura */
.dash-row-3 > *,
.dashboard-row > *,
.row-cards > * {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* estrutura interna dos cards */
.card,
.dashboard-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* conteúdo cresce igual */
.card-body,
.card-content {
  flex: 1;
}

/* evita card menor por conteúdo curto */
.card-footer,
.card-actions {
  margin-top: auto;
}

/* =========================
   CORREÇÃO REAL DO GRID DASHBOARD
   ========================= */

/* telas grandes */
@media (min-width: 1367px) {
  .dash-row-3,
  .dashboard-row {
    grid-template-columns: repeat(3, 1fr) !important;
  }
}

/* telas tipo notebook (SEU CASO) */
@media (max-width: 1366px) {
  .dash-row-3,
  .dashboard-row {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* mobile */
@media (max-width: 900px) {
  .dash-row-3,
  .dashboard-row {
    grid-template-columns: 1fr !important;
  }
}

/* evita quebra estranha */
.dash-row-3,
.dashboard-row {
  display: grid !important;
  gap: 16px;
}

/* garante que card não "empurre" layout */
.dash-row-3 > *,
.dashboard-row > * {
  min-width: 0;
}

/* =========================
   COR DE CATEGORIA (OPCIONAL)
   Input color compacto ao lado do campo Categoria.
   Não afeta nenhuma regra existente.
   ========================= */

/* Wrapper categoria: alinhar input text + color picker */
.prd-categoria-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.prd-categoria-wrap .prd-input {
  flex: 1;
  min-width: 0;
}

/* Botão color compacto */
.prd-color-picker {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

.prd-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.prd-color-picker::-webkit-color-swatch         { border: none; border-radius: 4px; }
.prd-color-picker::-moz-color-swatch            { border: none; border-radius: 4px; }

/* =========================
   AUTOCOMPLETE DE CATEGORIA
   Apenas visual — não afeta nenhuma regra existente.
   ========================= */

.autocomplete-box {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  max-height: 160px;
  overflow-y: auto;
  z-index: 1200;
  box-shadow: 0 4px 12px rgba(0,0,0,.10);
  /* oculto quando vazio */
}

.autocomplete-box:empty {
  display: none;
}

.autocomplete-item {
  padding: 8px 12px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item:hover {
  background: #f3f4f6;
  color: #2563eb;
}

/* ===== MELHORIA VISUAL KPI (SEGURO) ===== */

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.kpi-card small {
  font-size: 12px;
  color: #6b7280;
}

.kpi-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

/* ===== FIM ===== */

/* ===== MELHORIA VISUAL KPI — ESTILO PREMIUM ===== */

.kpi-value {
  font-size: 28px !important;
  font-weight: 800 !important;
  color: #0f172a !important;
  letter-spacing: -0.5px;
}

.kpi-card {
  position: relative; /* necessário para ::before */
  padding: 18px !important;
  transition: all 0.2s ease;
}

.kpi-card small {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
}

/* leve destaque lateral mais moderno */
.kpi-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(to bottom, #3b82f6, #6366f1);
}

/* ===== FIM ===== */

/* ===== EMPTY STATE — sem vendas ===== */

.empty-state {
  text-align: center;
  padding: 20px;
  color: #6b7280;
}

.empty-state strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

/* ===== FILTROS INTELIGENTES DO RELATÓRIO ===== */

.rpt-smart-filters {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.rpt-sf-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.rpt-sf-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
  flex: 1;
}

.rpt-sf-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.rpt-sf-select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  color: #374151;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}

.rpt-sf-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59,130,246,.15);
}

.rpt-sf-clear {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  align-self: flex-end;
}

.rpt-sf-clear:hover { background: #fecaca; }

.rpt-sf-active {
  margin-top: 6px;
  font-size: 11px;
  color: #3b82f6;
  font-weight: 600;
}

@media (max-width: 768px) {
  .rpt-sf-field { min-width: calc(50% - 5px); flex: none; }
}

@media (max-width: 480px) {
  .rpt-sf-field { min-width: 100%; }
}

/* ===== KPI VALUE — TEXTO ADAPTÁVEL (SEM ELLIPSIS) ===== */
.kpi-value,
.rpt-kpi-value {
  font-size: clamp(16px, 1.8vw, 24px) !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

.kpi-card,
.rpt-kpi-card {
  min-width: 0;
}
/* ===== FIM KPI VALUE ===== */

/* ===== INSIGHTS BOX — RESUMO INTELIGENTE ===== */
.insights-box {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.insight-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 20px;
  min-width: 200px;
  flex: 1 1 200px;
  max-width: 300px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.insight-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #eff6ff;
  border-radius: 8px;
  color: #2563eb;
  flex-shrink: 0;
}

.insight-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.insight-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.insight-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  white-space: nowrap;
}

.insight-value {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .insight-card { max-width: 100%; flex: 1 1 100%; }
}
/* ===== FIM INSIGHTS BOX ===== */

/* ══════════════════════════════════════════════════════════════
   CONTAS A PAGAR  –  /contas-pagar
   ══════════════════════════════════════════════════════════════ */

/* ── Wrapper de conteúdo — ocupa toda a largura disponível ──── */
.cp-page-wrap {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* ── Cabeçalho ───────────────────────────────────────────────── */
.cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.cp-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.cp-header-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
.cp-title    { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0; }
.cp-subtitle { font-size: 0.8rem;  color: #64748b; margin: 3px 0 0; }

/* ── Card de totalizador no header ───────────────────────────── */
.cp-summary-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.cp-summary-label { font-size: 0.72rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; }
.cp-summary-value { font-size: 1.3rem; font-weight: 800; color: #f59e0b; }

/* ── KPI grid de contas a pagar (padrão rpt-kpi) ─────────────── */
/* 5 cards em linha única no desktop; herda rpt-kpi-card para o visual */
.cp-kpi-grid {
  grid-template-columns: repeat(5, 1fr) !important;
  gap: 12px;
  margin-bottom: 18px;
}
.cp-kpi-grid .rpt-kpi-card {
  padding: 14px 16px;
  gap: 12px;
  border-radius: 10px;
}
.cp-kpi-grid .rpt-kpi-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 10px;
}
.cp-kpi-grid .rpt-kpi-icon-wrap i { width: 20px; height: 20px; }
/* Título (rótulo) — etiqueta discreta, não compete com valor */
.cp-kpi-grid .rpt-kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: #94a3b8;
  opacity: .85;
  margin-bottom: 3px;
}
/* Valor principal — elemento dominante (≈ text-3xl bold) */
.cp-kpi-grid .rpt-kpi-value {
  font-size: 26px !important;
  font-weight: 700 !important;
  line-height: 1.15 !important;
  white-space: nowrap;
}
/* Corpo: espaçamento vertical título → valor → contagem */
.cp-kpi-grid .rpt-kpi-body { gap: 0; }

/* Quantidade de contas — legível, secundário */
.cp-kpi-count {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
  margin-top: 4px;
}

/* ── Variantes de cor — fundo branco, cor só em borda + ícone + valor ── */

/* TOTAL PENDENTE — âmbar neutro */
.cp-kpi-amber  { border-left: 4px solid #f59e0b; background: #fff; }
.cp-kpi-icon-amber { background: #fffbeb; color: #d97706; }
.cp-kpi-amber .rpt-kpi-value { color: #b45309; }

/* TOTAL PAGO — verde */
.cp-kpi-green  { border-left: 4px solid #22c55e; background: #fff; }
.cp-kpi-icon-green { background: #f0fdf4; color: #16a34a; }
.cp-kpi-green .rpt-kpi-value { color: #15803d; }

/* VENCIDO — vermelho forte, card crítico */
.cp-kpi-red {
  border-left: 5px solid #dc2626;
  background: #fff;
  box-shadow: 0 2px 10px rgba(220,38,38,.14), 0 1px 3px rgba(0,0,0,.06);
}
.cp-kpi-red:hover {
  box-shadow: 0 6px 20px rgba(220,38,38,.20), 0 2px 6px rgba(0,0,0,.08);
}
.cp-kpi-icon-red { background: #fee2e2; color: #dc2626; }
.cp-kpi-red .rpt-kpi-value { color: #dc2626; font-size: 28px !important; }
.cp-kpi-red .rpt-kpi-label { color: #dc2626; opacity: 1; }

/* VENCE HOJE — amarelo vivo, claramente diferente do laranja */
.cp-kpi-yellow {
  border-left: 5px solid #eab308;
  background: #fff;
  box-shadow: 0 2px 8px rgba(234,179,8,.13), 0 1px 3px rgba(0,0,0,.05);
}
.cp-kpi-icon-yellow { background: #fef9c3; color: #ca8a04; }
.cp-kpi-yellow .rpt-kpi-value { color: #854d0e; font-size: 27px !important; }
.cp-kpi-yellow .rpt-kpi-label { color: #ca8a04; opacity: 1; }

/* PRÓXIMOS — laranja, distinto do amarelo */
.cp-kpi-orange {
  border-left: 4px solid #f97316;
  background: #fff;
}
.cp-kpi-icon-orange { background: #ffedd5; color: #ea580c; }
.cp-kpi-orange .rpt-kpi-value { color: #c2410c; }

/* ── Barra de busca + filtro — sobrescreve sl-search-card só nesta tela ── */
/* Garante que input (flex:1) e select (180px fixo) fiquem na mesma linha   */
.cp-page-wrap .sl-search-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.cp-page-wrap .sl-search-wrap {
  flex: 1;
  min-width: 0;
}
.cp-page-wrap .sl-search-input {
  height: 38px;
  font-size: 0.875rem;
}
.cp-page-wrap .sl-filter-select {
  height: 38px;
  min-width: 180px;
  width: 180px;
  flex-shrink: 0;
  font-size: 0.875rem;
}

/* ── Tabela ──────────────────────────────────────────────────── */
.cp-table-wrap {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.cp-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Proporções das colunas via classes semânticas */
.cp-col-desc   { width: 33%; }
.cp-col-forn   { width: 22%; }
.cp-col-valor  { width: 13%; }
.cp-col-venc   { width: 14%; }
.cp-col-status { width: 10%; }
.cp-col-acoes  { width: 130px; }

.cp-th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.695rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: .55px;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.cp-td {
  padding: 0 16px;
  height: 58px;
  font-size: 0.875rem;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.cp-table tbody tr:last-child .cp-td { border-bottom: none; }
.cp-table tbody tr:hover { background: #f8fafc; transition: background .1s; }

/* Linha vencida */
/* Linha vencida */
.cp-row-vencida .cp-td { background: #fff9f9; }
.cp-row-vencida .cp-td:first-child { border-left: 3px solid #dc2626; }

/* Linha vence hoje — amarelo vivo */
.cp-alerta-hoje .cp-td { background: #fefce8; }
.cp-alerta-hoje .cp-td:first-child { border-left: 3px solid #eab308; }

/* Linha próxima — laranja, claramente distinto do amarelo */
.cp-alerta-proximo .cp-td { background: #fff7ed; }
.cp-alerta-proximo .cp-td:first-child { border-left: 3px solid #f97316; }

/* Alertas visuais de vencimento */
.cp-alerta-vencido .cp-td { background: #fff1f1; }
.cp-alerta-vencido .cp-td:first-child { border-left: 3px solid #dc2626; }
.cp-alerta-vencido .cp-td { color: #dc2626; font-weight: 600; }

.cp-alerta-hoje .cp-td { background: #fffbeb; }
.cp-alerta-hoje .cp-td:first-child { border-left: 3px solid #f59e0b; }
.cp-alerta-hoje .cp-td { color: #b45309; font-weight: 600; }

.cp-alerta-proximo .cp-td { background: #fff7ed; }
.cp-alerta-proximo .cp-td:first-child { border-left: 3px solid #fb923c; }
.cp-alerta-proximo .cp-td { color: #c2410c; }

/* Células específicas */
.cp-td-desc  { overflow: visible; }
.cp-desc     { display: block; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-doc      { display: block; font-size: 0.74rem; color: #94a3b8; margin-top: 2px; }
.cp-td-valor { font-weight: 700; color: #0f172a; white-space: nowrap; }

/* ── Célula e coluna de Ações ─────────────────────────────────── */
.cp-th-acoes { text-align: right; padding-right: 14px; }
.cp-td-acoes {
  padding: 0 12px 0 8px;
  vertical-align: middle;
}
.cp-acoes-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

/* ── Botões de ação ──────────────────────────────────────────── */
.cp-btn-pagar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 11px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cp-btn-pagar:hover  { background: #dcfce7; border-color: #4ade80; color: #166534; }
.cp-btn-pagar:active { background: #bbf7d0; border-color: #22c55e; }

.cp-btn-editar,
.cp-btn-excluir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.cp-btn-editar  { color: #2563eb; }
.cp-btn-editar:hover  { background: #eff6ff; border-color: #93c5fd; }
.cp-btn-editar:active { background: #dbeafe; }
.cp-btn-excluir { color: #dc2626; }
.cp-btn-excluir:hover  { background: #fff1f2; border-color: #fca5a5; }
.cp-btn-excluir:active { background: #fee2e2; }

.cp-pago-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #16a34a;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ── Badges de status ────────────────────────────────────────── */
.cp-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}
.cp-badge-yellow { background: #fef9c3; color: #854d0e; }
.cp-badge-red    { background: #fee2e2; color: #991b1b; }
.cp-badge-green  { background: #d1fae5; color: #065f46; }
.cp-badge-blue   { background: #dbeafe; color: #1d4ed8; }

/* ── Empty state ─────────────────────────────────────────────── */
.cp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 24px;
  gap: 10px;
  color: #94a3b8;
  text-align: center;
}
.cp-empty-title { font-size: 1.05rem; font-weight: 700; color: #475569; margin: 4px 0 0; }
.cp-empty-desc  { font-size: 0.85rem; color: #94a3b8; margin: 0; }

/* ── Toast de feedback ───────────────────────────────────────── */
.cp-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.cp-toast-hidden  { opacity: 0; transform: translateY(8px); pointer-events: none; }
.cp-toast-success { opacity: 1; transform: translateY(0); background: #16a34a; }
.cp-toast-danger  { opacity: 1; transform: translateY(0); background: #dc2626; }
.cp-toast-warning { opacity: 1; transform: translateY(0); background: #d97706; }
.cp-toast-info    { opacity: 1; transform: translateY(0); background: #2563eb; }

/* ══════════════════════════════════════════════════════════════
   MODAL IMPORTAÇÃO DE PRODUTOS VIA XML  (.cpx-*)
   ══════════════════════════════════════════════════════════════ */
.cpx-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(15,23,42,.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.cpx-modal {
  background: #fff; border-radius: 14px;
  width: 100%; max-width: 640px; max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  overflow: hidden;
}
.cpx-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 14px; border-bottom: 1px solid #e5e7eb;
}
/* Barra "Selecionar todos" */
.cpx-select-all-bar {
  padding: 8px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}
.cpx-select-all-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; color: #475569; cursor: pointer;
  user-select: none;
}
.cpx-select-all-label:hover { color: #1e293b; }
.cpx-modal-title  { font-size: 17px; font-weight: 700; color: #0f172a; margin: 0 0 2px; }
.cpx-modal-sub    { font-size: 13px; color: #64748b; margin: 0; }
.cpx-close {
  background: none; border: none; cursor: pointer;
  font-size: 18px; color: #94a3b8; padding: 4px 6px; border-radius: 6px;
  line-height: 1; flex-shrink: 0;
}
.cpx-close:hover { background: #f1f5f9; color: #475569; }

.cpx-modal-body {
  overflow-y: auto; padding: 16px 24px;
  display: flex; flex-direction: column; gap: 12px;
}

/* Item individual */
.cpx-item {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid #e2e8f0;
  border-radius: 10px; padding: 12px 14px;
}
.cpx-item-novo      { background: #eff6ff; border-left: 4px solid #3b82f6; }
.cpx-item-existente { background: #f0fdf4; border-left: 4px solid #22c55e; }
.cpx-item-check { padding-top: 2px; }
.cpx-chk { width: 16px; height: 16px; cursor: pointer; accent-color: #2563eb; }
.cpx-item-body  { flex: 1; min-width: 0; }
.cpx-item-header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.cpx-item-nome  { font-size: 14px; font-weight: 600; color: #1e293b; cursor: pointer; }
.cpx-item-meta  {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-size: 12px; color: #64748b; margin-bottom: 8px;
}
.cpx-item-meta strong { color: #334155; }

/* Badges */
.cpx-badge        { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.cpx-badge-new    { background: #dbeafe; color: #1d4ed8; }
.cpx-badge-exists { background: #dcfce7; color: #15803d; }

/* Input preço de venda */
.cpx-venda-wrap  { margin-top: 4px; }
.cpx-venda-label { display: block; font-size: 11px; color: #64748b; margin-bottom: 3px; }
.cpx-venda-input {
  width: 160px; padding: 5px 10px;
  border: 1px solid #cbd5e1; border-radius: 6px;
  font-size: 13px; color: #1e293b;
}
.cpx-venda-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px #dbeafe; }
.cpx-venda-info  { font-size: 12px; color: #64748b; }

/* Resumo badges no subtítulo */
.cpx-resumo-new    { color: #1d4ed8; font-weight: 600; }
.cpx-resumo-exists { color: #15803d; font-weight: 600; }

/* Footer */
.cpx-modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 24px; border-top: 1px solid #e5e7eb;
}
.cpx-btn-cancel {
  padding: 8px 18px; border-radius: 8px; font-size: 14px; font-weight: 500;
  border: 1px solid #e2e8f0; background: #f8fafc; color: #475569; cursor: pointer;
}
.cpx-btn-cancel:hover { background: #f1f5f9; }
.cpx-btn-confirm {
  padding: 8px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
  background: #2563eb; color: #fff; border: none; cursor: pointer;
}
.cpx-btn-confirm:hover   { background: #1d4ed8; }
.cpx-btn-confirm:disabled { opacity: .6; cursor: not-allowed; }

/* Toast rico de importação de produtos (.cpx-toast-pro) */
.cpx-toast-pro {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; align-items: flex-start; gap: 14px;
  background: #fff;
  border-left: 5px solid #22c55e;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 16px 18px;
  min-width: 260px; max-width: 340px;
  animation: cpxToastIn .25s ease;
}
@keyframes cpxToastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cpx-toast-icon    { font-size: 22px; line-height: 1; padding-top: 1px; flex-shrink: 0; }
.cpx-toast-content { flex: 1; min-width: 0; }
.cpx-toast-title   { display: block; font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 5px; }
.cpx-toast-lines   { display: flex; flex-direction: column; gap: 3px; }
.cpx-toast-line    { font-size: 13px; color: #475569; }
.cpx-toast-line strong { color: #1e293b; }
.cpx-toast-err     { color: #dc2626; }
.cpx-toast-err strong { color: #dc2626; }
.cpx-toast-close {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: #94a3b8; padding: 2px 4px;
  border-radius: 4px; line-height: 1; flex-shrink: 0;
}
.cpx-toast-close:hover { background: #f1f5f9; color: #475569; }

/* Responsivo mobile */
@media (max-width: 480px) {
  .cpx-modal-header { padding: 16px 16px 12px; }
  .cpx-modal-body   { padding: 12px 16px; }
  .cpx-modal-footer { padding: 12px 16px; }
  .cpx-venda-input  { width: 100%; }
}

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .cp-col-desc  { width: 30%; }
  .cp-col-forn  { width: 22%; }
}
@media (max-width: 1100px) {
  .cp-kpi-grid { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 900px) {
  .cp-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 640px) {
  .cp-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .cp-kpi-grid .rpt-kpi-card { padding: 10px 12px; gap: 8px; }
  .cp-kpi-grid .rpt-kpi-value { font-size: 14px !important; }
  .cp-header { flex-direction: column; align-items: flex-start; }
  .cp-table { table-layout: auto; }
  .cp-th:nth-child(2),
  .cp-td:nth-child(2) { display: none; }   /* oculta Fornecedor */
  .cp-th:nth-child(4),
  .cp-td:nth-child(4) { display: none; }   /* oculta Vencimento */
  .cp-col-acoes { width: 100px; }
}
/* ===== FIM CONTAS A PAGAR ===== */

/* ===== FIX GLOBAL LAYOUT CONTAS A PAGAR ===== */

/* Barra de busca + filtro alinhados */
.cp-page-wrap .sl-search-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cp-page-wrap .sl-search-input {
  flex: 1;
  height: 40px;
}

.cp-page-wrap .sl-filter-select {
  width: 180px;
  height: 40px;
}

/* Tabela alinhada */
.cp-table th,
.cp-table td {
  vertical-align: middle;
}

.cp-table tr {
  height: 56px;
}

/* Coluna ações limpa e alinhada */
.cp-td-acoes {
  display: table-cell;
  vertical-align: middle;
  padding: 0 12px 0 8px;
}

.cp-acoes-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Segurança: remove qualquer texto indevido dentro de ações */
.cp-td-acoes > span {
  display: none !important;
}

/* ===== FIM FIX GLOBAL LAYOUT CONTAS A PAGAR ===== */

/* ══════════════════════════════════════════════════════════════
   CONTAS A PAGAR — Modal Nova Conta
   ══════════════════════════════════════════════════════════════ */

/* Botão "Nova Conta" no cabeçalho */
.cp-btn-new {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cp-btn-new:hover {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(245,158,11,.35);
  transform: translateY(-1px);
}
.cp-btn-new:active { transform: translateY(0); }

/* Botão Importar XML — tom azul discreto ao lado do Nova Conta */
.cp-btn-xml {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: #fff;
  color: #2563eb;
  border: 1.5px solid #bfdbfe;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s, transform .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.cp-btn-xml:hover {
  background: #eff6ff;
  border-color: #93c5fd;
  box-shadow: 0 3px 10px rgba(37,99,235,.15);
  transform: translateY(-1px);
}
.cp-btn-xml:active { transform: translateY(0); }
.cp-btn-xml:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* Ajuste no header-right para acomodar card + botão lado a lado */
.cp-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Overlay do modal */
.cp-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

/* Card do modal */
.cp-modal-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0,0,0,.22);
  width: 100%;
  max-width: 900px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;          /* scroll no card inteiro, como cust-modal-card */
  animation: slideUp .22s ease;
}

/* Cabeçalho */
.cp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;               /* fica fixo no topo ao rolar */
}
.cp-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cp-modal-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cp-modal-title    { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0; }
.cp-modal-subtitle { font-size: 12px; color: #64748b; margin: 2px 0 0; }

/* Botão fechar (X) */
.cp-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.cp-modal-close:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* Body com scroll */
.cp-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;       /* sem overflow próprio — quem rola é o card */
}

/* Cards internos de seção */
.cp-mcard {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  overflow: hidden;
}
.cp-mcard-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.cp-mcard-icon  { width: 15px; height: 15px; color: #f59e0b; flex-shrink: 0; }
.cp-mcard-title { font-size: 11.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .7px; }
.cp-mcard-body  { padding: 18px; display: flex; flex-direction: column; gap: 14px; }

/* Grids */
.cp-mgrid   { display: grid; gap: 14px; }
.cp-mgrid-1 { grid-template-columns: 1fr; }
.cp-mgrid-2 { grid-template-columns: 1fr 1fr; }

/* Campos */
.cp-mfield { display: flex; flex-direction: column; gap: 5px; }
.cp-mlabel { font-size: 12.5px; font-weight: 600; color: #334155; }
.cp-mrequired { color: #ef4444; }

/* Input wrapper */
.cp-minput-wrap { position: relative; display: flex; align-items: center; }
.cp-minput-icon {
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
  flex-shrink: 0;
}

/* Inputs */
.cp-minput {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  font-family: inherit;
}
.cp-minput.cp-mhas-icon { padding-left: 38px; }
.cp-minput:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.cp-minput::placeholder { color: #94a3b8; font-size: 13px; }

/* Selects */
.cp-mselect {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .18s, box-shadow .18s;
  font-family: inherit;
}
.cp-mselect.cp-mhas-icon { padding-left: 38px; }
.cp-mselect:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }

/* Textarea */
.cp-mtextarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color .18s, box-shadow .18s;
  font-family: inherit;
}
.cp-mtextarea:focus { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.cp-mtextarea::placeholder { color: #94a3b8; font-size: 13px; }

/* Footer do modal */
.cp-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  z-index: 10;
  border-radius: 0 0 16px 16px;
}

/* Botão Cancelar */
.cp-btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  background: #fff;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s;
}
.cp-btn-cancel:hover { background: #f1f5f9; border-color: #cbd5e1; color: #1e293b; }

/* Botão Salvar */
.cp-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 22px;
  background: #f59e0b;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, box-shadow .2s, transform .15s;
}
.cp-btn-save:hover:not(:disabled) {
  background: #d97706;
  box-shadow: 0 4px 12px rgba(245,158,11,.35);
  transform: translateY(-1px);
}
.cp-btn-save:active:not(:disabled) { transform: translateY(0); }
.cp-btn-save:disabled { opacity: .5; cursor: not-allowed; }

/* Responsivo */
@media (max-width: 600px) {
  .cp-modal-card { max-height: 95vh; border-radius: 12px; }
  .cp-mgrid-2 { grid-template-columns: 1fr; }
  .cp-modal-footer { flex-direction: column-reverse; gap: 8px; }
  .cp-btn-cancel, .cp-btn-save { width: 100%; height: 44px; justify-content: center; }
  .cp-header-right { flex-direction: column; align-items: flex-start; }
}
/* ===== FIM CONTAS A PAGAR MODAL ===== */

/* ══════════════════════════════════════════════════════════════
   FORNECEDORES  –  /suppliers
   ══════════════════════════════════════════════════════════════ */

/* ── Cabeçalho ───────────────────────────────────────────────── */
.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.sp-header-left { display: flex; align-items: center; gap: 14px; }
.sp-header-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 2px 8px rgba(99,102,241,.3);
}
.sp-title    { font-size: 1.25rem; font-weight: 700; color: #0f172a; margin: 0; }
.sp-subtitle { font-size: 0.8rem;  color: #64748b; margin: 3px 0 0; }

/* ── Botão novo ──────────────────────────────────────────────── */
.sp-btn-new {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; background: #4f46e5; color: #fff;
  border: none; border-radius: 8px; font-size: 14px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .2s, transform .15s;
}
.sp-btn-new:hover { background: #4338ca; transform: translateY(-1px); }

/* ── Tabela ──────────────────────────────────────────────────── */
.sp-table-wrap {
  background: #fff; border: 1px solid #e2e8f0;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
}
.sp-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.sp-col-nome   { width: 40%; }
.sp-col-doc    { width: 25%; }
.sp-col-tel    { width: 22%; }
.sp-col-acoes  { width: 120px; }

.sp-th {
  padding: 12px 16px; text-align: left;
  font-size: 0.695rem; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .55px;
  background: #f8fafc; border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.sp-td {
  padding: 0 16px; height: 56px;
  font-size: 0.875rem; color: #334155;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle; overflow: hidden; text-overflow: ellipsis;
}
.sp-table tbody tr:last-child .sp-td { border-bottom: none; }
.sp-table tbody tr:hover { background: #f8fafc; transition: background .1s; }

.sp-td-nome  { overflow: visible; }
.sp-nome     { display: block; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Coluna ações ────────────────────────────────────────────── */
.sp-th-acoes  { text-align: right; padding-right: 14px; }
.sp-td-acoes  { padding: 0 12px 0 8px; vertical-align: middle; }
.sp-acoes-wrap {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
}
.sp-btn-editar,
.sp-btn-excluir {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--border); background: #fff;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  flex-shrink: 0;
}
.sp-btn-editar  { color: #2563eb; }
.sp-btn-editar:hover  { background: #eff6ff; border-color: #93c5fd; }
.sp-btn-excluir { color: #dc2626; }
.sp-btn-excluir:hover { background: #fff1f2; border-color: #fca5a5; }

/* ── Empty state ─────────────────────────────────────────────── */
.sp-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 72px 24px; gap: 10px;
  color: #94a3b8; text-align: center;
}
.sp-empty-title { font-size: 1.05rem; font-weight: 700; color: #475569; margin: 4px 0 0; }
.sp-empty-desc  { font-size: 0.85rem; color: #94a3b8; margin: 0; }

/* ── Toast ───────────────────────────────────────────────────── */
.sp-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  padding: 13px 20px; border-radius: 10px; font-size: 0.875rem;
  font-weight: 600; color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,.15);
  pointer-events: none; transition: opacity .25s, transform .25s;
}
.sp-toast-hidden  { opacity: 0; transform: translateY(8px); pointer-events: none; }
.sp-toast-success { opacity: 1; transform: translateY(0); background: #16a34a; }
.sp-toast-danger  { opacity: 1; transform: translateY(0); background: #dc2626; }

/* ── Modal ───────────────────────────────────────────────────── */
.sp-modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  backdrop-filter: blur(3px); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.sp-modal-card {
  background: #fff; border-radius: 16px; width: 100%; max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18); display: flex; flex-direction: column;
  max-height: calc(100vh - 40px); overflow: hidden;
}
.sp-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 24px 24px 0; gap: 12px;
}
.sp-modal-header-left { display: flex; align-items: center; gap: 12px; }
.sp-modal-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #ede9fe, #c7d2fe);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #4f46e5;
}
.sp-modal-title    { font-size: 1.05rem; font-weight: 700; color: #0f172a; margin: 0; }
.sp-modal-subtitle { font-size: 0.8rem; color: #64748b; margin: 3px 0 0; }
.sp-modal-close {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: #f1f5f9; color: #64748b; cursor: pointer; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s, color .15s;
}
.sp-modal-close:hover { background: #e2e8f0; color: #334155; }

.sp-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }

.sp-alert {
  background: #fef2f2; border: 1px solid #fecaca; color: #dc2626;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 16px;
  font-size: 0.85rem; font-weight: 500;
}

.sp-mlabel {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: #374151; margin-bottom: 6px;
}
.sp-mlabel span { color: #ef4444; margin-left: 2px; }
.sp-minput {
  width: 100%; height: 42px; padding: 0 14px;
  border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.9rem;
  color: #1e293b; background: #f8fafc; outline: none;
  transition: border-color .2s; box-sizing: border-box;
}
.sp-minput:focus { border-color: #6366f1; background: #fff; }
.sp-mrow { margin-bottom: 16px; }
.sp-mrow:last-child { margin-bottom: 0; }
.sp-mrow-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px;
}

.sp-modal-footer {
  padding: 16px 24px; border-top: 1px solid #f1f5f9;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.sp-btn-cancel {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; background: #f1f5f9; color: #64748b;
  border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.sp-btn-cancel:hover { background: #e2e8f0; color: #334155; }
.sp-btn-save {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; background: #4f46e5; color: #fff;
  border: none; border-radius: 8px; font-size: 0.875rem;
  font-weight: 600; cursor: pointer; transition: background .15s;
}
.sp-btn-save:hover    { background: #4338ca; }
.sp-btn-save:disabled { opacity: .6; cursor: not-allowed; }

/* ── Responsivo ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .sp-header { flex-direction: column; align-items: flex-start; }
  .sp-table  { table-layout: auto; }
  .sp-th:nth-child(2), .sp-td:nth-child(2) { display: none; }
  .sp-mrow-2 { grid-template-columns: 1fr; }
  .sp-modal-footer { flex-direction: column-reverse; gap: 8px; }
  .sp-btn-cancel, .sp-btn-save { width: 100%; justify-content: center; }
}
/* ===== FIM FORNECEDORES ===== */

/* ══════════════════════════════════════════════════════════════
   FORNECEDORES V2  –  /suppliers-v2
   (Prefixo sv2-* para isolamento total)
   ══════════════════════════════════════════════════════════════ */

/* ── Cabeçalho ─────────────────────────────────────────────── */
.sv2-header {
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:16px; margin-bottom:24px;
}
.sv2-header-left { display:flex; align-items:center; gap:14px; }
.sv2-header-icon {
  width:46px; height:46px; border-radius:12px; flex-shrink:0;
  background:linear-gradient(135deg,#6366f1,#4f46e5);
  display:flex; align-items:center; justify-content:center;
  box-shadow:0 2px 8px rgba(99,102,241,.3);
}
.sv2-title    { font-size:1.25rem; font-weight:700; color:#0f172a; margin:0; }
.sv2-subtitle { font-size:0.8rem;  color:#64748b; margin:3px 0 0; }

/* ── Botão novo ─────────────────────────────────────────────── */
.sv2-btn-new {
  display:inline-flex; align-items:center; gap:7px;
  padding:10px 20px; background:#4f46e5; color:#fff;
  border:none; border-radius:8px; font-size:14px; font-weight:600;
  cursor:pointer; white-space:nowrap; transition:background .2s, transform .15s;
}
.sv2-btn-new:hover { background:#4338ca; transform:translateY(-1px); }

/* ── Tabela ─────────────────────────────────────────────────── */
.sv2-table-wrap {
  background:#fff; border:1px solid #e2e8f0; border-radius:14px;
  overflow:hidden; box-shadow:0 1px 6px rgba(0,0,0,.06);
}
.sv2-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.sv2-col-nome  { width:40%; }
.sv2-col-doc   { width:23%; }
.sv2-col-tel   { width:22%; }
.sv2-col-acoes { width:100px; }

.sv2-th {
  padding:12px 16px; text-align:left; font-size:0.695rem; font-weight:700;
  color:#64748b; text-transform:uppercase; letter-spacing:.55px;
  background:#f8fafc; border-bottom:2px solid #e2e8f0; white-space:nowrap;
}
.sv2-td {
  padding:0 16px; height:56px; font-size:0.875rem; color:#334155;
  border-bottom:1px solid #f1f5f9; vertical-align:middle;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.sv2-table tbody tr:last-child .sv2-td { border-bottom:none; }
.sv2-table tbody tr:hover { background:#f8fafc; transition:background .1s; }
.sv2-td-nome { overflow:visible; white-space:normal; }
.sv2-nome    { display:block; font-weight:600; color:#1e293b; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* ── Coluna ações ───────────────────────────────────────────── */
.sv2-th-acoes  { text-align:right; padding-right:14px; }
.sv2-td-acoes  { padding:0 10px 0 8px; vertical-align:middle; }
.sv2-acoes-wrap { display:flex; align-items:center; justify-content:flex-end; gap:6px; }

.sv2-btn-edit,
.sv2-btn-del {
  display:inline-flex; align-items:center; justify-content:center;
  width:30px; height:30px; border-radius:6px;
  border:1px solid var(--border); background:#fff;
  cursor:pointer; flex-shrink:0;
  transition:background .15s, border-color .15s, color .15s;
}
.sv2-btn-edit  { color:#2563eb; }
.sv2-btn-edit:hover  { background:#eff6ff; border-color:#93c5fd; }
.sv2-btn-del   { color:#dc2626; }
.sv2-btn-del:hover   { background:#fff1f2; border-color:#fca5a5; }

/* ── Empty state ────────────────────────────────────────────── */
.sv2-empty {
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; padding:72px 24px; gap:10px;
  color:#94a3b8; text-align:center;
}
.sv2-empty-title { font-size:1.05rem; font-weight:700; color:#475569; margin:4px 0 0; }
.sv2-empty-desc  { font-size:0.85rem; color:#94a3b8; margin:0; }

/* ── Toast ──────────────────────────────────────────────────── */
.sv2-toast {
  position:fixed; bottom:28px; right:28px; z-index:9999;
  padding:13px 20px; border-radius:10px; font-size:0.875rem;
  font-weight:600; color:#fff; box-shadow:0 4px 20px rgba(0,0,0,.15);
  pointer-events:none; transition:opacity .25s, transform .25s;
}
.sv2-toast-hidden  { opacity:0; transform:translateY(8px); pointer-events:none; }
.sv2-toast-success { opacity:1; transform:translateY(0); background:#16a34a; }
.sv2-toast-danger  { opacity:1; transform:translateY(0); background:#dc2626; }

/* ── Modal overlay ──────────────────────────────────────────── */
.sv2-modal-overlay {
  position:fixed; inset:0; background:rgba(15,23,42,.45);
  backdrop-filter:blur(3px); z-index:1000;
  display:flex; align-items:center; justify-content:center; padding:16px;
}
.sv2-modal-card {
  background:#fff; border-radius:16px; width:100%; max-width:480px;
  box-shadow:0 20px 60px rgba(0,0,0,.18); display:flex; flex-direction:column;
  max-height:calc(100vh - 40px); overflow:hidden;
}
/* Modal header */
.sv2-modal-header {
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:22px 24px 0; gap:12px;
}
.sv2-modal-header-left { display:flex; align-items:center; gap:12px; }
.sv2-modal-icon {
  width:40px; height:40px; border-radius:10px; flex-shrink:0;
  background:linear-gradient(135deg,#ede9fe,#c7d2fe);
  display:flex; align-items:center; justify-content:center; color:#4f46e5;
}
.sv2-modal-title    { font-size:1rem; font-weight:700; color:#0f172a; margin:0; }
.sv2-modal-subtitle { font-size:0.78rem; color:#64748b; margin:3px 0 0; }
.sv2-modal-close {
  width:32px; height:32px; border-radius:8px; border:none;
  background:#f1f5f9; color:#64748b; cursor:pointer; font-size:1.1rem;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  transition:background .15s, color .15s;
}
.sv2-modal-close:hover { background:#e2e8f0; color:#334155; }

/* Modal body */
.sv2-modal-body { padding:20px 24px; overflow-y:auto; flex:1; }
.sv2-alert {
  background:#fef2f2; border:1px solid #fecaca; color:#dc2626;
  border-radius:8px; padding:10px 14px; margin-bottom:16px;
  font-size:0.85rem; font-weight:500;
}
.sv2-mlabel {
  display:block; font-size:0.8rem; font-weight:600;
  color:#374151; margin-bottom:6px;
}
.sv2-mlabel span { color:#ef4444; margin-left:2px; }
.sv2-minput {
  width:100%; height:42px; padding:0 14px;
  border:1.5px solid #e2e8f0; border-radius:8px; font-size:0.9rem;
  color:#1e293b; background:#f8fafc; outline:none;
  transition:border-color .2s; box-sizing:border-box;
}
.sv2-minput:focus { border-color:#6366f1; background:#fff; }
.sv2-mrow  { margin-bottom:16px; }
.sv2-mrow:last-child { margin-bottom:0; }
.sv2-mrow-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-bottom:16px; }

/* Modal footer */
.sv2-modal-footer {
  padding:16px 24px; border-top:1px solid #f1f5f9;
  display:flex; align-items:center; justify-content:flex-end; gap:10px;
}
.sv2-btn-cancel {
  display:inline-flex; align-items:center; gap:6px;
  padding:9px 18px; background:#f1f5f9; color:#64748b;
  border:1px solid #e2e8f0; border-radius:8px;
  font-size:0.875rem; font-weight:600; cursor:pointer;
  transition:background .15s;
}
.sv2-btn-cancel:hover { background:#e2e8f0; color:#334155; }
.sv2-btn-save {
  display:inline-flex; align-items:center; gap:6px;
  padding:9px 20px; background:#4f46e5; color:#fff;
  border:none; border-radius:8px; font-size:0.875rem;
  font-weight:600; cursor:pointer; transition:background .15s;
}
.sv2-btn-save:hover    { background:#4338ca; }
.sv2-btn-save:disabled { opacity:.6; cursor:not-allowed; }

/* ── Responsivo ─────────────────────────────────────────────── */
@media (max-width:640px) {
  .sv2-header  { flex-direction:column; align-items:flex-start; }
  .sv2-table   { table-layout:auto; }
  .sv2-th:nth-child(2),.sv2-td:nth-child(2) { display:none; }
  .sv2-mrow-2  { grid-template-columns:1fr; }
  .sv2-modal-footer { flex-direction:column-reverse; gap:8px; }
  .sv2-btn-cancel,.sv2-btn-save { width:100%; justify-content:center; }
}
/* ── Seções do modal ────────────────────────────────────────── */
.sv2-section {
  border: 1px solid #f1f5f9;
  border-radius: 10px;
  padding: 16px 16px 4px;
  margin-bottom: 16px;
  background: #fafbfc;
}
.sv2-section-last { margin-bottom: 0; }

.sv2-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e7ff;
}

/* Modal mais largo para comportar o formulário */
.sv2-modal-card { max-width: 560px; }

/* Textarea */
.sv2-mtextarea {
  height: auto !important;
  padding: 10px 14px !important;
  resize: vertical;
  min-height: 72px;
}

/* Select */
.sv2-mselect {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px !important;
  cursor: pointer;
}
/* ===== FIM FORNECEDORES V2 ===== */

/* ===== ANEXOS – CONTAS A PAGAR ===== */
.cp-anexo-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 14px 16px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 13.5px;
  font-weight: 500;
  color: #475569;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .2s, background .2s, color .2s;
  user-select: none;
}
.cp-anexo-label:hover { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.cp-anexo-label.cp-anexo-selected { border-color: #16a34a; background: #f0fdf4; color: #15803d; }
.cp-anexo-atual {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
}
.cp-anexo-atual.hidden { display: none; }
.cp-anexo-atual-link { color: #2563eb; text-decoration: underline; font-weight: 500; }
.cp-anexo-atual-link:hover { color: #1d4ed8; }
.cp-anexo-atual-nome { color: #64748b; }
/* botão 📎 na tabela */
.cp-btn-anexo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  color: #2563eb;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.cp-btn-anexo:hover { background: #eff6ff; border-color: #93c5fd; }
/* ===== FIM ANEXOS ===== */

/* ===== HISTÓRICO CONTAS A PAGAR — MODAL FORNECEDOR ===== */
.sv2-hist-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.sv2-hist-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
}
.sv2-hist-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #64748b;
}
.sv2-hist-resumo {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.sv2-hist-card {
  flex: 1;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sv2-hist-card-green { background: #f0fdf4; border: 1px solid #bbf7d0; }
.sv2-hist-card-yellow { background: #fffbeb; border: 1px solid #fde68a; }
.sv2-hist-card-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
}
.sv2-hist-card-val {
  font-size: 15px;
  font-weight: 700;
  color: #1e293b;
}
.sv2-hist-card-green .sv2-hist-card-val { color: #16a34a; }
.sv2-hist-card-yellow .sv2-hist-card-val { color: #b45309; }
.sv2-hist-empty {
  font-size: 13px;
  color: #94a3b8;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sv2-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.sv2-hist-table thead th {
  background: #f1f5f9;
  color: #64748b;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.sv2-hist-td {
  padding: 7px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
}
.sv2-hist-td-val { font-weight: 600; color: #1e293b; }
.sv2-hist-table tbody tr:last-child .sv2-hist-td { border-bottom: none; }
.sv2-hist-table tbody tr:hover { background: #f8fafc; }
/* ===== FIM HISTÓRICO FORNECEDOR ===== */

/* ===== BOLETO PARSER — FEEDBACK INLINE ===== */
.cp-mhint          { font-size: 11.5px; color: #94a3b8; margin-top: 4px; display: block; }
.cp-boleto-ok      { color: #16a34a !important; font-weight: 500; }
.cp-boleto-err     { color: #dc2626 !important; font-weight: 500; }
/* ===== FIM BOLETO PARSER ===== */

/* ── Pagamento Parcial — Modal de Pagamento ───────────────────── */
.cp-pay-resumo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.cp-pay-resumo-item {
  padding: 10px 14px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cp-pay-resumo-pago {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.cp-pay-resumo-restante {
  background: #fefce8;
  border: 1px solid #fef08a;
}
.cp-pay-resumo-label {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.cp-pay-resumo-val {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}
.cp-pay-resumo-pago   .cp-pay-resumo-val { color: #16a34a; }
.cp-pay-resumo-restante .cp-pay-resumo-val { color: #ca8a04; }

/* Valor restante inline na tabela */
.cp-valor-restante {
  font-size: 11px;
  color: #ca8a04;
  font-weight: 600;
}

/* ── Histórico de pagamentos — Modal de Pagamento ─────────────── */
.cp-pay-hist-section {
  margin-top: 18px;
  border-top: 1px solid #e5e7eb;
  padding-top: 14px;
}
.cp-pay-hist-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.cp-pay-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.cp-pay-hist-th {
  text-align: left;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 1px solid #e5e7eb;
}
.cp-pay-hist-td {
  padding: 7px 8px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.cp-pay-hist-td-val {
  text-align: right;
  font-weight: 600;
  color: #16a34a;
}

/* ── Preview de parcelas no formulário de contas a pagar ──────── */
.cp-parcelas-preview {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
  margin-top: 4px;
}
.cp-parc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 12.5px;
}
.cp-parc-row:last-child { border-bottom: none; }
.cp-parc-num  { font-weight: 600; color: #374151; min-width: 80px; }
.cp-parc-venc { color: #6b7280; flex: 1; text-align: center; }
.cp-parc-val  { font-weight: 700; color: #f59e0b; min-width: 90px; text-align: right; }
.cp-parc-hint { font-size: 12px; color: #94a3b8; margin: 0; padding: 10px 14px; }

/* ── Botão pagar parcela no modal de detalhes ─────────────────── */
.cp-parc-btn-pagar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: #16a34a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.cp-parc-btn-pagar:hover { background: #15803d; }

/* ===== AJUSTE FINO MENU (ESTILO ANTIGO) ===== */

/* Links genéricos dentro do topnav */
.topnav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  color: #374151;
  font-weight: 500;
  transition: all 0.2s ease;
}

/* Hover */
.topnav a:hover {
  background: #f3f4f6;
}

/* Item ativo — estilo antigo adaptado */
.topnav a.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Ícones */
.topnav a i,
.topnav a svg {
  font-size: 16px;
}

/* Ícone ativo */
.topnav a.active i,
.topnav a.active svg {
  color: #ffffff;
}

/* ===== AJUSTE MENU REAL ===== */

/* Item padrão — border-radius levemente maior e transição suave */
.tnav-item {
  border-radius: 10px;
  transition: all 0.2s ease;
}

/* Hover */
.tnav-item:hover {
  background: #f3f4f6;
}

/* Item ativo — estilo antigo adaptado */
.tnav-active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}

/* Ícone ativo */
.tnav-active i,
.tnav-active svg {
  color: #ffffff !important;
}

/* ===== LOGO MAIS FORTE ===== */

/* "Zyon" — peso já herdado do .tnav-brand (800), reforça letter-spacing */
.tnav-brand .brand-word-dark {
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* "PDV" — destaque máximo */
.tnav-brand .brand-word-blue {
  font-weight: 800;
}

/* ===== LOGO PREMIUM ===== */

.tnav-brand .brand-word-dark {
  font-weight: 700;
  color: #111827;
  letter-spacing: 0.3px;
}

.tnav-brand .brand-word-blue {
  font-weight: 800;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Hover suave */
.tnav-brand:hover .brand-word-blue {
  filter: brightness(1.1);
}

/* ===== PADRÃO DE COR MENU ===== */

/* Todos os itens */
.tnav-item {
  color: #374151 !important;
}

/* Ícones */
.tnav-item i,
.tnav-item svg {
  color: #374151 !important;
  opacity: 0.9;
}

/* Hover */
.tnav-item:hover {
  color: #111827 !important;
}

.tnav-item:hover i,
.tnav-item:hover svg {
  color: #111827 !important;
  opacity: 1;
}

/* Ativo — mantém branco */
.tnav-active {
  color: #ffffff !important;
}

.tnav-active i,
.tnav-active svg {
  color: #ffffff !important;
  opacity: 1;
}

/* ===== PADRONIZAÇÃO TOTAL MENU ===== */

/* Todos os links e botões do topnav */
.topnav a,
.topnav button {
  color: #374151 !important;
}

/* Ícones */
.topnav a i,
.topnav a svg,
.topnav button i,
.topnav button svg {
  color: #374151 !important;
  opacity: 0.9;
}

/* Hover */
.topnav a:hover,
.topnav button:hover {
  color: #111827 !important;
}

.topnav a:hover i,
.topnav a:hover svg,
.topnav button:hover i,
.topnav button:hover svg {
  color: #111827 !important;
  opacity: 1;
}

/* Ativo — mantém branco sobre fundo azul */
.tnav-active,
.topnav .tnav-active {
  color: #ffffff !important;
}

.tnav-active i,
.tnav-active svg,
.topnav .tnav-active i,
.topnav .tnav-active svg {
  color: #ffffff !important;
  opacity: 1;
}

/* ===== PADRÃO DE PESO DO MENU ===== */

/* Todos os itens — peso médio uniforme */
.topnav a,
.topnav button {
  font-weight: 500 !important;
}

/* Dropdowns (classe do sistema) */
.topnav .tnav-item,
.topnav .tnav-dd-item {
  font-weight: 500 !important;
}

/* ===== COR + PESO FORÇADO (RESOLVE TUDO) ===== */

/* Font-weight uniforme — apenas itens de navegação, não o painel de usuário */
.tnav-links *,
.tnav-dd-menu * {
  font-weight: 500 !important;
}

/* Cor padrão — links e botões de navegação */
.tnav-links a,
.tnav-links button,
.tnav-dd-menu a,
.tnav-dd-menu button {
  color: #374151 !important;
}

/* Ícones de navegação */
.tnav-links i,
.tnav-links svg,
.tnav-dd-menu i,
.tnav-dd-menu svg {
  color: #374151 !important;
  opacity: 0.9;
}

/* Hover */
.tnav-links a:hover,
.tnav-links button:hover,
.tnav-dd-menu a:hover {
  color: #111827 !important;
}

.tnav-links a:hover i,
.tnav-links a:hover svg,
.tnav-links button:hover i,
.tnav-links button:hover svg,
.tnav-dd-menu a:hover i,
.tnav-dd-menu a:hover svg {
  color: #111827 !important;
  opacity: 1;
}

/* Item ativo — mantém branco sobre azul */
.tnav-active,
.tnav-links .tnav-active {
  color: #ffffff !important;
}

.tnav-active i,
.tnav-active svg,
.tnav-links .tnav-active i,
.tnav-links .tnav-active svg {
  color: #ffffff !important;
  opacity: 1;
}

/* ===== CORREÇÃO DROPDOWN (FINANCEIRO / SISTEMA) ===== */

.topnav .tnav-dd-trigger {
  color: #374151 !important;
  font-weight: 500 !important;
}

/* TEXTO (SPAN DENTRO DO BOTÃO) */
.topnav .tnav-dd-trigger span {
  color: #374151 !important;
  font-weight: 500 !important;
}

/* ÍCONES */
.topnav .tnav-dd-trigger svg {
  color: #374151 !important;
  opacity: 0.9;
}

/* HOVER */
.topnav .tnav-dd-trigger:hover {
  color: #111827 !important;
}

.topnav .tnav-dd-trigger:hover svg {
  color: #111827 !important;
  opacity: 1;
}

/* ===== PADRONIZAÇÃO DE FONTE ===== */

.topnav a,
.topnav button,
.topnav span {
  font-family: inherit !important;
  font-weight: 500 !important;
}

/* GARANTE HERANÇA DIRETA */
.tnav-links * {
  font-family: inherit !important;
}
