/* ============================================================
   style.css  —  Reembolso App
   Visual: Corporativo financeiro — sério, moderno, confiável
   Fonte: Outfit (display) + JetBrains Mono (código/números)
   ============================================================ */

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

/* ══════════════════════════════════════════════════════════
   TOKENS
   ══════════════════════════════════════════════════════════ */
:root {
  /* Cores principais */
  --green-900: #052e16;
  --green-800: #0f5132;
  --green-700: #166534;
  --green-600: #16a34a;
  --green-100: #dcfce7;
  --green-50:  #f0fdf4;

  /* Neutros */
  --gray-950: #0a0f0d;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50:  #f9fafb;
  --white:    #ffffff;

  /* Semânticas */
  --danger:      #dc2626;
  --danger-light:#fef2f2;
  --danger-mid:  #fee2e2;
  --warn:        #d97706;
  --warn-light:  #fffbeb;
  --warn-mid:    #fde68a;
  --info:        #1d4ed8;
  --info-light:  #eff6ff;
  --success:     var(--green-800);

  /* App tokens */
  --primary:        var(--green-800);
  --primary-hover:  var(--green-700);
  --primary-light:  var(--green-50);
  --primary-border: var(--green-100);

  --bg-page:   #f1f5f2;
  --bg-card:   var(--white);
  --bg-subtle: var(--gray-50);

  --text-primary:   var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted:     var(--gray-400);
  --text-on-dark:   var(--white);

  --border:        var(--gray-200);
  --border-strong: var(--gray-300);
  --border-focus:  var(--green-800);

  /* Layout */
  --sidebar-w:  264px;
  --topbar-h:   60px;
  --radius-xs:  4px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Sombras */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
  --shadow-xl: 0 20px 50px rgba(0,0,0,.15);

  /* Tipografia */
  --font-body:  'Outfit', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --font-display: 'Outfit', sans-serif;

  /* Transições */
  --trans-fast:  .12s ease;
  --trans-base:  .2s ease;
  --trans-slow:  .35s ease;
}
.topbar-title{font-family:'Syne',sans-serif;}
.topbar-title{font-size:16px;font-weight:700;letter-spacing:-.2px;}

/* ══════════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }

/* Scrollbar sutil */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ══════════════════════════════════════════════════════════
   TIPOGRAFIA
   ══════════════════════════════════════════════════════════ */
h1 { font-size: clamp(1.5rem, 3vw, 2rem);   font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
h2 { font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: .95rem; font-weight: 600; }

.mono { font-family: var(--font-mono); }
.text-sm  { font-size: .875rem; }
.text-xs  { font-size: .75rem; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary-color { color: var(--primary); }
.text-danger { color: var(--danger); }
.text-warn   { color: var(--warn); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ══════════════════════════════════════════════════════════
   LAYOUT PÚBLICO (login, checkout, index, erro, onboarding)
   ══════════════════════════════════════════════════════════ */

/* Header público */
header.public-header {
  background: var(--green-900);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.public-header .header-inner {
  max-width: 1280px;
  width: 100%;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo-img { height: 44px; object-fit: contain; }

/* ══════════════════════════════════════════════════════════
   AUTH PAGE — CORRIGIDA
   ══════════════════════════════════════════════════════════ */
.auth-page {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: flex-start;      /* flex-start evita explosão vertical no checkout */
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(160deg, var(--green-900) 0%, var(--gray-900) 60%, var(--gray-950) 100%);
}

/* Card padrão (login) */
.auth-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-xl);
}

/* Card wide — checkout (CORRIGIDO) */
.auth-card-wide {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px;
  width: 100%;
  max-width: 860px;
  box-shadow: var(--shadow-xl);
  margin: 0 auto;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}
.auth-logo img { height: 52px; margin: 0 auto 12px; }
.auth-logo h1 { font-size: 1.5rem; color: var(--primary); }
.auth-logo p  { font-size: .875rem; color: var(--text-secondary); margin-top: 4px; }

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

/* ══════════════════════════════════════════════════════════
   MODAIS DE PAGAMENTO
   ══════════════════════════════════════════════════════════ */
#pixModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#pixModal .modal-content {
  background: var(--white);
  width: 40%;
  min-width: 360px;
  max-width: 500px;
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow-xl);
  position: relative;
}

#qrCodeImage {
  width: 220px;
  height: 220px;
  margin: 0 auto 20px;
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: var(--radius-md);
}

