/* ═══════════════════════════════════════════════════════════════════
   Grupo Gestor — Conversor de Extratos
   Paleta: Azul #1A56A5 | Azul Médio #2E7DD1 | Teal #00C9A7
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --gg-blue-dark:  #1A56A5;
  --gg-blue-med:   #2E7DD1;
  --gg-teal:       #00C9A7;
  --gg-teal-dark:  #00A88C;
  --gg-bg:         #F0F4FA;
  --gg-white:      #FFFFFF;
  --gg-text:       #1A202C;
  --gg-muted:      #718096;
  --gg-border:     #E2E8F0;
  --sidebar-w:     260px;
  --topbar-h:      64px;
  --radius:        12px;
  --shadow:        0 2px 12px rgba(26,86,165,.10);
  --shadow-lg:     0 8px 30px rgba(26,86,165,.15);
}

* { box-sizing: border-box; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--gg-bg);
  color: var(--gg-text);
  margin: 0;
}

/* ─── SIDEBAR ─────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(180deg, var(--gg-blue-dark) 0%, #0F3A7A 100%);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .3s ease;
  box-shadow: 4px 0 20px rgba(0,0,0,.15);
}

.sidebar-brand {
  padding: 24px 20px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo { height: 42px; object-fit: contain; }
.sidebar-app-name {
  color: var(--gg-teal);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.sidebar-link i { font-size: 18px; min-width: 20px; }
.sidebar-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}
.sidebar-link.active {
  background: var(--gg-teal);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,201,167,.35);
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gg-teal);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
  flex-shrink: 0;
}
.sidebar-user-name { color: #fff; font-size: 13px; font-weight: 600; }
.sidebar-user-email { color: rgba(255,255,255,.5); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 155px; }
.sidebar-actions { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link-sm {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  color: rgba(255,255,255,.6); text-decoration: none;
  font-size: 12px; transition: all .2s;
}
.sidebar-link-sm:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-link-sm.text-danger { color: #FC8181 !important; }
.sidebar-link-sm.text-danger:hover { background: rgba(252,129,129,.15); }

/* ─── TOPBAR & MAIN ───────────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: var(--topbar-h);
  background: var(--gg-white);
  border-bottom: 1px solid var(--gg-border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gg-blue-dark);
  margin: 0;
  flex: 1;
}
.badge-role {
  background: var(--gg-teal);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.content-area { padding: 28px; flex: 1; }

/* ─── CARDS ───────────────────────────────────────────────────────── */
.gg-card {
  background: var(--gg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gg-border);
}
.gg-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gg-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.gg-card-header h5 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--gg-blue-dark);
}
.gg-card-body { padding: 24px; }

