:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --sidebar-width: 240px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --dot-color: #6b7280;
}

[data-theme="dark"] {
  /* Paleta próxima do padrão de mercado (GitHub/Linear/Vercel):
     bg e surface separados para dar profundidade/elevação aos cards. */
  --bg: #0d1117;
  --surface: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --primary: #58a6ff;
  --primary-hover: #79b8ff;
  --primary-soft: #17233b;
  --success: #3fb950;
  --success-bg: #122117;
  --warning: #d29922;
  --warning-bg: #2b2111;
  --danger: #f85149;
  --danger-bg: #2d1214;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --dot-color: #8b949e;
}

:root { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.app {
  display: flex;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

.mobile-menu-btn,
.mobile-overlay,
.mobile-page-title {
  display: none;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.35rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.sidebar-brand p {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-item:hover { background: var(--bg); color: var(--text); }

.nav-item.active {
  background: var(--primary);
  color: #fff;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Grupos (menu > submenu) */
.nav-group-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: none;
  background: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
}
.nav-group-header:hover { background: var(--bg); color: var(--text); }
.nav-group-header svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-group-label { flex: 1; }

.nav-group-caret {
  width: 15px !important;
  height: 15px !important;
  transition: transform 0.2s ease;
}
.nav-group.open .nav-group-caret { transform: rotate(180deg); }
.nav-group.has-active .nav-group-header { color: var(--text); font-weight: 600; }

.nav-group-items {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.22s ease;
}
.nav-group.open .nav-group-items { grid-template-rows: 1fr; }
.nav-group-inner { overflow: hidden; min-height: 0; }

/* recuo dos itens do submenu */
.nav-group-inner .nav-item {
  padding-left: 2.35rem;
  font-size: 0.84rem;
}

.sidebar-footer {
  padding: 0.85rem 0.65rem 1.1rem;
  border-top: 1px solid var(--border);
}

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-mini-profile{
  display:flex;
  align-items:center;
  gap:0.75rem;
  padding:0.65rem 0.75rem;
  border:1px solid rgba(148,163,184,0.18);
  border-radius:12px;
  margin-bottom:0.75rem;
  background: rgba(15,23,42,0.04);
}

[data-theme="dark"] .sidebar-mini-profile{
  background: rgba(255,255,255,0.04);
  border-color: rgba(148,163,184,0.18);
}

.mini-avatar{
  width:36px;
  height:36px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color:#111827;
  background: rgba(17,24,39,0.08);
  overflow:hidden;
}

[data-theme="dark"] .mini-avatar{
  color:#e5e7eb;
  background: rgba(255,255,255,0.10);
}

.mini-profile-info{display:flex;flex-direction:column;line-height:1.1}
.mini-profile-name{font-size:13px;font-weight:700}
.mini-profile-meta{font-size:12px;color:#6b7280;margin-top:2px}
[data-theme="dark"] .mini-profile-meta{color:#9ca3af}

.btn-theme {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-theme:hover { background: var(--bg); color: var(--text); }

.btn-theme svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex: 1;
  padding: 0.6rem 0.85rem;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
}

.btn-logout:hover { background: var(--bg); color: var(--text); }

.btn-logout svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.notif-form-header svg,
.panel-header .icon-inline {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Main */
.main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-width);
  padding: 1.75rem 2rem;
  max-width: 1280px;
  box-sizing: border-box;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header .subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 0.2rem;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: var(--shadow);
}

.stat-card .label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-card .value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0.3rem;
  min-height: 2.22rem;
}

.stat-card .detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.stat-docs-pending {
  display: grid;
  grid-template-columns: max-content max-content;
  grid-template-rows: minmax(2.22rem, auto) auto;
  column-gap: 1.5rem;
  row-gap: 0.15rem;
  margin-top: 0.3rem;
  width: fit-content;
  max-width: 100%;
}

.stat-docs-pending-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.2;
  justify-self: center;
  align-self: end;
}

.stat-docs-pending-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.25;
  justify-self: center;
  text-align: center;
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg { width: 20px; height: 20px; }

/* Panels */
.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.panel-header h3 { font-size: 0.9rem; font-weight: 600; }

.docs-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.docs-header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.docs-date-filters {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.docs-filter-group {
  min-width: 132px;
  max-width: 150px;
  margin-bottom: 0;
}

.docs-filter-group label {
  font-size: 0.7rem;
  margin-bottom: 0.2rem;
}

.docs-filter-group input {
  padding: 0.35rem 0.45rem;
  font-size: 0.78rem;
  height: 32px;
}

.date-mask-preview {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1;
}

.docs-count-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.panel-link {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
}

.panel-link:hover { text-decoration: underline; }

.panel-body { padding: 0.85rem 1.15rem; min-height: 120px; }

.empty-state {
  color: var(--text-muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 1.75rem 1rem;
}

.empty-state-page {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.empty-state-page .icon-lg {
  width: 56px;
  height: 56px;
  color: #d1d5db;
  margin: 0 auto 1rem;
}

.empty-state-page h3 { font-size: 1rem; margin-bottom: 0.35rem; }

.empty-state-page p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}

/* List items */
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child { border-bottom: none; }

.list-item-info { flex: 1; min-width: 0; }

.list-item-title { font-size: 0.875rem; font-weight: 600; }

.list-item-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }

.alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot-color);
  flex-shrink: 0;
  margin-top: 6px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-primary svg,
.btn-secondary svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn-no-wrap {
  white-space: nowrap;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary:hover { background: var(--bg); }

/* Search */
.search-box {
  position: relative;
  margin-bottom: 1rem;
}

.search-box svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

.search-box input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--surface);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-box-with-scanner input {
  padding-right: 2.85rem;
}

.search-box-scanner-btn {
  display: none;
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.search-box-scanner-btn:hover {
  background: #bfdbfe;
}

.search-box-scanner-btn svg {
  position: static;
  transform: none;
  width: 18px;
  height: 18px;
}

@media (max-width: 1280px) {
  .search-box-scanner-btn {
    display: inline-flex;
  }
}

/* Tablets em landscape (>1280px) com tela touch */
@media (hover: none) and (pointer: coarse) {
  .search-box-scanner-btn {
    display: inline-flex;
  }
}

/* Scanner de código (patrimônios) */
.barcode-scanner-modal {
  max-width: min(520px, calc(100vw - 2rem));
}

.barcode-scanner-body {
  padding-top: 0.5rem;
}

.barcode-scanner-viewport {
  position: relative;
  width: 100%;
  min-height: 240px;
  max-height: min(55vh, 420px);
  overflow: hidden;
  border-radius: var(--radius);
  background: #111827;
}

.barcode-scanner-viewport video,
.barcode-scanner-viewport canvas {
  width: 100% !important;
  height: auto !important;
  max-height: min(55vh, 420px);
  object-fit: cover;
}

.barcode-scanner-hint {
  margin: 0.75rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

body.barcode-scanner-open {
  overflow: hidden;
}

/* Table */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 0.8rem 1.15rem;
  text-align: left;
  font-size: 0.875rem;
}

th {
  background: var(--bg);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

td { border-bottom: 1px solid var(--border); }

tr:last-child td { border-bottom: none; }

.pagination-bar {
  margin-top: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.pagination-summary {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  max-width: 100%;
}

.pagination-controls > * {
  flex-shrink: 0;
}

.pagination-controls .pagination-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  min-width: 34px;
  max-width: 34px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.pagination-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.pagination-page-size select {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0.35rem 0.45rem;
  font-family: inherit;
  font-size: 0.78rem;
}

.pagination-page-indicator {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 92px;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.pagination-label-short,
.pagination-indicator-short {
  display: none;
}

.employee-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Badges */
.badge {
  display: inline-flex;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-ativo { background: var(--success-bg); color: var(--success); }
.badge-inativo { background: #f3f4f6; color: #6b7280; }
.badge-afastado { background: var(--warning-bg); color: var(--warning); }
.badge-desligado { background: var(--danger-bg); color: var(--danger); }
.badge-vencido { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

.row-actions { display: flex; gap: 0.25rem; justify-content: flex-end; }

.icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover { background: var(--bg); color: var(--primary); }
.icon-btn.danger:hover { color: var(--danger); }

.doc-redirect-link {
  border: 1px solid var(--border);
  background: var(--surface);
}

/* Toolbar */
.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 10;
}


.month-select {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.875rem;
  font-family: inherit;
  height: 42px;
  min-height: 42px;
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.month-select > svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.month-select.report-select {
  position: relative;
  padding: 0;
  cursor: pointer;
  user-select: none;
}

.report-select-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: 100%;
  padding: 0 0.85rem;
  box-sizing: border-box;
  background: transparent;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.report-select-trigger > svg:first-of-type {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.report-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.report-select-trigger svg.report-select-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.report-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  z-index: 30;
  overflow: hidden;
  padding: 0.25rem 0;
}

.report-select-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.6rem 2rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text);
  text-align: center;
  background: var(--surface);
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  box-sizing: border-box;
}

.report-select-option:last-child {
  border-bottom: none;
}

.report-select-option:hover {
  background: var(--bg);
}

.report-select-option.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.report-select-check {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
}

.report-select-option.active .report-select-check {
  opacity: 1;
}

.combo-picker {
  position: relative;
}

.combo-picker-field {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
}

.combo-picker-field input[data-combo-input] {
  flex: 1;
  min-width: 0;
}

.combo-picker-trigger {
  width: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  font: inherit;
}

.combo-picker-trigger:hover,
.combo-picker-trigger[aria-expanded="true"] {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.combo-picker-trigger svg {
  width: 18px;
  height: 18px;
}

.combo-picker-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

/* Card com combo aberto sobe acima dos cards seguintes (que criam
   stacking context via transform de animação) */
.budget-form-card:has([data-combo-menu]:not([hidden])) {
  position: relative;
  z-index: 70;
}

.combo-picker-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.combo-picker-search svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.combo-picker-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text);
}

.combo-picker-search input:focus {
  outline: none;
}

.combo-picker-list {
  max-height: 220px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.combo-picker-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.combo-picker-option:last-child {
  border-bottom: none;
}

.combo-picker-option:hover {
  background: var(--bg);
}

.combo-picker-option-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.combo-picker-option-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.combo-picker-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

[data-theme="dark"] .month-select input[type="month"] {
  color: var(--text);
  background-color: var(--surface);
}

.month-select input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
}

.report-select-option-text {
  width: 100%;
  text-align: center;
}

.month-select input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.summary-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary-soft);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 600;
  max-width: 100%;
  white-space: nowrap;
}

.summary-pill__icon {
  display: inline-flex;
  flex: 0 0 auto;
}

.summary-pill svg,
.summary-pill__icon svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
}

.summary-pill__text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

/* Documents layout */
.docs-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  min-height: 480px;
  height: calc(100vh - 10.5rem);
  max-height: calc(100vh - 10.5rem);
  align-items: stretch;
}

.docs-list, .docs-viewer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 0;
}

.docs-list {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.docs-list-folders {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}

.employee-folder {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}

.employee-folder:hover { background: var(--bg); }

.employee-folder.active {
  background: var(--primary-soft);
  border-color: #bfdbfe;
}

.folder-icon { color: var(--primary); }

.folder-count {
  margin-left: auto;
  background: var(--bg);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.docs-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  overflow-y: auto;
}

.docs-viewer.has-content {
  align-items: stretch;
  justify-content: flex-start;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.doc-item:last-child { border-bottom: none; }

/* Notifications */
.notif-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.notif-form-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.notif-form-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.notif-form-row .form-group {
  flex: 1;
  min-width: 180px;
  /* Remove o espaçamento extra do .form-group global para alinhar o botão */
  margin-bottom: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--surface);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.modal-lg { max-width: 560px; }

.modal-preview {
  max-width: 90vw;
  width: 90vw;
  height: 88vh;
  display: flex;
  flex-direction: column;
}
.modal-preview .modal-body {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.modal-preview .modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.modal-preview .modal-body img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.modal-preview-unsupported {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.modal-header {
  padding: 1.15rem 1.35rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e3a8a;
}

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.modal-body { padding: 0 1.35rem 1.25rem; }

.system-alert-message {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-line;
}

.modal-footer {
  padding: 1rem 1.35rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.btn-remove-attachment {
  color: var(--danger);
  border-color: var(--danger);
}

.btn-remove-attachment:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.form-group { margin-bottom: 0.85rem; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.form-group label .req { color: var(--danger); }

.form-hint {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.login-card .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.login-demo {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.login-demo code {
  background: var(--bg);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.report-preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.report-preview-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.report-preview-panel .panel-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.report-preview-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.report-preview-table {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.report-preview-panel .pagination-bar {
  padding: 0.75rem 1.15rem 1rem;
  margin-top: 0;
}

.chart-area {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.chart-area h3 {
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.bar-label {
  width: 140px;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
}

.bar-value {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 3rem;
  text-align: right;
}

.hidden { display: none !important; }

@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .panels-grid, .docs-layout { grid-template-columns: 1fr; }

  .docs-layout {
    height: auto;
    max-height: none;
  }

  .docs-list {
    max-height: min(40vh, 320px);
  }

  .main {
    max-width: calc(100vw - var(--sidebar-width));
    padding: 1.25rem 1rem;
  }

  .table-wrap {
    width: 100%;
    max-width: 100%;
  }

  .table-wrap-patrimonios table {
    min-width: 920px;
  }

  .table-wrap-patrimonios th,
  .table-wrap-patrimonios td {
    padding: 0.6rem 0.65rem;
    font-size: 0.8125rem;
  }

  .table-wrap-patrimonios th:nth-child(7),
  .table-wrap-patrimonios td:nth-child(7) {
    white-space: nowrap;
  }

  .table-wrap-patrimonios td:nth-child(8) {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .table-wrap-clientes table {
    min-width: 880px;
  }

  .table-wrap-clientes th,
  .table-wrap-clientes td {
    padding: 0.6rem 0.65rem;
    font-size: 0.8125rem;
  }

  .table-wrap-estoque table {
    min-width: 900px;
  }

  .table-wrap-estoque th,
  .table-wrap-estoque td {
    padding: 0.6rem 0.65rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  }

  body.mobile-menu-open { overflow: hidden; }
  body.mobile-menu-open .sidebar { transform: translateX(0); }

  .mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    border: none;
    z-index: 95;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.mobile-menu-open .mobile-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    position: fixed;
    top: 0.85rem;
    left: 0.85rem;
    z-index: 110;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-btn svg {
    width: 18px;
    height: 18px;
  }

  /* menu aberto: esconde o hambúrguer p/ não cobrir o brand (fecha via overlay) */
  body.mobile-menu-open .mobile-menu-btn { display: none; }

  .mobile-page-title {
    display: block;
    margin: 0 0 1rem 3rem;
    font-size: 0.92rem;
    color: var(--text-muted);
    font-weight: 600;
  }

  .main { margin-left: 0; padding: 1rem; max-width: 100%; }
  .page-header h2 { font-size: 1.25rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  th, td { padding: 0.65rem 0.75rem; }
  .table-wrap table { min-width: 720px; }
  .table-wrap-patrimonios table { min-width: 920px; }
  .table-wrap-clientes table { min-width: 880px; }
  .table-wrap-estoque table { min-width: 900px; }
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    overflow: visible;
  }

  .pagination-summary {
    width: 100%;
  }

  .pagination-controls {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
    flex-wrap: nowrap;
    overflow: visible;
    gap: 0.25rem;
    padding: 0;
  }

  .pagination-page-size {
    flex: 0 0 auto;
    font-size: 0.68rem;
    gap: 0.2rem;
  }

  .pagination-page-size select {
    padding: 0.25rem 0.35rem;
    font-size: 0.72rem;
  }

  .pagination-label-full,
  .pagination-indicator-full {
    display: none;
  }

  .pagination-label-short,
  .pagination-indicator-short {
    display: inline;
  }

  .pagination-page-indicator {
    min-width: auto;
    padding: 0 0.2rem;
    font-size: 0.72rem;
  }

  .pagination-controls .pagination-nav-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    max-width: 28px;
    font-size: 0.9rem;
  }

  .combo-picker-menu {
    left: 0;
    right: 0;
    max-height: min(52vh, 300px);
  }

  .combo-picker-list {
    max-height: calc(min(52vh, 300px) - 48px);
  }

  .combo-picker-trigger {
    width: 38px;
    min-width: 38px;
  }
}

/* Orçamentos */
.budget-form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

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

.budget-sheet-table th,
.budget-sheet-table td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.5rem;
  vertical-align: middle;
}

.budget-sheet-table th {
  background: var(--bg);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.budget-sheet-table input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  font-size: 0.875rem;
  background: var(--surface);
  color: var(--text);
}

.budget-sheet-table th input.col-label-input {
  background: transparent;
  border: 1px dashed var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  padding: 0.25rem 0.4rem;
}
.budget-sheet-table th input.col-label-input:focus {
  border-style: solid;
  border-color: var(--primary);
  outline: none;
}
.budget-sheet-table th input.col-label-num {
  text-align: right;
}

/* força maiúscula só nos títulos das colunas (cabeçalho), igual ao PDF */
.budget-sheet-table th input.col-label-input {
  text-transform: uppercase;
}

.budget-sheet-table .col-total {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}

.budget-sheet-table .col-num {
  text-align: right;
}

.budget-sheet-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-weight: 700;
}

.budget-labor-box {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.budget-labor-box .labor-total {
  margin-top: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
}

/* Blocos do orçamento (grid + mão de obra) */
.budget-block-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.budget-block-title {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.budget-labor-inline {
  margin-top: 1rem;
}
.budget-blocks-actions {
  margin: 0 0 1.25rem;
}
.budget-grand-total-card {
  background: var(--bg);
}
.budget-grand-total-card .budget-grand-total {
  font-size: 1.05rem;
  font-weight: 800;
}

.budget-form-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

.budget-list-center {
  max-width: 900px;
  margin: 0 auto;
}

.rich-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.rich-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.rich-editor-toolbar button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.rich-editor-toolbar button:hover {
  background: var(--primary-soft);
  border-color: #bfdbfe;
}

.rich-editor-toolbar button.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: #93c5fd;
}

.rich-editor-body {
  min-height: 160px;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  outline: none;
}

.rich-editor-body:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}

.rich-editor-body ul,
.rich-editor-body ol {
  margin: 0.35rem 0 0.35rem 1.25rem;
  padding: 0;
}

.budget-grand-total {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .budget-sheet-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* =====================================================================
   Micro-interações & animações globais (todas as páginas)
   ===================================================================== */

/* ---- transições suaves (sempre ativas) ---- */
.stat-card,
.panel,
.nav-item,
.btn-primary,
.btn-secondary,
.icon-btn,
.btn-theme,
.btn-logout,
.employee-folder,
.badge,
.summary-pill,
.doc-item,
.list-item,
.report-select-option,
.combo-picker-option,
.pagination-nav-btn,
.sidebar-mini-profile {
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

/* botões: leve elevação no hover, retorno no clique */
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28); }
.btn-primary:active,
.btn-secondary:active { transform: translateY(0); box-shadow: none; }
.btn-secondary:hover { transform: translateY(-1px); }
.icon-btn:hover { transform: translateY(-1px); }
[data-theme="dark"] .btn-primary:hover { box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45); }

/* navegação: desliza levemente ao passar o mouse */
.nav-item:hover { transform: translateX(3px); }
.nav-item.active { box-shadow: 0 6px 16px rgba(37, 99, 235, 0.28); }
[data-theme="dark"] .nav-item.active { box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); }

/* cards de estatística: elevam no hover */
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.10);
  border-color: var(--primary);
}
[data-theme="dark"] .stat-card:hover { box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45); }
.stat-card .stat-icon { transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1); }
.stat-card:hover .stat-icon { transform: scale(1.08) rotate(-3deg); }

/* painéis & blocos: sombra mais rica no hover */
.panel:hover,
.chart-area:hover,
.table-wrap:hover {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
[data-theme="dark"] .panel:hover,
[data-theme="dark"] .chart-area:hover,
[data-theme="dark"] .table-wrap:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

/* linhas de tabela: realce no hover */
tbody tr { transition: background-color 0.15s ease; }
tbody tr:hover { background: var(--bg); }

/* itens de lista / pastas */
.list-item:hover { background: var(--bg); border-radius: 8px; }
.employee-folder:hover { transform: translateX(2px); }

/* foco acessível visível */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---- animações de entrada (respeitam reduce-motion) ---- */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rhRise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
  }
  @keyframes rhFade {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  /* desabilita re-animação em atualizações parciais do grid */
  [data-no-anim] .table-wrap,
  [data-no-anim] .table-wrap-patrimonios,
  [data-no-anim] .table-wrap-clientes,
  [data-no-anim] .table-wrap-estoque { animation: none !important; }

  /* o conteúdo principal surge suavemente ao carregar */
  .main { animation: rhFade 0.45s ease both; }
  .sidebar { animation: rhFade 0.4s ease both; }

  /* blocos de topo entram em cascata (renderizam uma vez por página) */
  .page-header,
  .toolbar,
  .stats-grid,
  .panels-grid,
  .table-wrap,
  .chart-area,
  .docs-layout,
  .report-preview-panel,
  .notif-form-card,
  .budget-form-card,
  .budget-list-center,
  .empty-state-page,
  .summary-pill {
    animation: rhRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .page-header { animation-delay: 0.02s; }
  .toolbar     { animation-delay: 0.05s; }
  .stats-grid  { animation-delay: 0.06s; }
  .panels-grid,
  .table-wrap,
  .chart-area,
  .docs-layout,
  .report-preview-panel { animation-delay: 0.12s; }

  /* cards de estatística em cascata */
  .stats-grid .stat-card { animation: rhRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .stats-grid .stat-card:nth-child(1) { animation-delay: 0.08s; }
  .stats-grid .stat-card:nth-child(2) { animation-delay: 0.14s; }
  .stats-grid .stat-card:nth-child(3) { animation-delay: 0.20s; }
  .stats-grid .stat-card:nth-child(4) { animation-delay: 0.26s; }

  /* modal: entra com leve escala/subida */
  .modal-overlay .modal {
    transform: translateY(10px) scale(0.97);
    opacity: 0;
    transition:
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.28s ease;
  }
  .modal-overlay.open .modal { transform: none; opacity: 1; }
}

/* ===== Holerite ===== */
.holerite-section-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

/* Container de impressão (oculto na tela) */
.holerite-print { display: none; }

.hours-period-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  align-self: center;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .hours-period-label { width: 100%; order: 3; }
}

.holerite-print .hp-doc {
  color: #111;
  font-size: 12px;
  line-height: 1.4;
}
.holerite-print .hp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #111;
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.holerite-print .hp-head h1 { font-size: 20px; margin: 0; }
.holerite-print .hp-meta { text-align: right; }
.holerite-print .hp-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin-bottom: 16px;
}
.holerite-print h2 {
  font-size: 13px;
  margin: 14px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.holerite-print .hp-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}
.holerite-print .hp-table th,
.holerite-print .hp-table td {
  border: 1px solid #999;
  padding: 5px 8px;
  text-align: left;
}
.holerite-print .hp-table th { background: #eee; }
.holerite-print .hp-table .r { text-align: right; }
.holerite-print .hp-receber {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 2px solid #111;
  padding: 8px 12px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
}
.holerite-print .hp-obs { margin-top: 12px; font-size: 11px; }

@media print {
  body.printing-holerite .app,
  body.printing-holerite #modals { display: none !important; }
  body.printing-holerite .holerite-print {
    display: block !important;
    padding: 14mm;
  }
  /* remove header/footer do navegador (URL + nº da página) */
  body.printing-holerite { margin: 0; }
}

@page { margin: 0; }