#pixCodeDisplay {
  background: var(--gray-50);
  border: 1px dashed var(--border-strong);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  word-break: break-all;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════════
   FORM CONTROLS
   ══════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-group:last-child { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.form-label .req { color: var(--danger); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9375rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--white);
  transition: border-color var(--trans-fast), box-shadow var(--trans-fast);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(15,81,50,.1);
}
.form-control:disabled {
  background: var(--gray-100);
  color: var(--text-secondary);
  cursor: not-allowed;
}
.form-control::placeholder { color: var(--gray-400); }

select.form-control { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea.form-control { resize: vertical; min-height: 96px; }

.form-hint {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}
.form-error {
  font-size: .75rem;
  color: var(--danger);
  margin-top: 5px;
}

/* Grid rows */
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 0; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* Grupo de input com ícone */
.input-group { position: relative; }
.input-group .form-control { padding-left: 40px; }
.input-group .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  pointer-events: none;
  opacity: .5;
}

/* Toggle senha */
.input-group .toggle-pass {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--text-muted);
  font-size: 16px;
}

/* ══════════════════════════════════════════════════════════
   BOTÕES
   ══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background var(--trans-fast), color var(--trans-fast), border-color var(--trans-fast), box-shadow var(--trans-fast), opacity var(--trans-fast);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: .01em;
}
.btn:disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }

.btn-primary   { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-outline   { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }

.btn-ghost     { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--gray-100); color: var(--text-primary); }

.btn-danger    { background: var(--danger); color: var(--white); border-color: var(--danger); }
.btn-danger:hover { opacity: .88; }

.btn-danger-outline { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger-outline:hover { background: var(--danger-light); }

.btn-dark      { background: var(--gray-900); color: var(--white); border-color: var(--gray-900); }
.btn-dark:hover { background: var(--gray-800); }

.btn-full { width: 100%; }
.btn-lg   { padding: 12px 28px; font-size: 1rem; }
.btn-sm   { padding: 6px 14px; font-size: .8125rem; }
.btn-xs   { padding: 4px 10px; font-size: .75rem; }
.btn-icon { padding: 7px; width: 34px; height: 34px; border-radius: var(--radius-sm); }
.btn-icon-sm { padding: 5px; width: 28px; height: 28px; }

/* ══════════════════════════════════════════════════════════
   BADGES / CHIPS
   ══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.badge-green  { background: var(--green-100);   color: var(--green-800); }
.badge-red    { background: var(--danger-mid);   color: var(--danger); }
.badge-warn   { background: var(--warn-mid);     color: #92400e; }
.badge-blue   { background: #dbeafe;             color: #1e40af; }
.badge-purple { background: #ede9fe;             color: #5b21b6; }
.badge-gray   { background: var(--gray-100);     color: var(--gray-700); }
.badge-dark   { background: var(--gray-800);     color: var(--white); }

.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .7; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: .8125rem;
  font-weight: 600;
  border: 1px solid var(--primary-border);
}
.chip-del {
  cursor: pointer;
  opacity: .6;
  font-size: .75rem;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--trans-fast);
  background: none;
  border: none;
  color: inherit;
}
.chip-del:hover { background: var(--primary); color: var(--white); opacity: 1; }

/* ══════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-header h2 { font-size: .9375rem; font-weight: 700; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body   { padding: 22px; }
.card-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--bg-subtle); }

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow var(--trans-base);
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.si-green  { background: var(--green-100); }
.si-warn   { background: var(--warn-light); }
.si-blue   { background: var(--info-light); }
.si-red    { background: var(--danger-light); }
.si-gray   { background: var(--gray-100); }
.stat-value { font-size: 1.75rem; font-weight: 800; font-family: var(--font-mono); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }
.sv-green { color: var(--green-800); }
.sv-warn  { color: var(--warn); }
.sv-blue  { color: var(--info); }
.sv-red   { color: var(--danger); }
.sv-gray  { color: var(--gray-600); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }

/* ══════════════════════════════════════════════════════════
   TABELA
   ══════════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead tr { background: var(--gray-50); }
th {
  padding: 10px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gray-50); }
.td-mono { font-family: var(--font-mono); font-size: .8125rem; }
.td-actions { display: flex; gap: 6px; align-items: center; }

/* ══════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════ */
.empty-state {
  padding: 52px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: .5; }
.empty-state .empty-title { font-size: .9375rem; font-weight: 600; color: var(--text-secondary); }
.empty-state .empty-sub   { font-size: .8125rem; margin-top: 4px; }

