/* ============ Tema ============ */
:root {
  --rh-primary: #4f46e5;
  --rh-primary-600: #4338ca;
  --rh-primary-soft: #eef2ff;
  --rh-bg: #f5f6fa;
  --rh-surface: #ffffff;
  --rh-border: #e7e8ef;
  --rh-text: #1d2033;
  --rh-muted: #6b7084;
  --rh-sidebar-w: 256px;
  --rh-radius: 14px;
  --rh-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 8px rgba(16, 24, 40, .05);
  --bs-primary: var(--rh-primary);
  --bs-primary-rgb: 79, 70, 229;
  --bs-link-color: var(--rh-primary);
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: var(--rh-primary-600);
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--rh-text);
  --bs-border-color: var(--rh-border);
}
[data-bs-theme="dark"] {
  --rh-primary: #818cf8;
  --rh-primary-600: #a5b4fc;
  --rh-primary-soft: rgba(129, 140, 248, .14);
  --rh-bg: #0f1117;
  --rh-surface: #171a23;
  --rh-border: #262a37;
  --rh-text: #e6e8f0;
  --rh-muted: #9095a8;
  --rh-shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --bs-primary-rgb: 129, 140, 248;
  --bs-body-bg: var(--rh-bg);
  --bs-body-color: var(--rh-text);
  --bs-border-color: var(--rh-border);
  --bs-secondary-bg: #1d212c;
  --bs-tertiary-bg: #1a1d27;
}
body { background: var(--rh-bg); color: var(--rh-text); font-size: .935rem; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.text-muted, .form-text { color: var(--rh-muted) !important; }
.fw-semibold { font-weight: 600 !important; }

/* ============ Botões e formulários ============ */
.btn { border-radius: 10px; font-weight: 500; padding: .5rem 1rem; display: inline-flex; align-items: center; gap: .45rem; justify-content: center; }
.btn-sm { padding: .3rem .7rem; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--rh-primary); --bs-btn-border-color: var(--rh-primary); --bs-btn-hover-bg: var(--rh-primary-600); --bs-btn-hover-border-color: var(--rh-primary-600); --bs-btn-active-bg: var(--rh-primary-600); --bs-btn-disabled-bg: var(--rh-primary); }
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-soft { background: var(--rh-primary-soft); color: var(--rh-primary); border: 0; }
.btn-soft:hover { background: var(--rh-primary); color: #fff; }
.btn-light-border { background: var(--rh-surface); border: 1px solid var(--rh-border); color: var(--rh-text); }
.btn-light-border:hover { border-color: var(--rh-primary); color: var(--rh-primary); }
.form-control, .form-select { border-radius: 10px; border-color: var(--rh-border); padding: .55rem .8rem; background-color: var(--rh-surface); }
.form-control:focus, .form-select:focus { border-color: var(--rh-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .15); }
.form-label { font-weight: 500; font-size: .86rem; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--rh-primary); border-color: var(--rh-primary); }
.required-mark { color: #e5484d; margin-left: 2px; }
@media (max-width: 575.98px) { .stat-card { padding: 1rem; gap: .6rem; flex-direction: column; align-items: flex-start; } .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; } .stat-value { font-size: 1.35rem; }
  .btn, .form-control, .form-select { min-height: 44px; } .btn-sm { min-height: 36px; } }

