/* ============================================================
   Delta Analítica — style.css
   Ghost — CSS: layout, tipografia, cores, responsividade
   ============================================================ */

/* --- 0. FONTS --- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* --- 1. CSS VARIABLES --- */
:root {
  /* Paleta Delta Analítica (extraída da logo) */
  --fundo:           #0d1b3e;
  --fundo-card:      #132248;
  --fundo-sidebar:   #0a1530;
  --fundo-input:     #0f1e44;
  --primaria:        #c9a227;
  --primaria-hover:  #e0b72e;
  --primaria-dim:    rgba(201, 162, 39, 0.12);
  --primaria-border: rgba(201, 162, 39, 0.30);
  --branco:          #ffffff;
  --texto:           #e8eaf0;
  --texto-muted:     #8b9ab7;
  --border:          rgba(255, 255, 255, 0.08);
  --border-hover:    rgba(255, 255, 255, 0.15);
  --success:         #4caf78;
  --success-dim:     rgba(76, 175, 120, 0.12);
  --danger:          #e06060;
  --danger-dim:      rgba(224, 96, 96, 0.12);
  --warning:         #f0a500;

  /* Tipografia */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Espaçamento (sistema 8px) */
  --sp-1: 8px;
  --sp-2: 16px;
  --sp-3: 24px;
  --sp-4: 32px;
  --sp-5: 48px;
  --sp-6: 64px;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Sombras */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-btn:  0 4px 16px rgba(201, 162, 39, 0.30);
  --shadow-lg:   0 8px 40px rgba(0, 0, 0, 0.50);

  /* Topbar */
  --topbar-h: 64px;

  /* Sidebar */
  --sidebar-w: 280px;
  --sidebar-z: 1000;
  --overlay-z: 999;
}

/* --- 2. RESET --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-main);
  background: var(--fundo);
  color: var(--texto);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--primaria); text-decoration: none; }
a:hover { color: var(--primaria-hover); }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font-main); }
input, select, textarea { font-family: var(--font-main); }
ul, ol { list-style: none; }

/* --- 3. SCROLLBAR --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--fundo); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--texto-muted); }

/* --- 4. TIPOGRAFIA --- */
h1 { font-size: 2rem;    font-weight: 800; line-height: 1.2; }
h2 { font-size: 1.5rem;  font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem;    font-weight: 600; }
p  { line-height: 1.7; color: var(--texto-muted); }

.text-primary { color: var(--primaria); }
.text-muted   { color: var(--texto-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-white   { color: var(--branco); }
.text-sm      { font-size: 0.875rem; }
.text-xs      { font-size: 0.75rem; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.text-center { text-align: center; }

/* --- 5. LAYOUT --- */
.page-wrapper { min-height: 100vh; display: flex; flex-direction: column; }

.main-content {
  flex: 1;
  padding: var(--sp-4) var(--sp-3);
  padding-top: calc(var(--topbar-h) + var(--sp-4));
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* --- 6. TOPBAR --- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--fundo-sidebar);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-3);
  z-index: 100;
  gap: var(--sp-2);
}

.topbar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--primaria-border) 40%, var(--primaria-border) 60%, transparent 100%);
}

.topbar-left  { display: flex; align-items: center; gap: var(--sp-2); }
.topbar-right { display: flex; align-items: center; gap: var(--sp-2); }

.topbar-brand { display: flex; align-items: center; gap: var(--sp-1); }
.topbar-brand img { height: 36px; width: auto; }
.topbar-brand .brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primaria);
  letter-spacing: -0.02em;
}

.user-badge {
  display: flex; align-items: center; gap: 6px;
  background: var(--primaria-dim);
  border: 1px solid var(--primaria-border);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primaria);
}
.user-badge svg { width: 15px; height: 15px; }

