/* ═══════════════════════════════════════════════════
   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;
  --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 {
  height: 100%;
  margin: 0;
  padding: 0;
}

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

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%;
  height: 100%;
  overflow: hidden;
  background: none;
}

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

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

/* ══ LADO DIREITO — visual (50%) ══ */
.login-right {
  width: 50%;
  height: 100%;
  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;
}

/* 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 {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: #f0f1f6;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: transform .3s ease;
  box-shadow: 2px 0 16px rgba(0,0,0,.06);
}

.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: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin .3s ease;
}

/* ─── Topbar ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 0 24px;
  height: var(--topbar-h);
  background: white;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.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) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .topbar { padding: 0 16px; }
  #dashboard-content { padding: 16px; }
  .auth-card { padding: 28px 24px; }
  .company-profile { flex-direction: column; text-align: center; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@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 { padding: 28px 32px; flex: 1; max-width: 1600px; width: 100%; box-sizing: border-box; }

/* ───────────────────────────────────────────────────
   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 */
.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 */
.prd-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;
}
.prd-btn-new:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 12px rgba(37,99,235,.35);
  transform: translateY(-1px);
}
.prd-btn-new: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; }

/* 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: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

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

.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 scrollável do modal */
.prd-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 20px 24px 20px 24px;
  padding-right: 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

/* Último card do form ganha espaço inferior para não costar no rodapé */
.prd-modal-body .prd-form-card:last-child {
  margin-bottom: 20px;
}

.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 */
.prd-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  margin-top: 0;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  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 ── */
#receipt-print-area {
  display: none; /* visível somente via @media print */
}

/* ── Classes utilitárias do cupom ── */
.receipt-center {
  text-align: center;
}

.receipt-divider {
  border: none;
  border-top: 1px dashed #555;
  margin: 7px 0;
}

.receipt-double-line {
  border: none;
  border-top: 2px solid #000;
  margin: 7px 0;
}

.receipt-total {
  font-weight: bold;
  text-align: right;
}

/* ──────────────────────────────────────────
   IMPRESSÃO TÉRMICA — @media print
   Otimizado para rolo 80 mm (também 58 mm)
────────────────────────────────────────── */
@media print {

  /* ── 1. Página: rolo térmico 80 mm, sem margens, altura automática ── */
  @page {
    size: 80mm auto;
    margin: 0 !important;
  }

  /* ── 2. html/body: força largura 80mm e elimina alturas fixas ──
     min-height:100vh nas classes .dashboard-body/.main-content
     causa uma segunda página em branco; zeramos aqui. */
  html {
    width: 80mm !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }
  body {
    width: 80mm !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    overflow: visible !important;
  }

  /* ── 3. Zera alturas em TODOS os elementos do body ──
     Impede que qualquer div do layout force uma segunda página. */
  body > * {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* ── 4. Oculta todo o conteúdo via visibility:hidden ──
     visibility mantém o elemento no layout (não causa salto)
     mas impede que seja renderizado na impressão. */
  body * {
    visibility: hidden !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }

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

  /* ── 6. Posiciona o cupom no topo esquerdo da página ── */
  #receipt-print-area {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 80mm !important;
    max-width: 80mm !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 3mm 2mm 5mm !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;

    font-family: 'Courier New', Courier, monospace !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    color: #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  /* ── 7. Herança de fonte, cor e reset de altura para 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;
  }

  /* ── 8. Cabeçalho ── */
  #receipt-print-area .receipt-header-empresa {
    font-size: 15px !important;
    font-weight: 900 !important;
    text-align: center !important;
    line-height: 1.3 !important;
    margin-bottom: 1mm !important;
  }
  #receipt-print-area .receipt-header-cnpj {
    font-size: 11px !important;
    text-align: center !important;
    margin-bottom: 2mm !important;
  }
  #receipt-print-area .receipt-header-titulo {
    font-size: 14px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    text-align: center !important;
  }
  #receipt-print-area .receipt-header-sub {
    font-size: 10px !important;
    text-align: center !important;
  }

  /* ── 9. Tabela de dados do pedido ── */
  #receipt-print-area .receipt-info-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12px !important;
  }
  #receipt-print-area .receipt-info-table td {
    padding: 1px 0 !important;
    vertical-align: top !important;
  }
  #receipt-print-area .receipt-info-table td:last-child {
    text-align: right !important;
    font-weight: 600 !important;
    padding-left: 4px !important;
  }

  /* ── 10. Título de seção ── */
  #receipt-print-area .receipt-section-title {
    font-size: 12px !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin: 2mm 0 1mm !important;
  }

  /* ── 11. Tabela de itens ── */
  #receipt-print-area .receipt-items-head th {
    font-size: 10px !important;
    font-weight: 700 !important;
    border-bottom: 1px solid #000 !important;
    padding: 1px 0 !important;
    text-align: left !important;
  }
  #receipt-print-area .receipt-items-head th:nth-child(2),
  #receipt-print-area .receipt-items-head th:nth-child(3) {
    text-align: right !important;
  }
  #receipt-print-area .receipt-items-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12px !important;
  }
  #receipt-print-area .receipt-item-name td {
    font-size: 12px !important;
    padding: 3px 0 1px !important;
    font-weight: 700 !important;
  }
  #receipt-print-area .receipt-item-detail td {
    font-size: 11px !important;
    padding: 0 0 3px !important;
    border-bottom: 1px dotted #999 !important;
  }
  #receipt-print-area .receipt-item-detail td:nth-child(2),
  #receipt-print-area .receipt-item-detail td:nth-child(3) {
    text-align: right !important;
  }

  /* ── 12. Totais ── */
  #receipt-print-area .receipt-totals-table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 12px !important;
    margin-top: 1mm !important;
  }
  #receipt-print-area .receipt-totals-table td:last-child {
    text-align: right !important;
    font-weight: 600 !important;
  }
  #receipt-print-area .receipt-row-total td {
    font-size: 15px !important;
    font-weight: 900 !important;
    padding-top: 2mm !important;
    border-top: 2px solid #000 !important;
  }
  #receipt-print-area .receipt-row-discount td {
    font-style: italic !important;
  }

  /* ── 13. Rodapé ── */
  #receipt-print-area .receipt-footer {
    font-size: 11px !important;
    text-align: center !important;
    margin-top: 3mm !important;
    line-height: 1.5 !important;
  }

  /* ── 14. Divisores ── */
  #receipt-print-area .receipt-divider {
    border: none !important;
    border-top: 1px dashed #555 !important;
    margin: 3px 0 !important;
  }
  #receipt-print-area .receipt-double-line {
    border: none !important;
    border-top: 2px solid #000 !important;
    margin: 3px 0 !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);
}

