:root {
  --rh-sidebar: #13233a;
  --rh-sidebar-hover: #1d3354;
  --rh-accent: #2f6fed;
  --rh-bg: #f4f6fa;
}

body { background: var(--rh-bg); font-size: .925rem; }
.min-w-0 { min-width: 0; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  /* !important: o .offcanvas-lg do Bootstrap força fundo transparente em telas grandes. */
  width: 250px; background-color: var(--rh-sidebar) !important; color: #fff;
  display: flex; flex-direction: column; flex-shrink: 0;
}
@media (min-width: 992px) {
  .sidebar { position: sticky; top: 0; height: 100vh; }
}
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.25rem 1.25rem 1rem; }
.sidebar-brand > i { font-size: 1.6rem; color: #7fb0ff; }
.sidebar-brand strong { display: block; font-size: 1.05rem; }
.sidebar-brand small { display: block; color: rgba(255,255,255,.55); font-size: .75rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-nav { display: flex; flex-direction: column; padding: .5rem .75rem; gap: 2px; flex: 1; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: .65rem; color: rgba(255,255,255,.78);
  text-decoration: none; padding: .55rem .75rem; border-radius: .5rem;
}
.sidebar-nav a:hover { background: var(--rh-sidebar-hover); color: #fff; }
.sidebar-nav a.active { background: var(--rh-accent); color: #fff; }
.sidebar-nav i { font-size: 1.05rem; }
.sidebar-sep { border-top: 1px solid rgba(255,255,255,.1); margin: .5rem 0; }
.sidebar-user { display: flex; align-items: center; gap: .5rem; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.1); color: rgba(255,255,255,.8); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; background: #fff;
  border-bottom: 1px solid #e3e7ee; padding: .9rem 1.5rem; position: sticky; top: 0; z-index: 10;
}
.content { padding: 1.5rem; }
@media (max-width: 575px) {
  .content { padding: 1rem; }
  .topbar { padding: .75rem 1rem; flex-wrap: wrap; }
}

.card { border: 1px solid #e3e7ee; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; font-weight: 600; }

.kpi { display: flex; align-items: center; gap: 1rem; }
.kpi-icon { width: 46px; height: 46px; border-radius: .75rem; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.kpi-label { color: #6b7280; font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
a.card-link-kpi { text-decoration: none; color: inherit; }
a.card-link-kpi:hover .card { border-color: var(--rh-accent); }

.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #dbe6ff; color: #1f4fbf;
  display: inline-grid; place-items: center; font-weight: 600; font-size: .8rem; flex-shrink: 0;
}
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }

.table > :not(caption) > * > * { vertical-align: middle; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: #6b7280; font-weight: 600; background: #f8fafc; }

.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem 1.5rem; margin: 0; }
.dl-grid dt { font-size: .72rem; text-transform: uppercase; color: #6b7280; font-weight: 600; letter-spacing: .03em; }
.dl-grid dd { margin: 0; }

.progress-thin { height: 6px; }
.bar-dept { height: 8px; background: #e7ecf5; border-radius: 4px; overflow: hidden; }
.bar-dept > span { display: block; height: 100%; background: var(--rh-accent); }

.doc-card .doc-ext { width: 44px; height: 52px; border-radius: .4rem; display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: #fff; background: #64748b; flex-shrink: 0; }
.doc-ext.PDF { background: #dc3545; }
.doc-ext.JPG, .doc-ext.JPEG, .doc-ext.PNG, .doc-ext.WEBP { background: #0d9488; }
.doc-ext.DOC, .doc-ext.DOCX, .doc-ext.ODT { background: #2563eb; }
.doc-ext.XLS, .doc-ext.XLSX { background: #16a34a; }

.nav-tabs .nav-link { color: #4b5563; }
.nav-tabs .nav-link.active { font-weight: 600; }

.empty-state { text-align: center; padding: 3rem 1rem; color: #6b7280; }
.empty-state i { font-size: 2.5rem; display: block; margin-bottom: .5rem; color: #b6c0d0; }

/* Impressão (ficha de registro) */
.print-page { background: #fff; max-width: 210mm; margin: 1.5rem auto; padding: 14mm; box-shadow: 0 2px 12px rgba(0,0,0,.08); font-size: 11pt; color: #111; }
.print-page h1 { font-size: 15pt; }
.print-page h2 { font-size: 11pt; text-transform: uppercase; border-bottom: 1px solid #333; padding-bottom: 2px; margin-top: 1.2rem; }
.print-page table { font-size: 9pt; }
.assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; margin-top: 3.5rem; text-align: center; font-size: 9pt; }
.assinaturas div { border-top: 1px solid #333; padding-top: .3rem; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .print-page { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  @page { size: A4; margin: 12mm; }
}
