/* =========================================================================
   MedLaboral — Design system (sobre Bootstrap 5.3)
   Prioridad: claridad > decoración.
   ========================================================================= */
:root {
  --ml-primary: #0e7490;
  --ml-primary-600: #0b5e75;
  --ml-primary-50: #ecfeff;
  --ml-sidebar-bg: #0c1b26;
  --ml-sidebar-fg: #a9bcc9;
  --ml-sidebar-active: #ffffff;
  --ml-sidebar-hover: rgba(255, 255, 255, .06);
  --ml-bg: #f4f6f9;
  --ml-surface: #ffffff;
  --ml-border: #e3e8ee;
  --ml-text: #1c2733;
  --ml-muted: #66768a;
  --ml-radius: .6rem;
  --ml-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --ml-sidebar-w: 248px;

  --bs-primary: var(--ml-primary);
  --bs-primary-rgb: 14, 116, 144;
  --bs-link-color: var(--ml-primary);
  --bs-link-color-rgb: 14, 116, 144;
  --bs-link-hover-color: var(--ml-primary-600);
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--ml-text);
  --bs-body-bg: var(--ml-bg);
  --bs-border-color: var(--ml-border);
  --bs-border-radius: var(--ml-radius);
}

body { font-size: .9rem; background: var(--ml-bg); }
a { text-decoration: none; }
.text-muted, .text-secondary { color: var(--ml-muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.small-caps { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--ml-muted); }

/* ---------- Botones ---------- */
.btn { font-weight: 500; border-radius: .5rem; font-size: .875rem; }
.btn-primary { --bs-btn-bg: var(--ml-primary); --bs-btn-border-color: var(--ml-primary);
  --bs-btn-hover-bg: var(--ml-primary-600); --bs-btn-hover-border-color: var(--ml-primary-600);
  --bs-btn-active-bg: var(--ml-primary-600); --bs-btn-active-border-color: var(--ml-primary-600);
  --bs-btn-disabled-bg: var(--ml-primary); --bs-btn-disabled-border-color: var(--ml-primary); }
.btn-outline-primary { --bs-btn-color: var(--ml-primary); --bs-btn-border-color: var(--ml-primary);
  --bs-btn-hover-bg: var(--ml-primary); --bs-btn-hover-border-color: var(--ml-primary);
  --bs-btn-active-bg: var(--ml-primary); --bs-btn-active-border-color: var(--ml-primary); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--ml-border); --bs-btn-hover-bg: #f3f5f8;
  --bs-btn-hover-border-color: #d5dce4; }
.btn-icon { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Layout ---------- */
.ml-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--ml-sidebar-w); background: var(--ml-sidebar-bg);
  color: var(--ml-sidebar-fg); display: flex; flex-direction: column; z-index: 1040; transition: transform .2s;
}
.ml-brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1.25rem; color: #fff; }
.ml-brand-logo { width: 34px; height: 34px; border-radius: .55rem; background: linear-gradient(135deg, #14b8a6, #0e7490);
  display: grid; place-items: center; font-size: 1.1rem; color: #fff; }
.ml-brand-name { font-weight: 700; font-size: 1.02rem; line-height: 1.1; }
.ml-brand-sub { font-size: .68rem; color: var(--ml-sidebar-fg); }
.ml-nav { padding: .5rem .75rem 1rem; overflow-y: auto; flex: 1; }
.ml-nav-section { font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: #5f7688;
  margin: 1.1rem .6rem .35rem; font-weight: 600; }
.ml-nav a { display: flex; align-items: center; gap: .7rem; color: var(--ml-sidebar-fg); padding: .5rem .65rem;
  border-radius: .45rem; font-weight: 500; margin-bottom: 1px; }
.ml-nav a i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.ml-nav a:hover { background: var(--ml-sidebar-hover); color: #fff; }
.ml-nav a.active { background: rgba(20, 184, 166, .16); color: var(--ml-sidebar-active); }
.ml-nav a.active i { color: #2dd4bf; }
.ml-nav .badge-soon { margin-left: auto; font-size: .6rem; font-weight: 600; color: #7c93a4;
  border: 1px solid #2b4150; border-radius: 1rem; padding: .05rem .4rem; }
.ml-nav a.disabled { opacity: .55; pointer-events: none; }
.ml-sidebar-footer { padding: .9rem 1.25rem; border-top: 1px solid rgba(255, 255, 255, .06); font-size: .72rem; color: #5f7688; }

.ml-main { margin-left: var(--ml-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.ml-topbar { position: sticky; top: 0; z-index: 1030; height: 60px; background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px); border-bottom: 1px solid var(--ml-border); display: flex; align-items: center;
  gap: .75rem; padding: 0 1.5rem; }
.ml-content { padding: 1.5rem; flex: 1; max-width: 1480px; width: 100%; }
.ml-empresa-switch .form-select { min-width: 230px; font-weight: 500; }
.ml-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ml-primary-50); color: var(--ml-primary);
  display: inline-grid; place-items: center; font-weight: 700; font-size: .78rem; flex-shrink: 0; }
.ml-avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.ml-avatar-sm { width: 30px; height: 30px; font-size: .7rem; }

@media (max-width: 991.98px) {
  .ml-sidebar { transform: translateX(-100%); }
  .ml-sidebar.show { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); }
  .ml-main { margin-left: 0; }
  .ml-content { padding: 1rem; }
  .ml-topbar { padding: 0 1rem; }
  .ml-empresa-switch .form-select { min-width: 0; max-width: 180px; }
}
.ml-backdrop { display: none; }
.ml-sidebar.show + .ml-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1035; }

/* ---------- Encabezado de página ---------- */
.ml-page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.25rem; }
.ml-page-header h1 { font-size: 1.4rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.ml-page-header .ml-subtitle { color: var(--ml-muted); margin-top: .2rem; }
.breadcrumb { font-size: .8rem; margin-bottom: .35rem; --bs-breadcrumb-divider-color: #9aa8b6; }
.breadcrumb a { color: var(--ml-muted); }
.breadcrumb a:hover { color: var(--ml-primary); }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--ml-border); border-radius: var(--ml-radius); box-shadow: var(--ml-shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--ml-border); padding: .85rem 1.1rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header h2, .card-header h3 { font-size: .95rem; font-weight: 600; margin: 0; }
.card-body { padding: 1.1rem; }

/* KPI */
.kpi { display: block; color: inherit; height: 100%; transition: border-color .15s, box-shadow .15s, transform .15s; }
a.kpi:hover { border-color: #b7c6d3; box-shadow: 0 4px 14px rgba(16, 24, 40, .08); transform: translateY(-1px); color: inherit; }
.kpi .card-body { display: flex; gap: .9rem; align-items: flex-start; }
.kpi-icon { width: 42px; height: 42px; border-radius: .6rem; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; }
.kpi-label { color: var(--ml-muted); font-weight: 500; font-size: .8rem; }
.kpi-hint { font-size: .72rem; color: var(--ml-muted); margin-top: .25rem; }
.tone-primary { background: #e0f2f7; color: #0e7490; }
.tone-danger { background: #fde8e8; color: #c0262d; }
.tone-warning { background: #fef3dc; color: #b45309; }
.tone-info { background: #e6effd; color: #2855b8; }
.tone-success { background: #e3f6ec; color: #147a4a; }
.tone-violet { background: #efe9fd; color: #6a3fc9; }

/* ---------- Tablas ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; font-size: .86rem; }
.table > :not(caption) > * > * { padding: .7rem .9rem; border-bottom-color: var(--ml-border); }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ml-muted);
  font-weight: 600; background: #f8fafc; white-space: nowrap; }
.table thead th a { color: inherit; }
.table thead th a:hover { color: var(--ml-primary); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f6f9fc; }
.table tr.row-link { cursor: pointer; }
.table td .cell-main { font-weight: 600; color: var(--ml-text); }
.table td .cell-sub { font-size: .76rem; color: var(--ml-muted); }
.table-responsive { border-radius: 0 0 var(--ml-radius) var(--ml-radius); }
tr.anulado td { color: #9aa8b6; text-decoration: line-through; }

/* ---------- Filtros ---------- */
.ml-filters { padding: .85rem 1.1rem; border-bottom: 1px solid var(--ml-border); background: #fcfdfe; border-radius: var(--ml-radius) var(--ml-radius) 0 0; }
.ml-filters .form-control, .ml-filters .form-select { font-size: .84rem; }
.ml-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; padding: .2rem .6rem;
  background: var(--ml-primary-50); color: var(--ml-primary-600); border-radius: 1rem; font-weight: 500; }

/* ---------- Badges de estado ---------- */
.badge { font-weight: 600; font-size: .7rem; padding: .35em .6em; border-radius: .4rem; letter-spacing: .01em; }
.st { display: inline-flex; align-items: center; gap: .3rem; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-success { background: #e3f6ec; color: #147a4a; }
.st-danger { background: #fde8e8; color: #b42318; }
.st-warning { background: #fef3dc; color: #a15c07; }
.st-info { background: #e6effd; color: #2855b8; }
.st-neutral { background: #eef1f5; color: #506070; }
.st-violet { background: #efe9fd; color: #6a3fc9; }

/* ---------- Formularios ---------- */
.form-label { font-weight: 500; font-size: .82rem; margin-bottom: .3rem; color: #344454; }
.form-control, .form-select { border-color: #d5dce4; font-size: .875rem; border-radius: .5rem; }
.form-control:focus, .form-select:focus { border-color: #5fb3c7; box-shadow: 0 0 0 .2rem rgba(14, 116, 144, .15); }
.form-text { font-size: .75rem; }
.form-section { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ml-muted);
  margin: 0 0 .9rem; padding-bottom: .5rem; border-bottom: 1px solid var(--ml-border); }
.required::after { content: " *"; color: #c0262d; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; padding-top: 1rem; border-top: 1px solid var(--ml-border); margin-top: .5rem; }
.checkbox-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.checkbox-list li { display: flex; gap: .5rem; align-items: center; }
.confidencial { border-left: 3px solid #a78bfa; padding-left: .75rem; }

/* ---------- Tabs ---------- */
.nav-tabs.ml-tabs { border-bottom: 1px solid var(--ml-border); gap: .25rem; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.nav-tabs.ml-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--ml-muted); font-weight: 500;
  padding: .7rem .9rem; white-space: nowrap; display: flex; align-items: center; gap: .4rem; }
.nav-tabs.ml-tabs .nav-link:hover { color: var(--ml-text); }
.nav-tabs.ml-tabs .nav-link.active { color: var(--ml-primary); border-bottom-color: var(--ml-primary); background: transparent; }
.nav-tabs.ml-tabs .count { font-size: .68rem; background: #eef1f5; color: #506070; border-radius: 1rem; padding: .05rem .45rem; }
.nav-tabs.ml-tabs .nav-link.active .count { background: var(--ml-primary-50); color: var(--ml-primary); }

/* ---------- Ficha trabajador ---------- */
.ficha-header { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; }
.ficha-header h1 { font-size: 1.45rem; font-weight: 700; margin: 0; }
.ficha-meta { display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; color: var(--ml-muted); font-size: .83rem; margin-top: .35rem; }
.ficha-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem 1.25rem; margin: 0; }
.dl-grid dt { font-size: .72rem; color: var(--ml-muted); font-weight: 500; margin-bottom: .1rem; }
.dl-grid dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.alert-stack .alert { display: flex; gap: .6rem; align-items: center; padding: .6rem .9rem; margin-bottom: .5rem; font-size: .85rem; border-radius: .5rem; }
.mini-stat { text-align: center; padding: .75rem .5rem; border: 1px solid var(--ml-border); border-radius: .5rem; background: #fbfcfd; }
.mini-stat .v { font-size: 1.35rem; font-weight: 700; }
.mini-stat .l { font-size: .72rem; color: var(--ml-muted); }

/* ---------- Timeline ---------- */
.timeline { position: relative; margin: 0; padding: 0 0 0 1.75rem; list-style: none; }
.timeline::before { content: ""; position: absolute; left: .6rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--ml-border); }
.timeline > li { position: relative; margin-bottom: 1rem; }
.timeline-dot { position: absolute; left: -1.75rem; top: .75rem; width: 1.25rem; height: 1.25rem; border-radius: 50%;
  display: grid; place-items: center; font-size: .65rem; background: #fff; border: 2px solid var(--ml-primary); color: var(--ml-primary); }
.timeline-card { background: #fff; border: 1px solid var(--ml-border); border-radius: .55rem; padding: .85rem 1rem; }
.timeline-card.anulado { background: #f8f9fb; opacity: .75; }
.timeline-date { font-size: .75rem; color: var(--ml-muted); font-weight: 500; }
.timeline-year { font-size: .72rem; font-weight: 700; color: var(--ml-muted); margin: 0 0 .6rem -1.75rem; background: var(--ml-bg); display: inline-block; padding: 0 .4rem; position: relative; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ml-muted); }
.empty-state i { font-size: 2.2rem; color: #b8c4cf; display: block; margin-bottom: .6rem; }
.empty-state h3 { font-size: 1rem; color: var(--ml-text); font-weight: 600; margin-bottom: .3rem; }

/* ---------- Listas compactas ---------- */
.list-compact { list-style: none; padding: 0; margin: 0; }
.list-compact li { display: flex; gap: .75rem; align-items: center; padding: .65rem 1.1rem; border-bottom: 1px solid var(--ml-border); }
.list-compact li:last-child { border-bottom: 0; }
.list-compact .grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside { background: radial-gradient(circle at 20% 20%, #115e73 0, #0c1b26 60%); color: #d5e3ec; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside h2 { color: #fff; font-weight: 700; font-size: 1.9rem; letter-spacing: -.02em; }
.auth-aside ul { list-style: none; padding: 0; }
.auth-aside li { display: flex; gap: .6rem; margin-bottom: .7rem; }
.auth-aside li i { color: #2dd4bf; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.auth-form .inner { width: 100%; max-width: 380px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-aside { display: none; } }

/* ---------- Paginación ---------- */
.pagination { --bs-pagination-color: var(--ml-text); --bs-pagination-active-bg: var(--ml-primary); --bs-pagination-active-border-color: var(--ml-primary);
  --bs-pagination-font-size: .82rem; margin: 0; }
.ml-table-footer { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; padding: .75rem 1.1rem; border-top: 1px solid var(--ml-border); font-size: .8rem; color: var(--ml-muted); }

/* ---------- Otros ---------- */
.flash-container { position: fixed; top: 70px; right: 1.25rem; z-index: 1080; width: min(420px, calc(100vw - 2.5rem)); }
.flash-container .alert { box-shadow: 0 8px 24px rgba(16, 24, 40, .12); font-size: .86rem; }
.chart-box { position: relative; height: 240px; }
.text-pre { white-space: pre-line; }
.estado-banner { border-radius: .5rem; padding: .75rem 1rem; display: flex; gap: .6rem; align-items: center; }
.soon { font-size: .68rem; font-weight: 600; background: #eef1f5; color: #506070; border-radius: 1rem; padding: .1rem .5rem; }
.min-w-0 { min-width: 0; }

/* ---------- Análisis de ausentismo: jerarquía resultado → composición → análisis ---------- */
.hero { border-top: 4px solid var(--ml-primary); }
.hero .card-body { padding: 1.4rem 1.5rem; }
.hero-eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ml-muted); }
.hero-valor { font-size: clamp(3rem, 7vw, 4.4rem); font-weight: 800; line-height: 1; letter-spacing: -.035em; color: var(--ml-text); }
.hero-valor:hover { color: var(--ml-primary); }
.hero-unidad { font-size: .45em; font-weight: 700; margin-left: .15em; color: var(--ml-muted); }
.hero-variacion { display: flex; flex-direction: column; padding: .35rem .7rem; border-radius: .5rem; background: #eef1f5; color: #506070; margin-bottom: .35rem; }
.hero-variacion.sube { background: #fde8e8; color: #b42318; }
.hero-variacion.baja { background: #e3f6ec; color: #147a4a; }
.hero-variacion-ref { font-size: .75rem; color: var(--ml-muted); }
.hero-sub { margin-top: .5rem; color: var(--ml-muted); font-weight: 500; }
.hero-contexto { font-size: .8rem; color: var(--ml-muted); margin: .6rem 0 0; max-width: 62ch; }
.hero-composicion { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--ml-border); }
.composicion-barra { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #eef1f5; gap: 2px; }
.composicion-barra a { display: block; min-width: 4px; }
.composicion-barra a:hover { filter: brightness(1.15); }
.composicion-item { display: flex; gap: .55rem; align-items: flex-start; padding: .5rem .55rem; border-radius: .5rem; color: inherit; }
.composicion-item:hover { background: #f4f7fa; color: inherit; }
.composicion-item .punto { width: 10px; height: 10px; border-radius: 50%; margin-top: .3rem; flex-shrink: 0; }
.composicion-nombre { display: block; font-size: .78rem; color: var(--ml-muted); font-weight: 500; }
.composicion-valor { display: block; font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.composicion-meta { display: block; font-size: .72rem; color: var(--ml-muted); }
.secundarios .list-compact li { padding: 0; }
.secundarios .list-compact a { display: flex; gap: .75rem; align-items: center; padding: .8rem 1.1rem; color: inherit; width: 100%; }
.secundarios .list-compact a:hover { background: #f6f9fc; }
.sec-label { display: block; font-weight: 600; font-size: .84rem; }
.sec-hint { display: block; font-size: .72rem; color: var(--ml-muted); }
.sec-valor { font-size: 1.15rem; font-weight: 700; white-space: nowrap; color: #344454; }
.sec-valor-sm { font-size: 1rem; font-weight: 600; color: var(--ml-muted); }
.seccion-titulo { font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ml-muted); margin: 1.5rem 0 .6rem; }
.periodo-chip { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600; padding: .3rem .7rem;
  border-radius: 1rem; background: #eef1f5; color: #506070; border: 1px solid #dde3ea; }
.periodo-chip.en-curso { background: #e6effd; color: #1f4aa8; border-color: #b9cdf5; }
.hero.hero-en-curso { border-top-color: #3b6fd8; }

/* ---------- Notificaciones y medicina preventiva ---------- */
.notif-btn { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; }
.notif-contador { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #dc2626; color: #fff; font-size: .65rem; font-weight: 700; display: grid; place-items: center; }
.notif-menu { width: min(360px, calc(100vw - 2rem)); }
.notif-item { white-space: normal; border-bottom: 1px solid var(--ml-border); padding: .55rem .9rem; }
.notif-no-leida { background: #f5f9ff; }
.confidencial-bloque { background: #faf7ff; }
.resumen-restriccion { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }

/* ---------- Medicina preventiva: jerarquía y excepciones ---------- */
.excepcion { display: flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; margin-top: .15rem; white-space: nowrap; }
.excepcion .bi { font-size: .8rem; }
.excepcion-danger { color: #c0262d; }
.excepcion-warning { color: #b45309; }
.excepcion-violet { color: #6a3fc9; }
.excepcion-muted { color: var(--ml-muted); font-weight: 500; }
.vacio-compacto { display: flex; align-items: center; gap: .5rem; padding: .85rem 1.1rem; color: var(--ml-muted); font-size: .85rem; }
.vacio-compacto .bi { color: #9bb0a5; font-size: 1rem; }
.accion-kpi { display: flex; gap: .85rem; align-items: center; color: inherit; height: 100%; border-left: 4px solid transparent; }
.accion-kpi .card-body { display: flex; gap: .85rem; align-items: center; width: 100%; padding: 1rem 1.1rem; }
a.accion-kpi:hover { color: inherit; box-shadow: 0 4px 14px rgba(16, 24, 40, .08); }
.accion-kpi .accion-num { font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -.02em; min-width: 2.2ch; text-align: center; }
.accion-kpi .accion-texto { font-weight: 600; line-height: 1.25; }
.accion-kpi .accion-pista { font-size: .75rem; color: var(--ml-muted); margin-top: .15rem; }
.accion-kpi .accion-ir { margin-left: auto; color: var(--ml-muted); }
.accion-kpi.tono-danger { border-left-color: #d9363e; }
.accion-kpi.tono-danger .accion-num { color: #c0262d; }
.accion-kpi.tono-violet { border-left-color: #7c52d6; }
.accion-kpi.tono-violet .accion-num { color: #6a3fc9; }
.accion-kpi.tono-warning { border-left-color: #e0952b; }
.accion-kpi.tono-warning .accion-num { color: #b45309; }
.accion-kpi.tono-ok { border-left-color: #cfe7da; }
.accion-kpi.tono-ok .accion-num { color: #9bb0a5; }
.accion-kpi.tono-ok .accion-texto { color: var(--ml-muted); font-weight: 500; }
.info-strip { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; padding: .7rem 1.1rem; }
.info-strip a { display: inline-flex; align-items: baseline; gap: .4rem; color: var(--ml-muted); font-size: .85rem; }
.info-strip a strong { color: var(--ml-text); font-size: 1.05rem; }
.info-strip a:hover { color: var(--ml-text); }
.vistas-rapidas { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.vistas-rapidas .btn-group { flex-wrap: nowrap; }
.vistas-rapidas .btn-group .btn { white-space: nowrap; }
.proximo-paso { border-left: 4px solid; }
.proximo-paso.tono-danger { border-left-color: #d9363e; }
.proximo-paso.tono-violet { border-left-color: #7c52d6; }
.proximo-paso.tono-warning { border-left-color: #e0952b; }
.proximo-paso.tono-info { border-left-color: #3b6fd8; }
.proximo-paso .paso + .paso { border-top: 1px solid var(--ml-border); }
.proximo-paso .paso { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .8rem 1.1rem; }
.proximo-paso .paso .paso-texto { flex: 1 1 260px; }
.st.st-icono::before { display: none; }
.text-violet { color: #6a3fc9; }
#linea-clinica > li[hidden] { display: none; }
@media (max-width: 575.98px) {
  .vistas-rapidas { flex-wrap: wrap; }
  .vistas-rapidas .btn-group { max-width: 100%; overflow-x: auto; scrollbar-width: thin; }
}

/* Entorno de preproducción: franja visible para no confundirlo con producción */
.ml-franja-entorno { position: sticky; top: 0; z-index: 2000; background: #b45309; color: #fff; text-align: center; font-size: .78rem; font-weight: 600; padding: .25rem .5rem; letter-spacing: .02em; }

/* Búsqueda rápida de trabajadores en la barra superior */
.ml-busqueda-rapida { position: relative; align-items: center; flex: 0 1 320px; margin-left: .75rem; }
.ml-busqueda-rapida .bi { position: absolute; left: .6rem; color: var(--ml-muted); font-size: .85rem; pointer-events: none; }
.ml-busqueda-rapida .form-control { padding-left: 1.9rem; }

/* Derivación urgente en la bandeja del médico: se distingue sin convertir la pantalla en una alarma */
tr.derivacion-urgente > td:first-child { box-shadow: inset 3px 0 0 #d9363e; }
.notif-prioridad-URGENTE { border-left: 3px solid #d9363e; }
.notif-prioridad-IMPORTANTE { border-left: 3px solid #e0952b; }

/* Nueva atención de enfermería: carga progresiva. «oculto-si-js» sólo oculta con JavaScript activo (sin JS todo
   queda visible y el formulario funciona igual). */
.js-activo .oculto-si-js { display: none !important; }
html:not(.js-activo) .solo-js { display: none !important; }
.atencion-form fieldset.fila-proc { min-width: 0; border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.opciones-atencion { display: flex; flex-direction: column; gap: .75rem; border-top: 1px solid var(--ml-border); padding-top: 1rem; }
.opcion-atencion .detalle-opcion { margin: .5rem 0 0 1.75rem; padding: .75rem; border-left: 3px solid var(--ml-border); background: rgba(16, 24, 40, .02); border-radius: 0 .4rem .4rem 0; }
.acciones-atencion { flex-wrap: wrap; align-items: center; }
.guardar-y { position: relative; }
.guardar-y > summary { list-style: none; cursor: pointer; }
.guardar-y > summary::-webkit-details-marker { display: none; }
.guardar-y-menu { position: absolute; right: 0; bottom: calc(100% + .35rem); min-width: 15rem; background: #fff; border: 1px solid var(--ml-border); border-radius: .5rem; padding: .35rem; z-index: 20; display: flex; flex-direction: column; gap: .25rem; }
@media (max-width: 767.98px) {
  .opcion-atencion .detalle-opcion { margin-left: 0; }
  .acciones-atencion > * { flex: 1 1 auto; }
  .acciones-atencion .btn-primary { flex-basis: 100%; order: 10; }
  .acciones-atencion .guardar-y { flex-basis: 100%; }
  .acciones-atencion .guardar-y > summary { width: 100%; }
  .guardar-y-menu { position: static; margin-top: .35rem; min-width: 0; }
}

/* Señal de pendientes personales en otras empresas (barra superior) */
.ml-otras-empresas { display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap; }
@media (max-width: 991.98px) { .ml-otras-empresas span { display: none; } }
details.conducta { border: 1px solid var(--ml-border); border-radius: .5rem; padding: .6rem .9rem; }
details.conducta > summary { cursor: pointer; }
details.conducta .detalle-opcion { margin: .5rem 0 0 1.75rem; padding: .75rem; border-left: 3px solid var(--ml-border); }
@media (max-width: 767.98px) { details.conducta .detalle-opcion { margin-left: 0; } }