/* --- 7. HAMBURGER / DRAWER --- */
.hamburger {
  background: none;
  border: 1px solid var(--border);
  color: var(--texto);
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.hamburger:hover {
  background: var(--primaria-dim);
  border-color: var(--primaria-border);
  color: var(--primaria);
}

.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: var(--overlay-z);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { opacity: 1; pointer-events: all; }

.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--fundo-sidebar);
  border-right: 1px solid var(--border);
  z-index: var(--sidebar-z);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar.open { transform: translateX(0); }

.sidebar-header {
  padding: 0 var(--sp-3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--topbar-h);
  flex-shrink: 0;
}

.sidebar-logo { display: flex; align-items: center; gap: var(--sp-1); }
.sidebar-logo img  { height: 30px; width: auto; }
.sidebar-logo span { font-size: 0.95rem; font-weight: 700; color: var(--primaria); }

.sidebar-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--texto-muted);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.sidebar-close:hover { background: var(--danger-dim); border-color: var(--danger); color: var(--danger); }

.sidebar-nav { flex: 1; padding: var(--sp-2); }

.nav-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--texto-muted);
  padding: var(--sp-2) var(--sp-1) var(--sp-1);
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--texto-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { background: var(--primaria-dim); color: var(--texto); }
.nav-item.active {
  background: var(--primaria-dim);
  color: var(--primaria);
  padding-left: 15px;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--primaria);
  border-radius: 0 2px 2px 0;
}

