:root {
  color-scheme: light;
  --ink: #18343b;
  --muted: #607176;
  --petrol: #123b4a;
  --petrol-light: #237a78;
  --paper: #f8f7f3;
  --surface-alt: #e7eef0;
  --surface: #ffffff;
  --line: #d9e1df;
  --line-strong: #c7d3d0;
  --green: #285f58;
  --green-soft: #e7f0ed;
  --amber: #7b5518;
  --amber-mark: #c88b36;
  --amber-soft: #fbf2df;
  --red: #9b4a43;
  --red-soft: #f8e9e7;
  --shadow: 0 12px 32px rgba(20, 47, 52, .055);
  font-family: "Segoe UI", Aptos, Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body.app-body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--petrol-light); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #0c3948; }
button, input, select, textarea { font: inherit; }

.app-shell { min-height: 100vh; display: flex; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1020;
  width: 252px;
  height: 100vh;
  max-height: 100vh;
  padding: 22px 14px 16px 16px;
  color: #e9f0ef;
  background: var(--petrol);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app-brand, .auth-brand {
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.15;
  text-decoration: none;
  letter-spacing: .01em;
  flex-shrink: 0;
}
.app-brand:hover { color: #fff; }
.app-brand small { display: block; margin-top: 5px; color: #b5c8c8; font-size: 11px; font-weight: 450; }
.brand-mark {
  display: inline-grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 9px;
  color: white;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  flex-shrink: 0;
}
.nav-caption {
  flex-shrink: 0;
  margin: 22px 8px 8px;
  color: #9db6b8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.app-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
.app-nav::-webkit-scrollbar {
  width: 5px;
}
.app-nav::-webkit-scrollbar-track {
  background: transparent;
}
.app-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
.app-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.35);
}

.app-nav-link {
  position: relative;
  display: flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
  color: #d4e0df;
  font-size: 13px;
  font-weight: 550;
  text-decoration: none;
  transition: background-color .16s ease, color .16s ease;
}
.app-nav-link:hover { color: white; background: rgba(255,255,255,.09); }
.app-nav-link.active { color: #fff; background: rgba(255,255,255,.15); font-weight: 650; }
.app-nav-link.active::before { position: absolute; left: -16px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: #bed1ba; content: ""; }

.app-nav-group {
  display: flex;
  flex-direction: column;
}

.app-nav-group-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #d4e0df;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  letter-spacing: .01em;
  transition: background-color .16s ease, color .16s ease;
}

.app-nav-group-toggle:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, .09);
}

.app-nav-group.is-open > .app-nav-group-toggle {
  color: #ffffff;
  background: rgba(255, 255, 255, .06);
}

.app-nav-group.has-active > .app-nav-group-toggle {
  color: #ffffff;
  font-weight: 650;
}

.nav-toggle-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.nav-toggle-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.8;
  color: currentColor;
}

.app-nav-group.is-open > .app-nav-group-toggle .nav-toggle-icon,
.app-nav-link.active .nav-toggle-icon,
.app-nav-group.has-active > .app-nav-group-toggle .nav-toggle-icon {
  opacity: 1;
}

.nav-toggle-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform .22s cubic-bezier(0.4, 0, 0.2, 1), opacity .2s ease;
}

.app-nav-group.is-open > .app-nav-group-toggle .nav-chevron {
  transform: rotate(90deg);
  opacity: 0.95;
}

.app-nav-group-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 10px;
  margin-left: 18px;
  border-left: 1.5px solid rgba(255, 255, 255, .15);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height .24s cubic-bezier(0.4, 0, 0.2, 1), opacity .2s ease, margin .2s ease;
}

.app-nav-group.is-open > .app-nav-group-menu {
  max-height: 250px;
  opacity: 1;
  pointer-events: auto;
  margin-top: 3px;
  margin-bottom: 6px;
}

.app-nav-sublink {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 5px;
  color: #b5cbc9;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color .15s ease, color .15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-nav-sublink:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, .08);
}

.app-nav-sublink.active {
  color: #ffffff;
  background: rgba(255, 255, 255, .16);
  font-weight: 650;
}

.app-nav-sublink.active::before {
  position: absolute;
  left: -11.5px;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: #bed1ba;
  content: "";
}

.sidebar-foot { display: flex; gap: 9px; align-items: center; margin-top: auto; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.13); color: #bfd0cf; font-size: 10px; flex-shrink: 0; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a6c9a9; box-shadow: 0 0 0 3px rgba(166,201,169,.13); }
.app-main-wrap { width: calc(100% - 252px); min-width: 0; margin-left: 252px; }
.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1010;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(22px, 3vw, 44px);
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
}
.topbar-context { display: grid; gap: 2px; }
.context-line { color: #718286; font-size: 10px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; }
.topbar-context strong { color: var(--ink); font-size: 14px; font-weight: 650; }
.topbar-user { display: flex; align-items: center; gap: 15px; }
.user-name { text-align: right; font-size: 12px; font-weight: 650; }
.user-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; font-weight: 450; }
.app-content { position: relative; width: min(100%, 1720px); margin: 0 auto; padding: 31px clamp(22px, 3vw, 44px) 52px; }