/* ══════════════════════════════════════════════════════════════
   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;
}

.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;
}

/* Action buttons */
.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; }

/* ── 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-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;
}

.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;
}

/* ── 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;
}

/* ── 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;
}

/* ── 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;
}

/* ── 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: 14px;
  padding: 28px 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

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

.bk-header-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

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

.bk-title {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.bk-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

/* ── Divisor ── */
.bk-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 18px 0 16px;
}

/* ── Barra de info (contador) ── */
.bk-info-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}

.bk-info-text {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

/* ── Tabela de backups ── */
.bk-table-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

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

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

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

.bk-td {
  padding: 11px 14px;
  color: #374151;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  font-size: 13px;
}

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

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

/* ── Botão restaurar (dentro da tabela) ── */
.bk-btn-restore-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  background: #2563eb;
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  white-space: nowrap;
}

.bk-btn-restore-row:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.bk-btn-restore-row:active {
  transform: translateY(0);
}

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

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

.bk-empty-icon {
  width: 64px;
  height: 64px;
  background: #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.bk-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #374151;
  margin: 0 0 6px;
}

.bk-empty-desc {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
  max-width: 300px;
  line-height: 1.5;
}

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

.bk-restore-loading-title {
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  margin: 0 0 6px;
}

.bk-restore-loading-desc {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
}

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

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

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

.bk-modal-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;
}

.bk-modal-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

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

.bk-modal-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;
}

.bk-modal-close:hover { background: rgba(255,255,255,0.28); }

.bk-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bk-modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.bk-modal-info-item {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.bk-modal-info-label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.bk-modal-info-value {
  font-size: 13px;
  color: #111827;
  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: 8px;
  padding: 12px 14px;
  color: #9a3412;
}

.bk-modal-warning-text {
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}

.bk-modal-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

.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: 14px 20px;
  border-top: 1px solid #f1f5f9;
  background: #fafafa;
}

.bk-btn-cancel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #374151;
  font-size: 13px;
  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: 6px;
  height: 38px;
  padding: 0 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.bk-btn-restore:hover:not(:disabled) {
  opacity: 0.9;
  transform: translateY(-1px);
}

.bk-btn-restore:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ── Badge data do backup ── */
.bk-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #1e40af;
  font-size: 13px;
}

.bk-tag-recent {
  display: inline-block;
  background: #dcfce7;
  color: #166534;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

.bk-tag-old {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ── Colunas ocultas em mobile ── */
.bk-th-hide, .bk-td-hide { /* visível por padrão */ }

/* ── Responsividade ── */
@media (max-width: 640px) {
  .bk-card { padding: 20px 14px; }
  .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; }
}

