/* Intranet — layout limpio y profesional */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --sidebar: #1e293b;
  --sidebar-hover: #334155;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.app-body {
  min-height: 100vh;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 1.25rem 1rem;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav {
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.925rem;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover:not(.nav-item--disabled) {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.is-active {
  background: rgba(37, 99, 235, 0.35);
  color: #fff;
  border-left: 3px solid var(--primary);
  padding-left: calc(1rem - 3px);
}

.nav-item--disabled {
  opacity: 0.45;
  cursor: not-allowed;
  font-size: 0.85rem;
}

.nav-icon {
  opacity: 0.9;
  width: 1.25rem;
  text-align: center;
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1060;
}

.topbar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-user {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Botón hamburguesa: oculto en escritorio */
.nav-toggle {
  display: none;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

.nav-toggle:hover {
  background: var(--bg);
  border-color: var(--border);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.nav-toggle-box {
  width: 22px;
  height: 14px;
  position: relative;
  display: block;
}

.nav-toggle-inner,
.nav-toggle-inner::before,
.nav-toggle-inner::after {
  display: block;
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.nav-toggle-inner {
  top: 6px;
}

.nav-toggle-inner::before {
  content: "";
  top: -6px;
}

.nav-toggle-inner::after {
  content: "";
  top: 6px;
}

.sidebar-backdrop {
  display: none;
}

.main-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-head {
  margin-bottom: 1.5rem;
}

.page-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.page-head--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.card--form {
  max-width: 560px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 520px) {
  .form-row-2 {
    grid-template-columns: 1fr;
  }
}

.input-readonly {
  background: #f1f5f9;
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

.muted-xs {
  font-size: 0.8rem;
  color: var(--muted);
}

.form-inline-del {
  display: inline;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.filter-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-pill.is-active {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary);
  color: var(--primary);
}

.stack-section {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.stack-section:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.section-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.section-desc {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.policy-hint {
  margin-top: 0.65rem !important;
  font-size: 0.88rem !important;
  line-height: 1.45;
}

.form-hint {
  margin: -0.35rem 0 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.legal-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background: #f8fafc;
  margin-bottom: 0.25rem;
}

.legal-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  padding: 0.35rem 0;
  list-style: none;
}

.legal-details[open] .legal-summary {
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.legal-box {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text);
}

.legal-box p {
  margin: 0 0 0.65rem;
}

.legal-title {
  font-size: 0.95rem;
  margin: 0 0 0.65rem;
  font-weight: 700;
}

.legal-h {
  font-size: 0.85rem;
  margin: 0.85rem 0 0.35rem;
  font-weight: 600;
  color: var(--text);
}

.legal-ul {
  margin: 0 0 0.65rem 1.1rem;
  padding: 0;
}

.legal-ul li {
  margin-bottom: 0.35rem;
}

.checkbox-legal {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.88rem;
  line-height: 1.4;
  cursor: pointer;
}

.checkbox-legal input {
  width: auto;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.grid-cards--4 {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

@media (min-width: 960px) {
  .grid-cards--4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.card-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.35;
}

.ausencias-mes-bar {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.ausencias-mes-bar__title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}

.ausencias-mes-bar__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.ausencias-mes-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ausencias-mes-form input[type="month"] {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.ausencias-mes-bar__hint {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
}

/* Dashboard inicio */
.dashboard-lead {
  color: var(--muted);
  max-width: 42rem;
  margin-top: 0.35rem;
}

.dashboard-alert {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.dashboard-alert__link {
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}

.dashboard-alert__link:hover {
  text-decoration: underline;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dashboard-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.dashboard-panel__icon {
  font-size: 1.5rem;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.dashboard-panel__title {
  font-size: 1.05rem;
  margin: 0 0 0.85rem;
  font-weight: 700;
}

.dashboard-panel__stats {
  list-style: none;
  margin: 0 0 1.15rem;
  padding: 0;
  flex: 1;
  font-size: 0.92rem;
}

.dashboard-panel__stats li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border);
}

.dashboard-panel__stats li:last-child {
  border-bottom: none;
}

.dashboard-panel__label {
  color: var(--muted);
  flex: 1;
  min-width: 0;
}

/* Bloque derecho alineado: cifras en columna + unidad */
.dashboard-panel__nums {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem;
  min-width: 6.75rem;
}

.dashboard-panel__value {
  display: inline-block;
  min-width: 4.25rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.dashboard-panel__unit {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.88em;
  white-space: nowrap;
}

.dashboard-panel__cta {
  margin-top: auto;
}

.dashboard-panel__progress {
  height: 6px;
  background: #e8ecf0;
  border-radius: 3px;
  overflow: hidden;
  margin: 0 0 0.85rem;
}

.dashboard-panel__progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.dashboard-panel__hint {
  margin: -0.35rem 0 1rem;
  line-height: 1.45;
}

.dashboard-panel__value--text {
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.dashboard-panel__value--money {
  min-width: 5.5rem;
  font-size: 0.95rem;
}

/* Widget bono dashboard */
.dashboard-panel--wide {
  grid-column: 1 / -1;
}

.dashboard-panel--bono {
  padding: 1.35rem 1.5rem 1.25rem;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 55%, #f0f9ff 100%);
  border-color: #dbeafe;
}

.bono-dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1.15rem;
}

.bono-dash-head__title {
  margin: 0 0 0.25rem;
}

.bono-dash-head__lead {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 36rem;
}

.bono-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.bono-dash-card {
  position: relative;
  border-radius: 14px;
  padding: 1.15rem 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100%;
  overflow: hidden;
}

a.bono-dash-card--link {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

a.bono-dash-card--link:hover {
  transform: translateY(-2px);
}

a.bono-dash-card--link.bono-dash-card--live:hover {
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.18);
}

a.bono-dash-card--link.bono-dash-card--closed:hover {
  box-shadow: 0 12px 28px rgba(109, 40, 217, 0.16);
}

a.bono-dash-card--link:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.bono-dash-card--live {
  background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 45%, #bfdbfe 100%);
  border: 1px solid #93c5fd;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.bono-dash-card--closed {
  background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 45%, #ddd6fe 100%);
  border: 1px solid #c4b5fd;
  box-shadow: 0 8px 24px rgba(109, 40, 217, 0.1);
}

.bono-dash-card__badge {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #1e40af;
}

.bono-dash-card--closed .bono-dash-card__badge {
  color: #5b21b6;
}

.bono-dash-ring {
  --pct: 0;
  --ring-color: #2563eb;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  margin: 0.35rem 0 0.85rem;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), #e2e8f0 0);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.bono-dash-ring__inner {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.bono-dash-ring__value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.bono-dash-ring__unit {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.bono-dash-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.bono-dash-card__period {
  margin: 0;
  font-weight: 700;
  font-size: 1rem;
  color: #1e3a8a;
}

.bono-dash-card--closed .bono-dash-card__period {
  color: #5b21b6;
}

.bono-dash-card__dates {
  margin: 0.15rem 0 0.5rem;
  font-size: 0.82rem;
  color: #475569;
}

.bono-dash-card__money {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
}

.bono-dash-card__meta {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  color: #64748b;
}

.bono-dash-mini {
  width: 100%;
  display: grid;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.bono-dash-mini__item {
  display: grid;
  grid-template-columns: 2.75rem 1fr 1.75rem;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
}

.bono-dash-mini__lbl {
  text-align: left;
  color: #475569;
  font-weight: 600;
}

.bono-dash-mini__bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 3px;
  overflow: hidden;
}

.bono-dash-mini__bar i {
  display: block;
  height: 100%;
  border-radius: 3px;
}

.bono-dash-mini__val {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.bono-dash-empty {
  padding: 1.5rem 0.5rem;
  width: 100%;
}

.bono-dash-empty__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #94a3b8;
}

.bono-dash-foot {
  display: flex;
  justify-content: flex-start;
}

.bono-dash-foot .dashboard-panel__cta {
  margin-top: 0;
}

/* —— Página detalle bono empleado —— */
.bono-page {
  max-width: 1100px;
}

.bono-page-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.25rem;
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 40%, #e0e7ff 100%);
  border: 1px solid #93c5fd;
  box-shadow: 0 10px 32px rgba(37, 99, 235, 0.1);
}

.bono-page-hero__badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.bono-page-hero__badge--live {
  background: #2563eb;
  color: #fff;
}

.bono-page-hero__badge--closed {
  background: #5b21b6;
  color: #fff;
}

.bono-page-hero__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  color: #0f172a;
}

.bono-page-hero__period {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e40af;
}

.bono-page-hero__dates {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: #475569;
}

.bono-page-hero__filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.bono-page-select {
  min-width: 220px;
}

.bono-page-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.bono-page-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.bono-page-kpi--highlight {
  background: linear-gradient(160deg, #f8fafc 0%, #ffffff 100%);
  border-color: #cbd5e1;
}

.bono-page-kpi--money {
  background: linear-gradient(160deg, #ecfdf5 0%, #d1fae5 100%);
  border-color: #6ee7b7;
}

.bono-page-kpi--money .bono-page-kpi__value {
  color: #047857;
}

.bono-page-kpi--discount {
  background: linear-gradient(160deg, #fff7ed 0%, #ffedd5 100%);
  border-color: #fdba74;
}

.bono-page-kpi--discount .bono-page-kpi__value {
  color: #c2410c;
}

.bono-page-kpi__icon {
  font-size: 1.5rem;
  font-weight: 800;
  color: #059669;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.bono-page-kpi__value {
  font-size: 1.65rem;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.bono-page-kpi__value--sm {
  font-size: 1.45rem;
}

.bono-page-kpi__label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 0.35rem;
}

.bono-page-kpi__sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.bono-page-ring {
  --pct: 0;
  --ring-color: #2563eb;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto 0.5rem;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), #e2e8f0 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bono-page-ring__inner {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.bono-page-ring__value {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: #0f172a;
}

.bono-page-ring__unit {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

.bono-page-section {
  margin-bottom: 1.75rem;
}

.bono-page-section__head {
  margin-bottom: 1rem;
}

.bono-page-section__head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  color: #0f172a;
}

.bono-page-section__head p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 52rem;
}

.bono-page-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.bono-page-cat {
  --cat-color: #2563eb;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--cat-color);
}

.bono-page-cat__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.bono-page-cat__head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.bono-page-cat__pts {
  font-size: 0.82rem;
  color: #475569;
  white-space: nowrap;
}

.bono-page-cat__pts strong {
  color: var(--cat-color);
  font-size: 1rem;
}

.bono-page-cat__bar {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}

.bono-page-cat__bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--cat-color);
  transition: width 0.3s ease;
}

.bono-page-cat__meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: #64748b;
}

.bono-page-cat__help {
  margin-top: 0.65rem;
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.5rem;
}

.bono-page-cat__help summary {
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cat-color, #2563eb);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bono-page-cat__help summary::-webkit-details-marker {
  display: none;
}

.bono-page-cat__help summary::before {
  content: '+';
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: #f1f5f9;
  font-size: 0.85rem;
  line-height: 1;
}

.bono-page-cat__help[open] summary::before {
  content: '−';
}

.bono-page-cat__help-body {
  padding: 0.55rem 0 0.15rem;
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.45;
}

.bono-page-cat__help-como {
  margin: 0 0 0.45rem;
}

.bono-page-cat__help-resumen {
  margin: 0 0 0.5rem;
}

.bono-page-cat__help-subtitle {
  margin: 0.55rem 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
}

.bono-page-cat__escala {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}

.bono-page-cat__escala li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  font-size: 0.74rem;
  border-bottom: 1px solid #f1f5f9;
}

.bono-page-cat__escala li:last-child {
  border-bottom: none;
}

.bono-page-cat__escala--activo {
  background: #ecfdf5;
  font-weight: 600;
  color: #065f46;
}

.bono-page-cat__help-nota {
  margin: 0.45rem 0 0;
  font-style: italic;
}

.bono-page-total-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}

.bono-page-total-bar__track {
  flex: 1;
  height: 12px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.bono-page-total-bar__track i {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.bono-page-total-bar strong {
  font-size: 1.1rem;
  color: #0f172a;
  min-width: 3.5rem;
  text-align: right;
}

.bono-page-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}

.bono-page-chart__row {
  display: grid;
  grid-template-columns: 7rem 1fr 4rem 3.5rem;
  align-items: center;
  gap: 0.65rem;
  padding: 0.4rem 0;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
  font-size: 0.82rem;
}

.bono-page-chart__row:last-child {
  border-bottom: none;
}

.bono-page-chart__lbl {
  color: #334155;
  font-weight: 600;
}

.bono-page-chart__bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.bono-page-chart__bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.bono-page-chart__val {
  text-align: right;
  font-weight: 700;
  color: #0f172a;
}

.bono-page-chart__pct {
  text-align: right;
  color: #64748b;
}

.bono-page-day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.bono-page-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.bono-page-chip--ok {
  background: #dcfce7;
  color: #166534;
}

.bono-page-chip--warn {
  background: #fef3c7;
  color: #b45309;
}

.bono-page-chip--bad {
  background: #fee2e2;
  color: #b91c1c;
}

.bono-page-chip--muted {
  background: #f1f5f9;
  color: #64748b;
}

.bono-page-table-wrap {
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bono-page-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.bono-page-table tbody tr:hover {
  background: #eff6ff;
}

.bono-page-late {
  color: #c2410c;
  font-weight: 700;
}

.bono-page-fuente {
  font-size: 0.78rem;
  color: #64748b;
  text-transform: capitalize;
}

.bono-page-history {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.bono-page-hist-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.bono-page-hist-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.bono-page-hist-card--active {
  border-color: #2563eb;
  background: #eff6ff;
}

.bono-page-hist-card__pct {
  --ring-color: #2563eb;
  --pct: 70;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), #e2e8f0 0);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bono-page-hist-card__pct span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #0f172a;
}

.bono-page-hist-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.bono-page-hist-card__body strong {
  font-size: 0.88rem;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bono-page-hist-card__body span {
  font-size: 0.78rem;
  color: #64748b;
}

.bono-page-hist-card__badge {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
}

.bono-page-hist-card__badge--live {
  background: #dbeafe;
  color: #1e40af;
}

.bono-page-hist-card__badge--closed {
  background: #ede9fe;
  color: #5b21b6;
}

@media (max-width: 640px) {
  .bono-page-chart__row {
    grid-template-columns: 1fr 3rem;
    grid-template-rows: auto auto;
  }

  .bono-page-chart__lbl {
    grid-column: 1 / -1;
  }

  .bono-page-chart__bar {
    grid-column: 1;
  }

  .bono-page-chart__val,
  .bono-page-chart__pct {
    grid-column: 2;
    grid-row: 2;
  }
}

.dashboard-quick {
  margin-top: 0.5rem;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.dashboard-quick__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.dashboard-quick__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.dashboard-quick__a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.92rem;
}

.dashboard-quick__a:hover {
  text-decoration: underline;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(1.05);
}

.btn-danger:hover {
  filter: brightness(1.05);
}

.table-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: auto;
  box-shadow: var(--shadow);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pendiente {
  background: #fef9c3;
  color: #854d0e;
}

.badge-aprobada {
  background: #dcfce7;
  color: #166534;
}

.badge-conocimiento {
  background: #d1fae5;
  color: #065f46;
}

.badge-rechazada {
  background: #fee2e2;
  color: #991b1b;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.alert-impersonate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.impersonate-stop-form {
  margin: 0;
  flex-shrink: 0;
}

body.is-impersonating .topbar {
  box-shadow: inset 0 3px 0 #f59e0b;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.modal--wide {
  max-width: min(720px, 100vw - 2rem);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.modal-body {
  padding: 1.25rem;
}

.form-grid {
  display: grid;
  gap: 1rem;
}

label span {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type="text"],
input[type="date"],
input[type="time"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Login */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

.login-sub {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inline-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  align-items: center;
}

.col-acciones {
  min-width: 20rem;
  white-space: normal;
}

.app-footer {
  padding: 0.75rem 1.5rem 1.25rem;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .app-shell {
    display: block;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .sidebar-backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1040;
    -webkit-tap-highlight-color: transparent;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18);
  }

  .main-wrap {
    width: 100%;
    min-height: 100vh;
  }

  body.nav-menu-open {
    overflow: hidden;
  }
}