.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 0; color: var(--ink); font-size: clamp(25px, 2.2vw, 32px); font-weight: 650; letter-spacing: -.035em; }
.page-heading p.text-secondary { margin: 7px 0 0; max-width: 760px; color: var(--muted) !important; font-size: 13px; }
.eyebrow { margin: 0 0 6px; color: var(--petrol-light); font-size: 10px; font-weight: 750; letter-spacing: .13em; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 0 0 18px; }
.summary-grid-four { margin: 19px 0 0; }
.summary-panel { min-width: 0; padding: 16px 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 2px 5px rgba(24,52,59,.025); }
.summary-panel > span, .summary-panel > small { display: block; color: var(--muted); font-size: 11px; }
.summary-panel > strong { display: block; margin: 8px 0 3px; overflow: hidden; color: var(--ink); font-size: clamp(23px, 2vw, 29px); font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -.04em; text-overflow: ellipsis; }
.data-panel { min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: 0 4px 16px rgba(20,47,52,.035); }
/*.data-panel + .data-panel { margin-top: 18px; }*/
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 22px 14px; border-bottom: 1px solid #e8edeb; }
.panel-heading h2 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 650; letter-spacing: -.015em; }
.panel-heading p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.4; }
.panel-heading .eyebrow { margin-bottom: 4px; }
.panel-heading > a { flex: 0 0 auto; margin-top: 2px; font-size: 11.5px; font-weight: 600; }
.content-columns { display: grid; grid-template-columns: minmax(0, 1.42fr) minmax(290px, .92fr); gap: 18px; align-items: start; }
.content-columns > .data-panel, .split-workspace > .data-panel { min-width: 0; }
.data-panel > form.row, .data-panel > form:not(.table-responsive):not([id]) { padding: 18px 22px 20px; margin-left: 0; margin-right: 0; }
.callout-note { margin: 14px 22px 16px; padding: 11px 15px; border: 1px solid #d4e2d8; border-radius: 6px; background: #f3f7f5; color: #335346; font-size: 11px; line-height: 1.5; }
.callout-note.m-0 { margin: 0 !important; }
.empty-state { padding: 26px 20px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 13px; }
.empty-state p { margin: 0; font-size: 11px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 5px 14px; font-size: 12px; font-weight: 600; line-height: 1.4; border-radius: 6px; text-decoration: none; transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease; }
.btn-sm { min-height: 28px; padding: 3px 10px; font-size: 11px; border-radius: 5px; }
.auth-wrap .btn-primary { min-height: 42px; font-size: 13px; }
.btn-primary { --bs-btn-bg: var(--petrol); --bs-btn-border-color: var(--petrol); --bs-btn-hover-bg: #0c2d38; --bs-btn-hover-border-color: #0c2d38; --bs-btn-active-bg: #0c2d38; --bs-btn-active-border-color: #0c2d38; --bs-btn-disabled-bg: #8b9b9d; --bs-btn-disabled-border-color: #8b9b9d; box-shadow: 0 1px 2px rgba(18,59,74,.08); }
.btn-outline-primary { --bs-btn-color: var(--petrol); --bs-btn-border-color: #a4babb; --bs-btn-hover-bg: var(--petrol); --bs-btn-hover-border-color: var(--petrol); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--petrol); background-color: #fff; }
.btn-outline-secondary { --bs-btn-color: #4c6065; --bs-btn-border-color: #c5d2d0; --bs-btn-hover-bg: var(--surface-alt); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: #afbfbd; background-color: #fff; }
.form-label { margin-bottom: 5px; color: #2d484e; font-size: 11px; font-weight: 650; letter-spacing: .01em; }
.form-control, .form-select { height: 35px; min-height: 35px; padding: 5px 11px; border: 1px solid #c8d5d3; border-radius: 6px; color: var(--ink); font-size: 12px; background-color: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.form-control:focus, .form-select:focus { border-color: var(--petrol-light); box-shadow: 0 0 0 .18rem rgba(35,122,120,.14); outline: 0; }
.form-control::placeholder { color: #91a2a4; }
.form-control-sm, .form-select-sm { height: 29px; min-height: 29px; padding: 3px 8px; font-size: 11px; border-radius: 5px; }
.form-text { color: #748287; font-size: 10px; margin-top: 4px; }
.form-check-input { width: 15px; height: 15px; margin-top: .15em; border-color: #b9c8c6; }
.form-check-input:checked { border-color: var(--petrol-light); background-color: var(--petrol-light); }
.form-check-label { color: #3c5459; font-size: 11.5px; }
input[type="number"], input[type="date"], input[type="month"] { font-variant-numeric: tabular-nums; }
.alert { border-radius: 7px; font-size: 12px; }
.alert-warning { --bs-alert-color: #6f541f; --bs-alert-bg: var(--amber-soft); --bs-alert-border-color: #eddfbe; }
.alert-info { --bs-alert-color: #31565f; --bs-alert-bg: #e9f2f4; --bs-alert-border-color: #d0e2e5; }
.alert-success { --bs-alert-color: #345944; --bs-alert-bg: var(--green-soft); --bs-alert-border-color: #d0e2d4; }
.alert-danger { --bs-alert-color: #81413c; --bs-alert-bg: var(--red-soft); --bs-alert-border-color: #ecd2cf; }
.floating-toast-stack { position: absolute; z-index: 1080; display: grid; gap: 9px; pointer-events: none; }
.page-toast-stack { position: fixed !important; top: 20px !important; right: clamp(16px, 3vw, 40px) !important; width: min(400px, calc(100% - 32px)) !important; z-index: 1090 !important; }
.employee-modal-toast-stack { top: 10px; right: 56px; width: min(390px, calc(100% - 72px)); z-index: 1095; }
.floating-toast-stack .floating-toast { margin: 0; pointer-events: auto; box-shadow: 0 10px 28px rgba(18,48,54,.22); }
.floating-toast-stack .floating-toast.alert-success { --bs-alert-color: var(--green); --bs-alert-bg: color-mix(in srgb, var(--green) 28%, white); --bs-alert-border-color: color-mix(in srgb, var(--green) 52%, white); }
.table-responsive { border-radius: 0 0 9px 9px; }
.app-table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-border-color: #e8edeb; --bs-table-hover-bg: #f5f8f7; margin-bottom: 0; font-size: 11px; }
.app-table thead th { padding: 10px 12px; border-bottom: 1px solid var(--line-strong); background: var(--surface-alt); color: #53686d; font-size: 9px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.app-table tbody td { padding: 11px 12px; vertical-align: middle; }
.app-table tbody tr:last-child td { border-bottom: 0; }
.app-table td strong { display: block; font-size: 11px; font-weight: 650; }
.app-table td small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.table-active { --bs-table-bg: var(--surface-alt); --bs-table-color: var(--ink); }
.num-cell, .summary-panel > strong, .rate-line strong, .static-value { font-variant-numeric: tabular-nums; }
.num-cell { white-space: nowrap; }
.code-cell { display: block; margin-top: 4px; color: #758487; font-family: Consolas, "Courier New", monospace; font-size: 9px; }
.table-action { font-size: 10px; font-weight: 650; white-space: nowrap; }
.state-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid #dce4e2; border-radius: 999px; background: #f0f4f3; color: #506368; font-size: 9px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.state-ok { border-color: #d0e2d4; background: var(--green-soft); color: var(--green); }
.state-pending { border-color: #e9d7b4; background: var(--amber-soft); color: var(--amber); box-shadow: inset 0 0 0 1px rgba(200,139,54,.12); }
.state-error { border-color: #ecd2cf; background: var(--red-soft); color: var(--red); }
.state-ok::before, .state-pending::before { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; content: ""; }
.state-ok::before { background: var(--petrol-light); }
.state-pending::before { background: var(--amber-mark); }

.checklist-row { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 15px 19px; border-bottom: 1px solid #edf0ef; }
.checklist-number { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid #d1dfe1; border-radius: 50%; background: var(--surface-alt); color: var(--petrol-light); font-size: 10px; font-weight: 700; }
.checklist-row strong { display: block; color: var(--ink); font-size: 11px; }
.checklist-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.checklist-row > a { font-size: 10px; font-weight: 650; white-space: nowrap; }
.rate-panel { padding-bottom: 17px; }
.rate-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 19px; border-bottom: 1px solid #edf0ef; }
.rate-line > span { color: var(--ink); font-size: 11px; font-weight: 650; }
.rate-line small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 450; }
.rate-line strong { text-align: right; font-size: 15px; font-weight: 700; }
.rate-line strong small { display: inline; color: var(--muted); }

.split-workspace { display: grid; grid-template-columns: minmax(290px, .82fr) minmax(0, 1.45fr); gap: 17px; align-items: start; }
.roster-panel, .profile-panel { overflow: hidden; }
.roster-table { max-height: min(69vh, 760px); overflow: auto; }
.roster-table .app-table thead th { position: sticky; top: 0; z-index: 1; }
.employee-roster-panel { overflow: hidden; }
.roster-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.roster-filters > div { min-width: 0; }
.roster-filters > div:first-child { flex: 1 1 200px; min-width: 160px; }
.roster-filters > div:not(:first-child) { flex: 0 1 155px; min-width: 120px; }
.roster-clear { height: 35px; min-height: 35px; padding: 5px 14px; font-size: 11.5px; white-space: nowrap; flex: 0 0 auto; }
.employee-roster-table { max-height: none; overflow-x: auto; overflow-y: visible; }
.employee-roster-table .app-table { min-width: 820px; }
.employee-roster-table .app-table thead th { top: 0; }
.roster-pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--line); }
.roster-page-size { display: flex; align-items: center; gap: 9px; }
.roster-page-size .form-select { width: auto; min-width: 72px; height: 31px; min-height: 31px; padding: 3px 22px 3px 8px; font-size: 11px; }
.roster-page-summary, .roster-page-controls { color: var(--muted); font-size: 11px; }
.roster-page-controls { display: flex; align-items: center; gap: 8px; }
.roster-page-controls .btn { height: 31px; min-height: 31px; padding: 3px 11px; font-size: 11px; }
.app-modal-content { border: 1px solid var(--line); border-radius: 10px; box-shadow: none; }
.app-modal-content .modal-header { align-items: flex-start; padding: 19px 22px 16px; border-bottom-color: var(--line); }
.app-modal-content .modal-title { color: var(--ink); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.modal-subtitle { margin-top: 4px; color: var(--muted); font-size: 11px; }

/* Modales con Header y Footer fijos y Scroll en Modal-Body */
.modal-dialog-scrollable {
  max-height: calc(100vh - 2.5rem);
  display: flex;
}
.modal-dialog-scrollable .modal-content {
  max-height: calc(100vh - 2.5rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-dialog-scrollable .modal-content > form,
.modal-dialog-scrollable form.needs-validation,
.modal-content > form.profile-modal-form,
.modal-content > .profile-modal-form.form-stack {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
}
.modal-dialog-scrollable .modal-header,
.app-modal-content .modal-header {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  background: var(--surface, #fff);
}
.modal-dialog-scrollable .modal-footer,
.app-modal-content .modal-footer,
.profile-modal-footer {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--line, #e2e8f0);
  background: var(--surface, #fff);
}
.modal-dialog-scrollable .modal-body,
.profile-modal-form .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.profile-modal-form .modal-body { padding: 20px 22px; }
.profile-modal-form hr { margin: 19px 0; color: var(--line); opacity: 1; }
.profile-modal-footer { flex: 0 0 auto; justify-content: space-between; padding: 13px 22px 17px; }
.profile-modal-footer > span { margin-right: auto; color: var(--muted); font-size: 10px; }
.profile-agreement-entry { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); }
.profile-agreement-entry strong, .profile-agreement-entry small { display: block; }
.profile-agreement-entry strong { color: var(--ink); font-size: 12px; }
.profile-agreement-entry small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.profile-operations-block { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.profile-op-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); }
.profile-op-card strong { display: block; color: var(--ink); font-size: 13px; }
.profile-op-card small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.profile-op-card .profile-op-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.agreement-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.agreement-roster-table { max-height: calc(100vh - 280px); min-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.agreement-roster-table tbody { transition: opacity .18s ease; }
.agreement-roster-table tbody.is-refreshing { opacity: .82; }
.agreement-roster-table .app-table { min-width: 760px; }
.agreement-roster-table .app-table thead th { position: sticky; top: 0; z-index: 1; }
.agreement-actions { display: grid; min-width: 120px; gap: 6px; }
.agreement-actions > .btn, .agreement-state-form > .btn { height: 32px; min-height: 32px; font-size: 11px; padding: 4px 10px; }
.agreement-state-form { display: grid; gap: 5px; }
.agreement-state-form .form-select { min-width: 120px; height: 32px; min-height: 32px; font-size: 11px; padding: 3px 22px 3px 8px; }
.agreement-modal-footer { display: flex; justify-content: flex-end; margin-top: 16px; }
.agreement-editor-panel { padding: 4px 0 0; }
.agreement-editor-heading { margin: 0 0 15px; padding-bottom: 12px; border-bottom: 1px solid #e7edeb; }
.agreement-editor-heading h3 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 700; }
.agreement-editor-heading p:last-child { margin: 5px 0 0; font-size: 11px; }
.agreement-change-note { margin-bottom: 10px; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--amber-soft); color: var(--amber); font-size: 11px; line-height: 1.5; }
.preflight-panel { overflow: hidden; }
.preflight-controls { display: grid; grid-template-columns: minmax(180px, .72fr) repeat(2, minmax(150px, .78fr)) minmax(300px, 1.5fr); gap: 12px; align-items: stretch; padding: 15px 19px 17px; }
.preflight-period-form, .preflight-rate { min-width: 0; }
.preflight-period-form { display: flex; flex-direction: column; justify-content: center; }
.preflight-rate { display: flex; min-height: 69px; flex-direction: column; justify-content: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-alt); }
.preflight-rate > span { color: var(--muted); font-size: 10px; }
.preflight-rate > strong { margin-top: 3px; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.preflight-rate > small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.preflight-generate { display: grid; align-content: center; gap: 8px; }
.preflight-generate-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.preflight-income-options { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; min-width: 0; margin: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-alt); }
.preflight-income-options legend { float: none; width: auto; margin: 0 8px 0 0; color: var(--ink); font-size: 10px; font-weight: 700; }
.preflight-income-options .form-check { display: inline-flex; gap: 6px; align-items: center; min-height: auto; margin: 0; }
.preflight-income-options .form-text { flex: 1 0 100%; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.preflight-generate-form > div { min-width: 0; }
.preflight-generate-form .form-label { margin-bottom: 4px; }
.preflight-generate-form [data-payroll-generate-submit] { min-width: 145px; }
.preflight-links { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 10px; }
.preflight-links a { font-weight: 650; }
.payroll-review-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(315px, .82fr); gap: 17px; align-items: start; }
.payroll-review-grid > .data-panel { min-width: 0; overflow: hidden; }
.payroll-review-grid > .payroll-profile-panel { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 104px); overflow-y: auto; scrollbar-width: thin; }
.payroll-roster-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.payroll-roster-toolbar > div { min-width: 0; }
.payroll-roster-search { flex: 1 1 220px; min-width: 170px; }
.payroll-roster-toolbar select#payroll-roster-profile { width: 145px; }
.payroll-roster-toolbar select#payroll-roster-size { width: 85px; }
.payroll-roster-toolbar .form-control, .payroll-roster-toolbar .form-select, .payroll-roster-clear { height: 35px; min-height: 35px; }
.payroll-roster-clear { white-space: nowrap; flex: 0 0 auto; padding: 5px 14px; font-size: 11.5px; }
.payroll-roster-feedback { margin: 10px 19px 0; font-size: 11px; }
.payroll-roster-table { max-height: none; overflow-x: auto; overflow-y: visible; }
.payroll-roster-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.payroll-roster-page-controls { display: flex; align-items: center; gap: 8px; }
.payroll-roster-page-controls .btn { height: 31px; min-height: 31px; padding: 3px 11px; font-size: 11px; }
.payroll-roster-panel[aria-busy="true"] { cursor: progress; }
.payroll-roster-table .app-table thead th { top: 0; }
.payroll-employee-link { color: var(--ink); text-decoration: none; }
.payroll-employee-link:hover { color: var(--petrol-light); text-decoration: underline; }
.payroll-employee-select { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.payroll-employee-select:focus-visible { outline: 2px solid var(--petrol-light); outline-offset: 3px; }
.profile-review-footer { display: grid; gap: 8px; margin: 16px 20px 0; }
.profile-review-footer .btn { justify-self: start; }
.profile-review-footer small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.profile-panel { padding-bottom: 18px; }
.profile-panel > .panel-heading { margin-bottom: 16px; }
.profile-panel > form, .profile-panel > .detail-lines { margin-right: 20px; margin-left: 20px; }
.form-stack { display: grid; gap: 2px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid #e7edeb; width: 100%; }
.form-footer > span { color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.form-footer .btn { flex-shrink: 0; }
.static-value { min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-alt); color: var(--ink); font-size: 12px; font-weight: 650; }
.static-value small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 450; }
.detail-lines { display: grid; gap: 0; }
.detail-lines > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #edf0ef; }
.detail-lines span { color: var(--muted); font-size: 10px; }
.detail-lines strong { color: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; }
.profile-panel hr { margin: 18px 0; color: #dfe7e5; opacity: 1; }

.snapshot-list { display: grid; padding: 7px 19px 16px; }
.snapshot-list > div { display: grid; grid-template-columns: 29px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid #edf0ef; }
.snapshot-list > div:last-child { border: 0; }
.snapshot-list > div > span { color: #8c9b9c; font-family: Consolas, "Courier New", monospace; font-size: 10px; }
.snapshot-list strong { display: block; color: var(--ink); font-size: 11px; }
.snapshot-list small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.selected-version { overflow: hidden; }
.selected-version .panel-heading { padding-bottom: 17px; }
.frozen-rates { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 19px 17px; border-top: 1px solid #edf0ef; }
.frozen-rates > span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9f8; color: #4d6165; font-size: 10px; }
.frozen-rates strong { margin-right: 6px; color: var(--petrol); font-size: 9px; }
.frozen-rates small { margin-left: 4px; color: var(--muted); font-size: 9px; }
.version-detail-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(315px, .85fr); gap: 17px; align-items: start; }
.version-detail-grid > .data-panel { overflow: hidden; }
.snapshot-lines { padding: 0 18px 16px; }
.snapshot-lines > div { padding: 12px 0; border-bottom: 1px solid #e9eeec; }
.snapshot-lines > div:last-child { border-bottom: 0; }
.snapshot-lines strong { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; }
.snapshot-lines strong span { font-variant-numeric: tabular-nums; text-align: right; }
.snapshot-lines small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.snapshot-lines code { display: block; margin-top: 5px; color: #526970; font-size: 9px; white-space: normal; overflow-wrap: anywhere; }

.rate-use-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px 22px; border-bottom: 1px solid #edf0ef; transition: background-color .12s ease; }
.rate-use-row:hover { background-color: #fafcfb; }
.rate-use-row:last-child { border-bottom: 0; }
.rate-use-row > span:first-child, .rate-use-label { display: inline-flex; align-items: center; align-self: start; padding: 2px 8px; border-radius: 4px; background: #e7eff0; color: var(--petrol); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; width: fit-content; }
.rate-use-row strong { display: block; margin-top: 2px; color: var(--ink); font-size: 12px; font-weight: 650; }
.rate-use-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; line-height: 1.45; }

.deduction-config-list { display: flex; flex-direction: column; gap: 11px; padding: 0 19px 19px; }
.deduction-config-row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 12px; row-gap: 10px; align-items: end; padding: 14px 16px; background: #ffffff; border: 1px solid #e3eae6; border-radius: 8px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03); transition: border-color .15s ease, box-shadow .15s ease; }
.deduction-config-row:hover, .deduction-config-row:focus-within { border-color: #bcd1cb; box-shadow: 0 2px 6px rgba(16, 24, 40, 0.05); }
.deduction-config-row .form-label { display: block; font-size: 10px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; line-height: 1.2; }
.deduction-label-group { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.deduction-label-group .form-label { margin-bottom: 0; }
.deduction-code-pill { font-family: var(--font-mono, monospace); font-size: 9px; font-weight: 750; color: var(--petrol); background: #e8f1ef; border: 1px solid #d4e3e0; padding: 1px 6px; border-radius: 4px; letter-spacing: .03em; white-space: nowrap; }
.deduction-field-concept { grid-column: span 5; }
.deduction-field-mode { grid-column: span 3; }
.deduction-field-currency { grid-column: span 2; }
.deduction-field-rate { grid-column: span 2; }
.deduction-field-amount { grid-column: span 2; }
.deduction-field-status { grid-column: span 3; }
.deduction-field-description { grid-column: span 5; }
.deduction-checks-inline { display: flex; align-items: center; gap: 14px; height: 29px; }
.deduction-checks-inline .form-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 0; }
.deduction-checks-inline .form-check-input { margin: 0; float: none; }
.deduction-checks-inline .form-check-label { margin: 0; font-size: 11.5px; font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap; }
.deduction-config-submit { grid-column: span 2; display: flex; align-items: flex-end; height: 100%; }
.deduction-config-submit .btn { height: 29px; width: 100%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 650; padding: 0 10px; }
.rule-list { display: grid; gap: 0; padding: 0 19px; }
.rule-list > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid #edf0ef; }
.rule-list strong { color: var(--ink); font-size: 10px; }
.rule-list span { color: var(--muted); font-size: 10px; text-align: right; }
.custom-plan-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 8px; }
.custom-plan-rows { display: grid; gap: 8px; }
.duration-preview { margin: 0; padding: 11px 13px; border: 1px solid #d7e4db; border-radius: 6px; background: #f1f6f2; color: #3c5b4e; font-size: 11px; line-height: 1.5; }
.custom-plan-row { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(180px, 1fr); gap: 8px; }
.cause-text { max-width: 230px; }
.action-cell { min-width: 155px; }
.action-form { display: grid; gap: 5px; }
.action-form .btn { justify-self: start; }
.role-summary-list { display: grid; padding: 4px 19px 16px; }
.role-summary-list > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid #edf0ef; }
.role-summary-list > div:last-child { border-bottom: 0; }
.role-summary-list strong { color: var(--ink); font-size: 11px; }
.role-summary-list small { grid-column: 1; color: var(--muted); font-size: 9px; }
.role-summary-list .state-badge { grid-column: 2; grid-row: 1 / span 2; }
.permission-role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 17px; }
.permission-role { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfb; }
.permission-role h3 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 650; }
.permission-role > p { margin: 4px 0 12px; color: var(--muted); font-size: 10px; }
.permission-role .callout-note { margin: 12px 0 0; }
.permission-group { margin: 12px 0; padding: 10px 11px; border: 1px solid #e7edeb; border-radius: 6px; background: #fff; }
.permission-group h4 { margin: 0 0 8px; color: var(--petrol-light); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.permission-group .form-check + .form-check { margin-top: 5px; }
.password-reset { color: #52666a; font-size: 10px; }
.password-reset summary, .snapshot-line details summary, .profile-snapshot summary, .audit-detail summary { cursor: pointer; color: var(--petrol-light); font-size: 10px; font-weight: 650; }
.password-reset form { max-width: 800px; }
.audit-detail > div { min-width: 280px; max-width: 460px; padding: 10px; border: 1px solid #e5ece9; border-radius: 6px; background: #f8faf9; }
.audit-detail strong { margin-top: 8px; color: var(--ink); font-size: 9px; }
.audit-detail pre, .snapshot-line pre, .profile-snapshot pre { max-height: 220px; margin: 5px 0; overflow: auto; color: #455e62; font-family: Consolas, "Courier New", monospace; font-size: 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
.snapshot-line { padding: 12px 0; border-bottom: 1px solid #e9eeec; }
.snapshot-line:last-child { border-bottom: 0; }
.snapshot-line-head { display: flex; justify-content: space-between; gap: 12px; }
.snapshot-line-head strong { color: var(--ink); font-size: 10px; }
.snapshot-line-head span { color: var(--ink); font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.snapshot-line > small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.snapshot-line .bonus-flag { color: var(--amber); }
.snapshot-line details { margin-top: 7px; }
.profile-snapshot { margin: 0 18px 16px; padding: 11px; border: 1px solid #e5ece9; border-radius: 6px; background: #f8faf9; }

.salary-reference-list { display: grid; padding: 0 20px; }
.reference-row { display: grid; grid-template-columns: minmax(85px, .85fr) minmax(130px, 1.2fr) 85px 80px 115px 125px 125px minmax(140px, 1.2fr) auto; gap: 9px; align-items: end; padding: 12px 0; border-bottom: 1px solid #e9eeec; }
.reference-row:last-child { border-bottom: 0; }
.reference-submit { padding-bottom: 2px; }
.amount-input { max-width: 160px; }
.new-reference-form { padding: 18px 22px; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px; background: var(--paper); }
.auth-wrap { width: min(100%, 450px); }
.auth-brand { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 0; margin: 0 0 22px 2px; color: var(--petrol); }
.auth-brand .brand-mark { border-color: var(--line-strong); background: var(--petrol); }
.auth-brand .eyebrow { align-self: center; margin: 0; }
.auth-brand h1 { grid-column: 1 / -1; margin: 19px 0 5px; color: var(--ink); font-size: 24px; font-weight: 650; letter-spacing: -.03em; }
.auth-brand > p:last-child { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }
.auth-card, .error-card { padding: 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1, .auth-card h2, .error-card h1 { margin: 0 0 7px; color: var(--ink); font-size: 22px; font-weight: 650; letter-spacing: -.03em; }
.auth-card > p.text-secondary { margin: 0 0 22px; color: var(--muted) !important; font-size: 12px; }
.error-card { width: min(100%, 520px); }
.auth-card .small { font-size: 10px; }
.app-mobile-nav { background: var(--petrol); color: white; }
.app-mobile-nav .offcanvas-title { font-size: 17px; }
.app-mobile-nav .offcanvas-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

@media (max-width: 1350px) {
  .reference-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-columns, .version-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .split-workspace { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); }
  .preflight-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preflight-generate { grid-column: 1 / -1; }
  .payroll-review-grid { grid-template-columns: minmax(0, 1fr); }
  .payroll-review-grid > .payroll-profile-panel { position: static; max-height: none; overflow: hidden; }
}

@media (max-width: 991.98px) {
  .app-main-wrap { width: 100%; margin-left: 0; }
  .app-content { padding-top: 24px; }
  .app-topbar { min-height: 64px; padding-inline: 18px; }
  .topbar-context { margin-right: auto; }
  .split-workspace { grid-template-columns: 1fr; }
  .roster-table { max-height: 430px; }
  .employee-roster-table { max-height: none; overflow-x: auto; overflow-y: visible; }
  .roster-filters { padding: 13px 16px; }
}

@media (max-width: 640px) {
  .app-content { padding: 20px 14px 35px; }
  .app-topbar { gap: 10px; padding: 10px 14px; }
  .topbar-context strong { font-size: 12px; }
  .context-line { font-size: 8px; }
  .topbar-user { gap: 8px; }
  .user-name { display: none; }
  .page-heading { display: grid; align-items: start; gap: 13px; margin-bottom: 16px; }
  .page-heading .btn { justify-self: start; }
  .summary-grid { gap: 9px; }
  .summary-panel { padding: 12px; }
  .summary-panel > strong { font-size: 22px; }
  .panel-heading { padding: 15px 14px 12px; }
  .panel-heading > .state-badge { margin-top: 1px; }
  .checklist-row { grid-template-columns: 27px minmax(0,1fr); padding: 13px 14px; }
  .checklist-row > a { grid-column: 2; }
  .callout-note { margin: 12px 14px 15px; }
  .form-footer { align-items: flex-start; flex-direction: column; }
  .form-footer .btn { width: 100%; }
  .preflight-controls { grid-template-columns: minmax(0, 1fr); padding: 13px 14px 15px; }
  .preflight-generate { grid-column: auto; }
  .preflight-generate-form { grid-template-columns: minmax(0, 1fr); }
  .preflight-generate-form .btn { width: 100%; }
  .payroll-roster-table { max-height: none; }
  .payroll-roster-table table { min-width: 590px; }
  .payroll-roster-toolbar { flex-direction: column; align-items: stretch; gap: 9px; padding: 13px 14px; }
  .payroll-roster-search, .payroll-roster-toolbar select#payroll-roster-profile, .payroll-roster-toolbar select#payroll-roster-size { width: 100%; }
  .payroll-roster-clear { width: 100%; }
  .payroll-roster-pagination { align-items: stretch; flex-direction: column; padding: 12px 14px; }
  .payroll-roster-page-controls { justify-content: space-between; }
  .payroll-roster-page-controls .btn { height: 34px; min-height: 34px; }
  .profile-review-footer { margin-inline: 14px; }
  .roster-filters { flex-direction: column; align-items: stretch; gap: 9px; }
  .roster-filters > div { width: 100%; }
  .roster-clear { width: 100%; }
  .employee-roster-table { max-height: none; }
  .roster-pagination { align-items: stretch; flex-direction: column; padding-inline: 14px; }
  .roster-page-controls { justify-content: space-between; }
  .roster-page-controls .btn { height: 34px; min-height: 34px; }
  .app-modal-content .modal-header { padding: 15px 16px 13px; }
  .profile-modal-form .modal-body, .app-modal-content > .modal-body { padding: 16px; }
  .employee-modal-toast-stack { top: 70px; right: 12px; width: calc(100% - 24px); }
  .profile-modal-footer { align-items: stretch; flex-direction: column; padding: 12px 16px 15px; }
  .profile-modal-footer > span { margin-right: 0; }
  .profile-modal-footer .btn { width: 100%; }
  .profile-modal-footer .btn, .profile-agreement-entry .btn, .agreement-toolbar > .btn { min-height: 44px; }
  .agreement-toolbar { align-items: flex-start; flex-direction: column; }
  .agreement-toolbar > .btn { width: 100%; }
  .profile-agreement-entry { align-items: flex-start; flex-direction: column; }
  .profile-agreement-entry .btn { width: 100%; }
  .agreement-state-form { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .agreement-actions { min-width: 145px; }
  .reference-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deduction-config-row { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .deduction-field-concept { grid-column: span 7; }
  .deduction-field-mode { grid-column: span 5; }
  .deduction-field-currency { grid-column: span 3; }
  .deduction-field-rate { grid-column: span 5; }
  .deduction-field-amount { grid-column: span 4; }
  .deduction-field-status { grid-column: span 5; }
  .deduction-field-description { grid-column: span 5; }
  .deduction-config-submit { grid-column: span 2; }
  .deduction-config-list, .salary-reference-list { padding-inline: 14px; }
}

@media (max-width: 768px) {
  .deduction-config-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .deduction-field-concept, .deduction-field-mode, .deduction-field-description, .deduction-config-submit { grid-column: span 2; }
  .deduction-field-currency, .deduction-field-rate, .deduction-field-amount, .deduction-field-status { grid-column: span 1; }
  .custom-plan-row { grid-template-columns: 1fr; }
  .custom-plan-header { align-items: flex-start; flex-direction: column; }
  .permission-role-grid { grid-template-columns: 1fr; padding: 12px; }
  .auth-card, .error-card { padding: 22px; }
  .snapshot-lines { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.summary-grid-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-grid-five {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin: 19px 0 0;
}
.page-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.payroll-period-bar { padding: 14px 18px; }
.period-query-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.period-query-form > div { width: min(100%, 220px); }
.period-context { flex: 1 1 280px; padding-bottom: 8px; color: var(--muted); font-size: 11px; }
.payroll-entry-form { display: grid; gap: 15px; }
.payroll-entry-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px 15px; }
.entry-field { min-width: 0; }
.entry-field-wide { grid-column: span 2; }
.entry-field .form-label { display: block; }
.entry-textarea { height: auto; min-height: 66px; resize: vertical; }
.entry-check-field { display: flex; align-items: center; padding: 8px 11px; border: 1px solid #e3eae6; border-radius: 6px; background: #f8faf9; }
.entry-check-field .form-check { margin: 0; }
.payroll-entry-form > .callout-note { font-size: 11px; }
.payroll-entry-form .form-footer { margin-top: 0; }
.entry-row-actions, .loan-row-actions, .advance-row-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 112px; }
.entry-row-actions form, .loan-row-actions form { margin: 0; }
.loan-row-actions .loan-status-form { display: grid; gap: 4px; width: 142px; padding: 8px; border: 1px solid #e3eae6; border-radius: 6px; background: #f8faf9; }
.loan-status-form .form-label { margin: 0; font-size: 9px; }
.loan-status-form .form-control { width: 100%; }
.loan-status-form .btn { white-space: nowrap; }
.loan-row-actions { gap: 7px; }
.advance-row-actions form { margin: 0; }
.advance-status-form { display: grid; gap: 4px; width: 142px; padding: 8px; border: 1px solid #e3eae6; border-radius: 6px; background: #f8faf9; }
.advance-status-form .form-label { margin: 0; font-size: 9px; }
.advance-status-form .form-control { width: 100%; }
.advance-status-form .btn { white-space: nowrap; }
.advance-row-actions-group { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.advance-row-actions-group .btn { height: 28px; padding: 0 8px; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; }
.advance-cause-text { max-width: 260px; line-height: 1.35; color: var(--ink); font-size: 12.5px; }
.advance-select-col { vertical-align: middle !important; }
.advance-select-col .form-check-input { margin: 0; cursor: pointer; }
.advance-bulk-action-bar { background: #f0f7f3 !important; border-color: #d1e5db !important; transition: all .2s ease; }
.advances-toolbar .form-control, .advances-toolbar .form-select { height: 31px; font-size: 12px; }
.advances-pagination-bar { background: #fafbfa; }
.advances-pagination-bar .btn { height: 28px; padding: 0 10px; font-size: 11px; }

/* Anticipos: misma jerarquía en el primer render y las filas actualizadas por AJAX. */
#advancesTable { min-width: 1040px; table-layout: fixed; }
#advancesTable .advance-employee-heading { width: 180px; }
#advancesTable .advance-amount-heading { width: 140px; text-align: right; }
#advancesTable .advance-dates-heading { width: 155px; white-space: normal; line-height: 1.4; }
#advancesTable .advance-status-heading { width: 160px; }
#advancesTable > thead > tr > th { vertical-align: middle; }
#advancesTable > tbody > tr > td { padding: 14px 12px; }
#advancesTable .advance-select-col { width: 34px; }
#advancesTable .advance-employee-cell { min-width: 180px; }
#advancesTable .roster-emp-meta { align-items: center; gap: 10px; }
#advancesTable .roster-avatar { width: 30px; height: 30px; flex: 0 0 30px; font-size: 10px; }
#advancesTable .emp-name { font-size: 12px; line-height: 1.4; }
#advancesTable .advance-cause-text { min-width: 145px; max-width: 230px; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
#advancesTable .advance-amount-cell { min-width: 140px; text-align: right; white-space: nowrap; }
#advancesTable .advance-amount-cell strong { font-size: 12px !important; font-weight: 700; }
#advancesTable .advance-actions-heading { width: 200px; min-width: 200px; text-align: center; }
#advancesTable .advance-actions-cell { width: 200px; min-width: 200px; }
#advancesTable .advance-row-actions-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 176px; align-items: center; margin-left: auto; }
#advancesTable .advance-row-actions-group > .btn { width: 100%; height: 32px; min-height: 32px; padding: 0 8px; font-size: 11px; line-height: 1.2; }
#advancesTable .advance-row-actions-group > :only-child { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
#advancesTable .advance-row-actions-group > .btn-advance-change-status { color: #8b3934; border-color: transparent; background: transparent; }
#advancesTable .advance-row-actions-group > .btn-advance-change-status:hover { color: #702a26; border-color: #e5ccc9; background: #fbefed; }
#advancesTable .advance-row-actions-group > .btn-advance-change-status:focus-visible { outline: 2px solid #8b3934; outline-offset: 2px; box-shadow: none; }
#advancesTable .state-badge { white-space: nowrap; }
@media (min-width: 769px) and (max-width: 1399px) {
  #advancesTable { min-width: 920px; }
  #advancesTable .advance-employee-heading { width: 150px; }
  #advancesTable .advance-employee-cell { min-width: 0; }
  #advancesTable .advance-amount-heading, #advancesTable .advance-amount-cell { width: 120px; min-width: 0; }
  #advancesTable .advance-dates-heading { width: 130px; }
  #advancesTable .advance-status-heading { width: 152px; }
  #advancesTable .advance-actions-heading, #advancesTable .advance-actions-cell { width: 184px; min-width: 184px; }
  #advancesTable .advance-row-actions-group { width: 160px; }
  #advancesTable .advance-cause-text { min-width: 0; }
}
.payroll-entry-heading .eyebrow { margin-bottom: 5px; }
.employee-picker { position: relative; }
.employee-picker-selected { min-height: 42px; border-color: #d1ded8 !important; }
.employee-picker-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 195px;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: #ffffff;
  border: 1px solid #d1ded8;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(18, 48, 38, 0.12);
  z-index: 1060;
  margin-top: 4px;
}
.employee-picker-results {
  max-height: 195px;
  overflow-y: auto;
  overflow-x: hidden;
}
.employee-picker-results .list-group-item {
  border-left: 0;
  border-right: 0;
  cursor: pointer;
  padding: 8px 12px;
  transition: background .15s ease;
}
.employee-picker-results .list-group-item:hover { background-color: #f0f7f3; }
.employee-picker-results .list-group-item:first-child { border-top: 0; }
.employee-picker-results .list-group-item:last-child { border-bottom: 0; }

/* Responsive adaptativo para tarjetas de resumen */
@media (min-width: 1441px) {
  .summary-grid-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1440px) {
  .summary-grid-five {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .summary-grid-five .kpi-deferred {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #ffffff 0%, #faf5ff 100%);
    border-color: #d8b4fe;
  }
  .summary-grid-five .kpi-deferred .kpi-deferred-layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .summary-grid-five .kpi-deferred-val {
    text-align: right;
    flex-shrink: 0;
  }
  .summary-grid-five .kpi-deferred-val > strong {
    margin: 0;
    color: #6b21a8;
  }
}

@media (max-width: 1024px) {
  .summary-grid-three,
  .summary-grid-four,
  .summary-grid-five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .summary-grid-five .kpi-deferred {
    grid-column: 1 / -1;
  }
}

@media (max-width: 580px) {
  .summary-grid-three,
  .summary-grid-four,
  .summary-grid-five,
  .summary-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .summary-grid-five .kpi-deferred .kpi-deferred-layout {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .summary-grid-five .kpi-deferred-val {
    text-align: left;
  }
}

@media (max-width: 768px) {
  .page-heading-actions { justify-content: flex-start; }
  .period-query-form { align-items: stretch; flex-direction: column; }
  .period-query-form > div { width: 100%; }
  .period-context { flex-basis: auto; padding-bottom: 0; }
  .payroll-period-bar { padding: 13px 14px; }
  .payroll-entry-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .entry-field-wide { grid-column: auto; }
  .loan-row-actions { min-width: 130px; }
  .advance-row-actions { min-width: 130px; }
}

/* ========================================================
   PORTAL DEL EMPLEADO - ESTILOS DEL DASHBOARD Y PORTADA
   ======================================================== */
.portal-hero-card {
  position: relative;
  background: linear-gradient(135deg, #103847 0%, #164e63 50%, #0f766e 100%) !important;
  border-radius: 12px;
  padding: 24px 28px;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(18, 59, 74, 0.12);
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  overflow: hidden;
}
.portal-hero-card::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.portal-hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.portal-hero-avatar-img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  display: block;
}
.portal-hero-avatar-initials {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #ffffff;
  color: #103847;
  font-size: 28px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  text-transform: uppercase;
}
.portal-hero-name {
  color: #ffffff !important;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.portal-hero-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 650;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  letter-spacing: 0.02em;
}
.portal-hero-badge-status {
  background: #15803d;
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.portal-hero-role {
  color: #d1fae5 !important;
  font-size: 13.5px;
  font-weight: 600;
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.portal-hero-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 10px;
  font-size: 12.5px;
  color: #e0f2f1 !important;
  font-weight: 500;
}
.portal-hero-contact span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.portal-hero-contact svg {
  width: 14px;
  height: 14px;
  opacity: 0.85;
  flex-shrink: 0;
}
.portal-hero-btn {
  background: #ffffff !important;
  color: #103847 !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  padding: 8px 16px !important;
  border-radius: 7px !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.portal-hero-btn:hover {
  background: #f0fdf4 !important;
  color: #064e3b !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

/* KPI Cards */
.portal-kpis-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1300px) {
  .portal-kpis-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 860px) {
  .portal-kpis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 540px) {
  .portal-kpis-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.portal-kpi-card {
  position: relative;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(18, 59, 74, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.portal-kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(18, 59, 74, 0.12);
  border-color: #94a3b8;
}
.portal-kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.portal-kpi-card.kpi-disponible {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 50%);
  border-color: #86efac;
}
.portal-kpi-card.kpi-disponible::before { background: linear-gradient(90deg, #10b981, #059669); }
.portal-kpi-card.kpi-anticipos::before { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.portal-kpi-card.kpi-bonos::before { background: linear-gradient(90deg, #0d9488, #2dd4bf); }
.portal-kpi-card.kpi-deducciones::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.portal-kpi-card.kpi-permisos::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-title {
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #475569;
}
.portal-stat-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.pill-emerald { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.pill-blue { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.pill-green { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.pill-amber { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.pill-purple { background: #faf5ff; color: #6d28d9; border: 1px solid #e9d5ff; }

.kpi-value {
  font-size: 24px;
  font-weight: 800;
  color: #0f272e;
  line-height: 1.15;
  margin: 0 0 6px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi-value.kpi-value-money {
  font-size: 21px;
  word-break: break-word;
}
.kpi-subtext {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
  margin: 0;
  min-height: 38px;
}
.kpi-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}
.kpi-tag-amber {
  background: #fffbeb;
  color: #92400e;
  border-color: #fde68a;
}
.kpi-tag-purple {
  background: #faf5ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}
.kpi-action-row {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #edf2f0;
}

/* Activity Panels */
.portal-activity-panel {
  background: #ffffff;
  border: 1.5px solid #d9e2e0;
  border-radius: 11px;
  box-shadow: 0 3px 12px rgba(18, 59, 74, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.portal-activity-header {
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid #e8edeb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.portal-activity-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: #0f272e;
  display: flex;
  align-items: center;
  gap: 8px;
}
.portal-activity-body {
  flex: 1 1 auto;
}
.portal-empty-state {
  padding: 32px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.portal-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f0f7f5;
  color: #0f766e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.portal-empty-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 4px;
}
.portal-empty-desc {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 14px;
  max-width: 280px;
}
.portal-activity-footer {
  padding: 10px 18px;
  background: #f8faf9;
  border-top: 1px solid #e8edeb;
  font-size: 11.5px;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* --- CENTRO DE NOTIFICACIONES Y CAMPANA TOPBAR --- */
.topbar-notifications {
  display: flex;
  align-items: center;
}
.topbar-bell-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  outline: none;
}
.topbar-bell-btn:hover, .topbar-bell-btn:focus {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f766e;
}
.topbar-bell-btn .bell-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  display: block;
  flex-shrink: 0;
  color: #334155;
}
.topbar-bell-btn:hover .bell-icon {
  color: #0f766e;
}
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #e11d48;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(225, 29, 72, 0.3);
}
.notification-dropdown {
  width: 340px;
  max-width: 92vw;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-top: 8px !important;
}
.notification-dropdown-item {
  transition: background 0.15s ease;
  cursor: pointer;
}
.notification-dropdown-item:hover {
  background-color: #f8fafc;
}
.notification-dropdown-item.unread {
  background-color: rgba(15, 118, 110, 0.05);
}
.notification-dropdown-item.unread:hover {
  background-color: rgba(15, 118, 110, 0.09);
}
.notif-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}
.notification-dropdown-item.unread .notif-indicator-dot {
  background: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}

.notif-empty-state {
  padding: 48px 24px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.notif-empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.notif-empty-icon svg {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
  display: block;
  flex-shrink: 0;
}
.notification-tabs .nav-link svg,
.btn-teal svg,
.btn-outline-teal svg {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  min-height: 15px !important;
  max-width: 15px !important;
  max-height: 15px !important;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}

.notification-card {
  transition: all 0.2s ease;
  border-left: 3px solid #cbd5e1 !important;
}
.notification-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.notification-card.is-unread {
  border-left: 3px solid #0f766e !important;
  background: #fafdfc !important;
}
.notif-dot-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
  flex-shrink: 0;
}
.notif-dot-indicator.active {
  background: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}
.notification-tabs .nav-link {
  font-size: 13.5px;
  font-weight: 600;
  color: #64748b;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 18px;
  transition: all 0.2s ease;
}
.notification-tabs .nav-link:hover {
  color: #0f766e;
}
.notification-tabs .nav-link.active {
  color: #0f766e;
  border-bottom: 2px solid #0f766e;
  background: transparent;
}
.btn-teal {
  background-color: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}
.btn-teal:hover, .btn-teal:focus {
  background-color: #0d655f;
  border-color: #0d655f;
  color: #ffffff;
}
.btn-outline-teal {
  border-color: #0f766e;
  color: #0f766e;
}
.btn-outline-teal:hover, .btn-outline-teal:focus {
  background-color: #0f766e;
  border-color: #0f766e;
  color: #ffffff;
}
.bg-teal { background-color: #0f766e !important; color: #ffffff !important; }
.bg-teal-light { background-color: #ccfbf1 !important; color: #0f766e !important; }
.bg-purple-light { background-color: #f3e8ff !important; color: #7e22ce !important; }
.bg-emerald-light { background-color: #d1fae5 !important; color: #065f46 !important; }
.bg-rose-light { background-color: #ffe4e6 !important; color: #be123c !important; }
.bg-amber-light { background-color: #fef3c7 !important; color: #b45309 !important; }
.bg-slate-light { background-color: #f1f5f9 !important; color: #475569 !important; }

.payroll-firm-action { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--green-soft); }
.payroll-firm-action p { margin: 0; color: var(--green); font-size: 12px; }
.payroll-firm-action form { flex: 0 0 auto; }
.payroll-firm-action-closed { background: var(--surface-alt); }
.receipt-brand-form, .receipt-filter-form, .receipt-issue-form { display: grid; gap: 14px; padding: 17px 20px; }
.receipt-brand-fields { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr) minmax(140px, .65fr) minmax(210px, 1fr); gap: 12px; align-items: end; }
.receipt-brand-fields > div, .receipt-filter-form > div, .receipt-issue-form > div { min-width: 0; }
.receipt-brand-logo-row { display: flex; align-items: center; gap: 16px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.receipt-brand-logo-row img { width: auto; max-width: 190px; height: 66px; object-fit: contain; }
.receipt-filter-form { grid-template-columns: minmax(140px, .65fr) minmax(200px, 1fr) minmax(180px, 1fr) auto; align-items: end; }
.receipt-issue-form { grid-template-columns: minmax(240px, 1fr) auto; align-items: end; border-top: 1px solid var(--line); background: #fbfcfb; }
.receipt-format-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; padding: 13px 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt); color: var(--ink); font-size: 11px; }
.receipt-format-note span { color: var(--muted); }
.employee-receipt-history-modal { z-index: 1085; }
.employee-receipt-history-modal .modal-dialog { max-width: min(1000px, calc(100vw - 28px)); }
.preview-context-card { background: #f8faf9; border: 1px solid #e1e8e6; }
.preview-calendar-badge { font-size: 13px; font-weight: 600; color: #172d33; }
.preview-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.preview-kpi-box { background: #ffffff; border: 1px solid #e1e8e6; border-radius: 9px; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 1px 3px rgba(18, 48, 54, 0.04); position: relative; overflow: hidden; }
.preview-kpi-box::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: #607d8b; }
.preview-kpi-box.kpi-salary::before { background: #546e7a; }
.preview-kpi-box.kpi-income::before { background: #2e7d32; }
.preview-kpi-box.kpi-deductions::before { background: #e65100; }
.preview-kpi-box.kpi-net::before { background: #1565c0; }
.preview-kpi-box span { font-size: 10px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: #5f7478; }
.preview-kpi-box strong { font-size: 17px; font-weight: 750; color: #172d33; font-variant-numeric: tabular-nums; line-height: 1.25; }
.preview-kpi-box.kpi-net strong { color: #0d47a1; }
.preview-kpi-box.kpi-income strong { color: #1b5e20; }
.preview-kpi-box.kpi-deductions strong { color: #bf360c; }
.badge-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; vertical-align: middle; }
.receipt-history-loading { color: var(--muted); }
.receipt-history-empty { padding: 12px 0; color: var(--muted); }
.receipt-history-note { margin-top: 13px; color: var(--muted); font-size: 10px; }
.receipt-history-table { min-width: 740px; }
.receipt-print-view { min-height: 100vh; padding: 22px; color: var(--ink); background: var(--paper); }
.receipt-print-actions { display: flex; width: min(190mm, 100%); flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 auto 16px; }
.receipt-print-actions p { flex: 1 1 100%; margin: 0 0 2px; color: var(--muted); font-size: 12px; }
.receipt-document { display: flex; width: 198mm; max-width: 100%; min-height: 128mm; flex-direction: column; margin: 0 auto 16px; padding: 5mm 8mm 6mm; color: #000; background: #fff; font-family: "Yu Gothic UI Semibold", "Segoe UI Semibold", "Segoe UI", Arial, sans-serif; font-size: 9.5pt; line-height: 1.25; border: 1px solid #d0d7de; box-shadow: 0 4px 14px rgba(0,0,0,0.06); box-sizing: border-box; }
.receipt-document-head { display: flex; align-items: center; gap: 8mm; padding-bottom: 5mm; border-bottom: 1px solid #64767a; }
.receipt-document-logo { display: block; flex: 0 0 auto; width: auto; max-width: 32mm; height: auto; max-height: 26mm; object-fit: contain; }
.receipt-institution { flex: 1 1 auto; text-align: center; }
.receipt-institution h1 { margin: 0; color: #163d48; font-size: 15pt; font-weight: 700; line-height: 1.25; }
.receipt-institution p { margin: 2px 0 0; color: #40575d; font-size: 8.5pt; }
.receipt-document-title { margin: 6mm 0 4mm; color: #172d33; font-size: 12pt; font-weight: 650; text-align: center; text-transform: uppercase; }
.receipt-identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5mm 8mm; margin-bottom: 5mm; padding: 3mm 0; border-top: 1px solid #c3cece; border-bottom: 1px solid #c3cece; }
.receipt-identity-grid > div { display: grid; grid-template-columns: 34mm minmax(0, 1fr); gap: 3mm; }
.receipt-identity-grid span { color: #52666b; font-size: 8.5pt; }
.receipt-identity-grid strong { overflow-wrap: anywhere; color: #172d33; font-size: 9pt; font-weight: 650; }
.receipt-worker { grid-column: 1 / -1; }
.receipt-breakdown-table { width: 100%; border-collapse: collapse; }
.receipt-breakdown-table .receipt-income-amount-column, .receipt-breakdown-table .receipt-total-column { width: 32mm; }
.receipt-breakdown-table th, .receipt-breakdown-table td { padding: 2.2mm 2.5mm; border: 0; vertical-align: top; }
.receipt-breakdown-table thead th { border-top: 1px solid #526167; border-bottom: 1px solid #526167; color: #172d33; background: #fff; font-size: 9pt; font-weight: 700; }
.receipt-breakdown-table .receipt-amount-heading, .receipt-breakdown-table .receipt-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.receipt-breakdown-table .receipt-benefits-total { font-weight: 700; }
.receipt-breakdown-table .receipt-section-total th, .receipt-breakdown-table .receipt-section-total td { border-top: 1px solid #526167; border-bottom: 1px solid #526167; font-weight: 700; }
.receipt-breakdown-table .receipt-section-label th { padding-block: 3.5mm; border-bottom: 1px solid #526167; color: #172d33; background: #fff; text-align: center; }
.receipt-breakdown-table .receipt-deduction-total th, .receipt-breakdown-table .receipt-deduction-total td { border-top: 1px solid #526167; border-bottom: 1px solid #526167; }
.receipt-breakdown-table .receipt-net-row th, .receipt-breakdown-table .receipt-net-row td { border-bottom: 1px solid #526167; color: #172d33; background: #fff; font-size: 11pt; font-weight: 700; }
.receipt-cause { display: block; margin-top: 1mm; color: #53676c; font-size: 8pt; }
.receipt-signature-block { width: min(100%, 100mm); margin: auto auto 0; padding-top: 17mm; text-align: center; }
.receipt-signature-block p { margin: 0 0 15mm; font-weight: 650; }
.receipt-signature-line { border-top: 1px solid #485c60; }
.receipt-signature-meta { display: flex; justify-content: space-between; gap: 12mm; padding-top: 2mm; color: #43595e; font-size: 8pt; }

/* Estilos de Réplica Exacta para Recibo Oficial de Bonos y Ayudas (Media Carta Horizontal) */
.receipt-official-format { position: relative; }
.receipt-official-header { position: relative; display: flex; align-items: flex-start; justify-content: center; margin-bottom: 2mm; min-height: 18mm; }
.receipt-official-logo-box { position: absolute; left: 0; top: 0; width: 22mm; height: 18mm; display: flex; align-items: center; justify-content: flex-start; }
.receipt-official-logo { max-width: 100%; max-height: 100%; object-fit: contain; }
.receipt-official-headings { flex: 1; text-align: center; margin: 0 24mm; }
.receipt-official-school-name { margin: 0; font-size: 14pt; font-weight: 700; color: #000; line-height: 1.15; font-family: "Yu Gothic UI Semibold", "Segoe UI", Arial, sans-serif; }
.receipt-official-school-address { margin: 1.2mm 0 0.4mm; font-size: 8.5pt; color: #000; font-weight: 400; line-height: 1.2; }
.receipt-official-school-rif { margin: 0 0 1.2mm; font-size: 8.5pt; color: #000; font-weight: 400; line-height: 1.2; }
.receipt-official-doc-title { margin: 1.2mm 0 0; font-size: 11pt; font-weight: 600; color: #000; letter-spacing: 0.16em; text-transform: uppercase; }
.receipt-official-date-row { margin: 1.8mm 0 1.2mm; text-align: left; font-size: 9pt; font-weight: 700; color: #000; }
.receipt-official-worker-box { background-color: #95b3d7 !important; border-top: 1px solid #000; border-bottom: 2px solid #000; border-left: 1px solid #000; border-right: 1px solid #000; padding: 1.2mm 2.5mm; margin-bottom: 0; display: flex; flex-direction: column; gap: 0.8mm; font-size: 9pt; color: #000; }
.receipt-official-worker-row { display: flex; align-items: baseline; gap: 3mm; }
.receipt-worker-lbl { font-weight: 700; min-width: 16mm; }
.receipt-worker-row-name .receipt-worker-lbl { min-width: 44mm; }
.receipt-worker-val { color: #000; font-weight: 700; }
.receipt-official-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 9pt; color: #000; border-left: 2px solid #000; border-right: 2px solid #000; }
.receipt-col-concept { width: 38%; }
.receipt-col-amount-ind { width: 20%; }
.receipt-col-center { width: 18%; }
.receipt-col-total { width: 24%; }
.receipt-table-th-row th { padding: 1.2mm 2.5mm; font-weight: 700; font-size: 9pt; border-bottom: 2px solid #000; vertical-align: middle; color: #000; }
.receipt-th-concept { text-align: center; }
.receipt-th-total { text-align: right; padding-right: 4mm; }
.receipt-cell-concept { padding: 0.5mm 1.0mm; font-weight: 700; text-align: left; vertical-align: middle; }
.receipt-cell-ind { padding: 0.5mm 1.0mm; text-align: center; font-variant-numeric: tabular-nums; vertical-align: middle; }
/*.receipt-cell-framed { border: 1px solid #000; }*/
.receipt-cell-total-col { padding: 0.5mm 1.0mm; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; vertical-align: middle; }
.receipt-row-deductions-header td { padding: 1.4mm 2.5mm; text-align: center; font-weight: 700; font-size: 9.5pt; border-top: 2px solid #000; border-bottom: 2px solid #000; color: #000; }
.receipt-row-total-deductions { background-color: #c5d9f1 !important; border-top: 1px solid #000; border-bottom: 2px solid #000; }
.receipt-cell-total-lbl { padding: 1.4mm 2.5mm; font-weight: 700; text-align: left; vertical-align: middle; }
.receipt-cell-center-dash { padding: 0.5mm 1.0mm; font-weight: 700; text-align: center; vertical-align: middle; }
.receipt-row-net-pay { border-bottom: 1px solid #000; }
.receipt-cell-net-lbl { padding: 1.6mm 2.5mm; font-weight: 700; text-align: left; vertical-align: middle; }
.receipt-cell-net-val-col { padding: 1mm 2.5mm; text-align: right; vertical-align: middle; }
.receipt-net-val-box { display: inline-block; min-width: 32mm; padding: 1mm 3mm; background-color: #d9d9d9 !important; border: 1px solid #000; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.receipt-official-footer { margin-top: 4.5mm; display: grid; grid-template-columns: 32% 38% 30%; align-items: start; font-size: 9pt; color: #000; }
.receipt-footer-recibido { font-size: 9.5pt; font-weight: 700; padding-top: 1.5mm; text-align:right; }
.receipt-footer-signature-center { grid-column: 2 / 3; text-align: center; }
.receipt-footer-signature-line { border-top: 2px solid #000; width: 100%; margin: 5.5mm 0 1mm; }
.receipt-footer-signature-title { font-size: 9pt; font-weight: 400; text-align: center; margin-bottom: 1.5mm; }
.receipt-footer-ci-line { font-size: 9pt; font-weight: 400; text-align: left; padding-top: 0.5mm; }

@media screen and (max-width: 768px) {
  .payroll-firm-action { align-items: stretch; flex-direction: column; gap: 10px; padding: 13px 14px; }
  .payroll-firm-action form, .payroll-firm-action .btn { width: 100%; }
  .receipt-brand-form, .receipt-filter-form, .receipt-issue-form { padding-inline: 14px; }
  .receipt-brand-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .receipt-brand-fields > div:first-child, .receipt-brand-fields > div:nth-child(2) { grid-column: 1 / -1; }
  .receipt-filter-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .receipt-filter-form > button { width: 100%; }
  .receipt-issue-form { grid-template-columns: minmax(0, 1fr); }
  .receipt-issue-form > button { width: 100%; }
  .receipt-print-view { padding: 14px; }
  .receipt-document { width: 100%; min-height: 0; padding: 22px 18px; border: 1px solid var(--line-strong); font-size: 12px; }
  .receipt-document-head { gap: 14px; padding-bottom: 14px; }
  .receipt-document-logo { max-width: 72px; max-height: 60px; }
  .receipt-institution h1 { font-size: 15px; }
  .receipt-institution p { font-size: 10px; }
  .receipt-document-title { margin: 18px 0 12px; font-size: 13px; }
  .receipt-identity-grid { gap: 9px 12px; margin-bottom: 14px; padding: 10px 0; }
  .receipt-identity-grid > div { grid-template-columns: minmax(70px, 34%) minmax(0, 1fr); gap: 6px; }
  .receipt-identity-grid span, .receipt-identity-grid strong { font-size: 10px; }
  .receipt-breakdown-table th, .receipt-breakdown-table td { padding: 8px 7px; }
  .receipt-breakdown-table .receipt-income-amount-column, .receipt-breakdown-table .receipt-total-column { width: 82px; }
  .receipt-signature-block { padding-top: 70px; }
}

/* Ficha y Modal de Perfil de Empleado */
.profile-modal-tabs-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.profile-modal-tabs-bar .nav-pills .nav-link {
  color: #475569;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  transition: all 0.15s ease-in-out;
}
.profile-modal-tabs-bar .nav-pills .nav-link:hover {
  color: #0f766e;
  background: #f1f5f9;
}
.profile-modal-tabs-bar .nav-pills .nav-link.active {
  background-color: #0f766e;
  color: #ffffff;
  box-shadow: 0 2px 5px rgba(15, 118, 110, 0.2);
}
.profile-section-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.profile-section-card .card-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
}
.profile-section-card .card-body {
  padding: 16px;
}
.profile-op-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.profile-op-box:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   MEJORAS VISUALES Y JERÁRQUICAS (Módulos de Gestión: Personal, Recibos, Nóminas, Anticipos, Descuentos)
   ========================================================================== */
.summary-panel {
  position: relative;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}
.summary-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #94a3b8;
}
.summary-panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.06);
  border-color: #cbd5e1;
}
.summary-panel.kpi-amber::before { background: linear-gradient(90deg, #d97706, #fbbf24); }
.summary-panel.kpi-green::before { background: linear-gradient(90deg, #059669, #34d399); }
.summary-panel.kpi-blue::before  { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.summary-panel.kpi-purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.summary-panel.kpi-teal::before   { background: linear-gradient(90deg, #0d9488, #2dd4bf); }

.summary-panel > span {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.summary-panel > strong {
  display: block;
  margin: 6px 0 2px;
  color: #0f172a;
  font-size: clamp(19px, 1.4vw, 25px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary-panel > small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
}

/* Avatares con iniciales */
.roster-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f2fe 0%, #dbeafe 100%);
  color: #0284c7;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: -0.02em;
  border: 1px solid #bae6fd;
}
.roster-emp-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.roster-emp-meta .emp-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.3;
}
.roster-emp-meta .emp-id {
  font-size: 11px;
  color: #64748b;
  font-family: inherit;
}

/* Badges con semántica jerárquica */
.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.state-ok {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.state-pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.state-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.state-neutral {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #e2e8f0;
}

/* Filtros modernos */
.modern-filter-panel {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 20px;
}
.modern-filter-panel .form-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  margin-bottom: 5px;
}
.modern-filter-panel .form-control,
.modern-filter-panel .form-select {
  border-color: #cbd5e1;
  font-size: 12.5px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.modern-filter-panel .form-control:focus,
.modern-filter-panel .form-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* Tablas con mejor espaciado y legibilidad */
.app-table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: middle;
}
.app-table tbody td {
  padding: 12px 14px;
  font-size: 12.5px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.app-table tbody tr:hover {
  background-color: #f8fafc;
}
.table-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

/* Tarjeta estructurada con encabezado suave */
.structured-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  margin-bottom: 20px;
  overflow: hidden;
}
.structured-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.structured-card-header h2,
.structured-card-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 8px;
}
.structured-card-header p {
  margin: 2px 0 0;
  font-size: 11px;
  color: #64748b;
}
.structured-card-body {
  padding: 20px;
}

/* Recibos y Brand Box */
.receipt-logo-preview-box {
  width: 130px;
  height: 90px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 8px;
  overflow: hidden;
}
.receipt-logo-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Nóminas - Bloque de tasas */
.rates-ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.rate-ticker-card {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
.rate-ticker-card .rate-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
}
.rate-ticker-card .rate-val {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

@page { size: 215.9mm 139.7mm landscape; margin: 4mm 8mm 4mm 8mm; }
@media print {
  html, body { width: 100% !important; min-width: 0 !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.app-body { display: block !important; min-height: 0 !important; color: #000 !important; font-size: 9pt !important; }
  .app-sidebar, .app-topbar, .page-toast-stack, .app-mobile-nav, .receipt-print-actions { display: none !important; }
  .receipt-preview-warning { display: none !important; }
  .app-shell, .app-main-wrap { display: block !important; width: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; }
  .app-content { width: auto !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; }
  .receipt-print-view { min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .receipt-document { width: 198mm !important; max-width: 198mm !important; min-height: 0 !important; max-height: 128mm !important; margin: 0 auto !important; padding: 1mm 0 0 !important; font-size: 8.5pt !important; line-height: 1.2 !important; break-inside: avoid !important; page-break-inside: avoid !important; print-color-adjust: exact !important; -webkit-print-color-adjust: exact !important; border: none !important; box-shadow: none !important; }
  .receipt-official-header { margin-bottom: 1.5mm !important; min-height: 16mm !important; }
  .receipt-official-logo-box { width: 20mm !important; height: 16mm !important; }
  .receipt-official-headings { margin: 0 22mm !important; }
  .receipt-official-school-name { font-size: 13pt !important; }
  .receipt-official-school-address { font-size: 8pt !important; margin: 1mm 0 0.3mm !important; }
  .receipt-official-school-rif { font-size: 8pt !important; margin: 0 0 1mm !important; }
  .receipt-official-doc-title { font-size: 10.5pt !important; margin-top: 1mm !important; }
  .receipt-official-date-row { font-size: 8.5pt !important; margin: 1.2mm 0 1mm !important; }
  .receipt-official-worker-box { padding: 1mm 2mm !important; font-size: 8.5pt !important; background-color: #95b3d7 !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .receipt-official-table { font-size: 8.5pt !important; }
  .receipt-table-th-row th { padding: 1mm 2mm !important; font-size: 8.5pt !important; }
  .receipt-cell-concept { padding: 0.8mm 2mm !important; }
  .receipt-cell-ind { padding: 0.8mm 2mm !important; }
  .receipt-cell-total-col { padding: 0.8mm 2mm !important; }
  .receipt-row-deductions-header td { padding: 1mm 2mm !important; font-size: 8.5pt !important; }
  .receipt-row-total-deductions { background-color: #c5d9f1 !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .receipt-cell-total-lbl { padding: 1mm 2mm !important; }
  .receipt-cell-center-dash { padding: 1mm 2mm !important; }
  .receipt-cell-net-lbl { padding: 1.2mm 2mm !important; }
  .receipt-cell-net-val-col { padding: 0.8mm 2mm !important; }
  .receipt-net-val-box { background-color: #d9d9d9 !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; min-width: 30mm !important; padding: 0.8mm 2.5mm !important; }
  .receipt-official-footer { margin-top: 3.5mm !important; font-size: 8.5pt !important; }
  .receipt-footer-recibido { font-size: 9pt !important; }
  .receipt-document:not(:last-child) { break-after: page; page-break-after: always; }
}

/* Modal de previsualización de recibo oficial */
.receipt-modal-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 8px 0;
}
.receipt-modal-wrapper .receipt-document {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  max-width: 100%;
}
.employee-receipt-official-preview-modal .modal-body {
  background-color: #e2e8f0;
}

/* Evitar desbordamiento en contenedor de disponibilidad y sobregiro de anticipos */
[data-advance-availability] {
  max-width: 100% !important;
  overflow: hidden !important;
}

[data-advance-availability-limit] {
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Selectores compactos para Cédula y Teléfono en Input Groups */
.input-group .select-prefix-cedula {
  width: 76px !important;
  min-width: 76px !important;
  max-width: 76px !important;
  flex: 0 0 76px !important;
  padding-left: 12px !important;
  padding-right: 22px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f3946 !important;
  background-color: #f8faf9 !important;
  background-position: right 8px center !important;
  background-size: 9px 6px !important;
  border-color: #c8d5d3 !important;
  cursor: pointer;
}

.input-group .select-prefix-phone {
  width: 110px !important;
  min-width: 110px !important;
  max-width: 110px !important;
  flex: 0 0 110px !important;
  padding-left: 10px !important;
  padding-right: 22px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #0f3946 !important;
  background-color: #f8faf9 !important;
  background-position: right 8px center !important;
  background-size: 9px 6px !important;
  border-color: #c8d5d3 !important;
  cursor: pointer;
}

.input-group .select-prefix-cedula:focus,
.input-group .select-prefix-phone:focus {
  z-index: 5;
  background-color: #fff !important;
  border-color: var(--petrol-light) !important;
  box-shadow: 0 0 0 .18rem rgba(35,122,120,.14) !important;
}

/* Centro de Reportes: KPIs e Impresión */
.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.report-kpi-card {
  background: #ffffff;
  border: 1px solid #dce5e3;
  border-radius: 10px;
  padding: 14px 16px;
  border-top: 3px solid #0f3443;
  box-shadow: 0 2px 6px rgba(15, 52, 67, 0.04);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-kpi-card[data-tone="success"] { border-top-color: #198754; }
.report-kpi-card[data-tone="warning"] { border-top-color: #d97706; }
.report-kpi-card[data-tone="danger"] { border-top-color: #dc3545; }
.report-kpi-card[data-tone="info"] { border-top-color: #0dcaf0; }
.report-kpi-card[data-tone="neutral"] { border-top-color: #6c757d; }
.report-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #53686d;
}
.report-kpi-value {
  font-size: 20px;
  font-weight: 750;
  color: #0f2933;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.report-kpi-sub {
  font-size: 11.5px;
  color: #6b7d83;
}
@media print {
  .sidebar, .topbar, .report-controls-no-print, #reportTypeTabs { display: none !important; }
  .app-shell, .main-column, .page-content { margin: 0 !important; padding: 0 !important; width: 100% !important; max-width: 100% !important; }
  .data-panel { border: none !important; box-shadow: none !important; }
  body { background: #fff !important; font-size: 11px !important; }
}

/* Reporte de Dispersión de Pagos (Modal y PDF) */
.payments-pdf-sheet {
  max-width: 1060px;
  margin: 0 auto;
  padding: 28px 32px;
  background: #ffffff;
  color: #162a30;
  font-family: 'Segoe UI', Arial, sans-serif;
  border: 1px solid #d6e0dd;
  border-radius: 6px;
  box-shadow: 0 6px 22px rgba(15, 52, 67, 0.08);
}
.payments-pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 2.5px solid #0f3443;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
.payments-pdf-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.payments-pdf-logo-box {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8faf9;
  border: 1px solid #e1e8e6;
  border-radius: 8px;
  padding: 4px;
}
.payments-pdf-logo-box img {
  max-height: 54px;
  max-width: 56px;
  object-fit: contain;
}
.payments-pdf-school {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0f3443;
  letter-spacing: -0.01em;
}
.payments-pdf-meta-line {
  font-size: 10.5px;
  color: #546970;
  margin-top: 2px;
}
.payments-pdf-docbox {
  text-align: right;
  background: #f4f8f7;
  border: 1px solid #d4e2df;
  border-left: 4px solid #0f3443;
  border-radius: 6px;
  padding: 8px 14px;
}
.payments-pdf-doctitle {
  font-size: 11px;
  font-weight: 800;
  color: #0f3443;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.payments-pdf-docversion {
  font-size: 12px;
  font-weight: 700;
  color: #1b4d5e;
  margin-top: 2px;
}
.payments-pdf-docdate {
  font-size: 10px;
  color: #5c7278;
  margin-top: 2px;
}
.payments-pdf-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.payments-pdf-kpi {
  border-radius: 6px;
  padding: 10px 14px;
  border: 1px solid #d5e0e6;
  border-top-width: 3px;
  background: #f4f7f9;
}
.payments-pdf-kpi.kpi-green { background: #f0f7f4; border-color: #c6e0d5; border-top-color: #198754; }
.payments-pdf-kpi.kpi-teal { background: #f4f7f9; border-color: #d5e0e6; border-top-color: #0f3443; }
.payments-pdf-kpi.kpi-blue { background: #f4f7fb; border-color: #d4e0ef; border-top-color: #0d6efd; }
.payments-pdf-kpi.kpi-cyan { background: #f3f9fb; border-color: #cfe6ee; border-top-color: #0dcaf0; }
.payments-pdf-kpi-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #465f66;
}
.payments-pdf-kpi.kpi-green .payments-pdf-kpi-label { color: #146c43; }
.payments-pdf-kpi.kpi-blue .payments-pdf-kpi-label { color: #0a58ca; }
.payments-pdf-kpi.kpi-cyan .payments-pdf-kpi-label { color: #087990; }
.payments-pdf-kpi-val {
  font-size: 17px;
  font-weight: 800;
  color: #0f3443;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.payments-pdf-kpi.kpi-green .payments-pdf-kpi-val { color: #0f3d28; }
.payments-pdf-kpi-sub { font-size: 11px; font-weight: 600; }
.payments-pdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
}
.payments-pdf-table thead tr {
  background: #0f3443;
  color: #ffffff;
}
.payments-pdf-table thead th {
  padding: 8px 8px;
  border: 1px solid #0f3443;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
}
.payments-pdf-table thead th.col-nro { width: 34px; text-align: center; }
.payments-pdf-table thead th.col-ced { width: 98px; }
.payments-pdf-table thead th.col-neto { width: 125px; text-align: right; }
.payments-pdf-table tbody tr:nth-child(even) { background: #f8fbfa; }
.payments-pdf-table tbody td {
  padding: 7px 8px;
  border: 1px solid #dce5e3;
  vertical-align: middle;
}
.payments-pdf-table tbody td.cell-nro { text-align: center; color: #5c7278; font-weight: 600; }
.payments-pdf-table tbody td.cell-ced { font-family: Consolas, monospace; color: #243b42; white-space: nowrap; }
.payments-pdf-table tbody td.cell-neto {
  text-align: right;
  font-weight: 800;
  font-size: 11px;
  color: #0f3443;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: #fcfdfd;
}
.payments-pdf-emp-name { font-weight: 700; color: #0f2933; font-size: 11px; }
.payments-pdf-emp-cat { font-size: 9.5px; color: #5c7278; }
.payments-pdf-bank-name { font-weight: 600; color: #17353d; font-size: 10px; }
.payments-pdf-bank-acc { font-family: Consolas, monospace; font-size: 10.5px; color: #364e54; letter-spacing: 0.03em; }
.payments-pdf-no-acc {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9.5px;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe69c;
  border-radius: 4px;
}
.payments-pdf-tfoot-row {
  background: #e6f0ee;
  border-top: 2px solid #0f3443;
}
.payments-pdf-tfoot-row td {
  padding: 9px 10px;
  border: 1px solid #b8c9c4;
  font-weight: 800;
  color: #0f3443;
}
.payments-pdf-tfoot-label { text-align: right; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.payments-pdf-tfoot-val { text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.payments-pdf-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 34px;
  padding-top: 10px;
}
.payments-pdf-sig-box { text-align: center; }
.payments-pdf-sig-line { border-top: 1.5px solid #485c60; margin: 28px 10px 6px; }
.payments-pdf-sig-title { font-size: 10px; font-weight: 700; color: #162a30; }
.payments-pdf-sig-role { font-size: 9px; color: #5c7278; }

/* =========================================================
   ESCRITORIO ADMINISTRATIVO TIPO WINDOWS (MENÚ TOP + VENTANAS)
   ========================================================= */
.win-desktop-body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  background: #edf2f4;
}
.win-iframe-body {
  background: #f5f7f6;
}
.win-iframe-content {
  padding: 18px 22px 28px !important;
  max-width: 100% !important;
}
.win-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}
.win-topbar {
  height: 54px;
  flex: 0 0 54px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  color: #0f2933;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid #d4e1de;
  box-shadow: 0 2px 12px rgba(15, 52, 67, 0.08);
  z-index: 1200;
}
.win-topbar-left {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}
.win-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #0f2933;
  flex-shrink: 0;
}
.win-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0f3443, #1a7a76);
  color: #ffffff;
  font-weight: 850;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 52, 67, 0.22);
}
.win-brand-text {
  font-weight: 750;
  font-size: 13.5px;
  line-height: 1.15;
  color: #0f2933;
  display: flex;
  flex-direction: column;
}
.win-brand-text small {
  font-size: 10px;
  font-weight: 500;
  color: #5b7178;
}
.win-menubar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.win-menu-item {
  background: transparent;
  border: 1px solid transparent;
  color: #16333c;
  font-size: 12.5px;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.win-menu-item:hover,
.win-menu-item[aria-expanded="true"] {
  background: #e9f3f1;
  border-color: #cde0dc;
  color: #0f3443;
}
.win-menu-dropdown { position: relative; }
.win-dropdown-menu {
  top: 100%;
  left: 0;
  right: auto;
  bottom: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #d4e0dd;
  border-radius: 10px;
  padding: 6px;
  min-width: 230px;
  margin-top: 6px !important;
}
.win-submenu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: #16333c;
  padding: 8px 12px;
  border-radius: 7px;
}
.win-submenu-item:hover {
  background: #e9f3f1;
  color: #0b2530;
}
.win-submenu-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a7a76;
  flex-shrink: 0;
}
.win-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.win-bell-btn {
  color: #0f3443 !important;
  background: #f3f7f6 !important;
  border-radius: 8px !important;
  border: 1px solid #d4e1de !important;
}
.win-user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f3f7f6;
  border: 1px solid #d4e1de;
  border-radius: 10px;
  padding: 4px 8px 4px 10px;
}
.win-user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.win-user-info span {
  font-size: 12px;
  font-weight: 700;
  color: #0f2933;
}
.win-user-info small {
  font-size: 10px;
  color: #5b7178;
}
.win-logout-btn {
  font-size: 11px;
  padding: 3px 9px;
  color: #0f3443 !important;
  border-color: #c4d5d1 !important;
  background: #ffffff !important;
}
.win-logout-btn:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

/* Escritorio y Fondo */
.win-desktop {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(circle at 18% 20%, #e4f0ee 0%, #eef4f6 45%, #e5ecf0 100%);
}
.win-desktop-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: safe center;
  justify-content: center;
  padding: 36px 32px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 14% 18%, rgba(35, 122, 120, 0.12) 0%, transparent 42%),
    radial-gradient(circle at 86% 80%, rgba(18, 59, 74, 0.10) 0%, transparent 45%),
    linear-gradient(135deg, #f3f8f8 0%, #eaf1f2 50%, #e4eded 100%);
}
.win-desktop-welcome {
  max-width: 1020px;
  width: 100%;
}
.win-desktop-hero {
  margin-bottom: 26px;
  padding: 26px 30px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 10px 30px rgba(15, 41, 51, 0.06);
}
.win-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(26, 122, 118, 0.1);
  color: #13615e;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.win-hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #1a7a76;
  box-shadow: 0 0 0 3px rgba(26, 122, 118, 0.22);
}
.win-desktop-hero h1 {
  font-size: 30px;
  font-weight: 800;
  color: #0f2933;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.win-desktop-hero p {
  color: #4b636b;
  font-size: 14px;
  max-width: 680px;
  margin-bottom: 0;
  line-height: 1.55;
}
.win-desktop-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.win-shortcut-card {
  position: relative;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(209, 224, 222, 0.9);
  border-radius: 16px;
  padding: 18px 20px;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(15, 52, 67, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  cursor: pointer;
}
.win-shortcut-card:hover {
  transform: translateY(-3px);
  background: #ffffff;
  box-shadow: 0 12px 26px rgba(15, 52, 67, 0.11);
  border-color: #1a7a76;
}
.win-shortcut-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.win-shortcut-icon.is-teal { background: rgba(26, 122, 118, 0.12); color: #166b67; }
.win-shortcut-icon.is-blue { background: rgba(37, 99, 235, 0.11); color: #1d4ed8; }
.win-shortcut-icon.is-emerald { background: rgba(16, 185, 129, 0.12); color: #047857; }
.win-shortcut-icon.is-amber { background: rgba(245, 158, 11, 0.13); color: #b45309; }
.win-shortcut-icon.is-indigo { background: rgba(79, 70, 229, 0.11); color: #4338ca; }
.win-shortcut-icon.is-rose { background: rgba(225, 29, 72, 0.10); color: #be123c; }
.win-shortcut-icon.is-cyan { background: rgba(6, 182, 212, 0.12); color: #0e7490; }
.win-shortcut-icon.is-slate { background: rgba(71, 85, 105, 0.12); color: #334155; }
.win-shortcut-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}
.win-shortcut-body strong {
  font-size: 15px;
  font-weight: 700;
  color: #0f2933;
}
.win-shortcut-body span {
  font-size: 12.5px;
  color: #5b7279;
  line-height: 1.4;
}
.win-shortcut-arrow {
  color: #8ba1a7;
  font-size: 16px;
  font-weight: 700;
  align-self: center;
  transition: transform 0.18s ease, color 0.18s ease;
}
.win-shortcut-card:hover .win-shortcut-arrow {
  transform: translateX(3px);
  color: #1a7a76;
}
.win-shortcut-card strong {
  font-size: 15px;
  font-weight: 750;
  color: #0f3443;
}
.win-shortcut-card span {
  font-size: 12px;
  color: #5b7076;
}

/* Ventana Flotante tipo Windows */
.os-window {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #b8cbc7;
  border-radius: 10px;
  box-shadow: 0 18px 46px rgba(10, 35, 44, 0.24);
  overflow: hidden;
  min-width: min(480px, 100%);
  min-height: min(320px, 100%);
  max-width: 100%;
  max-height: 100%;
  resize: both;
}
.os-window.is-active {
  border-color: #0f3443;
  box-shadow: 0 22px 54px rgba(10, 35, 44, 0.34);
}
.os-window.is-maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0;
  border: none;
  resize: none;
}
.os-window.is-minimized {
  display: none !important;
}
.os-window-header {
  height: 38px;
  flex: 0 0 38px;
  background: #e9f0ef;
  border-bottom: 1px solid #d1dedc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 14px;
  user-select: none;
  cursor: grab;
}
.os-window.is-active .os-window-header {
  background: linear-gradient(90deg, #0f3443 0%, #174c5e 100%);
  color: #ffffff;
  border-bottom-color: #0c2b38;
}
.os-window.is-maximized .os-window-header,
.os-window.has-child-modal .os-window-header {
  cursor: default;
}
.os-window-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.os-window-lock-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(255, 193, 7, 0.22);
  color: #ffe082;
  border: 1px solid rgba(255, 193, 7, 0.4);
  padding: 1px 7px;
  border-radius: 999px;
}
.os-window-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}
.os-win-btn {
  width: 28px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.12s ease;
}
.os-win-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.os-win-btn.btn-close-win:hover {
  background: #dc3545;
  color: #ffffff;
}
.os-window-body {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  position: relative;
  background: #f5f7f6;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.os-window-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.os-window-dom-content {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  background: #f5f7f6;
  padding: 24px clamp(18px, 2.5vw, 36px) 48px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}
.os-window-dom-content > .app-content {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
.os-window-dom-content[aria-busy="true"] {
  cursor: progress;
}
.win-dom-window-message {
  max-width: 560px;
  margin: 32px auto;
}
.os-window-drag-shield {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
}
.os-window.is-dragging .os-window-drag-shield {
  display: block;
}

/* Barra de Tareas Inferior */
.win-taskbar {
  height: 44px;
  flex: 0 0 44px;
  background: rgba(248, 250, 251, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid #d4e1de;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 10px;
  z-index: 1200;
  color: #0f2933;
  box-shadow: 0 -2px 10px rgba(15, 52, 67, 0.06);
}
.win-taskbar-home {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid #cddcd8;
  color: #0f3443;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 7px;
  flex-shrink: 0;
}
.win-taskbar-home:hover {
  background: #e9f3f1;
  border-color: #1a7a76;
}
.win-taskbar-items {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
}
.win-taskbar-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 210px;
  background: #ffffff;
  border: 1px solid #d5e2df;
  border-bottom: 2.5px solid transparent;
  color: #354e56;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.win-taskbar-item:hover {
  background: #f1f7f6;
  color: #0f3443;
}
.win-taskbar-item.is-active {
  background: #e6f3f1;
  border-color: #b8d8d2;
  border-bottom-color: #0f766e;
  color: #0f3443;
  font-weight: 700;
}
.win-taskbar-item.is-minimized {
  opacity: 0.72;
  background: #f3f6f7;
  border-bottom-color: #94a3b8;
}
.win-taskbar-clock {
  font-size: 11.5px;
  font-weight: 700;
  color: #354e56;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* Modales Jerárquicos tipo Dialog Windows dentro de Ventanas */
.modal-header-win-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.btn-modal-max {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #d1dedc;
  border-radius: 6px;
  background: #f4f8f7;
  color: #16333c;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.btn-modal-max:hover {
  background: #e1ecea;
  border-color: #0f3443;
}
.modal-dialog.is-modal-maximized {
  width: calc(100vw - 16px) !important;
  max-width: calc(100vw - 16px) !important;
  height: calc(100vh - 16px) !important;
  margin: 8px auto !important;
}
.modal-dialog.is-modal-maximized .modal-content {
  height: 100% !important;
  border-radius: 8px !important;
}
.modal-dialog.is-modal-maximized .modal-body {
  overflow-y: auto !important;
  flex: 1 1 auto !important;
}
.os-window.is-locked-behind {
  pointer-events: none;
  opacity: 0.92;
}
.os-window.is-dialog-maximized {
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  resize: none !important;
}
.os-window.has-child-modal .os-win-btn {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}
.win-modal-lock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 37, 48, 0.36);
  backdrop-filter: blur(1.5px);
  z-index: 900;
  display: none;
}
.win-modal-lock-overlay.is-visible {
  display: block;
}

/* Ventana Hija Independiente (Modal Dialog proyectado fuera de la ventana padre) */
.os-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 37, 48, 0.42);
  backdrop-filter: blur(1.5px);
}
.os-window.os-dialog-window {
  box-shadow: 0 24px 60px rgba(8, 28, 36, 0.42);
  border-color: #0f3443;
}
.os-window.os-dialog-window .os-window-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  background: #ffffff;
  padding: 0;
}
.os-ported-modal-root {
  display: flex !important;
  flex-direction: column !important;
  position: static !important;
  overflow: hidden !important;
  opacity: 1 !important;
  width: 100% !important;
  height: 100% !important;
  flex: 1 1 auto !important;
}
.os-ported-modal-root .modal-dialog {
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
}
.os-ported-modal-root .modal-content {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.os-ported-modal-root .modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 1.25rem 1.5rem !important;
  box-sizing: border-box !important;
  -webkit-overflow-scrolling: touch;
}
.os-ported-modal-root .modal-footer {
  flex: 0 0 auto !important;
  background: #f8fafb;
}
.os-ported-modal-root .modal-header {
  display: none !important;
}
.win-desktop-toast-stack {
  position: fixed !important;
  top: 64px !important;
  right: 20px !important;
  z-index: 99999 !important;
  max-width: 420px;
}

/* El menú conserva su jerarquía cuando el escritorio se abre en una ventana pequeña. */
.win-menu-toggle { display: none; }
.win-menu-toggle:focus-visible { outline: 2px solid #237a78; outline-offset: 2px; }
@media (max-width: 1199.98px) {
  .win-topbar {
    position: relative;
    height: auto;
    min-height: 54px;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px 12px;
    padding: 8px 12px;
  }
  .win-topbar-left { display: contents; }
  .win-brand { grid-column: 1; grid-row: 1; min-width: 0; }
  .win-menu-toggle {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 6px 10px;
    color: #123b4a;
    background: #fff;
    border: 1px solid #cddcd8;
    border-radius: 6px;
  }
  .win-menu-toggle[aria-expanded="true"] { background: #e7eef0; }
  .win-topbar-right { grid-column: 3; grid-row: 1; gap: 8px; }
  .win-menubar {
    display: none;
    position: absolute;
    top: 100%;
    right: 12px;
    width: min(340px, calc(100vw - 24px));
    min-width: 0;
    align-items: stretch;
    flex-wrap: nowrap;
    max-height: calc(100dvh - 112px);
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid #d4e1de;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 12px 28px rgba(15, 52, 67, 0.18);
  }
  .win-topbar.is-menu-open .win-menubar { display: flex; flex-direction: column; }
  .win-menubar > * { flex: 0 0 auto; width: 100%; min-width: 0; }
  .win-menubar .win-menu-item { width: 100%; min-height: 40px; justify-content: space-between; }
  .win-menubar .win-dropdown-menu {
    position: static !important;
    transform: none !important;
    min-width: 0;
    margin: 0 0 4px !important;
    box-shadow: none !important;
  }
  .win-menubar .win-submenu-item { min-height: 40px; white-space: normal; }
}
@media (max-width: 599.98px) {
  .win-shell, .win-desktop-body { height: 100dvh; }
  .win-brand-text { font-size: 12px; }
  .win-brand-text small, .win-user-info { display: none; }
  .win-brand { gap: 6px; }
  .win-user-pill { padding: 3px; gap: 4px; }
  .win-user-pill img { display: none; }
  .win-topbar { gap: 6px; padding: 6px 8px; }
  .win-menu-toggle { padding: 6px; min-height: 44px; }
  .win-topbar-right { gap: 6px; }
  .win-desktop-backdrop { padding: 20px 16px; align-items: flex-start; }
  .win-desktop-hero h1 { font-size: 24px; }
  .win-desktop-shortcuts { grid-template-columns: minmax(0, 1fr); }
  .win-taskbar { padding: 0 6px; gap: 6px; }
  .win-taskbar-items { min-width: 0; }
  .win-taskbar-item { flex-shrink: 0; max-width: 140px; }
  .win-taskbar-clock { display: none; }
  .win-desktop-toast-stack { right: 8px !important; max-width: calc(100vw - 16px); }
  .win-iframe-content { padding: 12px !important; }
}

/* Módulo de vacaciones y comprobante vacacional en media carta vertical. */
.vacaciones-panel-body { padding: 20px; }
.vacaciones-portal-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 12px; margin-bottom: 20px; }
.vacaciones-portal-summary > div { display: grid; gap: 5px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.vacaciones-portal-summary span { color: var(--muted); font-size: .82rem; }
.vacaciones-portal-summary strong { color: var(--ink); font-size: 1.15rem; }
.vacaciones-portal-summary small { color: var(--muted); }
.vacaciones-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 16px; }
.vacaciones-check-grid label { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); }
.vacaciones-inline-form { min-width: 210px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.vacaciones-recibo-page { min-height: 100vh; padding: 24px; background: var(--paper); color: var(--ink); }
.vacaciones-recibo-toolbar { display: flex; justify-content: flex-end; gap: 8px; max-width: 780px; margin: 0 auto 14px; }
.vacaciones-recibo { box-sizing: border-box; width: min(100%, 780px); min-height: 1040px; margin: 0 auto; padding: 32px; border: 1px solid var(--line-strong); background: #fff; box-shadow: 0 8px 28px rgb(17 48 58 / 10%); }
.vacaciones-recibo-header { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 2px solid var(--petrol); }
.vacaciones-recibo-logo { max-width: 72px; max-height: 72px; object-fit: contain; }
.vacaciones-recibo-institution h1 { margin: 0 0 4px; font-size: 18px; }
.vacaciones-recibo-institution p { margin: 2px 0; font-size: 11px; color: var(--muted); }
.vacaciones-recibo-kind { grid-column: 1 / -1; margin-top: 6px; color: var(--petrol); font-size: 15px; font-weight: 700; text-align: center; }
.vacaciones-recibo-identity { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; padding: 18px 0; }
.vacaciones-recibo-identity div { display: grid; gap: 3px; }
.vacaciones-recibo-identity span, .vacaciones-recibo-total span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.vacaciones-recibo-identity strong { font-size: 12px; }
.vacaciones-recibo-lines { width: 100%; border-collapse: collapse; font-size: 10px; }
.vacaciones-recibo-lines th, .vacaciones-recibo-lines td { padding: 7px 5px; border-bottom: 1px solid var(--line); vertical-align: top; }
.vacaciones-recibo-lines th { background: var(--surface-alt); color: var(--ink); text-align: left; }
.vacaciones-recibo-total { width: min(100%, 340px); margin: 16px 0 0 auto; }
.vacaciones-recibo-total div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.vacaciones-recibo-total .vacaciones-recibo-neto { margin-top: 5px; border-top: 2px solid var(--petrol); border-bottom: 0; color: var(--petrol); font-size: 13px; font-weight: 700; }
.vacaciones-recibo-payment { display: grid; gap: 3px; margin-top: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; }
.vacaciones-recibo-payment strong { color: var(--petrol); }
.vacaciones-recibo-note { margin-top: 18px; padding: 9px; border: 1px solid var(--line); background: var(--surface-alt); color: var(--muted); font-size: 10px; }
.vacaciones-recibo-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 54px; }
.vacaciones-recibo-signatures div { display: grid; min-height: 42px; align-content: end; gap: 5px; border-top: 1px solid var(--ink); text-align: center; font-size: 10px; }
.vacaciones-recibo-signatures small { color: var(--muted); }
.vacaciones-recibo-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; color: var(--muted); font-size: 8px; }
@media print {
  @page { size: 5.5in 8.5in portrait; margin: .22in; }
  html, body { width: 5.06in; height: 8.06in; min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .vacaciones-recibo-toolbar { display: none !important; }
  .vacaciones-recibo { width: 100%; height: 8.06in; min-height: 0; margin: 0; padding: .18in; border: 0; box-shadow: none; overflow: hidden; }
  .vacaciones-recibo-header { grid-template-columns: .58in 1fr; gap: .1in; padding-bottom: .1in; }
  .vacaciones-recibo-logo { max-width: .58in; max-height: .58in; }
  .vacaciones-recibo-institution h1 { font-size: 12pt; }
  .vacaciones-recibo-institution p { font-size: 7pt; }
  .vacaciones-recibo-kind { font-size: 10pt; }
  .vacaciones-recibo-identity { gap: .08in .14in; padding: .12in 0; }
  .vacaciones-recibo-identity span, .vacaciones-recibo-total span { font-size: 6.5pt; }
  .vacaciones-recibo-identity strong { font-size: 7.5pt; }
  .vacaciones-recibo-lines { font-size: 7pt; }
  .vacaciones-recibo-lines th, .vacaciones-recibo-lines td { padding: .045in .035in; }
  .vacaciones-recibo-total { width: 3.1in; margin-top: .12in; }
  .vacaciones-recibo-total div { padding: .035in 0; font-size: 7pt; }
  .vacaciones-recibo-total .vacaciones-recibo-neto { font-size: 8pt; }
  .vacaciones-recibo-payment { gap: .02in; margin-top: .08in; padding: .06in; font-size: 6.5pt; }
  .vacaciones-recibo-note { margin-top: .12in; padding: .07in; font-size: 6.5pt; }
  .vacaciones-recibo-signatures { gap: .28in; margin-top: .38in; }
  .vacaciones-recibo-signatures div { min-height: .38in; font-size: 6.5pt; }
  .vacaciones-recibo-footer { margin-top: .14in; font-size: 5.5pt; }
}
@media (max-width: 575.98px) {
  .vacaciones-panel-body { padding: 14px; }
  .vacaciones-portal-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
  .vacaciones-portal-summary > div { padding: 11px 12px; }
  .vacaciones-portal-summary > div:first-child { grid-column: 1 / -1; }
  .vacaciones-portal-summary strong { font-size: 1rem; }
}

/* Padrón y expediente individual de vacaciones. */
.vacaciones-admin-heading { align-items: end; }
.vacaciones-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 18px 0 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.vacaciones-summary a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 13px 16px; color: var(--ink); text-decoration: none; }
.vacaciones-summary a + a { border-left: 1px solid var(--line); }
.vacaciones-summary a:hover, .vacaciones-summary a:focus-visible { background: var(--surface-alt); color: var(--petrol); }
.vacaciones-summary span { color: var(--muted); font-size: 11px; line-height: 1.35; }
.vacaciones-summary strong { color: var(--petrol); font-size: 20px; font-variant-numeric: tabular-nums; }
.vacaciones-legal-gate { margin-bottom: 18px; }

.vacaciones-roster-page { display: grid; gap: 20px; padding: 24px; }
.vacaciones-roster-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.vacaciones-roster-heading h1 { margin: 0; color: var(--ink); font-size: clamp(25px, 2.2vw, 32px); font-weight: 700; letter-spacing: -.035em; }
.vacaciones-roster-heading p { max-width: 700px; margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.vacaciones-roster-count { display: grid; justify-items: end; flex: 0 0 auto; }
.vacaciones-roster-count strong { color: var(--petrol); font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; }
.vacaciones-roster-count span, .vacaciones-roster-range { color: var(--muted); font-size: 11px; }
.vacaciones-roster-panel { min-width: 0; overflow: hidden; }
.vacaciones-roster-panel > .panel-heading { align-items: center; }
.vacaciones-roster-range { white-space: nowrap; }
.vacaciones-roster-filters { display: flex; align-items: end; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.vacaciones-roster-search { display: grid; flex: 1 1 420px; gap: 5px; max-width: 620px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.vacaciones-roster-filter-actions { display: flex; gap: 8px; }
.vacaciones-roster-table-wrap { max-height: none; overflow: visible; }
.vacaciones-roster-table { min-width: 760px; }
.vacaciones-roster-table td { padding: 12px; }
.vacaciones-roster-table tbody tr:hover { background: #f4f8f7; }
.vacaciones-roster-table .vacaciones-number { min-width: 135px; font-variant-numeric: tabular-nums; }
.vacaciones-roster-empty { padding: 42px 20px !important; color: var(--muted); text-align: center; }
.vacaciones-roster-empty strong, .vacaciones-roster-empty span { display: block; }
.vacaciones-roster-empty strong { margin-bottom: 5px; color: var(--ink); font-size: 14px; }
.vacaciones-roster-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: #fbfcfc; color: var(--muted); font-size: 11px; }
.vacaciones-roster-pagination > div { display: flex; gap: 7px; }

.vacaciones-empleado-modal .modal-dialog { width: min(1160px, calc(100vw - 32px)); max-width: 1160px; }
.vacaciones-empleado-modal .modal-content { max-height: min(820px, calc(100dvh - 36px)); overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: 0 18px 56px rgb(13 37 45 / 24%); }
.vacaciones-empleado-modal .modal-header { align-items: center; gap: 18px; padding: 16px 22px; border-bottom: 0; background: var(--petrol); color: #fff; }
.vacaciones-empleado-modal .modal-title { color: inherit; font-size: 17px; font-weight: 700; }
.vacaciones-empleado-modal .modal-header .btn-close { flex: 0 0 auto; filter: invert(1); opacity: .82; }
.vacaciones-modal-subtitle { margin-top: 4px; color: rgb(255 255 255 / 76%); font-size: 11px; }
.vacaciones-empleado-modal .modal-body { min-height: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; }
.vacaciones-empleado-modal .modal-footer { justify-content: space-between; gap: 12px; padding: 10px 18px; background: #f7f9f9; }
.vacaciones-modal-footer-note { color: var(--muted); font-size: 10px; }
.vacaciones-modal-toast { position: sticky; z-index: 3; top: 0; margin: 0; padding: 11px 20px; border-bottom: 1px solid #acd6bf; background: #d9f1e2; color: #145b38; font-size: 12px; font-weight: 650; box-shadow: 0 4px 12px rgb(24 52 59 / 8%); }
.vacaciones-modal-toast-error { border-color: #e8b8b4; background: #fbe5e3; color: #842c27; }
.vacaciones-workspace-loading { display: flex; min-height: 260px; align-items: center; justify-content: center; gap: 11px; padding: 32px; color: var(--muted); font-size: 13px; }
.vacaciones-employee-workspace { padding: 20px 24px 26px; }
.vacaciones-employee-profile-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 1px 0 16px; }
.vacaciones-employee-profile-head h3 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.vacaciones-employee-profile-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.vacaciones-employee-profile-state { display: grid; justify-items: end; gap: 5px; color: var(--muted); font-size: 10px; }
.vacaciones-employee-balance-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; overflow: hidden; }
.vacaciones-employee-balance-strip > div { display: flex; flex-direction: column; justify-content: center; gap: 3px; min-width: 0; padding: 12px 16px; }
.vacaciones-employee-balance-strip > div + div { border-left: 1px solid #e2e8f0; }
.vacaciones-employee-balance-strip span { color: #64748b; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.vacaciones-employee-balance-strip strong { overflow-wrap: anywhere; color: #0f4c5c; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.vacaciones-employee-rule-alert { margin-bottom: 14px; font-size: 11px; }
.vacaciones-employee-tabs { display: flex; flex-wrap: nowrap; gap: 8px; margin: 0 -24px 18px; padding: 10px 24px; overflow-x: auto; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; background: #f8fafc; scrollbar-width: thin; }
.vacaciones-employee-tabs .nav-link { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 7px 14px; border: 1px solid transparent; border-radius: 8px; color: #475569; font-size: 13px; font-weight: 600; transition: all 0.15s ease-in-out; background: transparent; }
.vacaciones-employee-tabs .nav-link:hover { color: #0f766e; background: #f1f5f9; }
.vacaciones-employee-tabs .nav-link.active { background: #0f766e; color: #ffffff; box-shadow: 0 2px 5px rgba(15, 118, 110, 0.2); }
.vacaciones-tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: rgba(15, 23, 42, 0.09); color: inherit; font-size: 10.5px; font-weight: 700; }
.vacaciones-employee-tabs .nav-link.active .vacaciones-tab-count { background: rgba(255, 255, 255, 0.22); color: #ffffff; }
.vacaciones-employee-tab-content { min-height: 240px; }
.vacaciones-employee-tab-content > .tab-pane { padding: 0 1px 8px; }
.vacaciones-workspace-section { margin: 0 0 15px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.vacaciones-workspace-section:last-child { margin-bottom: 0; }
.vacaciones-workspace-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin: 0 0 14px; }
.vacaciones-workspace-section-heading h4 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 700; }
.vacaciones-workspace-section-heading p { max-width: 720px; margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.vacaciones-employee-workspace .form-label { display: block; width: 100%; margin-bottom: 4px; color: #1e293b; font-size: 12px; font-weight: 600; }
.vacaciones-employee-workspace .form-text { margin-top: 4px; color: #64748b; font-size: 11px; line-height: 1.35; }
.vacaciones-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 8px; }
.vacaciones-form-footer small { color: var(--muted); font-size: 10px; }
.vacaciones-employee-request-list { display: grid; gap: 11px; }
.vacaciones-request-item { padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: #fbfcfc; }
.vacaciones-request-item > header { display: flex; align-items: start; justify-content: space-between; gap: 14px; }
.vacaciones-request-item > header > div { display: grid; gap: 4px; }
.vacaciones-request-item > header strong { color: var(--ink); font-size: 12px; }
.vacaciones-request-item > header small { color: var(--muted); font-size: 10px; }
.vacaciones-request-calculation { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 9px 0; padding: 9px 11px; border: 1px solid #d5e4e1; border-radius: 6px; background: #f1f7f5; }
.vacaciones-request-calculation strong { color: var(--petrol); font-size: 14px; font-variant-numeric: tabular-nums; }
.vacaciones-request-calculation span { color: var(--muted); font-size: 10px; }
.vacaciones-request-note { margin: 8px 0; color: var(--muted); font-size: 10px; }
.vacaciones-request-actions { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vacaciones-request-actions form { min-width: 120px; }
.vacaciones-request-actions .vacaciones-review-form { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 5px; max-width: 440px; }
.vacaciones-request-actions .vacaciones-review-form .form-label { grid-column: 1 / -1; }
.vacaciones-request-actions .vacaciones-review-form button { grid-column: 1 / -1; justify-self: start; }
.vacaciones-employee-workspace .vacaciones-table { min-width: 640px; }
.vacaciones-employee-workspace .vacaciones-table td { vertical-align: top; }
.vacaciones-employee-workspace .vacaciones-inline-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.vacaciones-employee-workspace .vacaciones-inline-actions form { display: inline-flex; }
.vacaciones-employee-workspace .vacaciones-blocker-list { margin: 6px 0 0; padding-left: 17px; color: #855a17; font-size: 10px; }

@media (max-width: 767.98px) {
  .vacaciones-roster-page { gap: 14px; padding: 16px; }
  .vacaciones-roster-heading { align-items: start; }
  .vacaciones-roster-filters { align-items: stretch; flex-direction: column; }
  .vacaciones-roster-search { max-width: none; }
  .vacaciones-roster-filter-actions .btn { flex: 1; }
  .vacaciones-summary { grid-template-columns: 1fr 1fr; }
  .vacaciones-summary a { padding: 11px 12px; }
  .vacaciones-summary a + a { border-left: 0; }
  .vacaciones-summary a:nth-child(even) { border-left: 1px solid var(--line); }
  .vacaciones-summary a:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .vacaciones-empleado-modal .modal-dialog { width: calc(100vw - 16px); max-width: none; margin: 8px; }
  .vacaciones-empleado-modal .modal-content { max-height: calc(100dvh - 16px); }
  .vacaciones-employee-workspace { padding: 15px 14px 20px; }
  .vacaciones-employee-tabs { margin-right: -14px; margin-left: -14px; padding-right: 12px; padding-left: 12px; }
  .vacaciones-workspace-section { padding: 13px; }
}
@media (max-width: 480px) {
  .vacaciones-roster-heading { flex-direction: column; }
  .vacaciones-roster-count { justify-items: start; }
  .vacaciones-roster-panel > .panel-heading { align-items: start; flex-direction: column; }
  .vacaciones-employee-profile-head { flex-direction: column; gap: 10px; }
  .vacaciones-employee-profile-state { justify-items: start; }
  .vacaciones-employee-balance-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vacaciones-employee-balance-strip > div:nth-child(odd) { border-left: 0; }
  .vacaciones-employee-balance-strip > div:nth-child(n + 3) { border-top: 1px solid #e2e8f0; }
  .vacaciones-employee-balance-strip strong { font-size: 13px; }
  .vacaciones-form-footer { align-items: stretch; flex-direction: column; }
  .vacaciones-modal-footer-note { display: none; }
  .vacaciones-empleado-modal .modal-footer { justify-content: end; }
  .vacaciones-request-item > header { align-items: start; flex-direction: column; }
  .vacaciones-request-calculation { align-items: start; flex-direction: column; }
}

/* ==========================================================================
   DOCUMENTO OFICIAL DE VACACIONES Y CONSTANCIA PARA FIRMA
   ========================================================================== */
.vacation-document-page {
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  color: #173743;
  background: #f1f5f9;
}

.vacation-document-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  max-width: 820px;
  margin: 0 auto 18px;
}

.vacation-document-footer-bar {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.vacation-document-footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 820px;
  gap: 12px;
}

.vacation-document-modal-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 12px 0 20px;
  background-color: transparent;
}

.vacation-document-modal-wrapper .vacation-document {
  margin: 0 auto;
  width: 100%;
}

.vacaciones-recibo-modal-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 12px 0 20px;
  background-color: transparent;
}

.vacaciones-recibo-modal-wrapper .vacaciones-recibo {
  margin: 0 auto;
  width: min(100%, 780px);
  min-height: auto;
  border-radius: 8px;
}

.vacation-receipt-preview-modal:not(.os-ported-modal-root) .modal-dialog {
  width: min(1180px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  height: min(820px, calc(100vh - 2rem));
  margin: 1rem auto;
}

.vacation-receipt-preview-modal .modal-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  border-radius: 12px;
}

.vacation-receipt-preview-modal .modal-header,
.vacation-receipt-preview-modal .modal-footer {
  flex: 0 0 auto;
}

.vacation-receipt-preview-modal [data-vacation-receipt-modal-content] {
  flex: 1 1 auto;
  min-height: 0 !important;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: #f1f5f9;
}

@supports (height: 100dvh) {
  .vacation-receipt-preview-modal:not(.os-ported-modal-root) .modal-dialog {
    height: min(820px, calc(100dvh - 2rem));
  }

  .vacation-receipt-preview-modal .modal-content {
    max-height: calc(100dvh - 2rem);
  }
}

@media (max-width: 575.98px) {
  .vacation-receipt-preview-modal:not(.os-ported-modal-root) .modal-dialog {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    height: calc(100vh - 1rem);
    margin: 0.5rem auto;
  }

  .vacation-receipt-preview-modal .modal-content {
    max-height: calc(100vh - 1rem);
  }

  .vacaciones-recibo-modal-wrapper {
    padding: 4px 0 8px;
  }
}

.vacation-document {
  max-width: 820px;
  width: 100%;
  min-height: 860px;
  margin: 0 auto;
  padding: 42px 48px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(15, 35, 45, 0.08);
  box-sizing: border-box;
  font-family: inherit;
  color: #173743;
}

.vacation-document-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid #164252;
  margin-bottom: 18px;
}

.vacation-document-logo {
  max-width: 95px;
  max-height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}

.vacation-document-heading h1 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 700;
  color: #164252;
  line-height: 1.25;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.vacation-document-heading p {
  margin: 2px 0;
  color: #516c75;
  font-size: 12px;
  line-height: 1.35;
}

.vacation-document-kicker {
  margin: 18px 0 6px;
  color: #0d9488;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.vacation-document h2 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.vacation-document > p,
.vacation-document-section p,
.vacation-document-declaration p {
  line-height: 1.6;
  font-size: 13.5px;
  color: #334155;
  margin-bottom: 14px;
}

.vacation-document-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  margin: 20px 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.vacation-document-grid > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 60px;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  box-sizing: border-box;
}

.vacation-document-grid > div:nth-child(odd) {
  border-right: 1px solid #e2e8f0;
}

.vacation-document-grid > div:nth-last-child(1),
.vacation-document-grid > div:nth-last-child(2):nth-child(odd) {
  border-bottom: 0;
}

.vacation-document-grid span {
  display: block;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.vacation-document-grid strong {
  display: block;
  color: #0f172a;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}

.vacation-document-section,
.vacation-document-declaration {
  margin: 22px 0;
}

.vacation-document-section h3,
.vacation-document-declaration h3 {
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #164252;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.vacation-document table {
  width: 100%;
  margin: 14px 0;
  border-collapse: collapse;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.vacation-document th,
.vacation-document td {
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
}

.vacation-document thead th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #475569;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.vacation-document-total th {
  background-color: #f1f5f9;
  border-top: 2px solid #164252;
  font-weight: 700;
  font-size: 13.5px;
  color: #0f172a;
}

.vacation-document-note,
.vacation-document-footnote {
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.45;
}

.vacation-document-date {
  margin: 28px 0 42px;
  font-size: 13px;
  color: #334155;
}

.vacation-document-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-top: 48px;
  text-align: center;
}

.vacation-document-signatures > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.vacation-document-signature-line {
  display: block;
  width: 80%;
  height: 1px;
  margin-bottom: 6px;
  background: #475569;
}

.vacation-document-signatures strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #0f172a;
}

.vacation-document-signatures small {
  color: #64748b;
  font-size: 10.5px;
}

.vacation-document-footnote {
  margin-top: 42px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  overflow-wrap: anywhere;
}

@media (max-width: 680px) {
  .vacation-document-page { padding: 12px; }
  .vacation-document { min-height: auto; padding: 24px 18px; }
  .vacation-document-toolbar { justify-content: stretch; }
  .vacation-document-toolbar > * { flex: 1; }
  .vacation-document-heading { flex-direction: column; text-align: center; gap: 10px; }
  .vacation-document-grid,
  .vacation-document-signatures { grid-template-columns: 1fr; }
  .vacation-document-grid > div:nth-child(odd) { border-right: 0; }
  .vacation-document-signatures { gap: 36px; }
}

@media print {
  .vacation-document-page { padding: 0; background: #fff; }
  .vacation-document-toolbar,
  .vacation-document-footer-bar { display: none !important; }
  .vacation-document { max-width: none; min-height: 0; margin: 0; padding: 0; border: 0; box-shadow: none; border-radius: 0; }
  .vacation-document-date,
  .vacation-document-signatures,
  .vacation-document-section { break-inside: avoid; }
}

.report-table-loading {
  opacity: 0.58;
  transition: opacity 120ms ease;
}

@media print {
  body.report-print-mode.win-desktop-body {
    display: block !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #fff !important;
  }

  body.report-print-mode .win-topbar,
  body.report-print-mode .win-taskbar,
  body.report-print-mode .win-desktop-backdrop,
  body.report-print-mode .win-desktop-toast-stack,
  body.report-print-mode .modal-backdrop,
  body.report-print-mode .modal,
  body.report-print-mode .os-window:not(.report-print-target) {
    display: none !important;
  }

  body.report-print-mode .win-shell,
  body.report-print-mode .win-desktop {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.report-print-mode .os-window.report-print-target {
    display: block !important;
    position: static !important;
    inset: auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  body.report-print-mode .report-print-target > .os-window-header {
    display: none !important;
  }

  body.report-print-mode .report-print-target > .os-window-body,
  body.report-print-mode .report-print-target .os-window-dom-content {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.report-print-mode .report-print-target .table-responsive {
    overflow: visible !important;
  }

  body.report-print-mode .report-print-target .data-panel {
    border: 0 !important;
    box-shadow: none !important;
  }
}