/* ══════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--green-900);
  color: var(--white);
  display: flex;
  align-items: center;
  z-index: 400;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.topbar-brand {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  height: 100%;
  border-right: 1px solid rgba(255,255,255,.08);
}
.topbar-brand .logo-img { height: 34px; }
.topbar-brand .brand-name {
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--white);
}
.topbar-center { flex: 1; padding: 0 24px; }
.topbar-right  { padding: 0 20px; display: flex; align-items: center; gap: 10px; }

.user-menu { position: relative; }
.user-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--trans-fast);
  border: none;
  background: none;
  color: var(--white);
}
.user-trigger:hover { background: rgba(255,255,255,.1); }
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .8125rem;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.2);
}
.user-info .u-name { font-size: .8125rem; font-weight: 600; line-height: 1.2; }
.user-info .u-role { font-size: .6875rem; opacity: .65; }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--white);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  min-width: 220px;
  border: 1px solid var(--border);
  overflow: hidden;
  z-index: 500;
  animation: dropDown .15s ease;
}
@keyframes dropDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown { display: block; }

.ud-head { padding: 14px 16px; background: var(--green-50); border-bottom: 1px solid var(--border); }
.ud-head .ud-name  { font-size: .875rem; font-weight: 700; color: var(--primary); }
.ud-head .ud-email { font-size: .75rem; color: var(--text-secondary); margin-top: 2px; }
.ud-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: .8375rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--trans-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.ud-item:hover { background: var(--gray-50); }
.ud-divider { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.ud-item.danger { color: var(--danger); }
.ud-item.danger:hover { background: var(--danger-light); }

/* ══════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--white);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 300;
  display: flex;
  flex-direction: column;
}
.sidebar-inner { padding: 12px 0 24px; flex: 1; }
.sidebar-section {
  padding: 16px 18px 6px;
  font-size: .65rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: .8375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--trans-fast);
  border-left: 3px solid transparent;
  user-select: none;
  text-decoration: none;
}
.nav-item:hover { background: var(--green-50); color: var(--primary); border-left-color: var(--green-100); }
.nav-item.active { background: var(--green-50); color: var(--primary); border-left-color: var(--primary); font-weight: 600; }
.nav-icon { width: 20px; font-size: 1rem; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: var(--white);
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* ══════════════════════════════════════════════════════════
   MAIN
   ══════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.main-content {
  margin-top: var(--topbar-h);
  margin-left: var(--sidebar-w);
  padding: 28px 30px;
  flex: 1;
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-header-text h1 { color: var(--text-primary); }
.page-header-text p  { color: var(--text-secondary); font-size: .875rem; margin-top: 3px; }

.section { display: none; }
.section.active { display: block; animation: fadeInUp .2s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ══════════════════════════════════════════════════════════
   MODAIS
   ══════════════════════════════════════════════════════════ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 700;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: modalIn .22s ease;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box.modal-md  { max-width: 580px; }
.modal-box.modal-lg  { max-width: 700px; }
.modal-box.modal-xl  { max-width: 860px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(-16px) scale(.97); } to { opacity: 1; transform: none; } }

.modal-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-head h3 { font-size: 1rem; font-weight: 700; color: var(--primary); }
.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--gray-100);
  border: none;
  cursor: pointer;
  font-size: .875rem;
  color: var(--text-secondary);
  transition: var(--trans-fast);
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); }

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

/* ══════════════════════════════════════════════════════════
   UPLOAD AREA
   ══════════════════════════════════════════════════════════ */
.upload-area {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--trans-base);
  background: var(--bg-subtle);
  position: relative;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon { font-size: 2rem; margin-bottom: 8px; opacity: .5; }
.upload-text  { font-size: .875rem; font-weight: 600; color: var(--text-secondary); }
.upload-sub   { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.upload-file-name {
  margin-top: 10px;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--primary);
  font-family: var(--font-mono);
}

.progress-wrap {
  background: var(--gray-200);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width .3s ease;
  width: 0%;
}

/* ══════════════════════════════════════════════════════════
   LOTE CARD
   ══════════════════════════════════════════════════════════ */
.lote-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: all var(--trans-fast);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
}
.lote-card:hover { border-color: var(--primary); background: var(--primary-light); }
.lote-icon {
  width: 42px; height: 42px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
  border: 1px solid var(--primary-border);
}
.lote-info { flex: 1; min-width: 0; }
.lote-nome { font-family: var(--font-mono); font-size: .875rem; font-weight: 600; color: var(--primary); }
.lote-meta { font-size: .75rem; color: var(--text-secondary); margin-top: 2px; }
.lote-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; flex-wrap: wrap; }

