@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #5b21b6; --primary-dk: #3b0764; --primary-lt: #f5f3ff;
  --primary-mid: #7c3aed;
  --success: #16a34a; --warning: #d97706; --danger: #dc2626;
  --text: #111827; --muted: #6b7280; --border: #e5e7eb;
  --bg: #f0eef6; --white: #fff;
  --shadow: 0 1px 3px rgba(0,0,0,.1); --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --radius: 10px; --radius-sm: 6px;
  --topbar-h: 64px;   /* altura padrão da topbar */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   TOPBAR — padrão WOW Corp (barra superior única)
   ═══════════════════════════════════════════════════════════════ */
.wow-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 28px;     /* mais espaçamento lateral */
  gap: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

/* Logo WOW */
.wow-topbar .wow-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
/* Logo WOW Score — imagem real */
.wow-topbar .wow-logo { display:flex; align-items:center; text-decoration:none; flex-shrink:0; }
/* Oculta fallbacks de texto/SVG caso existam */
.wow-topbar .wow-logo-icon { display:none; }
.wow-topbar .wow-logo-text { display:none; }

/* Separador vertical */
.wow-topbar .vdivider {
  width: 1px; height: 28px; background: var(--border); flex-shrink: 0;
}

/* Título da página atual */
.wow-topbar .page-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  flex-shrink: 0;
}

/* Spacer */
.wow-topbar .spacer { flex: 1; }

/* Botão de módulos (grid 3x3) — igual ao SICAR */
.topbar-menu-wrap { position: relative; flex-shrink: 0; }

/* Logo principal */
.wow-topbar .wow-logo-img {
  height: 120px;
  object-fit: contain;
  display: block;
}

.wow-topbar .btn-modules {
  position: relative;
  width: 36px; height: 36px;
  border: none; background: none;
  cursor: pointer; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}
.wow-topbar .btn-modules:hover { background: var(--primary-lt); }
.btn-modules-icon {
  display: grid; grid-template-columns: repeat(3,5px); gap: 2.5px;
}
.btn-modules-icon span {
  width: 5px; height: 5px; border-radius: 1px;
  background: var(--muted); display: block;
  transition: background .15s;
}
.btn-modules:hover .btn-modules-icon span { background: var(--primary); }

/* Dropdown de módulos */
.modules-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.12);
  padding: 20px 16px; width: 320px; z-index: 300;
}
.modules-dropdown.open { display: block; }
.modules-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.module-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border-radius: 10px; text-decoration: none;
  cursor: pointer; border: none; background: none; font-family: inherit;
  transition: background .15s;
}
.module-item:hover { background: var(--primary-lt); }
.module-icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--primary); display: flex; align-items: center;
  justify-content: center; font-size: 18px;
}
.module-label {
  font-size: 10px; font-weight: 600; color: var(--text);
  text-align: center; line-height: 1.2;
}

/* Avatar + dropdown de usuário */
.wow-topbar .user-area {
  position: relative; flex-shrink: 0;
}
.wow-topbar .user-btn {
  display: flex; align-items: center; gap: 8px;
  border: none; background: none; cursor: pointer;
  padding: 4px 6px; border-radius: 8px; transition: background .15s;
}
.wow-topbar .user-btn:hover { background: var(--primary-lt); }
.wow-topbar .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-dk); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.wow-topbar .user-chevron {
  width: 16px; height: 16px; color: var(--muted);
  transition: transform .2s;
}
.user-area.open .user-chevron { transform: rotate(180deg); }

