/* ============================================================
   SIGEF — Estilos Customizados
   ============================================================ */

/* ── Variáveis ─────────────────────────────────────────────── */
:root {
  --sigef-primary:      #1a3a5c;   /* azul escuro institucional */
  --sigef-primary-dark: #122840;
  --sigef-accent:       #2e7d32;   /* verde financeiro */
  --sigef-accent-light: #e8f5e9;
  --sigef-danger-light: #fdecea;
  --sidebar-width:      260px;
  --navbar-height:      56px;
}

/* ── Cores Bootstrap customizadas ──────────────────────────── */
.bg-sigef-primary   { background-color: var(--sigef-primary) !important; }
.text-sigef-primary { color: var(--sigef-primary) !important; }
.btn-sigef          { background-color: var(--sigef-primary); color: #fff; border: none; }
.btn-sigef:hover    { background-color: var(--sigef-primary-dark); color: #fff; }

/* ── Layout base ───────────────────────────────────────────── */
body {
  background-color: #f4f6f9;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  padding-top: var(--navbar-height);
}

.wrapper {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100%;
  background-color: #fff;
  border-right: 1px solid #dee2e6;
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  bottom: 0;
  z-index: 1030;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  background-color: var(--sigef-primary);
  color: #fff;
  min-height: 60px;
}

.sidebar .nav-link {
  color: #495057;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.9rem;
  transition: background 0.15s;
}

.sidebar .nav-link:hover {
  background-color: #e9ecef;
  color: var(--sigef-primary);
}

.sidebar .nav-link.active {
  background-color: var(--sigef-primary);
  color: #fff;
  font-weight: 600;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #adb5bd;
  padding: 12px 12px 4px;
  list-style: none;
}

.sidebar-footer {
  font-size: 0.8rem;
}

/* ── Conteúdo principal ────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 24px;
  min-width: 0;
}

/* ── Mobile: sidebar oculta por padrão ────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.show {
    transform: translateX(0);
    box-shadow: 4px 0 16px rgba(0,0,0,0.15);
  }
  .main-content {
    margin-left: 0;
    padding: 16px;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1029;
}
.sidebar-overlay.show {
  display: block;
}

/* ── Page header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e9ecef;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--sigef-primary);
  margin: 0;
}

/* ── Cards de KPI (dashboard) ──────────────────────────────── */
.kpi-card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: transform 0.15s, box-shadow 0.15s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.kpi-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-label {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Tabelas ────────────────────────────────────────────────── */
.table-sigef thead th {
  background-color: var(--sigef-primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  border: none;
  white-space: nowrap;
}

.table-sigef tbody tr:hover {
  background-color: #f0f4ff;
}

/* ── Cards padrão ───────────────────────────────────────────── */
.card {
  border: 1px solid #e3e8ef;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.card-header-sigef {
  background-color: var(--sigef-primary);
  color: #fff;
  border-radius: 10px 10px 0 0 !important;
  padding: 14px 20px;
  font-weight: 600;
}

/* ── Badges de valor ────────────────────────────────────────── */
.valor-entrada { color: #1b5e20; font-weight: 600; }
.valor-saida   { color: #b71c1c; font-weight: 600; }
.valor-neutro  { color: #1a3a5c; font-weight: 600; }

/* ── Alertas de comprovante pendente ───────────────────────── */
.alert-comprovante {
  background-color: #fff3cd;
  border-left: 4px solid #ffc107;
  border-radius: 6px;
}

/* ── Formulários ────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 0.875rem; color: #495057; }
.required::after { content: ' *'; color: #dc3545; }

/* ── Upload area ────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed #c8d6e5;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  background: #f8fbff;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--sigef-primary);
  background: #eef3ff;
}

/* ── Toasts de feedback ─────────────────────────────────────── */
.toast-container { z-index: 9999; }

/* ── Tela de login ──────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sigef-primary) 0%, #2c5f8a 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.login-logo {
  text-align: center;
  margin-bottom: 8px;
}

.login-logo .icone {
  font-size: 3rem;
  color: var(--sigef-primary);
}

/* ── Responsividade de tabelas (mobile) ─────────────────────── */
@media (max-width: 576px) {
  .kpi-value { font-size: 1.3rem; }
  .page-title { font-size: 1.1rem; }
  .main-content { padding: 12px; }
}