/* ============ Layout ============ */
.app-shell { min-height: 100vh; }
.sidebar { width: var(--rh-sidebar-w); background: var(--rh-surface); border-right: 1px solid var(--rh-border); }
@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; }
  .app-main { margin-left: var(--rh-sidebar-w); }
}
.sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: 100%; }
/* A lista de links rola; marca e menu do usuário ficam sempre visíveis, mesmo em telas baixas */
.side-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-bottom: .75rem; scrollbar-width: thin; }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.25rem 1.25rem 1rem; color: var(--rh-text); }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--rh-primary), #8b5cf6); color: #fff; display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-name { font-weight: 700; line-height: 1.1; }
.brand-sub { font-size: .75rem; color: var(--rh-muted); }
.nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--rh-muted); padding: .85rem .75rem .35rem; font-weight: 600; }
.side-nav { padding: 0 .75rem; }
.side-link { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: 10px; color: var(--rh-muted); font-weight: 500; margin-bottom: 2px; }
.side-link i { font-size: 1.1rem; width: 1.25rem; text-align: center; }
.side-link:hover { background: var(--rh-bg); color: var(--rh-text); }
.side-link.active { background: var(--rh-primary-soft); color: var(--rh-primary); }
.side-link .badge { margin-left: auto; }
.sidebar-footer { flex-shrink: 0; padding: .75rem 1rem; border-top: 1px solid var(--rh-border); background: var(--rh-surface); }
.topbar { position: sticky; top: 0; z-index: 1020; background: color-mix(in srgb, var(--rh-bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rh-border); }
.topbar-inner { height: 64px; display: flex; align-items: center; gap: .75rem; padding: 0 1rem; }
@media (min-width: 768px) { .topbar-inner { padding: 0 2rem; } }
.content { padding: 1.25rem 1rem 3rem; max-width: 1400px; }
@media (min-width: 768px) { .content { padding: 1.75rem 2rem 3rem; } }
.page-head { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; }
.page-title { font-size: 1.45rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.page-sub { color: var(--rh-muted); margin: .2rem 0 0; }
.crumbs { font-size: .82rem; color: var(--rh-muted); margin-bottom: .35rem; }
.crumbs a { color: var(--rh-muted); }
.crumbs a:hover { color: var(--rh-primary); }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: inline-grid; place-items: center; border: 1px solid var(--rh-border); background: var(--rh-surface); color: var(--rh-text); }
.icon-btn:hover { color: var(--rh-primary); border-color: var(--rh-primary); }

/* ============ Cards ============ */
.card { border: 1px solid var(--rh-border); border-radius: var(--rh-radius); background: var(--rh-surface); box-shadow: var(--rh-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--rh-border); padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header h2, .card-title-sm { font-size: 1rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.25rem; }
.stat-card { padding: 1.15rem 1.25rem; display: flex; flex-direction: row; gap: 1rem; align-items: center; height: 100%; color: var(--rh-text); transition: transform .15s ease, border-color .15s ease; }
a.stat-card:hover { transform: translateY(-2px); border-color: var(--rh-primary); }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { color: var(--rh-muted); font-size: .82rem; margin-top: .3rem; }
.tone-indigo { background: #eef2ff; color: #4f46e5; } .tone-green { background: #e9f9ef; color: #16a34a; }
.tone-amber { background: #fff6e5; color: #d97706; } .tone-red { background: #fdecec; color: #dc2626; }
.tone-sky { background: #e8f5fd; color: #0284c7; } .tone-slate { background: #f1f2f6; color: #64748b; }
.tone-violet { background: #f3edff; color: #7c3aed; }
[data-bs-theme="dark"] .tone-indigo { background: rgba(99,102,241,.15); color: #a5b4fc; }
[data-bs-theme="dark"] .tone-green { background: rgba(34,197,94,.13); color: #4ade80; }
[data-bs-theme="dark"] .tone-amber { background: rgba(245,158,11,.13); color: #fbbf24; }
[data-bs-theme="dark"] .tone-red { background: rgba(239,68,68,.14); color: #f87171; }
[data-bs-theme="dark"] .tone-sky { background: rgba(14,165,233,.14); color: #38bdf8; }
[data-bs-theme="dark"] .tone-slate { background: rgba(148,163,184,.12); color: #cbd5e1; }
[data-bs-theme="dark"] .tone-violet { background: rgba(139,92,246,.15); color: #c4b5fd; }

/* ============ Badges / pills ============ */
.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; padding: .22rem .6rem; border-radius: 999px; white-space: nowrap; }
.pill-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.level-expired, .level-critical { background: #fdecec; color: #c62828; }
.level-high { background: #fff1e0; color: #c2410c; }
.level-medium { background: #fff8db; color: #a16207; }
.level-ok { background: #e9f9ef; color: #15803d; }
.level-info { background: #e8f5fd; color: #0369a1; }
.level-muted { background: #f1f2f6; color: #64748b; }
[data-bs-theme="dark"] .level-expired, [data-bs-theme="dark"] .level-critical { background: rgba(239,68,68,.15); color: #fca5a5; }
[data-bs-theme="dark"] .level-high { background: rgba(249,115,22,.15); color: #fdba74; }
[data-bs-theme="dark"] .level-medium { background: rgba(234,179,8,.14); color: #fde047; }
[data-bs-theme="dark"] .level-ok { background: rgba(34,197,94,.13); color: #86efac; }
[data-bs-theme="dark"] .level-info { background: rgba(14,165,233,.14); color: #7dd3fc; }
[data-bs-theme="dark"] .level-muted { background: rgba(148,163,184,.12); color: #cbd5e1; }

/* ============ Avatar ============ */
.avatar { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; font-size: .85rem; flex-shrink: 0; object-fit: cover; color: #fff; }
.avatar-sm { width: 32px; height: 32px; font-size: .72rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 1.8rem; border: 4px solid var(--rh-surface); box-shadow: var(--rh-shadow); }
.avatar-xl { width: 128px; height: 128px; font-size: 2.3rem; }
.av-0 { background: linear-gradient(135deg,#6366f1,#8b5cf6); } .av-1 { background: linear-gradient(135deg,#0ea5e9,#2563eb); }
.av-2 { background: linear-gradient(135deg,#10b981,#059669); } .av-3 { background: linear-gradient(135deg,#f59e0b,#ea580c); }
.av-4 { background: linear-gradient(135deg,#ec4899,#db2777); } .av-5 { background: linear-gradient(135deg,#14b8a6,#0d9488); }
.av-default { background: var(--rh-border); color: var(--rh-muted); }

/* ============ Tabelas e listas ============ */
.table { --bs-table-bg: transparent; margin: 0; }
.table > :not(caption) > * > * { padding: .8rem 1rem; border-bottom-color: var(--rh-border); }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--rh-muted); font-weight: 600; background: var(--rh-bg); border-bottom: 1px solid var(--rh-border); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: var(--rh-primary-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.row-link { cursor: pointer; }
.person { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.person-name { font-weight: 600; color: var(--rh-text); }
.person-meta { font-size: .8rem; color: var(--rh-muted); }
.mobile-list { display: flex; flex-direction: column; }
.mobile-item { display: flex; gap: .85rem; padding: .9rem 1rem; border-bottom: 1px solid var(--rh-border); color: var(--rh-text); align-items: center; }
.mobile-item:last-child { border-bottom: 0; }
.mobile-item:active { background: var(--rh-primary-soft); }
.feed-item { display: flex; gap: .85rem; align-items: center; padding: .8rem 1.25rem; border-bottom: 1px solid var(--rh-border); color: var(--rh-text); }
.feed-item:last-child { border-bottom: 0; }
.feed-item:hover { background: var(--rh-bg); }
.feed-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.min-w-0 { min-width: 0; }

/* ============ Filtros ============ */
.filter-bar { display: grid; gap: .6rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .filter-bar { grid-template-columns: 2fr repeat(3, 1fr) auto; align-items: end; } }
.search-input { position: relative; }
.search-input i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--rh-muted); }
.search-input input { padding-left: 2.4rem; }
.seg { display: inline-flex; background: var(--rh-bg); border: 1px solid var(--rh-border); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: .35rem .8rem; border-radius: 8px; color: var(--rh-muted); font-weight: 500; font-size: .85rem; }
.seg a.active { background: var(--rh-surface); color: var(--rh-text); box-shadow: var(--rh-shadow); }

/* ============ Ficha do colaborador ============ */
.profile-cover { height: 96px; background: linear-gradient(120deg, var(--rh-primary), #8b5cf6 60%, #ec4899); border-radius: var(--rh-radius) var(--rh-radius) 0 0; }
.profile-head { padding: 0 1.25rem 1.25rem; display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-top: -48px; }
.profile-name { font-size: 1.35rem; font-weight: 700; margin: 0; }
.profile-info { padding-top: 0; flex-basis: 100%; }
@media (min-width: 576px) { .profile-info { padding-top: 3.4rem; flex-basis: 0; } }
.tabs { display: flex; gap: .25rem; overflow-x: auto; border-bottom: 1px solid var(--rh-border); padding: 0 1rem; scrollbar-width: none; }
.tabs a { padding: .85rem .9rem; color: var(--rh-muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; display: inline-flex; gap: .4rem; align-items: center; }
.tabs a.active { color: var(--rh-primary); border-bottom-color: var(--rh-primary); }
.tabs .count { background: var(--rh-bg); border-radius: 999px; padding: 0 .45rem; font-size: .72rem; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem 1.5rem; margin: 0; }
.dl-grid dt { font-size: .75rem; color: var(--rh-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.dl-grid dd { margin: .2rem 0 0; font-weight: 500; word-break: break-word; }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--rh-muted); font-weight: 600; margin: 0 0 1rem; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 1.1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--rh-primary); box-shadow: 0 0 0 4px var(--rh-primary-soft); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--rh-border); }
.timeline li:last-child::after { display: none; }
.doc-row { display: flex; gap: .9rem; align-items: center; padding: .9rem 1.25rem; border-bottom: 1px solid var(--rh-border); flex-wrap: wrap; }
.doc-row:last-child { border-bottom: 0; }
.doc-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 1.25rem; flex-shrink: 0; }
.doc-actions { margin-left: auto; display: flex; gap: .4rem; flex-wrap: wrap; }
@media (max-width: 575.98px) { .doc-actions { margin-left: 0; width: 100%; } .doc-actions .btn { flex: 1; } }

/* ============ Formulário em seções ============ */
.form-section { padding: 1.25rem; border-bottom: 1px solid var(--rh-border); }
.form-section:last-child { border-bottom: 0; }
.form-section-head { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.form-section-head .stat-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
.form-section-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.form-actions { position: sticky; bottom: 0; background: var(--rh-surface); border-top: 1px solid var(--rh-border); padding: .9rem 1.25rem; display: flex; gap: .5rem; justify-content: flex-end; border-radius: 0 0 var(--rh-radius) var(--rh-radius); flex-wrap: wrap; }
@media (max-width: 575.98px) { .form-actions .btn { flex: 1; } }
.photo-picker { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.dropzone { border: 2px dashed var(--rh-border); border-radius: 12px; padding: 1rem; text-align: center; color: var(--rh-muted); cursor: pointer; transition: border-color .15s, background .15s; flex: 1; min-width: 220px; }
.dropzone:hover, .dropzone.drag { border-color: var(--rh-primary); background: var(--rh-primary-soft); }

/* ============ Calendário ============ */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rh-border); border-left: 1px solid var(--rh-border); }
.cal-head { font-size: .72rem; text-transform: uppercase; color: var(--rh-muted); font-weight: 600; text-align: center; padding: .5rem 0; border-right: 1px solid var(--rh-border); border-bottom: 1px solid var(--rh-border); background: var(--rh-bg); }
.cal-day { min-height: 96px; border-right: 1px solid var(--rh-border); border-bottom: 1px solid var(--rh-border); padding: .35rem; font-size: .8rem; min-width: 0; }
.cal-day.out { background: var(--rh-bg); color: var(--rh-muted); }
.cal-num { font-weight: 600; font-size: .78rem; width: 24px; height: 24px; display: inline-grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--rh-primary); color: #fff; }
.cal-ev { display: block; font-size: .7rem; padding: 1px 5px; border-radius: 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--rh-primary-soft); color: var(--rh-primary); font-weight: 500; }
.cal-ev.approved { background: #e9f9ef; color: #15803d; }
.cal-ev.completed { background: #f1f2f6; color: #64748b; }
@media (max-width: 767.98px) { .cal-day { min-height: 56px; padding: .2rem; } .cal-ev { font-size: 0; height: 6px; padding: 0; } }

/* ============ Barras ============ */
.bar-row { margin-bottom: .9rem; }
.bar-row:last-child { margin-bottom: 0; }
.bar-track { height: 8px; background: var(--rh-bg); border-radius: 999px; overflow: hidden; margin-top: .35rem; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--rh-primary), #8b5cf6); border-radius: 999px; }

/* ============ Estados vazios, alertas, auth ============ */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--rh-muted); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: .6rem; opacity: .6; }
.empty h3 { font-size: 1rem; color: var(--rh-text); font-weight: 600; margin-bottom: .25rem; }
.alert { border-radius: 12px; border: 0; }
.toast-stack { position: fixed; top: 76px; right: 1rem; z-index: 1080; display: flex; flex-direction: column; gap: .5rem; max-width: min(420px, calc(100vw - 2rem)); }
.toast-msg { background: var(--rh-surface); border: 1px solid var(--rh-border); border-left: 4px solid var(--rh-primary); box-shadow: 0 10px 30px rgba(16,24,40,.12); border-radius: 12px; padding: .8rem 1rem; display: flex; gap: .65rem; align-items: flex-start; animation: slideIn .25s ease; }
.toast-msg.success { border-left-color: #16a34a; } .toast-msg.error { border-left-color: #dc2626; } .toast-msg.warning { border-left-color: #d97706; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.1fr 1fr; } }
.auth-hero { display: none; background: radial-gradient(circle at 20% 20%, #8b5cf6 0, transparent 45%), radial-gradient(circle at 80% 80%, #ec4899 0, transparent 40%), linear-gradient(135deg, #312e81, #4f46e5); color: #fff; padding: 3rem; position: relative; overflow: hidden; }
@media (min-width: 992px) { .auth-hero { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-hero h1 { font-size: 2.2rem; font-weight: 700; letter-spacing: -.02em; max-width: 460px; }
.auth-feature { display: flex; gap: .75rem; align-items: center; margin-bottom: .9rem; opacity: .92; }
.auth-feature i { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.15); display: grid; place-items: center; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 400px; }
.kbd-hint { font-size: .75rem; color: var(--rh-muted); }
.table-responsive { border-radius: 0 0 var(--rh-radius) var(--rh-radius); }
.pagination { --bs-pagination-border-radius: 10px; --bs-pagination-active-bg: var(--rh-primary); --bs-pagination-active-border-color: var(--rh-primary); --bs-pagination-color: var(--rh-text); margin: 0; }
.dropdown-menu { border-radius: 12px; border-color: var(--rh-border); box-shadow: 0 10px 30px rgba(16,24,40,.12); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; display: flex; gap: .55rem; align-items: center; }
.modal-content { border-radius: 16px; border: 0; }

/* ============ Cadastro via link (página pública) ============ */
.public-top { background: linear-gradient(120deg, var(--rh-primary), #8b5cf6 60%, #ec4899); color: #fff; padding: 1.5rem 1rem 4.5rem; }
.public-top .brand-mark { background: rgba(255,255,255,.2); }
.public-wrap { max-width: 760px; margin: -3.25rem auto 3rem; padding: 0 1rem; }
.step-dot { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--rh-primary-soft); color: var(--rh-primary); flex-shrink: 0; }
.file-slot { border: 1px dashed var(--rh-border); border-radius: 12px; padding: .9rem; height: 100%; }
.file-slot .done { color: #15803d; font-size: .8rem; font-weight: 600; }
.link-box { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.link-box input { flex: 1 1 260px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.diff-row td { vertical-align: top; }
.diff-row.changed td.new { background: rgba(var(--bs-primary-rgb), .07); font-weight: 600; }
.status-hero { text-align: center; padding: 2.5rem 1.5rem; }
.status-hero i { font-size: 3rem; display: block; margin-bottom: .75rem; }

/* ============ Tutorial ============ */
.tutorial-modal .modal-content { overflow: hidden; }
.tutorial-modal .modal-header { padding: 1.25rem 1.5rem .75rem; }
.tutorial-modal .modal-body { padding: .5rem 1.5rem 1rem; }
.tutorial-modal .modal-footer { padding: 0 1.5rem 1.25rem; flex-wrap: wrap; gap: .75rem; }
.tutorial-frame { border: 1px solid var(--rh-border); border-radius: 12px; overflow: hidden; background: var(--rh-bg); box-shadow: 0 12px 40px rgba(16, 24, 40, .12); }
.tutorial-chrome { height: 28px; display: flex; gap: 6px; align-items: center; padding: 0 12px; background: var(--rh-surface); border-bottom: 1px solid var(--rh-border); }
.tutorial-chrome span { width: 10px; height: 10px; border-radius: 50%; background: #f87171; }
.tutorial-chrome span:nth-child(2) { background: #fbbf24; }
.tutorial-chrome span:nth-child(3) { background: #34d399; }
.tutorial-frame img { height: auto; aspect-ratio: 16 / 9; }
/* Largura limitada pela altura da tela: imagem 16:9 + cabeçalho + rodapé sempre cabem sem rolagem */
.tutorial-modal .modal-dialog { max-width: min(1140px, calc((100vh - 230px) * 16 / 9 + 50px), calc(100vw - 1rem)); }
.tutorial-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.tutorial-dots button { width: 8px; height: 8px; border-radius: 999px; border: 0; padding: 0; background: var(--rh-border); transition: width .2s, background .2s; }
.tutorial-dots button.active { width: 24px; background: var(--rh-primary); }
@media (max-width: 575.98px) {
  .tutorial-modal .modal-footer { justify-content: center !important; }
  .tutorial-modal [data-tutorial-skip] { display: none; }
}

/* ============ Portal do colaborador ============ */
.portal-top { background: linear-gradient(120deg, var(--rh-primary), #8b5cf6 60%, #ec4899); color: #fff; }
.portal-top-inner { max-width: 880px; margin: 0 auto; padding: 1rem 1rem 0; }
.portal-top .brand-mark { background: rgba(255,255,255,.2); }
.portal-top a, .portal-top button { color: #fff; }
/* O menu suspenso fica sobre fundo claro: volta às cores normais do Bootstrap */
.portal-top .dropdown-menu .dropdown-item { color: var(--bs-dropdown-link-color); }
.portal-top .dropdown-menu .dropdown-item:hover, .portal-top .dropdown-menu .dropdown-item:focus { color: var(--bs-dropdown-link-hover-color); }
.portal-top .dropdown-menu .dropdown-item.text-danger { color: var(--bs-danger) !important; }
.portal-tabs { display: none; gap: .25rem; margin-top: .75rem; }
.portal-tabs a { padding: .65rem 1rem; border-radius: 10px 10px 0 0; color: rgba(255,255,255,.85); font-weight: 500; display: inline-flex; gap: .45rem; align-items: center; }
.portal-tabs a.active { background: var(--rh-bg); color: var(--rh-primary); }
.portal-main { max-width: 880px; margin: 0 auto; padding: 1.25rem 1rem 6rem; }
.portal-bottom { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: var(--rh-surface); border-top: 1px solid var(--rh-border); display: grid; grid-template-columns: repeat(4, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.portal-bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .55rem 0 .5rem; font-size: .72rem; color: var(--rh-muted); font-weight: 500; }
.portal-bottom a i { font-size: 1.25rem; }
.portal-bottom a.active { color: var(--rh-primary); }
@media (min-width: 768px) {
  .portal-tabs { display: flex; }
  .portal-bottom { display: none; }
  .portal-main { padding-bottom: 3rem; }
}
.hello-card { background: var(--rh-surface); border: 1px solid var(--rh-border); border-radius: var(--rh-radius); padding: 1.25rem; box-shadow: var(--rh-shadow); }
.big-action { display: flex; gap: .9rem; align-items: center; padding: 1rem 1.1rem; color: var(--rh-text); height: 100%; }
.big-action:hover { border-color: var(--rh-primary); }
.req-row { display: flex; gap: .85rem; align-items: flex-start; padding: .9rem 1.1rem; border-bottom: 1px solid var(--rh-border); }
.req-row:last-child { border-bottom: 0; }

/* ============ Escalas ============ */
.sched-wrap { overflow-x: auto; border-radius: 0 0 var(--rh-radius) var(--rh-radius); }
.sched-table { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.sched-table th, .sched-table td { border-bottom: 1px solid var(--rh-border); border-right: 1px solid var(--rh-border); vertical-align: top; padding: .5rem; }
.sched-table th:last-child, .sched-table td:last-child { border-right: 0; }
.sched-table thead th { background: var(--rh-bg); font-size: .78rem; font-weight: 600; text-align: center; position: sticky; top: 0; z-index: 1; }
.sched-table thead th.today { color: var(--rh-primary); box-shadow: inset 0 -2px 0 var(--rh-primary); }
.sched-table .shift-col { width: 180px; position: sticky; left: 0; background: var(--rh-surface); z-index: 2; }
.sched-table thead .shift-col { z-index: 3; background: var(--rh-bg); }
.sched-table td.off { background: repeating-linear-gradient(135deg, var(--rh-bg), var(--rh-bg) 6px, transparent 6px, transparent 12px); }
.shift-bar { width: 4px; border-radius: 4px; align-self: stretch; flex-shrink: 0; }
.bar-indigo { background: #6366f1; } .bar-sky { background: #0ea5e9; } .bar-green { background: #10b981; }
.bar-amber { background: #f59e0b; } .bar-violet { background: #8b5cf6; } .bar-red { background: #ef4444; }
.sched-chip { display: flex; align-items: center; gap: .35rem; padding: .22rem .3rem .22rem .25rem; border-radius: 8px; background: var(--rh-bg); border: 1px solid var(--rh-border); font-size: .76rem; margin-bottom: .3rem; min-width: 0; }
.sched-chip .avatar { width: 22px; height: 22px; font-size: .6rem; }
.sched-chip .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.sched-chip.warn { border-color: #f59e0b; background: #fff8e6; }
.sched-chip.conflict { border-color: #ef4444; background: #fdecec; }
[data-bs-theme="dark"] .sched-chip.warn { background: rgba(245,158,11,.12); }
[data-bs-theme="dark"] .sched-chip.conflict { background: rgba(239,68,68,.14); }
.sched-chip form { margin: 0; line-height: 1; }
.sched-chip .rm { border: 0; background: none; padding: 0 .1rem; color: var(--rh-muted); font-size: .9rem; line-height: 1; }
.sched-chip .rm:hover { color: #dc2626; }
.slot-add { display: block; text-align: center; font-size: .74rem; padding: .25rem; border-radius: 8px; border: 1px dashed var(--rh-border); color: var(--rh-muted); }
.slot-add:hover { border-color: var(--rh-primary); color: var(--rh-primary); }
.slot-add.missing { border-color: #fca5a5; color: #dc2626; background: rgba(239,68,68,.05); }
.weekday-check { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; list-style: none; }
.weekday-check > div, .weekday-check li { margin: 0; }
.weekday-check label { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--rh-border); border-radius: 999px; padding: .3rem .75rem; cursor: pointer; font-size: .85rem; user-select: none; }
.weekday-check input { accent-color: var(--rh-primary); }
.check-list > div { display: flex; flex-wrap: wrap; gap: .4rem; }
.check-list label { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--rh-border); border-radius: 10px; padding: .35rem .7rem; font-size: .85rem; cursor: pointer; }
.cand-row { display: flex; gap: .85rem; align-items: center; padding: .75rem 1.1rem; border-bottom: 1px solid var(--rh-border); flex-wrap: wrap; }
.cand-row:last-child { border-bottom: 0; }
.cand-row.blocked { opacity: .65; }
@media print {
  .sidebar, .topbar, .no-print, .toast-stack { display: none !important; }
  .app-main { margin: 0 !important; }
  .content { padding: 0 !important; max-width: none; }
  .card { box-shadow: none !important; }
  .sched-table { min-width: 0; font-size: 10px; }
  .sched-table .shift-col { position: static; }
  body { background: #fff; }
}
@media (max-width: 767.98px) { .sched-table .shift-col { width: 128px; } .sched-table { min-width: 860px; } }
