/* ═══════════════════════════════════════════════
   Portal RH 2026 — Main Stylesheet
   ═══════════════════════════════════════════════ */

:root {
  --primary:        #003F87;
  --primary-light:  #0056b3;
  --sidebar-width:  240px;
  --topbar-height:  56px;
  --sidebar-bg:     #1a2236;
  --sidebar-text:   #c8d3e0;
  --sidebar-active: #0d6efd;
}

/* ── Reset / Base ─────────────────────────────── */
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; font-size: .9rem; }

/* ── Login ────────────────────────────────────── */
.login-body  { background: linear-gradient(135deg, #003F87 0%, #0056b3 60%, #17a2b8 100%); }
.login-card  {
  background: #fff; border-radius: 16px; padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.login-logo  {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, #003F87, #0d6efd);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff;
}

/* ── Admin layout ─────────────────────────────── */
.admin-body    { background: #f0f2f7; min-height: 100vh; }
.admin-topbar  { background: var(--primary); height: var(--topbar-height); box-shadow: 0 2px 8px rgba(0,0,0,.2); z-index: 1040; }

.admin-wrapper {
  display: flex;
  padding-top: var(--topbar-height);
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--sidebar-width);
  min-height: calc(100vh - var(--topbar-height));
  background: var(--sidebar-bg);
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  transition: transform .25s ease;
  z-index: 1030;
}
.admin-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  transition: margin-left .25s ease;
}

/* ── Funcionário layout ───────────────────────── */
.func-body     { background: #f0f2f7; min-height: 100vh; }
.func-topbar   { background: #1a5276; height: var(--topbar-height); box-shadow: 0 2px 8px rgba(0,0,0,.2); z-index: 1040; }
.func-wrapper  { display: flex; padding-top: var(--topbar-height); min-height: 100vh; }
.func-sidebar  {
  width: var(--sidebar-width); min-height: calc(100vh - var(--topbar-height));
  background: var(--sidebar-bg); position: fixed; top: var(--topbar-height);
  left: 0; bottom: 0; overflow-y: auto; z-index: 1030;
}
.func-content  { margin-left: var(--sidebar-width); flex: 1; min-width: 0; }

/* ── Sidebar links ────────────────────────────── */
.sidebar-link {
  color: var(--sidebar-text) !important;
  border-radius: 8px;
  padding: .5rem .75rem;
  font-size: .875rem;
  transition: all .15s;
  display: flex;
  align-items: center;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff !important; }
.sidebar-link.active { background: var(--sidebar-active); color: #fff !important; }
.sidebar-section-title {
  color: #6c7a8d; font-size: .7rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  padding: .75rem .75rem .25rem;
}
.sidebar-header { color: var(--sidebar-text); }

/* ── Cards / Stats ────────────────────────────── */
.stat-card    { border-radius: 12px; transition: transform .15s, box-shadow .15s; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.1) !important; }
.stat-icon    { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-num     { font-size: 1.75rem; font-weight: 700; line-height: 1; }
.stat-label   { font-size: .78rem; color: #6c757d; margin-top: .15rem; }

/* ── Tables ───────────────────────────────────── */
.table th { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6c757d; }
.table tbody tr { cursor: default; }
.table-hover tbody tr:hover { background: #f8f9ff; }

/* ── Breadcrumb ───────────────────────────────── */
.breadcrumb-sm { font-size: .8rem; }
.breadcrumb-item + .breadcrumb-item::before { color: #adb5bd; }

/* ── Badges ───────────────────────────────────── */
.badge { font-weight: 500; }

/* ── Forms ────────────────────────────────────── */
.form-label   { font-size: .85rem; }
.form-control, .form-select { font-size: .875rem; }
.form-control:focus, .form-select:focus { border-color: #0d6efd; box-shadow: 0 0 0 .2rem rgba(13,110,253,.15); }

/* ── Alerts ───────────────────────────────────── */
.alert { border-radius: 10px; border: none; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-info    { background: #dbeafe; color: #1e40af; }
.alert-warning { background: #fef3c7; color: #92400e; }

/* ── Sidebar toggle (mobile) ──────────────────── */
.sidebar-toggle { background: none; border: none; cursor: pointer; padding: .25rem; }

/* ── Nav tabs ─────────────────────────────────── */
.nav-tabs .nav-link { font-size: .875rem; border-radius: 8px 8px 0 0; }
.nav-tabs .nav-link.active { font-weight: 600; }

/* ── Holerite print layout ────────────────────── */
.holerite-print-card { border-radius: 12px; }

@media print {
  /* Esconde toda navegação, botões e alertas */
  .admin-sidebar, .func-sidebar,
  .admin-topbar,  .func-topbar,
  .btn, .breadcrumb, .alert, .navbar,
  .d-print-none { display: none !important; }

  /* Conteúdo ocupa a página inteira */
  .admin-content, .func-content,
  .admin-wrapper, .func-wrapper { margin: 0 !important; padding: 0 !important; }

  /* Holerite limpo para impressão */
  body { background: #fff !important; font-size: 11pt; }
  .holerite-print-card {
    box-shadow: none !important;
    border: 1px solid #dee2e6 !important;
    break-inside: avoid;
  }
  .card { border: 1px solid #dee2e6 !important; box-shadow: none !important; }

  /* Cores nos totais */
  .table-success td, .table-success th { background-color: #d1fae5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .table-danger  td, .table-danger  th { background-color: #fee2e2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bg-primary { background-color: #003F87 !important; color: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  @page { size: A4 portrait; margin: 1.5cm; }
}

/* ── Mobile responsive ────────────────────────── */
@media (max-width: 768px) {
  .admin-sidebar, .func-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.show, .func-sidebar.show {
    transform: translateX(0);
  }
  .admin-content, .func-content { margin-left: 0; }
  .stat-num { font-size: 1.4rem; }
}

/* ── Scrollbar ────────────────────────────────── */
.admin-sidebar::-webkit-scrollbar, .func-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-track, .func-sidebar::-webkit-scrollbar-track { background: transparent; }
.admin-sidebar::-webkit-scrollbar-thumb, .func-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* ── Utilities ────────────────────────────────── */
.avatar-placeholder { font-size: 1.1rem; }
.cursor-pointer { cursor: pointer; }
.z-3 { z-index: 1050; }
