/* =====================================================================
   estilos.css — SSOMA v2 · Centro de operaciones
   Interfaz sobria para gestión industrial, sin dependencias tipográficas
   externas ni recursos visuales remotos.
   ===================================================================== */

:root {
  --app-viewport-height: 100vh;
  --corp:        #DF1F3D;   /* acento corporativo */
  --corp-dark:   #b3182f;
  --corp-soft:   #fdecef;

  --ink:         #0F172A;   /* texto principal (Slate 900) */
  --ink-soft:    #475569;   /* texto secundario (Slate 600) */
  --ink-faint:   #94A3B8;   /* placeholders (Slate 400) */

  --bg:          #F8FAFC;   /* fondo general (Slate 50) */
  --surface:     #ffffff;   /* tarjetas blancas */
  --line:        #E2E8F0;   /* bordes (Slate 200) */
  --line-soft:   #F1F5F9;   /* bordes ultra suaves (Slate 100) */

  --glass:       rgba(255, 255, 255, 0.72);
  --blur:        12px;

  --radius:      12px;
  --radius-lg:   16px;
  
  --shadow-xs:   0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm:   0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 1px 2px -1px rgba(15, 23, 42, 0.02);
  --shadow:      0 4px 6px -1px rgba(15, 23, 42, 0.04), 0 2px 4px -2px rgba(15, 23, 42, 0.02);
  --shadow-lg:   0 10px 15px -3px rgba(15, 23, 42, 0.04), 0 4px 6px -4px rgba(15, 23, 42, 0.02);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

@supports (height: 100dvh) {
  :root { --app-viewport-height: 100dvh; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--corp); text-decoration: none; }
a:hover { color: var(--corp-dark); }

h1,h2,h3,h4,h5 { font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }

/* ---------- Botones ------------------------------------------------ */
.btn-corp {
  background: var(--corp);
  border: 1px solid var(--corp);
  color: #fff;
  border-radius: 10px;
  padding: .62rem 1.15rem;
  font-weight: 600;
  letter-spacing: .01em;
  box-shadow: 0 4px 12px rgba(223,31,61,.15);
  transition: background .15s ease, box-shadow .15s ease, transform .1s ease;
}
.btn-corp:hover  { background: var(--corp-dark); border-color: var(--corp-dark); color:#fff; box-shadow: 0 6px 16px rgba(223,31,61,.25); transform: translateY(-1px); }
.btn-corp:active { transform: translateY(1px); }

.btn-outline-corp {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 11px;
  padding: .55rem 1.05rem;
  font-weight: 600;
}
.btn-outline-corp:hover { border-color: var(--corp); color: var(--corp); background: var(--corp-soft); }

/* ---------- Formularios ------------------------------------------- */
.form-label { font-weight: 600; font-size: 12.5px; color: var(--ink-soft); margin-bottom: .3rem; }
.form-control, .form-select {
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  padding: .62rem .85rem;
  color: var(--ink);
  font-size: 14.5px;
}
.form-control::placeholder { color: var(--ink-faint); }
.form-control:focus, .form-select:focus {
  border-color: var(--corp);
  box-shadow: 0 0 0 3px rgba(223,31,61,.12);
  outline: none;
}

/* =====================================================================
   LOGIN — Pantalla dividida (split 50/50)
   ===================================================================== */
/* La pantalla de login ocupa exactamente el viewport, sin scroll. */
body.login-page {
  margin: 0;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.login-split {
  height: 100vh;
  width: 100vw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  overflow: hidden;
}

/* Lado izquierdo: formulario sobre base limpia */
.login-left {
  display: grid;
  place-items: center;
  padding: 24px 28px;
  overflow: hidden;           /* sin barra de desplazamiento */
  background:
    radial-gradient(600px 300px at 20% 0%, rgba(223,31,61,.04), transparent 60%),
    var(--surface);
}

/* Contenedor del formulario (glass sutil) */
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(140%);
  backdrop-filter: blur(var(--blur)) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 34px 32px;
}

.login-brand { text-align: center; margin-bottom: 6px; }
.login-brand .logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 22px; color: var(--corp); letter-spacing: -.02em;
}
.login-brand .logo .dot {
  width: 30px; height: 30px; border-radius: 9px; background: var(--corp);
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 800;
  box-shadow: 0 6px 14px rgba(223,31,61,.30);
}
.login-title { text-align: center; font-size: 20px; margin: 14px 0 2px; color: var(--ink); }
.login-sub   { text-align: center; color: var(--ink-soft); font-size: 13px; margin-bottom: 20px; }

/* Segmented control (pestañas de empresa) — estilo iOS/Fluent */
.login-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 4px;
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.login-tabs::-webkit-scrollbar { display: none; }
.login-tab {
  flex: 1 0 auto;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 13.5px;
  padding: .5rem .9rem;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.login-tab:hover { color: var(--ink); }
.login-tab.activo {
  background: #fff;
  color: var(--corp);
  box-shadow: var(--shadow-sm);
}

.login-field { margin-bottom: 14px; }

/* Campo contraseña con botón Mostrar */
.login-pass { position: relative; }
.login-pass .toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--corp);
  font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.login-pass .form-control { padding-right: 78px; }

.btn-login {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: .8rem 1rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  background: var(--corp);
  box-shadow: 0 8px 20px rgba(223,31,61,.26);
  cursor: pointer;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn-login:hover  { background: var(--corp-dark); box-shadow: 0 10px 24px rgba(223,31,61,.32); }
.btn-login:active { transform: translateY(1px); }

/* Botón Microsoft (opcional) */
.btn-ms {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: .72rem 1rem;
  font-weight: 600; color: var(--ink);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.btn-ms:hover { border-color: var(--corp); background: var(--corp-soft); color: var(--ink); }
.btn-ms .ms-grid {
  width: 16px; height: 16px;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px;
}
.btn-ms .ms-grid i { display:block; }
.btn-ms .ms-grid i:nth-child(1){ background:#F25022; }
.btn-ms .ms-grid i:nth-child(2){ background:#7FBA00; }
.btn-ms .ms-grid i:nth-child(3){ background:#00A4EF; }
.btn-ms .ms-grid i:nth-child(4){ background:#FFB900; }

.login-sep {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-faint); font-size: 12px; margin: 16px 0;
}
.login-sep::before, .login-sep::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.login-links { text-align: center; margin-top: 4px; }
.login-links a { display: block; font-size: 13px; margin: 6px 0; font-weight: 600; }
.login-links .muted { color: var(--ink-soft); font-weight: 500; }

.login-foot {
  text-align: center; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.login-foot a { font-weight: 700; letter-spacing: .06em; font-size: 12.5px; }

.alert-login {
  background: var(--corp-soft);
  border: 1px solid rgba(223,31,61,.25);
  color: var(--corp-dark);
  border-radius: 11px;
  padding: .6rem .8rem;
  font-size: 13px;
  margin-bottom: 16px;
}

/* Lado derecho: la mascota es la protagonista (grande, tocando el borde) */
.login-right {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(700px 500px at 70% 10%, #eef2f8, transparent 60%),
    radial-gradient(600px 500px at 90% 100%, var(--corp-soft), transparent 55%),
    linear-gradient(180deg, #fbfcfe 0%, #f2f5f9 100%);
  display: flex;
  align-items: flex-end;      /* la mascota se apoya en el borde inferior */
  justify-content: center;
}
/* Línea vertical de acento (como en las referencias) */
.login-right::before {
  content: "";
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 2px;
  background: linear-gradient(180deg, transparent, var(--corp), transparent);
  opacity: .55;
  z-index: 1;
}
.login-art {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.login-art .mascota {
  height: 96%;                /* casi todo el alto disponible */
  max-width: 100%;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(16,24,40,.16));
}
.login-art .fallback {
  width: 220px; height: 220px; border-radius: 50%;
  margin: 0 auto 8%;
  display: grid; place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: 82px; font-weight: 800; color: var(--corp);
}

@media (max-width: 900px) {
  /* En móvil prioriza el formulario: una sola columna y sin mascota. */
  body.login-page { overflow: auto; height: auto; }
  .login-split { grid-template-columns: 1fr; height: auto; min-height: 100vh; overflow: visible; }
  .login-right { display: none; }
  .login-left { padding: 24px 18px; }
  .login-card { max-width: 440px; }
}

/* =====================================================================
   ESTÁNDAR DEL SISTEMA (app: sidebar + header + tarjetas)
   ===================================================================== */
.app { display: flex; min-height: var(--app-viewport-height); background: var(--bg); }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 12px;
  position: sticky; top: 0;
  height: var(--app-viewport-height);
  overflow-y: auto;            /* el menú crece: permite scroll interno */
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  z-index: 4;
}
/* Scrollbar del sidebar: delgado, sutil y elegante */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(16,24,40,.14);
  border-radius: 999px;
}
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(223,31,61,.45); }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(16,24,40,.18) transparent; }
.sidebar .brand { display:flex; align-items:center; gap:10px; padding: 6px 10px 16px; }
.sidebar .brand .dot {
  width: 32px; height: 32px; border-radius: 9px; background: var(--corp);
  display:grid; place-items:center; color:#fff; font-weight:800;
  box-shadow: 0 6px 14px rgba(223,31,61,.28);
}
.sidebar .brand strong { font-size: 15px; }

.nav-corp { list-style: none; padding: 0; margin: 0; }
.nav-corp li { margin: 1px 0; }
.nav-corp a {
  display: flex; align-items: center; gap: 10px;
  padding: .58rem .8rem;
  border-radius: 10px;
  color: var(--ink-soft);
  font-weight: 550;
  font-size: 14px;
  transition: background .12s ease, color .12s ease;
}
.nav-corp a:hover { background: var(--line-soft); color: var(--ink); }
.nav-corp .nav-logout { margin: 0; }
.nav-corp .nav-logout button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: transparent; color: var(--muted);
  padding: .58rem .8rem; border-radius: 10px; text-align: left;
  font: inherit; cursor: pointer;
}
.nav-corp .nav-logout button:hover { background: var(--line-soft); color: var(--ink); }
.nav-corp a.activo {
  background: var(--corp-soft);
  color: var(--corp);
  font-weight: 650;
  position: relative;
}
.nav-corp a.activo::before {
  content: "";
  position: absolute;
  left: -12px; /* Pull it to the edge of the padding */
  top: 50%;
  transform: translateY(-50%);
  height: 60%;
  width: 4px;
  background: var(--corp);
  border-radius: 0 4px 4px 0;
}
.nav-corp a i.bi { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-corp .grupo {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-faint); padding: 14px 10px 6px; font-weight: 700;
}

/* Botón de la topbar (colapsar) */
.topbar-btn {
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; color: var(--ink);
  display: grid; place-items: center; font-size: 18px;
}
.topbar-btn:hover { border-color: var(--corp); color: var(--corp); }

/* ---- Sidebar COLAPSADO (solo íconos) — escritorio ---- */
.app.sidebar-colapsado .sidebar { width: 66px; padding: 16px 8px; }
.app.sidebar-colapsado .sidebar .brand strong,
.app.sidebar-colapsado .nav-corp .txt,
.app.sidebar-colapsado .nav-corp .grupo { display: none; }
.app.sidebar-colapsado .sidebar .brand { justify-content: center; }
.app.sidebar-colapsado .nav-corp a { justify-content: center; padding: .6rem 0; }
.app.sidebar-colapsado .nav-corp a i.bi { width: auto; }

.contenido { flex: 1; min-width: 0; }

.topbar {
  background: rgba(255,255,255,.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 14px 26px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 5;
}
.topbar .titulo { font-weight: 700; font-size: 17px; color: var(--corp); letter-spacing: -.01em; }
.topbar .usuario { display:flex; align-items:center; gap:10px; color: var(--ink-soft); font-size: 13.5px; }
.topbar .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--corp-soft); color: var(--corp);
  display:grid; place-items:center; font-weight: 700;
  overflow: hidden; border: 1px solid var(--line);
}
.topbar .avatar img { width: 100%; height: 100%; object-fit: cover; }

.main { padding: 24px; }

/* ---------- Tarjetas ---------------------------------------------- */
.card-corp {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-corp:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-corp .card-head {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  display:flex; align-items:center; justify-content:space-between;
  font-weight: 650; font-size: 15px;
}
.card-corp .card-body { padding: 20px; }

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.metric .n { font-size: 32px; font-weight: 800; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.metric .l { color: var(--ink-soft); font-size: 13px; margin-top: 8px; font-weight: 600; }
.metric.accent { border-left: 4px solid var(--corp); }
.metric.accent .n { color: var(--corp); }

/* ---------- Tarjetas KPI del dashboard (glass) -------------------- */
.kpi {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--corp);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.kpi-ico { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; background: var(--corp-soft); color: var(--corp); }
.kpi-n { font-size: 28px; font-weight: 800; line-height: 1; color: var(--ink); letter-spacing: -0.02em; }
.kpi-l { font-size: 13px; color: var(--ink-soft); margin-top: 6px; font-weight: 600; }

/* Contenedor de gráficos (altura fija para que Chart.js dibuje bien) */
.grafico-box { position: relative; height: 260px; }

/* ---------- Modo impresión del acta (para PDF sin cortes) --------- */
.modo-impresion {
  width: 800px !important;
  max-width: none !important;
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}
.modo-impresion img { object-fit: contain !important; }
.modo-impresion .acta-anexo img { max-height: 320px !important; object-fit: contain !important; }

/* ---------- Tablas ------------------------------------------------- */
.table-corp { width: 100%; border-collapse: collapse; text-align: left; }
.table-corp thead { background: var(--bg); }
.table-corp th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-soft);
  padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700;
}
.table-corp td { 
  padding: 16px; 
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  vertical-align: middle;
}
.table-corp tr { transition: background 0.15s ease; }
.table-corp tr:hover td { background: var(--bg); }

.badge-corp {
  background: var(--corp-soft); color: var(--corp);
  padding: .25rem .7rem; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-muted {
  background: var(--line-soft); color: var(--ink-soft);
  padding: .25rem .7rem; border-radius: 999px; font-size: 12px; font-weight: 600;
}

/* Badges de estado - SEMÁNTICA BUK */
.est {
  display: inline-block;
  padding: .25rem .75rem; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .01em;
}
.est-ok    { background: #DCFCE7; color: #15803D; }  /* Verde esmeralda */
.est-warn  { background: #FEF3C7; color: #B45309; }  /* Ámbar */
.est-bad   { background: #FEE2E2; color: #B91C1C; }  /* Rojo carmesí */
.est-muted { background: #eef0f3; color: #6c757d; }  /* gris */

/* ---------- Formulario SSOMA (secciones, buscador, firma) ---------- */
.seccion-titulo {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--corp); margin: 6px 0 8px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.buscador-select { position: relative; }
.buscador-drop {
  display: none; position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  margin-top: 4px; max-height: 240px; overflow-y: auto;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.buscador-item { padding: .5rem .8rem; cursor: pointer; font-size: 14px; }
.buscador-item:hover { background: var(--corp-soft); color: var(--corp-dark); }

.firma-wrap { text-align: center; }
.firma-canvas {
  display: block;
  width: 400px; height: 200px;         /* tamaño de dibujo = tamaño mostrado */
  max-width: 100%;
  margin: 0 auto;                       /* contenedor centrado */
  background: #fff;
  border: 2px dashed #ccc; border-radius: 8px;
  touch-action: none; cursor: crosshair;
}

/* ---------- Acta de auditoría (modal Ver detalle) ------------------ */
.acta { color: var(--ink); }
.acta-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--corp);
}
.acta-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.acta-logo-right { align-items: flex-end; text-align: right; }
.acta-logo img { max-height: 46px; max-width: 150px; object-fit: contain; }
.acta-logo-ph {
  width: 46px; height: 46px; border-radius: 10px; background: var(--corp-soft);
  color: var(--corp); display: grid; place-items: center; font-weight: 800; font-size: 20px;
}
.acta-emp { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
.acta-titulo { text-align: center; }
.acta-titulo .t1 { font-weight: 800; font-size: 16px; color: var(--corp); }
.acta-titulo .t2 { font-size: 12px; color: var(--ink-soft); }

.acta-estado {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px;
}
.acta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acta-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.acta-card-t { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--corp); margin-bottom: 8px; }
.acta-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.acta-row span { color: var(--ink-soft); }

.acta-anexos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.acta-anexo { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.acta-anexo-t { font-size: 12px; font-weight: 600; color: var(--ink-soft); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.acta-anexo img { width: 100%; max-height: 300px; object-fit: contain; display: block; background: #fff; }
.acta-anexo-vacio { height: 300px; display: grid; place-items: center; color: var(--ink-faint); font-size: 13px; }

.acta-firma { text-align: center; margin-top: 22px; }
.acta-firma-img { max-height: 90px; object-fit: contain; }
.acta-firma-linea { width: 240px; height: 1px; background: var(--ink); margin: 4px auto 6px; }
.acta-firma-nom { font-weight: 700; }
.acta-firma-dni { font-size: 12px; color: var(--ink-soft); }

@media (max-width: 640px) {
  .acta-head { grid-template-columns: 1fr; text-align: center; }
  .acta-logo, .acta-logo-right { align-items: center; }
  .acta-grid, .acta-anexos { grid-template-columns: 1fr; }
}

.icon-btn {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: .3rem .55rem; color: var(--ink-soft); cursor: pointer; font-size: 13px;
}
.icon-btn:hover { border-color: var(--corp); color: var(--corp); }
.icon-btn.danger:hover { border-color: var(--corp); color: var(--corp); background: var(--corp-soft); }

/* ---------- Modales ----------------------------------------------- */
.modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.modal-header, .modal-footer { border-color: var(--line); }
.modal-backdrop { z-index: 1050; }
.modal          { z-index: 1060; }
.modal-backdrop.show { opacity: .30; }
/* Backdrop desenfocado (glass) tras los modales */
.modal-backdrop.show { -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }

/* ---------- Secciones de grupo (inventario por categoría) --------- */
.grupo-head {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 2px 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.grupo-head .grupo-foto {
  width: 30px; height: 30px; border-radius: 8px; object-fit: cover;
  border: 1px solid var(--line);
}
.grupo-head .grupo-titulo {
  margin: 0; font-size: 16px; font-weight: 700; color: var(--ink);
}

/* ---------- Perfil ------------------------------------------------- */
.perfil-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.perfil-foto {
  width: 104px; height: 104px; border-radius: 24px; object-fit: cover;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.perfil-foto-ph {
  width: 104px; height: 104px; border-radius: 24px;
  display: grid; place-items: center; font-size: 38px; font-weight: 800; color: var(--corp);
  background: var(--corp-soft); border: 1px solid var(--line);
}
.dato-label { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.dato-valor { font-size: 15px; font-weight: 600; }

/* ---------- Footer parametrizado (separado y centrado) ------------- */
.app-footer {
  margin-top: 40px;                 /* respiro sobre las tarjetas */
  padding: 22px 26px;
  color: var(--ink-soft);
  font-size: 13px;
  text-align: center;
  border-top: 1px solid var(--line);
}
/* Enlace de la agencia: color corporativo obligatorio + negrita */
.footer-agencia,
.app-footer a,
.login-footer-txt a { color: var(--corp) !important; font-weight: bold; text-decoration: none; }
.footer-agencia:hover,
.app-footer a:hover,
.login-footer-txt a:hover { color: var(--corp-dark) !important; text-decoration: underline; }
.login-footer-txt { font-size: 11.5px; margin-top: 8px; font-weight: 500; color: var(--ink-soft); }

/* ---------- Botón hamburguesa (solo visible en móvil) -------------- */
.hamburguesa {
  display: none;                 /* oculto en escritorio */
  flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; padding: 0 9px;
}
.hamburguesa span { display: block; height: 2px; background: var(--ink); border-radius: 2px; }

/* Capa oscura tras el sidebar en móvil */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(16,24,40,.4);
  opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.sidebar-overlay.visible { opacity: 1; visibility: visible; }

/* Tablas: permiten scroll horizontal sin romper el layout */
.card-corp .card-body.p-0 { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-corp { min-width: 560px; }

/* =====================================================================
   RESPONSIVE (tablets y móviles)
   ===================================================================== */
@media (max-width: 992px) {
  .main { padding: 18px; }
}

@media (max-width: 820px) {
  /* Sidebar off-canvas: se muestra/oculta con el botón hamburguesa. */
  .sidebar {
    position: fixed; top: 0; left: 0; height: var(--app-viewport-height);
    max-height: var(--app-viewport-height);
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.abierto { transform: translateX(0); }
  .hamburguesa { display: flex; }
  .topbar-btn { display: none; }               /* colapsar solo en escritorio */
  /* En móvil el sidebar es off-canvas: ignoramos el modo colapsado */
  .app.sidebar-colapsado .sidebar { width: 248px; padding: 16px 12px; }
  .app.sidebar-colapsado .sidebar .brand strong,
  .app.sidebar-colapsado .nav-corp .txt,
  .app.sidebar-colapsado .nav-corp .grupo { display: revert; }
  .app.sidebar-colapsado .nav-corp a { justify-content: flex-start; padding: .58rem .8rem; }
  .topbar { padding: 12px 16px; }
  .topbar .usuario span:first-child { display: none; } /* solo avatar en móvil */
  .main { padding: 14px; }
  .card-corp .card-body { padding: 16px; }
}

@media (max-width: 560px) {
  .topbar .titulo { font-size: 15px; }
  .metric .n { font-size: 24px; }
  .app-footer { padding: 14px 16px; text-align: center; }
}

/* =====================================================================
   SISTEMA VISUAL 2026 · CONSOLA OPERATIVA
   Sobrio, compacto y funcional: sin glassmorphism, franjas decorativas,
   gradientes ni elevaciones exageradas.
   ===================================================================== */
:root {
  --corp: #d7193f;
  --corp-dark: #a90f2d;
  --corp-soft: #fff0f3;
  --ink: #111827;
  --ink-soft: #566171;
  --ink-faint: #8b95a5;
  --muted: #667085;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #dfe3e8;
  --line-soft: #edf0f3;
  --sidebar-bg: #151a23;
  --sidebar-surface: #202733;
  --sidebar-text: #cbd2dc;
  --sidebar-muted: #747f90;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow: 0 8px 24px rgba(17, 24, 39, .07);
  --shadow-lg: 0 18px 42px rgba(17, 24, 39, .13);
  --font: "Aptos", "Segoe UI Variable", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background: var(--bg);
  font-size: 14px;
  line-height: 1.45;
}

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -.018em;
}

.app { background: var(--bg); }
.contenido { min-height: var(--app-viewport-height); }

/* Navegación: una columna de trabajo, no una tarjeta flotante. */
.sidebar {
  width: 264px;
  padding: 0 12px 18px;
  background: var(--sidebar-bg);
  border-right: 0;
  box-shadow: 8px 0 24px rgba(15, 23, 42, .06);
}

.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .25); }
.sidebar { scrollbar-color: rgba(255, 255, 255, .18) transparent; }

.sidebar .brand {
  min-height: 78px;
  padding: 16px 10px;
  margin-bottom: 7px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.sidebar .brand .dot {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--corp);
  box-shadow: none;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  color: #fff;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-copy span {
  margin-top: 4px;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.nav-corp li { margin: 2px 0; }
.nav-corp .grupo {
  padding: 17px 10px 6px;
  color: var(--sidebar-muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .11em;
}

.nav-corp a,
.nav-corp .nav-logout button {
  min-height: 39px;
  padding: .58rem .72rem;
  gap: 11px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 550;
  transition: background-color .14s ease, color .14s ease;
}

.nav-corp a i.bi,
.nav-corp .nav-logout i.bi {
  width: 20px;
  color: #8e99aa;
  font-size: 16px;
}

.nav-corp a:hover,
.nav-corp .nav-logout button:hover {
  color: #fff;
  background: var(--sidebar-surface);
}

.nav-corp a:hover i.bi { color: #fff; }
.nav-corp a.activo {
  color: #fff;
  background: #2a313d;
  box-shadow: inset 3px 0 0 var(--corp);
  font-weight: 650;
}

.nav-corp a.activo i.bi { color: #ff617d; }
.nav-corp a.activo::before { display: none; }

.app.sidebar-colapsado .sidebar { width: 72px; padding: 0 9px 18px; }
.app.sidebar-colapsado .sidebar .brand { justify-content: center; padding-inline: 0; }
.app.sidebar-colapsado .sidebar .brand-copy { display: none; }
.app.sidebar-colapsado .nav-corp a,
.app.sidebar-colapsado .nav-corp .nav-logout button { justify-content: center; padding-inline: 0; }

/* Cabecera utilitaria, con contexto y usuario claramente separados. */
.topbar {
  min-height: 72px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 1px 0 rgba(17, 24, 39, .02);
}

.topbar-context {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.topbar-context > span {
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.topbar .titulo {
  color: var(--ink);
  font-size: 18px;
  font-weight: 720;
}

.topbar .usuario { gap: 11px; }
.usuario-meta {
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
}
.usuario-meta strong { color: var(--ink); font-size: 13px; font-weight: 680; }
.usuario-meta span { margin-top: 3px; color: var(--ink-faint); font-size: 11px; }
.topbar .avatar {
  width: 38px !important;
  height: 38px !important;
  background: #f0f2f5;
  color: var(--ink);
  border: 1px solid var(--line) !important;
}

.topbar-btn,
.hamburguesa {
  width: 38px;
  height: 38px;
  border-radius: 7px;
  border-color: var(--line);
  color: var(--ink-soft);
  box-shadow: none;
}
.topbar-btn:hover { color: var(--ink); border-color: #b9c0ca; background: #f7f8fa; }

.main { padding: 26px 28px 34px; }

/* Superficies: bordes precisos y muy poca elevación. */
.card-corp,
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card-corp { background: var(--surface); }
.card-corp.border-0 { border: 1px solid var(--line) !important; }
.card-corp.shadow-sm { box-shadow: var(--shadow-xs) !important; }
.card-corp:hover { transform: none; box-shadow: var(--shadow-xs); }
.card-corp .card-head {
  min-height: 54px;
  padding: 14px 18px;
  border-bottom-color: var(--line-soft);
  font-size: 14px;
  font-weight: 680;
}
.card-corp .card-body { padding: 18px; }

.metric {
  min-height: 90px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  background: var(--surface);
}
.metric:hover { transform: none; box-shadow: none; border-color: #cbd1d9; }
.metric.accent { border-left: 1px solid var(--line); }
.metric.accent .n { color: var(--ink); }
.metric .n {
  color: var(--ink);
  font-size: 29px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
}
.metric .l { margin-top: 5px; color: var(--ink-soft); font-size: 12.5px; font-weight: 520; }
.metric-row { display: flex; align-items: center; gap: 14px; }
.metric-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef3ff;
  color: #2458c6;
  font-size: 19px;
}
.metric-icon.tone-green { color: #087a50; background: #e7f7ef; }
.metric-icon.tone-amber { color: #a15c00; background: #fff5d8; }

.kpi {
  min-height: 88px;
  padding: 17px 19px;
  gap: 14px;
  border: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  background: var(--surface);
}
.kpi:hover { transform: none; box-shadow: none; border-color: #cbd1d9; }
.kpi > div:last-child { min-width: 0; }
.kpi-ico { width: 42px; height: 42px; border-radius: 8px; font-size: 19px; }
.kpi-n { font-size: 29px; font-weight: 760; font-variant-numeric: tabular-nums; letter-spacing: -.035em; }
.kpi-l { margin-top: 4px; color: var(--ink-soft); font-size: 12.5px; font-weight: 520; }

/* Encabezados para separar familias de módulos. */
.module-section { margin: 30px 0 14px; }
.module-section:first-child { margin-top: 6px; }
.module-section-kicker {
  color: var(--corp);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.module-section-title {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 720;
}
.module-section-copy { margin: 3px 0 0; color: var(--ink-soft); font-size: 13px; }

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.page-intro .eyebrow { color: var(--corp); font-size: 10px; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
.page-intro h2 { margin: 4px 0 0; font-size: 22px; font-weight: 740; }
.page-intro p { margin: 5px 0 0; color: var(--ink-soft); }

/* Controles compactos, pensados para jornadas largas de operación. */
.btn,
.btn-corp,
.btn-outline-corp,
.form-control,
.form-select {
  border-radius: 7px;
}
.btn-corp {
  padding: .58rem 1rem;
  background: var(--corp);
  border-color: var(--corp);
  box-shadow: none;
}
.btn-corp:hover { background: var(--corp-dark); border-color: var(--corp-dark); box-shadow: none; transform: none; }
.btn-outline-corp { background: #fff; }
.form-label { color: #4f5968; font-size: 12px; font-weight: 650; }
.form-control, .form-select { padding: .59rem .75rem; border-color: #d6dbe2; }
.form-control:focus, .form-select:focus { border-color: #9fabb9; box-shadow: 0 0 0 3px rgba(31, 41, 55, .08); }

.table-corp thead { background: #f7f8fa; }
.table-corp th { padding: 12px 15px; color: #667085; border-bottom-color: var(--line); font-size: 10.5px; letter-spacing: .075em; }
.table-corp td { padding: 14px 15px; border-bottom-color: var(--line-soft); }
.table-corp tr:hover td { background: #fafbfc; }

.badge-corp,
.badge-muted,
.est { border-radius: 6px; font-weight: 650; }
.badge-corp { background: var(--corp-soft); }
.badge-muted { background: #f0f2f5; }

.seccion-titulo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 11px;
  padding: 0;
  color: #4d5868;
  border: 0;
  font-size: 10.5px;
  letter-spacing: .09em;
}
.seccion-titulo::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--corp);
}

.modal-content { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--line-soft); }
.modal-footer { border-top-color: var(--line-soft); }
.alert { border-radius: 8px; }
.accordion-button { box-shadow: none !important; }

/* Acceso: misma identidad visual, sin paneles de cristal ni degradados. */
.login-left { background: #f4f6f8; }
.login-card {
  max-width: 420px;
  padding: 34px;
  background: #fff;
  border-radius: 12px;
  border-color: var(--line);
  box-shadow: 0 18px 50px rgba(17, 24, 39, .09);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.login-right { background: #e9edf2; }
.login-right::before { width: 1px; top: 0; bottom: 0; background: #d6dbe2; opacity: 1; }
.login-tabs { border-radius: 8px; padding: 3px; }
.login-tab { border-radius: 6px; }
.btn-login { border-radius: 7px; box-shadow: none; }
.btn-login:hover { box-shadow: none; }
.btn-ms { border-radius: 7px; }
.alert-login { border-radius: 7px; }

@media (max-width: 820px) {
  body.sidebar-movil-abierto { overflow: hidden; }
  .sidebar {
    width: 264px;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    touch-action: pan-y;
  }
  .app.sidebar-colapsado .sidebar {
    width: 264px;
    padding: 0 12px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .app.sidebar-colapsado .sidebar .brand { justify-content: flex-start; padding: 16px 10px; }
  .app.sidebar-colapsado .sidebar .brand-copy { display: flex; }
  .app.sidebar-colapsado .nav-corp .txt,
  .app.sidebar-colapsado .nav-corp .grupo { display: revert; }
  .app.sidebar-colapsado .nav-corp a,
  .app.sidebar-colapsado .nav-corp .nav-logout button { justify-content: flex-start; padding: .58rem .72rem; }
  .nav-corp a,
  .nav-corp .nav-logout button {
    min-height: 44px;
    touch-action: manipulation;
  }
  .topbar { min-height: 64px; padding: 10px 16px; }
  .main { padding: 18px 14px 28px; }
}

@media (max-width: 560px) {
  .topbar-context > span { display: none; }
  .topbar .titulo { font-size: 16px; }
  .page-intro { align-items: flex-start; flex-direction: column; }
  .metric, .kpi { min-height: 82px; padding: 15px; }
  .metric .n, .kpi-n { font-size: 25px; }
  .card-corp .card-head { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .card-corp .card-head > .d-flex { width: 100%; justify-content: space-between; }
}

/* Autoría compartida del registro RACS */
.rac-leyenda {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  color: #667085;
  font-size: .76rem;
  font-weight: 600;
}
.rac-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.rac-punto {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #98a2b3;
}
.rac-punto.propio { background: #2563eb; }
.rac-punto.equipo { background: #98a2b3; }
.table-corp tbody tr.rac-propio > td { background-color: #f2f7ff; }
.table-corp tbody tr.rac-propio:hover > td { background-color: #e9f2ff; }

/* Cronograma de asignación PDR (estilo Gantt / Microsoft Project) */
.pdr-gantt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pdr-gantt { min-width: 920px; }
.pdr-gantt-row { display: grid; grid-template-columns: 275px minmax(620px, 1fr); min-height: 42px; border-bottom: 1px solid var(--line-soft); }
.pdr-gantt-row:last-child { border-bottom: 0; }
.pdr-gantt-label { position: sticky; left: 0; z-index: 4; display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 8px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.pdr-gantt-label strong, .pdr-gantt-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdr-gantt-label small { color: var(--ink-soft); font-size: 11px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdr-gantt-track { position: relative; min-height: 42px; background-image: linear-gradient(to right, var(--line-soft) 1px, transparent 1px); background-size: calc(100% / var(--gantt-dias)) 100%; }
.pdr-gantt-header { min-height: 50px; position: sticky; top: 0; z-index: 6; }
.pdr-gantt-header .pdr-gantt-label, .pdr-gantt-header .pdr-gantt-track { background-color: #f7f8fa; }
.pdr-gantt-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid #cbd1d9; }
.pdr-gantt-tick > span { position: absolute; top: 7px; left: 5px; color: var(--ink-soft); font-size: 10px; font-weight: 650; white-space: nowrap; }
.pdr-gantt-hoy { position: absolute; z-index: 3; top: 0; bottom: 0; width: 2px; background: #dc3545; pointer-events: none; }
.pdr-gantt-hoy > span { position: absolute; top: 25px; left: 5px; color: #b42318; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.pdr-gantt-proyecto { min-height: 44px; }
.pdr-gantt-proyecto .pdr-gantt-label { background: #f2f4f7; }
.pdr-gantt-proyecto .pdr-gantt-track { background-color: #fafbfc; }
.pdr-gantt-persona .pdr-gantt-label { padding-left: 27px; }
.pdr-gantt-barra { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); border-radius: 4px; min-width: 4px; }
.pdr-gantt-barra::before, .pdr-gantt-barra::after { content: ''; display: none; position: absolute; top: 50%; transform: translateY(-50%); border: 5px solid transparent; }
.pdr-gantt-barra.continua-antes::before { display: block; left: -9px; border-right-color: currentColor; }
.pdr-gantt-barra.continua-despues::after { display: block; right: -9px; border-left-color: currentColor; }
.pdr-gantt-barra-proyecto { height: 8px; color: #344054; background: #475467; }
.pdr-gantt-barra-pdr { height: 24px; color: var(--corp); background: var(--corp); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.pdr-gantt-barra-pdr > span { display: block; padding: 3px 7px; color: #fff; font-size: 10px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdr-gantt-fecha-pendiente { position: absolute; z-index: 2; left: 10px; top: 50%; transform: translateY(-50%); color: #667085; font-size: 11px; font-weight: 650; white-space: nowrap; }
.pdr-gantt-sin-pdr .pdr-gantt-label { color: #b45309; background: #fffbeb; }
.pdr-gantt-compacto .pdr-gantt { min-width: 760px; }
.pdr-gantt-compacto .pdr-gantt-row { grid-template-columns: 230px minmax(500px, 1fr); min-height: 36px; }
.pdr-gantt-compacto .pdr-gantt-track { min-height: 36px; }
.pdr-gantt-compacto .pdr-gantt-persona .pdr-gantt-label { padding-left: 22px; }
@media (max-width: 820px) {
  .pdr-gantt-row { grid-template-columns: 220px minmax(620px, 1fr); }
  .pdr-gantt-label { position: relative; }
}
.rac-autoria {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #f8fafc;
  color: #475467;
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.rac-autoria.propio {
  border-color: #bfd3ff;
  background: #e7f0ff;
  color: #174ea6;
}

/* Recuperación de acceso y configuración inicial del perfil. */
.auth-page {
  min-height: var(--app-viewport-height);
  background: #eef1f4;
}
.auth-shell {
  min-height: var(--app-viewport-height);
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 18px calc(24px + env(safe-area-inset-bottom, 0px));
}
.auth-card {
  width: min(100%, 470px);
  padding: 34px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(17, 24, 39, .09);
}
.auth-card h1 { margin: 4px 0 8px; font-size: 26px; }
.auth-lead { margin: 0 0 24px; color: var(--ink-soft); }
.auth-brand { min-height: 48px; margin-bottom: 18px; display: flex; align-items: center; }
.auth-brand img { max-width: 190px; max-height: 52px; object-fit: contain; }
.auth-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--corp);
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}
.auth-back { display: block; margin-top: 18px; text-align: center; font-weight: 650; }

.onboarding-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 17px 18px;
  border: 1px solid #f0cf78;
  border-left: 4px solid #d69b13;
  border-radius: 8px;
  background: #fff9e8;
  color: #57430f;
}
.onboarding-notice strong { display: block; margin-bottom: 5px; color: #382b0a; }
.onboarding-notice ol { margin: 0; padding-left: 19px; }
.onboarding-notice li + li { margin-top: 4px; }
.onboarding-notice a { color: #8a5d00; font-weight: 750; text-decoration: underline; text-underline-offset: 2px; }
.onboarding-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: #f8df9b;
  color: #765000;
  font-size: 18px;
}
.perfil-actions { display: flex; flex-direction: column; }
.perfil-foto-card { order: 0; }
.perfil-password-card { order: 1; }
.perfil-firma-card { order: 2; }
#cambio-password,
#firma-interna { scroll-margin-top: 88px; }
#cambio-password:focus,
#firma-interna:focus { outline: 3px solid rgba(215, 25, 63, .18); outline-offset: 3px; }
.firma-consentimiento {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7f8fa;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}
.firma-consentimiento .form-check-label { color: var(--ink); font-weight: 600; }

@media (max-width: 560px) {
  .auth-shell { place-items: start center; padding-inline: 12px; }
  .auth-card { padding: 24px 20px; }
  .onboarding-notice { padding: 14px; }
}