/* ─── STAT CARDS ──────────────────────────────────────────────────── */
.stat-card {
  background: var(--gg-white);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gg-border);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.blue { background: #EBF4FF; color: var(--gg-blue-dark); }
.stat-icon.teal { background: #E6FBF7; color: var(--gg-teal-dark); }
.stat-icon.orange { background: #FFF5EB; color: #E07B23; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gg-text); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gg-muted); margin-top: 4px; }

/* ─── AUTH LAYOUT ─────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--gg-blue-dark) 0%, #0F3A7A 50%, #092A5E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(0,201,167,.08);
  top: -200px; right: -150px;
}
.auth-wrapper::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(46,125,209,.1);
  bottom: -100px; left: -100px;
}
.auth-card {
  background: var(--gg-white);
  border-radius: 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative; z-index: 1;
}
.auth-card-header {
  background: linear-gradient(135deg, var(--gg-blue-dark), var(--gg-blue-med));
  padding: 32px 36px 28px;
  text-align: center;
}
.auth-card-header img { height: 56px; object-fit: contain; margin-bottom: 14px; }
.auth-card-header h2 { color: #fff; font-size: 20px; font-weight: 700; margin: 0; }
.auth-card-header p { color: rgba(255,255,255,.7); font-size: 13px; margin: 6px 0 0; }
.auth-card-body { padding: 32px 36px; }

/* ─── FORMS ───────────────────────────────────────────────────────── */
.form-label { font-size: 13px; font-weight: 600; color: var(--gg-text); margin-bottom: 6px; }
.form-control, .form-select {
  border: 1.5px solid var(--gg-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--gg-blue-med);
  box-shadow: 0 0 0 3px rgba(46,125,209,.15);
  outline: none;
}

/* ─── BUTTONS ─────────────────────────────────────────────────────── */
.btn-gg-primary {
  background: linear-gradient(135deg, var(--gg-blue-dark), var(--gg-blue-med));
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 11px 24px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-gg-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26,86,165,.35);
  color: #fff;
}
.btn-gg-teal {
  background: linear-gradient(135deg, var(--gg-teal), var(--gg-teal-dark));
  color: #fff; border: none;
  border-radius: 8px; padding: 11px 24px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all .2s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-gg-teal:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,201,167,.35); color: #fff; }

/* ─── UPLOAD AREA ─────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--gg-border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #FAFCFF;
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--gg-blue-med);
  background: #EBF4FF;
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}
.upload-icon { font-size: 48px; color: var(--gg-blue-med); margin-bottom: 12px; }
.upload-title { font-size: 16px; font-weight: 600; color: var(--gg-blue-dark); }
.upload-sub { font-size: 12px; color: var(--gg-muted); margin-top: 4px; }
.upload-badge {
  display: inline-block;
  background: #EBF4FF; color: var(--gg-blue-dark);
  border-radius: 6px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; margin: 2px;
}

/* ─── LAYOUT SELECTOR ─────────────────────────────────────────────── */
.layout-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.layout-card {
  border: 2px solid var(--gg-border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
}
.layout-card:hover { border-color: var(--gg-blue-med); background: #F7FAFF; }
.layout-card input[type="radio"] { display: none; }
.layout-card.selected { border-color: var(--gg-teal); background: #F0FDF9; }
.layout-card.selected::after {
  content: '\F633';
  font-family: 'bootstrap-icons';
  position: absolute; top: 10px; right: 10px;
  color: var(--gg-teal); font-size: 18px;
}
.layout-name { font-weight: 700; font-size: 14px; color: var(--gg-text); }
.layout-desc { font-size: 12px; color: var(--gg-muted); margin-top: 4px; }
.layout-icon { font-size: 24px; margin-bottom: 8px; color: var(--gg-blue-med); }

/* ─── STATUS BADGES ───────────────────────────────────────────────── */
.status-done    { background: #E6FBF7; color: #00876A; }
.status-error   { background: #FEE2E2; color: #C0392B; }
.status-pending { background: #FEF3C7; color: #92400E; }
.status-processing { background: #EBF4FF; color: var(--gg-blue-dark); }
.status-badge {
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}

/* ─── TABLE ───────────────────────────────────────────────────────── */
.gg-table { width: 100%; border-collapse: collapse; }
.gg-table th {
  background: var(--gg-blue-dark); color: #fff;
  padding: 11px 16px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  text-align: left; border: none;
}
.gg-table td {
  padding: 12px 16px; font-size: 13px;
  border-bottom: 1px solid var(--gg-border);
  vertical-align: middle;
}
.gg-table tr:last-child td { border-bottom: none; }
.gg-table tbody tr:hover { background: #F7FAFF; }

/* ─── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .layout-grid { grid-template-columns: 1fr; }
}

/* ─── MISC ────────────────────────────────────────────────────────── */
.text-teal { color: var(--gg-teal) !important; }
.text-blue { color: var(--gg-blue-dark) !important; }
.divider-text {
  position: relative; text-align: center; margin: 20px 0;
  color: var(--gg-muted); font-size: 12px;
}
.divider-text::before, .divider-text::after {
  content: ''; position: absolute; top: 50%;
  width: calc(50% - 40px); height: 1px;
  background: var(--gg-border);
}
.divider-text::before { left: 0; }
.divider-text::after { right: 0; }

.spinner-gg {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── QUESTOR ─────────────────────────────────────────────────────── */
.pattern-badge {
  display: inline-block;
  font-size: 10px; padding: 2px 7px; border-radius: 20px;
  font-weight: 600; letter-spacing: .3px; white-space: nowrap;
}
.pat-cnpj { background: #EBF8FF; color: #2B6CB0; }
.pat-cpf  { background: #F0FFF4; color: #276749; }
.pat-tipo { background: #FAF5FF; color: #6B46C1; }
.pat-desc { background: #FFF5F5; color: #9B2C2C; }

.empty-state { text-align: center; padding: 48px 24px; }
.empty-state-icon { font-size: 48px; color: var(--gg-border); margin-bottom: 12px; }
.empty-state-title { font-weight: 700; color: var(--gg-muted); font-size: 16px; }
.empty-state-sub { font-size: 13px; color: var(--gg-muted); margin-top: 4px; }
