/*
 * app.css — Gestão de Patrimônio
 * Estilos customizados compilados a partir do SCSS do projeto.
 * Importado após Bootstrap 5 e Tabler Icons.
 * ──────────────────────────────────────────────────────────────────────────── */

/* ── Google Fonts ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ── Variáveis de cor do projeto ──────────────────────────────────────────── */
:root {
  --pat-primary:          #E66239;
  --pat-primary-rgb:      230, 98, 57;
  --pat-primary-hover:    #d4562f;
  --pat-primary-active:   #c04e2a;
  --pat-border:           #e5e5e5;
  --pat-text-muted:       #737373;
  --pat-sidebar-bg:       #ffffff;
  --topbar-height:        60px;
  --sidebar-width:        240px;
  --sidebar-collapsed:    60px;

  /* Sobrescreve as variáveis CSS do Bootstrap 5 */
  --bs-primary:           #E66239;
  --bs-primary-rgb:       230, 98, 57;
  --bs-link-color:        #E66239;
  --bs-link-color-rgb:    230, 98, 57;
  --bs-link-hover-color:  #d4562f;
  --bs-border-color:      #e5e5e5;
}

/* ── Base ──────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Poppins', sans-serif;
  background-color: #fafafa;
}

/* ── Sobrescritas de componentes Bootstrap com a cor primária do projeto ───── */
.btn-primary {
  background-color: var(--pat-primary);
  border-color: var(--pat-primary);
}
.btn-primary:hover {
  background-color: var(--pat-primary-hover);
  border-color: var(--pat-primary-hover);
}
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
  background-color: var(--pat-primary-active);
  border-color: var(--pat-primary-active);
  box-shadow: 0 0 0 .25rem rgba(var(--pat-primary-rgb), .35);
}
.btn-outline-primary {
  color: var(--pat-primary);
  border-color: var(--pat-primary);
}
.btn-outline-primary:hover {
  background-color: var(--pat-primary);
  border-color: var(--pat-primary);
}
.bg-primary                              { background-color: var(--pat-primary) !important; }
.text-primary                            { color: var(--pat-primary) !important; }
.border-primary                          { border-color: var(--pat-primary) !important; }
.badge.bg-primary                        { background-color: var(--pat-primary) !important; }
.bg-primary.bg-opacity-10                { background-color: rgba(var(--pat-primary-rgb), .10) !important; }
.border-primary.border-opacity-25        { border-color:     rgba(var(--pat-primary-rgb), .25) !important; }
.link-primary                            { color: var(--pat-primary) !important; }
.link-primary:hover                      { color: var(--pat-primary-hover) !important; }
.form-control:focus,
.form-select:focus                       { border-color: var(--pat-primary); box-shadow: 0 0 0 .25rem rgba(var(--pat-primary-rgb), .25); }
.form-check-input:checked                { background-color: var(--pat-primary); border-color: var(--pat-primary); }
.nav-pills .nav-link.active              { background-color: var(--pat-primary); }
.page-item.active .page-link             { background-color: var(--pat-primary); border-color: var(--pat-primary); }

/* ── Overlay (mobile) ──────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(1px);
  display: none;
  z-index: 1030;
}
.overlay.show { display: block; }

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--pat-sidebar-bg);
  border-right: 1px solid var(--pat-border);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  padding-top: var(--topbar-height);
  z-index: 1031;
  transition: width .3s, left .3s;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Logo */
.sidebar .logo-area {
  position: absolute;
  top: 0;
  left: 0;
  height: var(--topbar-height);
  width: 100%;
  background: #fff;
  display: flex;
  align-items: center;
  padding-left: 17px;
  gap: 10px;
  border-bottom: 1px solid var(--pat-border);
}
.sidebar .logo-title {
  font-size: .875rem;
  font-weight: 600;
  color: #262626;
  white-space: nowrap;
  transition: opacity .2s;
}

/* Rótulos de grupo */
.sidebar .nav-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--pat-text-muted);
  padding: .625rem 1.25rem .3rem;
  display: block;
}

/* Links de navegação */
.sidebar .nav-link {
  color: #404040;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  font-size: .875rem;
  font-weight: 400;
  gap: 12px;
  white-space: nowrap;
  margin: 1px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
.sidebar .nav-link .ti { font-size: 18px; }
.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: var(--pat-primary);
  background-color: rgba(var(--pat-primary-rgb), .095);
}

/* Estado colapsado (desktop) */
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .nav-text,
.sidebar.collapsed .logo-title,
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-link {
  margin: 0;
  padding: 10px 0;
  border-radius: 0;
  background-color: transparent;
  justify-content: center;
}

/* ── Topbar ────────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  margin-left: var(--sidebar-width);
  transition: margin-left .3s;
}
.topbar.full { margin-left: var(--sidebar-collapsed); }

/* ── Área de conteúdo ──────────────────────────────────────────────────────── */
.content {
  margin-left: var(--sidebar-width);
  padding-top: calc(var(--topbar-height) + 1rem);
  min-height: 100vh;
  transition: margin-left .3s;
}
.content.full { margin-left: var(--sidebar-collapsed); }

/* ── Responsivo (< 992 px) ─────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .sidebar {
    left: calc(-1 * var(--sidebar-width));
    transition: left .3s;
  }
  .sidebar.mobile-show { left: 0; }
  .topbar  { margin-left: 0 !important; width: 100% !important; }
  .content { margin-left: 0 !important; }
}

/* ── Avatar ────────────────────────────────────────────────────────────────── */
.avatar    { width: 2rem;    height: 2rem;    object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.avatar-sm { width: 1.75rem; height: 1.75rem; }
.avatar-md { width: 2.25rem; height: 2.25rem; }
.avatar-lg { width: 3rem;    height: 3rem;    }

/* ── Icon shapes ───────────────────────────────────────────────────────────── */
.icon-shape {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-shape.icon-sm { width: 1.75rem; height: 1.75rem; font-size: .875rem; }
.icon-shape.icon-md { width: 2.5rem;  height: 2.5rem;  font-size: 1.1rem; }
.icon-shape.icon-lg { width: 3.25rem; height: 3.25rem; font-size: 1.4rem; }

/* ── Cards de estatísticas ─────────────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--pat-border);
  border-radius: .75rem;
  padding: 1.25rem;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 4px 24px rgba(0, 0, 0, .07); }

/* ── Utilitários extras ────────────────────────────────────────────────────── */
.py-10          { padding-top: 2.5rem !important; padding-bottom: 2.5rem !important; }
.mb-6           { margin-bottom: 1.5rem !important; }
.border-dashed  { border-style: dashed !important; }
.fw-500         { font-weight: 500 !important; }

/* ── Toasts ────────────────────────────────────────────────────────────────── */
.toast-container { z-index: 1090; }

/* ── Página de login ───────────────────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #fafafa 0%, #f0f0f0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--pat-border);
  border-radius: 1rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, .08);
}

/* ── Tabelas ───────────────────────────────────────────────────────────────── */
.table > :not(caption) > * > * { padding: .6rem .75rem; }