/* ══════════════════════════════════════════════════════════
   RANGE EXPORT
   ══════════════════════════════════════════════════════════ */
.range-wrap { margin: 10px 0; }
input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  height: 4px;
}
.range-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-muted); margin-top: 4px; }

/* ══════════════════════════════════════════════════════════
   INFO BOX
   ══════════════════════════════════════════════════════════ */
.info-box {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.5;
}
.info-box.warn   { background: var(--warn-light); border: 1px solid var(--warn-mid); color: #92400e; }
.info-box.info   { background: var(--info-light); border: 1px solid #bfdbfe; color: #1e40af; }
.info-box.success{ background: var(--green-50); border: 1px solid var(--green-100); color: var(--green-800); }
.info-box.danger { background: var(--danger-light); border: 1px solid var(--danger-mid); color: var(--danger); }

/* ══════════════════════════════════════════════════════════
   SEARCH INPUT
   ══════════════════════════════════════════════════════════ */
.search-wrap { position: relative; }
.search-wrap .form-control { padding-left: 36px; }
.search-wrap .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: .875rem;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════
   HERO (index.html)
   ══════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(160deg, var(--green-900) 0%, var(--gray-900) 100%);
  color: var(--white);
  padding: 100px 20px 120px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 60% 0%, rgba(22,163,74,.18) 0%, transparent 70%);
}
.hero-content { position: relative; max-width: 680px; margin: auto; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; color: var(--white); margin-bottom: 16px; }
.hero h1 span { color: #4ade80; }
.hero p  { font-size: 1.125rem; opacity: .8; margin-bottom: 36px; line-height: 1.6; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.benefits { padding: 80px 20px; background: var(--white); }
.benefits-inner { max-width: 1200px; margin: auto; }
.section-title { text-align: center; margin-bottom: 48px; }
.section-title h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 800; }
.section-title p  { color: var(--text-secondary); margin-top: 8px; font-size: 1rem; }
.benefit-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.benefit-card {
  padding: 28px 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  text-align: center;
  transition: box-shadow var(--trans-base), transform var(--trans-base);
}
.benefit-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.benefit-icon { font-size: 2.5rem; margin-bottom: 14px; }
.benefit-card h3 { font-size: 1rem; margin-bottom: 8px; }
.benefit-card p  { font-size: .875rem; color: var(--text-secondary); line-height: 1.5; }

.pricing { padding: 80px 20px; background: var(--bg-page); }
.pricing-inner { max-width: 600px; margin: auto; }
.pricing-box {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.price-list { list-style: none; padding: 0; margin: 0 0 24px; }
.price-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9375rem;
}
.price-list li:last-child { border: none; }
.price-highlight { color: var(--primary); font-weight: 700; font-family: var(--font-mono); }
.price-result {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  margin: 20px 0;
  padding: 16px;
  background: var(--primary-light);
  border-radius: var(--radius-sm);
  border: 1px solid var(--primary-border);
}

footer {
  background: var(--green-900);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 24px 20px;
  font-size: .8125rem;
}
/* ══ TOPBAR ══ */
.topbar{position:fixed;top:0;left:0;right:0;height:var(--header-h);background:var(--primary);color:#fff;display:flex;align-items:center;padding:0 20px 0 0;z-index:300;border-bottom:1px solid rgba(255,255,255,.08);}
.topbar-brand{width:var(--sidebar-w);display:flex;align-items:center;gap:10px;padding:0 20px;border-right:1px solid rgba(255,255,255,.12);height:100%;}
.topbar-logo{height:36px;object-fit:contain;}
.topbar-title{font-size:16px;font-weight:700;letter-spacing:-.2px;}
.topbar-spacer{flex:1;}
.topbar-right{display:flex;align-items:center;gap:8px;padding:0 20px;}
.topbar-user{display:flex;align-items:center;gap:10px;cursor:pointer;position:relative;padding:6px 12px;border-radius:var(--radius-sm);transition:.2s;}
.topbar-user:hover{background:rgba(255,255,255,.1);}
.topbar-avatar{width:34px;height:34px;border-radius:50%;background:linear-gradient(135deg,var(--accent),var(--primary-light));display:flex;align-items:center;justify-content:center;font-weight:800;font-size:13px;color:#fff;font-family:'Syne',sans-serif;flex-shrink:0;}
.t-name{font-size:13px;font-weight:700;line-height:1.2;}
.t-role{font-size:11px;opacity:.7;font-weight:500;}
.user-dropdown{display:none;position:absolute;top:calc(100% + 8px);right:0;background:#fff;color:var(--text);border-radius:var(--radius);box-shadow:var(--shadow-lg);min-width:210px;overflow:hidden;z-index:400;border:1px solid var(--border);}
.topbar-user:hover .user-dropdown{display:block;animation:fadeIn .15s ease;}
@keyframes fadeIn{from{opacity:0;transform:translateY(-6px);}to{opacity:1;transform:none;}}
.ud-header{padding:14px 16px;background:var(--primary-pale);border-bottom:1px solid var(--border);}
.ud-header strong{display:block;font-size:13px;color:var(--primary);}
.ud-header span{font-size:11px;color:var(--text-sub);}
.user-dropdown a{display:flex;align-items:center;gap:10px;padding:10px 16px;text-decoration:none;color:var(--text);font-size:13px;font-weight:500;transition:.15s;}
.user-dropdown a:hover{background:var(--bg);}
.ud-divider{border:none;border-top:1px solid var(--border);margin:4px 0;}
.ud-logout{color:var(--danger)!important;}
.ud-logout:hover{background:var(--danger-pale)!important;}

/* ══════════════════════════════════════════════════════════
   ONBOARDING
   ══════════════════════════════════════════════════════════ */
.onboarding-steps {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.step-tab {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--gray-50);
  border: none;
  border-right: 1px solid var(--border);
  cursor: default;
  transition: var(--trans-fast);
}
.step-tab:last-child { border-right: none; }
.step-tab.active { background: var(--primary); color: var(--white); }
.step-tab.done   { background: var(--primary-light); color: var(--primary); }

/* ══════════════════════════════════════════════════════════
   ERRO PAGE
   ══════════════════════════════════════════════════════════ */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(160deg, var(--green-900), var(--gray-950));
}
.error-card {
  text-align: center;
  color: var(--white);
  max-width: 480px;
}
.error-code { font-size: 6rem; font-weight: 800; font-family: var(--font-mono); color: #4ade80; line-height: 1; }
.error-msg  { font-size: 1.5rem; font-weight: 700; margin: 12px 0 8px; }
.error-sub  { opacity: .65; font-size: .9375rem; margin-bottom: 28px; }

/* ══════════════════════════════════════════════════════════
   FORGOT PASSWORD LINK
   ══════════════════════════════════════════════════════════ */
.forgot-link {
  text-align: right;
  font-size: .8125rem;
  margin-top: 6px;
}
.forgot-link a, .forgot-link span {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.forgot-link a:hover, .forgot-link span:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════ */
.d-none     { display: none !important; }
.d-flex     { display: flex; }
.d-grid     { display: grid; }
.gap-8      { gap: 8px; }
.gap-12     { gap: 12px; }
.gap-16     { gap: 16px; }
.gap-20     { gap: 20px; }
.mt-4  { margin-top: 4px;  }
.mt-8  { margin-top: 8px;  }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.w-full  { width: 100%; }
.flex-1  { flex: 1; }
.items-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-end     { justify-content: flex-end; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ══════════════════════════════════════════════════════════
   SWEETALERT2 OVERRIDE
   ══════════════════════════════════════════════════════════ */
.swal2-confirm { background: var(--primary) !important; }
.swal2-confirm:hover { background: var(--primary-hover) !important; }
.swal2-popup { border-radius: var(--radius-lg) !important; font-family: var(--font-body) !important; }
.swal2-title { font-family: var(--font-body) !important; font-weight: 700 !important; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVO
   ══════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .benefit-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .topbar-brand { display: none; }
  .main-content { margin-left: 0; padding: 20px 16px; }
  .form-row-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .auth-card-wide {
    padding: 32px 24px;
    max-width: 100%;
  }
  .auth-card-wide .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .auth-card { padding: 32px 24px; }
  .pricing-box { padding: 32px 24px; }
  .card-header { flex-direction: column; align-items: flex-start; }
  .page-header { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .hero { padding: 64px 20px 80px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .public-header { padding: 0 20px; }
  .auth-page { padding: 24px 16px; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .benefit-grid { grid-template-columns: 1fr; }
  .modal-box { border-radius: var(--radius-md); }
  .auth-card { padding: 24px 16px; border-radius: var(--radius-lg); }
  .auth-card-wide { padding: 24px 16px; border-radius: var(--radius-lg); }
  .hero h1 { font-size: 1.75rem; }
  .error-code { font-size: 4rem; }
  .main-content { padding: 16px 12px; }
}