/* Dropdown do usuário */
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 200px; z-index: 300; overflow: hidden;
}
.user-area.open .user-dropdown { display: block; }
.user-dropdown-header {
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.user-dropdown-header .ud-name  { font-size: 13px; font-weight: 700; color: var(--text); }
.user-dropdown-header .ud-role  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.user-dropdown-header .ud-tenant{ font-size: 11px; color: var(--primary); font-weight: 600; }
.user-dropdown a, .user-dropdown button {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 13px; color: var(--text);
  text-decoration: none; background: none; border: none;
  font-family: inherit; cursor: pointer; width: 100%; text-align: left;
  transition: background .12s;
}
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--primary-lt); color: var(--primary); }
.user-dropdown .logout-btn { color: var(--danger); border-top: 1px solid var(--border); }
.user-dropdown .logout-btn:hover { background: #fef2f2; color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ═══════════════════════════════════════════════════════════════ */
.layout { display: flex; flex-direction: column; min-height: 100vh; }
.main   { margin-top: var(--topbar-h); flex: 1; display: flex; flex-direction: column; }
.content { padding: 24px; }

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title  { font-size: 14px; font-weight: 600; }
.card-body   { padding: 20px; }

/* ═══════════════════════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════════════════════ */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--white); border-radius: var(--radius); padding: 18px 20px; border: 1px solid var(--border); }
.stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 700; margin-top: 4px; }
.stat-value.blue   { color: var(--primary); }
.stat-value.green  { color: var(--success); }
.stat-value.orange { color: var(--warning); }
.stat-value.primary  { color: #007bff; }

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-label .req { color: var(--danger); }
.form-control { width: 100%; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: var(--white); transition: .15s; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,33,182,.1); }
.form-row { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-section { margin-bottom: 24px; }
.form-section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; border: none; text-decoration: none; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); }
.btn-success { background: var(--success); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-lt); }
.btn-sm  { padding: 5px 12px; font-size: 12px; }
.btn-lg  { padding: 11px 28px; font-size: 15px; }
.btn-danger { background: var(--danger); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   ALERTS / BADGES / TABLE
   ═══════════════════════════════════════════════════════════════ */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-info    { background: var(--primary-lt); border: 1px solid #ddd6fe; color: #4c1d95; }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: #dcfce7; color: var(--success); }
.badge-danger  { background: #fee2e2; color: var(--danger); }
.badge-gray    { background: #f3f4f6; color: var(--muted); }
.badge-info    { background: var(--primary-lt); color: var(--primary); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #faf5ff; padding: 10px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--border); text-align: left; }
td { padding: 12px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #faf5ff; }

/* ═══════════════════════════════════════════════════════════════
   RESULT CARDS
   ═══════════════════════════════════════════════════════════════ */
.result-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 14px; }
.result-card { background: var(--white); border: 2px solid var(--border); border-radius: var(--radius); padding: 18px; transition: .2s; position: relative; }
.result-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.result-card.best { border-color: var(--primary); }
.result-card.best::before { content: '⭐ MELHOR OFERTA'; position: absolute; top: -11px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 10px; border-radius: 20px; white-space: nowrap; }
.result-card.failed { opacity: .55; }
.result-bank    { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.result-parcela { font-size: 28px; font-weight: 700; color: var(--primary); }
.result-label   { font-size: 11px; color: var(--muted); }
.result-details { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.result-row     { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.result-row span:first-child { color: var(--muted); }
.result-row span:last-child  { font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   BANK CONFIG
   ═══════════════════════════════════════════════════════════════ */
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(320px,1fr)); gap: 14px; }
.bank-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px; }
.bank-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bank-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dot     { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-ok  { background: var(--success); }
.dot-off { background: #d1d5db; }

/* ═══════════════════════════════════════════════════════════════
   TOGGLE
   ═══════════════════════════════════════════════════════════════ */
.toggle { position: relative; width: 38px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #d1d5db; border-radius: 20px; cursor: pointer; transition: .2s; }
.toggle-slider:before { content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%; background: #fff; left: 3px; top: 3px; transition: .2s; }
.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

/* ═══════════════════════════════════════════════════════════════
   ASSINATURA
   ═══════════════════════════════════════════════════════════════ */
.assinatura-status { background: linear-gradient(135deg,#3b0764,#7c3aed); border-radius: 16px; padding: 28px 32px; color: white; display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.assinatura-status .info h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.assinatura-status .info p  { font-size: 13px; opacity: .75; }
.assinatura-status .badge-plano { background: rgba(255,255,255,.15); border-radius: 10px; padding: 16px 24px; text-align: center; }
.assinatura-status .badge-plano .plano-label { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .08em; }
.assinatura-status .badge-plano .plano-nome  { font-size: 20px; font-weight: 800; }
.assinatura-status .badge-plano .plano-val   { font-size: 12px; opacity: .75; margin-top: 2px; }

.planos-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 18px; margin-bottom: 32px; }
.plano-card { border: 2px solid var(--border); border-radius: 14px; padding: 28px 22px; text-align: center; transition: .2s; position: relative; }
.plano-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.plano-card.featured { border-color: var(--primary); background: var(--primary-lt); }
.plano-card.featured::before { content: '⭐ RECOMENDADO'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 12px; border-radius: 20px; white-space: nowrap; }
.plano-nome    { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
.plano-preco   { font-size: 40px; font-weight: 800; color: var(--primary-dk); line-height: 1; }
.plano-preco sup { font-size: 16px; vertical-align: top; margin-top: 8px; display: inline-block; }
.plano-periodo { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.plano-features { text-align: left; font-size: 13px; margin-bottom: 20px; }
.plano-feature { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.plano-feature::before { content: '✓'; color: var(--primary); font-weight: 700; flex-shrink: 0; }
.tx-type-PURCHASE    { color: #059669; font-weight: 600; }
.tx-type-CONSUMPTION { color: #dc2626; }
.tx-type-ADJUSTMENT  { color: #d97706; }

/* ═══════════════════════════════════════════════════════════════
   LOGIN — padrão WOW Corp
   ═══════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #f3f4f6; padding: 16px;
}
.login-card { display: flex; width: 100%; max-width: 880px; min-height: 520px; border-radius: 20px; overflow: hidden; box-shadow: 0 24px 60px rgba(59,7,100,.22); }
.login-left { width: 45%; background: var(--primary-dk); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: clamp(24px,5vw,48px) clamp(16px,4vw,36px); gap: 16px; }
.login-left .wow-logo-big { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.login-left .wow-icon { width: 72px; height: 72px; background: rgba(255,255,255,.1); border-radius: 20px; display: flex; align-items: center; justify-content: center; }
.login-left .wow-icon svg { width: 42px; height: 42px; }
.login-left .wow-name { font-size: 32px; font-weight: 800; color: #fff; letter-spacing: -1px; }
.login-left .wow-name span { color: #a78bfa; }
.login-left .wow-tagline { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); }
.login-left .login-subtitle { font-size: 13px; color: rgba(255,255,255,.5); text-align: center; margin-top: 8px; line-height: 1.5; }
.login-right { width: 55%; background: #fff; display: flex; flex-direction: column; justify-content: center; padding: clamp(24px,5vw,48px) clamp(20px,5vw,44px); }
.login-right .login-tabs { display: flex; gap: 0; margin-bottom: 28px; }
.login-tab { padding: 8px 20px; font-size: 14px; font-weight: 700; border-radius: 6px 0 0 6px; background: var(--primary); color: #fff; cursor: default; }
.login-tab.inactive { background: transparent; color: var(--primary); border-radius: 0 6px 6px 0; border: 1.5px solid var(--primary); border-left: none; }
.login-right h2 { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-right .login-desc { font-size: 13px; color: var(--muted); margin-bottom: 24px; line-height: 1.5; }
.login-right .login-desc strong { color: var(--text); }
.login-field { margin-bottom: 18px; }
.login-field label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.login-field label span { color: var(--muted); font-size: 12px; font-weight: 400; }
.login-field input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: #f9f9f9; transition: .15s; }
.login-field input::placeholder { color: #bbb; }
.login-field input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(91,33,182,.1); }
.login-btn { width: 100%; padding: 12px; background: var(--primary-dk); color: #fff; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; transition: .15s; margin-top: 4px; }
.login-btn:hover { background: var(--primary); }
.login-footer { text-align: center; margin-top: 20px; font-size: 12px; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════
   MISC
   ═══════════════════════════════════════════════════════════════ */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 20px; font-weight: 700; }
.page-header p  { color: var(--muted); font-size: 13px; margin-top: 3px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.flex { display: flex; } .items-center { align-items: center; } .gap-8 { gap: 8px; }
.justify-between { justify-content: space-between; } .mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; } .fw-bold { font-weight: 700; }
.text-muted { color: var(--muted); } .text-success { color: var(--success); } .text-danger { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVIDADE — Sistema completo mobile-first
   Breakpoints: xs <480  sm <640  md <768  lg <1024  xl ≥1024
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Tablet e menor (≤1024px) ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .wow-page { padding: 16px; }
  .wow-card-body { padding: 20px 16px; }

  /* Formulário: 4 colunas → 2 */
  .form-row[style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Tabela resultado: ocultar colunas menos importantes */
  .result-table .hide-tablet { display: none; }

  /* Topbar: logo menor */
  }

/* ── Mobile médio (≤768px) ─────────────────────────────────────────────── */
@media (max-width: 768px) {

  /* ── Topbar ── */
  .wow-topbar { padding: 0 14px; gap: 10px; height: 56px; }
  .vdivider { display: none; }
  .page-title { display: none; } /* oculta título no mobile — ícone do menu já indica */

  /* ── Menu dropdown mobile — ancorado no botão, cabe na tela ── */
  .modules-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(290px, calc(100vw - 16px));
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    transform: none;
    padding: 16px 12px;
  }
  /* 3 ícones de 56px + gap 8px × 2 + padding 12px × 2 = 208px < 290px — sempre cabe */
  .modules-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .module-img { width: 56px; height: 56px; }
  /* labels abaixo dos ícones no mobile */
  .module-item { gap: 4px; padding: 6px 4px; }

  /* ── Layout principal ── */
  .main { padding-top: var(--topbar-h); }
  .wow-page { padding: 12px; }
  .wow-card-body { padding: 16px 12px; }
  .wow-card-header-inner { flex-wrap: wrap; gap: 8px; }

  /* ── Grids de formulário ── */
  .cols-2 { grid-template-columns: 1fr; }
  .cols-3 { grid-template-columns: 1fr; }
  .cols-4 { grid-template-columns: 1fr 1fr; }
  .form-row { gap: 12px; }

  /* Grids inline via style= */
  [style*="grid-template-columns:1fr 1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Botões de ação no header do card ── */
  .wow-card-header-inner > div:last-child {
    width: 100%;
    display: flex; gap: 8px; flex-wrap: wrap;
  }
  .wow-card-header-inner > div:last-child .btn {
    flex: 1; min-width: 120px; text-align: center;
  }

  /* ── Seções ── */
  .wow-section-header { padding: 10px 12px; font-size: 11px; }
  .wow-section-body { padding: 14px 12px; }

  /* ── Stats do dashboard ── */
  .stats-row { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 28px; }

  /* ── Tabelas ── */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 540px; font-size: 12px; }
  th, td { padding: 8px 10px; }

  /* ── Cards de plano ── */
  .planos-grid { grid-template-columns: 1fr 1fr; }

  /* ── Resultado da simulação — cards em coluna única ── */
  .banks-grid { grid-template-columns: 1fr !important; }
  .bank-result-card { padding: 14px; }
  .bank-parcela { font-size: 22px; }

  /* ── Formulário de login ── */
  .login-card { flex-direction: column; max-width: 440px; border-radius: 16px; }
  .login-left  { width: 100%; min-height: 160px; padding: 28px 24px; }
  .login-right { width: 100%; padding: 28px 24px; }
  .login-logo-img { width: 160px; }

  /* ── Resumo financeiro inline ── */
  #resumo > div { flex-direction: column !important; gap: 8px !important; }

  /* ── Botão simular — full width no mobile ── */
  #btnSimular { width: 100%; justify-content: center; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* ── Checkbox CNH ── */
  .cnh-row { margin-top: 12px; }

  /* ── Assinatura status card ── */
  .assinatura-status { flex-direction: column; gap: 16px; align-items: flex-start; }
  .plano-cards { grid-template-columns: 1fr; }
}

/* ── Mobile pequeno (≤480px) ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .wow-topbar { padding: 0 10px; height: 50px; }
  .wow-page { padding: 8px; }
  .wow-card-body { padding: 12px 10px; }
  .wow-card-header-inner { padding: 10px 12px; }
  .wow-card-icon-img img { width: 44px; height: 44px; }
  .wow-card-title-bar h2 { font-size: 15px; }

  /* Uma coluna em tudo */
  .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr !important; }
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* Planos: 1 coluna */
  .planos-grid { grid-template-columns: 1fr; }

  /* Stats: empilhados */
  .stats-row { grid-template-columns: 1fr; }

  /* Tabela com scroll horizontal */
  .table-wrap { border-radius: 8px; }
  table { min-width: 480px; font-size: 11px; }
  th, td { padding: 6px 8px; }

  /* Avatar menor */
  .avatar { width: 30px; height: 30px; font-size: 13px; }

  /* Botões do módulo menores */
  .module-img { width: 50px; height: 50px; }

  /* Loading box */
  .loading-box { padding: 24px 16px; margin: 8px; }
  .loading-bank-row { font-size: 12px; }
}

/* ── Impressão ─────────────────────────────────────────────────────────── */
@media print {
  .wow-topbar, .btn, .btn-outline, .wow-card-header-inner > div:last-child { display: none !important; }
  .wow-page { padding: 0; }
  .wow-card { box-shadow: none; border: 1px solid #ccc; }
  .banks-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ═══════════════════════════════════════════════════════════════
   LAYOUT WOW.VE — card com faixa roxa no topo
   ═══════════════════════════════════════════════════════════════ */

/* Container da página no padrão wow.ve */
.wow-page { padding: 20px 24px; }

/* Card principal com faixa roxa no topo */
.wow-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: relative;
}
/* Tarja roxa lateral — dentro do card, sobre a borda esquerda */
.wow-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 36px;
  width: 46px;
  height: 17px;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
  z-index: 2;
}
.wow-card-header {
  padding: 14px 20px 0 24px;
  background: #fff;
  border-bottom: none;
  position: relative;
}
.wow-card-header-inner {
  display: flex;
  align-items: center;
  gap: 0;
}
.wow-card-icon {
  width: 56px; height: 56px;
  background: transparent;
  border-radius: 10px 10px 0 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  margin-right: 0;
  position: relative;
  z-index: 1;
}
.wow-card-icon::before { display: none; }
.wow-card-header::before { display: none; }
.wow-card-title-bar {
  flex: 1;
  padding-bottom: 0;
  padding-left: 14px;
}
.wow-card-title-bar h2 {
  font-size: 15px; font-weight: 700; color: var(--text);
}
/* Barra gradiente separadora */
.wow-card-divider {
  height: 4px;
  border-bottom: 5px solid rgb(103,53,170);
  border-image: linear-gradient(to right, rgb(103,53,170), rgb(188,161,225), rgb(203,186,227), lightgray) 1;
  margin: 0;
}
/* Corpo do card */
.wow-card-body { padding: 24px 20px; }

/* Seção dentro do card (ex: VEÍCULO, FORNECEDOR) */
.wow-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}
.wow-section-header {
  background: #faf5ff;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--primary);
  display: flex; align-items: center; justify-content: space-between;
}
.wow-section-body { padding: 16px; }

/* ═══════════════════════════════════════════════════════════════
   LOADING OVERLAY — tela de processamento
   ═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   LOADING MODAL — elegante com anel giratório e progresso
   ═══════════════════════════════════════════════════════════════ */

.loading-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 15, 25, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
  padding: 20px;
}
.loading-overlay.active { display: flex; }

/* Modal box */
.loading-modal {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 420px; width: 100%;
  box-shadow: 0 32px 80px rgba(59,7,100,.3), 0 8px 24px rgba(0,0,0,.15);
  text-align: center;
  animation: modalSlideIn .3s ease;
}
@keyframes modalSlideIn {
  from { opacity:0; transform: translateY(20px) scale(.96); }
  to   { opacity:1; transform: translateY(0)    scale(1); }
}

/* Logo no topo */
.loading-header { margin-bottom: 20px; }
.loading-logo   { height: 36px; width: auto; }

/* Anel spinner elegante */
.loading-animation {
  position: relative;
  width: 72px; height: 72px;
  margin: 0 auto 20px;
}
.loading-ring {
  display: block; position: relative;
  width: 72px; height: 72px;
}
.loading-ring div {
  box-sizing: border-box;
  display: block;
  position: absolute;
  width: 64px; height: 64px;
  margin: 4px;
  border: 5px solid transparent;
  border-radius: 50%;
  animation: ring-spin 1.4s cubic-bezier(.5,.15,.5,.85) infinite;
}
.loading-ring div:nth-child(1) {
  border-top-color: var(--primary);
  animation-delay: -0.45s;
}
.loading-ring div:nth-child(2) {
  border-top-color: #7c3aed;
  animation-delay: -0.3s;
}
.loading-ring div:nth-child(3) {
  border-top-color: #a78bfa;
  animation-delay: -0.15s;
}
.loading-ring div:nth-child(4) {
  border-top-color: #c4b5fd;
}
@keyframes ring-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Título e subtítulo */
.loading-content  { margin-bottom: 16px; }
.loading-title    { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.loading-subtitle { font-size: 13px; color: var(--white); margin: 0; }

/* Lista de bancos */
.loading-banks {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
  max-height: 200px; overflow-y: auto;
}
.loading-bank-row {
  display: flex; align-items: center; gap: 10px;
  background: #faf5ff;
  border: 1px solid #ede9fe;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  text-align: left;
}
.lbr-icon  { font-size: 18px; flex-shrink: 0; }
.lbr-name  { font-weight: 600; color: var(--text); flex: 1; }
.lbr-status {
  font-size: 11px; color: var(--muted);
  display: flex; align-items: center; gap: 4px;
}
.lbr-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  animation: dot-pulse 1.2s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.4; transform:scale(.7); }
}

/* Barra de progresso */
.loading-progress-wrap {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.loading-progress {
  flex: 1;
  height: 6px;
  background: #e9d5ff;
  border-radius: 6px;
  overflow: hidden;
}
.loading-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--primary-dk), var(--primary-mid));
  border-radius: 6px;
  transition: width .5s ease;
}
.loading-progress-label {
  font-size: 11px; font-weight: 700; color: var(--primary);
  min-width: 30px; text-align: right;
}

/* Dica no rodapé */
.loading-tip {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: var(--muted);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}


/* Spinner animado */
.loading-spinner {
  width: 56px; height: 56px;
  border: 4px solid #ede9fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-title {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin-bottom: 6px;
}
.loading-subtitle {
  font-size: 13px; color: var(--muted);
  margin-bottom: 20px; line-height: 1.5;
}

/* Barra de progresso dos bancos */
.loading-banks {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 180px; overflow-y: auto;
  margin-bottom: 20px;
}
.loading-bank-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: #f9f5ff;
  border-radius: 8px;
  font-size: 13px;
}
.loading-bank-row .bank-icon { font-size: 18px; }
.loading-bank-row .bank-name { flex: 1; font-weight: 600; color: var(--text); text-align: left; }
.loading-bank-row .bank-status { font-size: 11px; color: var(--muted); }

/* Animação de pulso nos status */
.pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .4; }
}

/* Progress bar geral */
.loading-progress {
  height: 6px; background: #ede9fe; border-radius: 3px;
  overflow: hidden;
}
.loading-progress-bar {
  height: 100%; background: linear-gradient(to right, var(--primary-dk), var(--primary-mid));
  border-radius: 3px;
  transition: width .4s ease;
  animation: progressAnim 2s ease-in-out infinite;
}
@keyframes progressAnim {
  0%   { width: 15%; }
  50%  { width: 80%; }
  100% { width: 15%; }
}

.loading-tip {
  font-size: 11px; color: var(--muted);
  margin-top: 14px; font-style: italic;
}

/* ── Ícones de imagem no menu de módulos ─────────────────────────── */
.module-icon-img {
  width: 44px; height: 44px;
  border-radius: 10px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  flex-shrink: 0;
}
.module-icon-img img {
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ── Ícones imagem no menu ───────────────────────────────────────── */
.module-icon-wrap {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden; background: transparent;
}
.module-icon-wrap img  { width: 44px; height: 44px; object-fit: contain; }
.module-icon-wrap svg  { width: 44px; height: 44px; }
.module-icon-bank      { font-size: 24px; line-height: 1; }

.modules-dropdown-title {
  font-size:10px; font-weight:700; text-transform:uppercase;
  letter-spacing:.08em; color:var(--muted); padding:0 4px 8px;
}
.modules-bancos-section {
  border-top:1px solid var(--border); margin-top:10px; padding-top:10px;
}

/* ── Menu ícones maiores sem labels ─────────────────────────────── */
.module-label { display: none !important; }
.module-img   { width: 80px; height: 80px; object-fit: contain; border-radius: 14px; }
.module-bank-emoji { font-size: 36px; line-height: 1; }
.module-item:hover { background: var(--primary-lt); transform: scale(1.05); }

/* ── wow-card-icon com imagem real ──────────────────────────────── */
.wow-card-icon-img {
  background: transparent !important;
  padding: 0;
}
.wow-card-icon-img img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  position: relative;
  display: block;
  z-index: 30;
}

/* ── Topbar logo imagem real (fundo branco — manter cores) ────────── */
/* Login logo: painel roxo — inverter para branco */
.login-logo-img {
  width: 312px; height: auto;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

/* ═══════════════════════════════════════════════════════════════════════
   UTILITÁRIOS E CORREÇÕES RESPONSIVAS
   ═══════════════════════════════════════════════════════════════════════ */

/* Grid cols-4 */
.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Stats row — 3 colunas default */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.stat {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 24px;
}
.stat-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin-bottom: 8px;
}
.stat-value {
  font-size: 36px; font-weight: 800; line-height: 1;
}
.stat-value.blue   { color: var(--primary); }
.stat-value.green  { color: var(--success); }
.stat-value.orange { color: var(--warning); }

/* Ações de formulário — responsivo */
.form-actions {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;
}

/* Tabela overflow container */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
}

/* Loading overlay — centralizado e responsivo */
.loading-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 9999;
  align-items: center; justify-content: center;
  padding: 16px;
}
.loading-overlay.active { display: flex; }
.loading-box {
  background: #fff; border-radius: 16px;
  padding: 36px 32px; max-width: 480px; width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  text-align: center;
}
.loading-banks {
  max-height: 240px; overflow-y: auto;
  margin: 16px 0;
}
.loading-bank-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 6px;
  background: #faf5ff; border: 1px solid #ede9fe;
  font-size: 13px;
}

/* Seções wow — padding responsivo */
.wow-section-body { padding: 16px 20px; }

/* Wow card header — wrap ao espremer */
.wow-card-header-inner {
  flex-wrap: wrap;
}

/* Banks grid resultado */
.banks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Planos grid */
.planos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Scrollbar estilizada */
.table-wrap::-webkit-scrollbar { height: 4px; }
.table-wrap::-webkit-scrollbar-track { background: #f1f5f9; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ── Botão Continuar Proposta C6 Bank ──────────────────────────────────── */
.btn-continuar-c6 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  color: #f5c518;
  border: 1px solid #f5c518;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all .2s;
  width: 100%;
  justify-content: center;
}
.btn-continuar-c6:hover {
  background: #f5c518;
  color: #1a1a2e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,197,24,.3);
}


/* ── Status PRÉ-APROVADO ─────────────────────────────────────────────────── */
.bank-result-card.pre-approved {
  border-color: #f59e0b;
  background: linear-gradient(135deg, #fffbeb, #fff);
}
.bank-dot.pre-approved {
  background: #f59e0b;
}


/* ── Campo preenchido automaticamente pela API CPF ──────────────────────── */
@keyframes campo-api-highlight {
  0%   { border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.15); background:#f0fdf4; }
  70%  { border-color: #059669; box-shadow: 0 0 0 3px rgba(5,150,105,.10); background:#f0fdf4; }
  100% { border-color: var(--border); box-shadow: none; background: #fff; }
}
.campo-preenchido-api {
  animation: campo-api-highlight 2.5s ease forwards;
}


/* ═══════════════════════════════════════════════════════════════════════
   ESTILOS ESPECÍFICOS POR TELA — centralizados do app.css
   (movidos dos <style> inline de cada template)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── simulacao-resultado.html ── */
/* Cards de banco — estilo do print 2 */
    .bank-result-card {
      background: #fff; border: 1px solid var(--border);
      border-radius: 10px; padding: 18px; position: relative;
    }
    .bank-result-card.best { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(91,33,182,.15); }
    .bank-result-card.failed { opacity: .65; }
    .bank-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
    .bank-dot.ok     { background: var(--primary); }
    .bank-dot.failed { background: #9ca3af; }
    .bank-card-name { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; }
    .bank-parcela { font-size: 26px; font-weight: 800; color: var(--primary-dk); margin-bottom: 2px; }
    .bank-parcela-label { font-size: 11px; color: var(--muted); margin-bottom: 12px; }
    .bank-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
    .bank-tag { font-size: 11px; padding: 2px 10px; border-radius: 20px; font-weight: 600; }
    .bank-tag.best-tag { background: var(--primary-lt); color: var(--primary); }
    .bank-tag.ok-tag   { background: #dcfce7; color: var(--success); }
    .bank-unavail { font-size: 13px; font-weight: 600; color: var(--danger); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
    .bank-unavail-msg { font-size: 12px; color: var(--muted); }
    .bank-detail-row { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; border-bottom: 1px solid #f3f4f6; }
    .bank-detail-row:last-child { border-bottom: none; }
    .bank-detail-row span:first-child { color: var(--muted); }
    .bank-detail-row span:last-child  { font-weight: 600; }

/* ── creditos.html ── */
/* ── Status da assinatura ── */
    .assinatura-status {
      background: linear-gradient(135deg, #3b0764, #7c3aed);
      border-radius: 16px; padding: 28px 32px; color: white;
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 28px;
    }
    .assinatura-status .info h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
    .assinatura-status .info p  { font-size: 13px; opacity: .75; }
    .assinatura-status .badge-plano {
      background: rgba(255,255,255,.15); border-radius: 10px;
      padding: 16px 24px; text-align: center;
    }
    .assinatura-status .badge-plano .plano-label { font-size: 11px; opacity: .7; text-transform: uppercase; letter-spacing: .08em; }
    .assinatura-status .badge-plano .plano-nome  { font-size: 20px; font-weight: 800; }
    .assinatura-status .badge-plano .plano-val   { font-size: 12px; opacity: .75; margin-top: 2px; }

    /* ── Cards de planos mensais ── */
    .planos-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 32px; }
    .plano-card {
      border: 2px solid var(--border); border-radius: 14px;
      padding: 28px 22px; text-align: center; transition: .2s; position: relative;
    }
    .plano-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
    .plano-card.featured { border-color: var(--primary); background: var(--primary-lt); }
    .plano-card.featured::before {
      content: '⭐ RECOMENDADO';
      position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
      background: var(--primary); color: #fff; font-size: 10px; font-weight: 700;
      padding: 3px 12px; border-radius: 20px; white-space: nowrap;
    }
    .plano-nome    { font-size: 14px; font-weight: 700; color: var(--white); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
    .plano-card-nome    { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 12px; }
    .plano-preco   { font-size: 40px; font-weight: 800; color: var(--primary-dk); line-height: 1; }
    .plano-preco sup { font-size: 16px; vertical-align: top; margin-top: 8px; display: inline-block; }
    .plano-periodo { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
    .plano-features { text-align: left; font-size: 13px; margin-bottom: 20px; }
    .plano-feature { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
    .plano-feature::before { content: '✓'; color: var(--primary); font-weight: 700; flex-shrink: 0; }

    /* ── Histórico ── */
    .tx-type-PURCHASE    { color: #059669; font-weight: 600; }
    .tx-type-CONSUMPTION { color: #dc2626; }
    .tx-type-ADJUSTMENT  { color: #d97706; }

/* ── usuarios.html ── */
.role-MANAGER { background:#dbeafe;color:#1e40af;padding:2px 8px;border-radius:12px;font-size:12px;font-weight:600; }
    .role-OPERATOR { background:#d1fae5;color:#065f46;padding:2px 8px;border-radius:12px;font-size:12px;font-weight:600; }
    .modal-overlay { display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:1000;align-items:center;justify-content:center; }
    .modal-overlay.open { display:flex; }
    .modal-box { background:white;border-radius:12px;padding:32px;width:480px;max-width:95vw; }
    .modal-title { font-size:18px;font-weight:700;margin-bottom:20px; }

/* ── historico.html ── */
.detail-sub { font-size:11px; color:var(--muted); margin-top:2px; }

/* ── admin/planos.html ── */
/* ── Cards de plano ─────────────────────────────────────────── */
    .planos-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 16px; margin-bottom: 32px;
    }
    .plan-card {
      border: 2px solid var(--border); border-radius: 14px;
      padding: 20px; position: relative; background: #fff;
      transition: .2s; display: flex; flex-direction: column;
    }
    .plan-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }
    .plan-card.inactive { opacity: .5; }
    .plan-card.highlight { border-color: var(--primary); }
    .plan-card.highlight::before {
      content: '⭐ RECOMENDADO';
      position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
      background: var(--primary); color: #fff; font-size: 10px; font-weight: 700;
      padding: 3px 12px; border-radius: 20px; white-space: nowrap;
    }

    /* Status badge no canto */
    .plan-status {
      position: absolute; top: 10px; right: 10px;
      font-size: 10px; font-weight: 700; display: flex; align-items: center; gap: 4px;
    }
    .plan-status.ativo  { color: var(--success); }
    .plan-status.inativo{ color: var(--muted); }

    /* Tipo badge */
    .plan-type-badge {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 10px; font-weight: 700; text-transform: uppercase;
      letter-spacing: .06em; padding: 3px 8px; border-radius: 20px;
      margin-bottom: 8px;
    }
    .badge-monthly  { background: #ede9fe; color: var(--primary); }
    .badge-quarterly{ background: #dbeafe; color: #1d4ed8; }
    .badge-yearly   { background: #dcfce7; color: #15803d; }
    .badge-credits  { background: #fef3c7; color: #b45309; }
    .badge-unlimited{ background: #fce7f3; color: #9d174d; }

    /* Validade do plano */
    .plan-validity {
      font-size: 11px; color: var(--muted);
      background: #fef3c7; border-radius: 6px; padding: 4px 8px;
      margin-bottom: 8px; display: flex; align-items: center; gap: 4px;
    }
    .plan-validity.expired { background: #fee2e2; color: var(--danger); }

    /* Número principal */
    .plan-number {
      font-size: 44px; font-weight: 800; color: var(--primary-dk); line-height: 1;
      margin: 4px 0 2px;
    }
    .plan-number.unlimited { font-size: 32px; margin-top: 8px; }
    .plan-unit { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
    .plan-price { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 2px; }
    .plan-period{ font-size: 11px; color: var(--muted); margin-bottom: 8px; }
    .plan-desc  { font-size: 11px; color: var(--muted); flex: 1; margin-bottom: 10px; line-height: 1.4; }

    /* Faixas de crédito */
    .tier-list { margin: 8px 0 10px; }
    .tier-row  {
      display: flex; justify-content: space-between; align-items: center;
      font-size: 11px; padding: 3px 0;
      border-bottom: 1px solid var(--border);
    }
    .tier-row:last-child { border-bottom: none; }
    .tier-range { color: var(--muted); }
    .tier-price { font-weight: 700; color: var(--primary); }

    .plan-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 12px; }

    /* ── Modal ──────────────────────────────────────────────────── */
    .modal-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.55);
                     z-index:1000; align-items:center; justify-content:center; overflow-y:auto; padding:20px; }
    .modal-overlay.open { display:flex; }
    .modal-box {
      background: white; border-radius: 16px; padding: 32px;
      width: 580px; max-width: 98vw; max-height: 90vh; overflow-y: auto;
      box-shadow: 0 20px 60px rgba(0,0,0,.2);
    }
    .modal-title { font-size: 17px; font-weight: 700; margin-bottom: 24px; color: var(--primary-dk); }

    /* Seção condicional do modal */
    .modal-section {
      border: 1.5px solid var(--border); border-radius: 10px;
      padding: 16px; margin-bottom: 16px; background: #faf5ff;
    }
    .modal-section-title {
      font-size: 11px; font-weight: 700; text-transform: uppercase;
      letter-spacing: .08em; color: var(--primary); margin-bottom: 12px;
    }

    /* Abas do tipo de plano */
    .type-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
    .type-tab {
      padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600;
      cursor: pointer; border: 2px solid var(--border); background: #fff;
      color: var(--muted); transition: .15s;
    }
    .type-tab.active { border-color: var(--primary); background: var(--primary-lt); color: var(--primary); }

    /* Tabela de faixas */
    .tiers-table { width: 100%; border-collapse: collapse; font-size: 13px; }
    .tiers-table th { background: #faf5ff; padding: 8px 10px; text-align: left;
                      font-size: 11px; font-weight: 700; text-transform: uppercase;
                      color: var(--primary); border-bottom: 2px solid var(--border); }
    .tiers-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
    .tiers-table input { width: 100%; padding: 4px 8px; border: 1.5px solid var(--border);
                         border-radius: 6px; font-size: 12px; font-family: inherit; }
    .tiers-table input:focus { outline:none; border-color:var(--primary); }
    .btn-add-tier { font-size:12px; padding:5px 12px; margin-top:8px; }
    .btn-del-tier { background:none; border:none; color:var(--danger); cursor:pointer; font-size:14px; padding:2px 6px; }

/* ── admin/dashboard.html ── */
.stat-grid { display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:28px; }
    .stat-box { background:white;border:1px solid #e5e7eb;border-radius:12px;padding:20px;text-align:center; }
    .stat-num { font-size:36px;font-weight:800;color:var(--primary); }
    .stat-label { font-size:13px;color:#6b7280;margin-top:4px; }
    .badge-active { background:#d1fae5;color:#065f46;padding:2px 8px;border-radius:12px;font-size:11px; }
    .badge-inactive { background:#fee2e2;color:#991b1b;padding:2px 8px;border-radius:12px;font-size:11px; }
    .modal-overlay { display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:1000;align-items:center;justify-content:center; }
    .modal-overlay.open { display:flex; }
    .modal-box { background:white;border-radius:12px;padding:32px;width:520px;max-width:95vw;max-height:90vh;overflow-y:auto; }

/* ── admin/empresas.html ── */
.badge-active   { background:#d1fae5;color:#065f46;padding:2px 8px;border-radius:12px;font-size:11px; }
    .badge-inactive { background:#fee2e2;color:#991b1b;padding:2px 8px;border-radius:12px;font-size:11px; }
    .modal-overlay  { display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:1000;align-items:center;justify-content:center; }
    .modal-overlay.open { display:flex; }
    .modal-box { background:white;border-radius:12px;padding:32px;width:560px;max-width:95vw;max-height:90vh;overflow-y:auto; }
    .credits-low  { color:#d97706;font-weight:600; }
    .credits-zero { color:#dc2626;font-weight:600; }
    .credits-ok   { color:#059669;font-weight:600; }


/* ── Footer ──────────────────────────────────────────────── */
.wow-footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.wow-footer-sep { color: var(--border); }

/* ── Mobile: header do card compacto ────────────────────────────── */
@media (max-width: 768px) {
  .wow-card-header {
    padding: 10px 14px 0;
  }
  .wow-card-icon {
    width: 44px; height: 44px;
  }
  .wow-card-icon-img img {
    width: 44px !important; height: 44px !important;
  }
  .wow-card-title-bar h2 {
    font-size: 16px;
  }
  .wow-card-title-bar {
    padding-left: 10px;
  }
}
@media (max-width: 480px) {
  .wow-card-header {
    padding: 8px 10px 0;
  }
  .wow-card-icon {
    width: 38px; height: 38px;
  }
  .wow-card-icon-img img {
    width: 38px !important; height: 38px !important;
  }
  .wow-card-title-bar h2 {
    font-size: 14px;
  }
}


.hidden {
    display: none;
}

/* OVERLAY (fundo escuro com blur) */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 10, 30, 0.55);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* CONTAINER CENTRAL */
.loading-center {
    text-align: center;
    color: white;
}

/* ÁREA DA ANIMAÇÃO */
.loading-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CÍRCULO GIRANDO */
.loading-animation::before {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.15);
    border-top-color: #a78bfa;
    border-right-color: #7c3aed;
    animation: spinSmooth 1s linear infinite;
}

/* GLOW */
.loading-animation::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(124,58,237,0.6);
    animation: pulseGlow 2s ease-in-out infinite;
}

/* LOGO */
.loading-logo {
    width: 70px;
    height: auto;
    animation: floatLogo 2s ease-in-out infinite;
    filter: drop-shadow(0 6px 16px rgba(124, 58, 237, 0.5));
}

/* TEXTO */
.loading-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.loading-subtitle {
    font-size: 13px;
    opacity: 0.8;
}

/* ANIMAÇÕES */
@keyframes spinSmooth {
    to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
    0%,100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

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

.progress-ring {
    position: absolute;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: transparent;
    stroke: rgba(255,255,255,0.15);
    stroke-width: 4;
}

.progress-ring-fill {
    fill: transparent;
    stroke: #a78bfa;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 377; /* 2πr = 2 * PI * 60 */
    stroke-dashoffset: 377;
    transition: stroke-dashoffset 1s linear;
}

.wow-card-pix {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  position: relative;
}