.sidebar-footer {
  padding: var(--sp-2);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user {
  padding: 8px 12px;
  font-size: 0.78rem;
  color: var(--texto-muted);
  margin-bottom: var(--sp-1);
}
.sidebar-user strong { display: block; color: var(--texto); font-size: 0.85rem; margin-bottom: 2px; }

/* --- 8. CARDS --- */
.card {
  background: var(--fundo-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  box-shadow: var(--shadow-card);
}
.card-sm { padding: var(--sp-2); }
.card-lg { padding: var(--sp-4); }

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-3); gap: var(--sp-2);
}
.card-title    { font-size: 1rem; font-weight: 600; color: var(--texto); }
.card-subtitle { font-size: 0.78rem; color: var(--texto-muted); margin-top: 2px; }

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.kpi-card {
  background: var(--fundo-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s;
}
.kpi-card:hover { border-color: var(--primaria-border); }
.kpi-card.kpi-warn  { border-color: #e0a42766; background: #e0a4270d; }
.kpi-card.kpi-warn .kpi-value  { color: #e0a427; }
.kpi-card.kpi-danger { border-color: rgba(224,96,96,.4); background: rgba(224,96,96,.06); }
.kpi-card.kpi-danger .kpi-value { color: var(--danger); }

.kpi-icon {
  width: 44px; height: 44px;
  background: var(--primaria-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: var(--sp-2);
}
.kpi-icon svg { width: 22px; height: 22px; color: var(--primaria); }

.kpi-value { font-size: 2rem; font-weight: 800; color: var(--branco); line-height: 1; }
.kpi-label { font-size: 0.78rem; color: var(--texto-muted); margin-top: 4px; }

/* Converter Cards */
.converters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
}

.converter-card {
  background: var(--fundo-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.converter-card:hover {
  border-color: var(--primaria-border);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 0 1px var(--primaria-border);
}

.converter-card-icon {
  width: 56px; height: 56px;
  background: var(--primaria-dim);
  border: 1px solid var(--primaria-border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.converter-card-icon svg { width: 28px; height: 28px; color: var(--primaria); }

.converter-card h3 { font-size: 1.1rem; color: var(--branco); }
.converter-card p  { font-size: 0.875rem; color: var(--texto-muted); flex: 1; }

.converter-card-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(76, 175, 120, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
  width: fit-content;
}

/* --- 9. BOTÕES --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: 44px;
  cursor: pointer;
}
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }

.btn-primary { background: var(--primaria); color: #0a1530; }
.btn-primary:hover {
  background: var(--primaria-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-btn);
}
.btn-primary:active { transform: translateY(0); box-shadow: none; }

.btn-outline {
  background: transparent;
  color: var(--texto);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  background: var(--primaria-dim);
  border-color: var(--primaria-border);
  color: var(--primaria);
}

.btn-ghost { background: transparent; color: var(--texto-muted); border: none; }
.btn-ghost:hover { color: var(--primaria); background: var(--primaria-dim); }

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(224, 96, 96, 0.25);
}
.btn-danger:hover { background: var(--danger); color: var(--branco); }

.btn-sm  { padding: 6px 14px; font-size: 0.8rem; min-height: 36px; }
.btn-lg  { padding: 14px 28px; font-size: 1rem; min-height: 52px; }
.btn-full { width: 100%; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* --- 10. FORMULÁRIOS --- */
.form-group { margin-bottom: var(--sp-3); }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--texto);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--fundo-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--texto);
  padding: 10px 14px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 44px;
}
.form-control::placeholder { color: var(--texto-muted); }
.form-control:focus {
  border-color: var(--primaria);
  box-shadow: 0 0 0 3px var(--primaria-dim);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b9ab7' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint  { font-size: 0.75rem; color: var(--texto-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; display: none; }
.form-error.show { display: block; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2);
}

/* --- 11. TABELAS --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table th {
  background: rgba(255,255,255,0.03);
  color: var(--texto-muted);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

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

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

/* --- 12. BADGES --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
}
.badge-success { background: var(--success-dim); color: var(--success); border: 1px solid rgba(76,175,120,0.3); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger);  border: 1px solid rgba(224,96,96,0.3); }
.badge-primary { background: var(--primaria-dim); color: var(--primaria); border: 1px solid var(--primaria-border); }
.badge-muted   { background: rgba(255,255,255,0.05); color: var(--texto-muted); border: 1px solid var(--border); }

/* --- 13. TOASTS --- */
#toast-container {
  position: fixed;
  top: 80px; right: var(--sp-3);
  z-index: 9999;
  display: flex; flex-direction: column; gap: var(--sp-1);
  max-width: 360px;
  pointer-events: none;
}

.toast {
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success { background: var(--fundo-card); color: var(--success); border: 1px solid rgba(76,175,120,0.3); }
.toast-danger  { background: var(--fundo-card); color: var(--danger);  border: 1px solid rgba(224,96,96,0.3); }
.toast-info    { background: var(--fundo-card); color: var(--primaria); border: 1px solid var(--primaria-border); }

/* --- 14. LOGIN PAGE --- */
.login-page {
  min-height: 100vh;
  display: flex;
}

/* ---- Painel esquerdo — Brand ---- */
.login-brand-panel {
  flex: 0 0 44%;
  background: linear-gradient(145deg, #071023 0%, #0a1530 40%, #0d1b3e 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.brand-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(201, 162, 39, 0.18) 1.2px, transparent 1.2px);
  background-size: 28px 28px;
  opacity: 0.55;
  pointer-events: none;
}

.brand-watermark {
  position: absolute;
  bottom: -60px; right: -60px;
  width: 360px; height: 360px;
  pointer-events: none;
}
.brand-watermark svg { width: 100%; height: 100%; }

.brand-content {
  position: relative;
  z-index: 1;
  max-width: 340px;
  text-align: center;
}

.brand-logo {
  width: 88px; height: 80px;
  margin: 0 auto 24px;
  filter: drop-shadow(0 0 20px rgba(201, 162, 39, 0.4));
  animation: goldGlow 3s ease infinite;
}
.brand-logo svg { width: 100%; height: 100%; }

.brand-name {
  display: flex; align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}
.brand-name-main {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand-name-sub {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primaria);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.brand-divider {
  width: 48px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primaria), transparent);
  margin: 0 auto 20px;
  border-radius: 1px;
}

.brand-tagline {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--texto-muted);
  line-height: 1.7;
  margin-bottom: 32px;
}

.brand-features {
  display: flex; flex-direction: column; gap: 12px;
  text-align: left;
}
.brand-features li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.8rem;
  color: rgba(232, 234, 240, 0.72);
  font-weight: 400;
  line-height: 1.5;
}
.brand-features li svg {
  width: 15px; height: 15px;
  color: var(--primaria);
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---- Painel direito — Formulário ---- */
.login-form-panel {
  flex: 1;
  background: #f4f6fb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  min-height: 100vh;
  position: relative;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow:
    0 4px 48px rgba(13, 27, 62, 0.10),
    0 1px 4px rgba(0, 0, 0, 0.04);
  position: relative;
}

.login-form-header {
  display: flex; align-items: center;
  gap: 14px;
  margin-bottom: 6px;
}
.login-form-logo {
  width: 40px; height: 36px;
  flex-shrink: 0;
}
.login-form-logo svg { width: 100%; height: 100%; }
.login-form-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0d1b3e;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.login-form-header p {
  font-size: 0.8rem;
  color: #8b9ab7;
  margin: 0;
  line-height: 1.4;
}

.login-divider {
  height: 1px;
  background: #e8edf5;
  margin: 20px 0;
}

/* Light theme overrides para o painel do formulário */
.login-form-panel .form-label {
  color: #2d3748;
  font-weight: 600;
}
.login-form-panel .form-control {
  background: #f5f7fc;
  border-color: #dde2ef;
  color: #1a202c;
}
.login-form-panel .form-control::placeholder {
  color: #a0aec0;
}
.login-form-panel .form-control:focus {
  border-color: var(--primaria);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.14);
}

/* Password toggle */
.input-password-wrap { position: relative; }
.input-password-toggle {
  position: absolute;
  right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: #a0aec0;
  padding: 4px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 0;
}
.input-password-toggle:hover { color: var(--primaria); }
.input-password-toggle svg { width: 18px; height: 18px; }
.login-form-panel .input-password-wrap .form-control { padding-right: 44px; }

.login-footer-text {
  text-align: center;
  font-size: 0.7rem;
  color: #b0bcd4;
  margin-top: 24px;
}

/* Shake no card (senha errada) */
.shake { animation: shake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

/* --- 15. PAGE HEADER --- */
.page-header { margin-bottom: var(--sp-4); }
.page-header h1 { font-size: 1.75rem; color: var(--branco); }
.page-header p  { margin-top: 4px; }
.page-header-actions {
  display: flex; align-items: center; gap: var(--sp-2);
  flex-wrap: wrap; margin-top: var(--sp-2);
}

/* --- 16. TABS --- */
.tabs {
  display: flex; gap: 4px;
  background: var(--fundo);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--sp-3);
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1; min-width: 120px;
  background: none; border: none;
  color: var(--texto-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}
.tab-btn:hover { color: var(--texto); background: rgba(255,255,255,0.04); }
.tab-btn.active {
  background: var(--fundo-card);
  color: var(--primaria);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* --- 17. MODAL --- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-3);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal {
  background: var(--fundo-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 500px;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}
.modal-overlay.active .modal { transform: scale(1); }

.modal-header {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1.1rem; font-weight: 700; color: var(--branco); }

.modal-close {
  background: none; border: none;
  color: var(--texto-muted);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
}
.modal-close:hover { background: var(--danger-dim); color: var(--danger); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body   { padding: var(--sp-3); }
.modal-footer {
  padding: var(--sp-2) var(--sp-3);
  border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: var(--sp-1);
}

/* --- 18. SEARCH BAR --- */
.search-bar { position: relative; }
.search-bar svg {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--texto-muted);
  pointer-events: none;
}
.search-bar input { padding-left: 40px; }

/* --- 19. DROP ZONE --- */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-3);
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--primaria);
  background: var(--primaria-dim);
}

.drop-icon {
  width: 64px; height: 64px;
  background: var(--primaria-dim);
  border: 1px solid var(--primaria-border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--sp-2);
}
.drop-icon svg { width: 32px; height: 32px; color: var(--primaria); }

.drop-zone h3 { font-size: 1.1rem; color: var(--branco); margin-bottom: 8px; }
.drop-zone p  { font-size: 0.875rem; color: var(--texto-muted); margin-bottom: var(--sp-2); }

/* --- 20. FILE LIST --- */
.file-list { display: flex; flex-direction: column; gap: 8px; }

.file-item {
  background: var(--fundo-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex; align-items: center; gap: var(--sp-2);
  transition: border-color 0.2s;
}
.file-item:hover { border-color: var(--border-hover); }

.file-item-icon {
  width: 38px; height: 38px;
  background: var(--primaria-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.file-item-icon svg { width: 18px; height: 18px; color: var(--primaria); }

.file-item-name { font-size: 0.875rem; font-weight: 600; color: var(--texto); flex: 1; word-break: break-word; min-width: 0; }
.file-item-size { font-size: 0.75rem; color: var(--texto-muted); white-space: nowrap; margin-right: 8px; }
.file-item-status { font-size: 0.75rem; font-weight: 600; white-space: nowrap; }
.file-item-status.processing { color: var(--warning); }
.file-item-status.done       { color: var(--success); }
.file-item-status.error      { color: var(--danger); }

.progress-bar {
  width: 100%; height: 4px;
  background: var(--border);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--primaria);
  border-radius: 2px; transition: width 0.3s ease; width: 0%;
}

/* --- 21. EMPTY STATE --- */
.empty-state { text-align: center; padding: var(--sp-5); color: var(--texto-muted); }
.empty-state svg { width: 48px; height: 48px; margin: 0 auto var(--sp-2); opacity: 0.4; color: var(--texto-muted); }
.empty-state h3  { font-size: 1rem; color: var(--texto-muted); font-weight: 500; }
.empty-state p   { font-size: 0.875rem; margin-top: 4px; }

/* --- 22. SWITCH TOGGLE --- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  transition: all 0.25s; cursor: pointer;
}
.switch-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: var(--texto-muted);
  border-radius: 50%; transition: all 0.25s;
}
.switch input:checked + .switch-slider { background: var(--primaria); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); background: #0a1530; }

/* --- 23. UTILITIES --- */
.divider { height: 1px; background: var(--border); margin: var(--sp-3) 0; }
.d-flex           { display: flex; }
.align-center     { align-items: center; }
.justify-between  { justify-content: space-between; }
.flex-wrap        { flex-wrap: wrap; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.mt-1  { margin-top: var(--sp-1); }
.mt-2  { margin-top: var(--sp-2); }
.mt-3  { margin-top: var(--sp-3); }
.mb-1  { margin-bottom: var(--sp-1); }
.mb-2  { margin-bottom: var(--sp-2); }
.mb-3  { margin-bottom: var(--sp-3); }
.mb-4  { margin-bottom: var(--sp-4); }
.ml-auto { margin-left: auto; }

/* --- 24. CONVERSOR PAGE --- */
.conversor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  align-items: start;
}

.conversor-actions {
  display: flex; align-items: center; gap: var(--sp-1);
  flex-wrap: wrap; margin-top: var(--sp-2);
}

.info-list {
  display: flex; flex-direction: column; gap: 10px;
}
.info-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.875rem; color: var(--texto-muted);
}
.info-list li svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; margin-top: 2px; }

/* --- 25. RESPONSIVO --- */
@media (max-width: 1024px) {
  .conversor-layout { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .login-brand-panel { display: none; }
  .login-form-panel  { flex: 1; }
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .kpi-grid  { grid-template-columns: 1fr 1fr; }
  .converters-grid { grid-template-columns: 1fr; }
  .main-content { padding: var(--sp-3) var(--sp-2); padding-top: calc(var(--topbar-h) + var(--sp-3)); }
  .login-card { padding: var(--sp-4) var(--sp-3); border-radius: var(--radius-lg); }
  h1 { font-size: 1.5rem; }
  .page-header h1 { font-size: 1.5rem; }
  .table td, .table th { padding: 10px 12px; }
  .topbar-brand .brand-name { display: none; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .tabs { flex-direction: column; }
  .tab-btn { min-width: auto; }
  .conversor-actions { flex-direction: column; }
  .conversor-actions .btn { width: 100%; }
}
