/* ============================================================
   SIREVEN - Sistema de Registro y Verificación de Emisiones
   NOM-163-SEMARNAT-SCFI-2023
   Estilos personalizados del prototipo
   ============================================================ */

/* --- Reset para convivencia con GobMX v3 --- */
.sireven-app {
  font-family: 'Public Sans', sans-serif;
  color: #1b1c1c;
}

/* --- Tipografia editorial --- */
.font-editorial,
.sireven-app h1,
.sireven-app h2,
.sireven-app h3 {
  font-family: 'Noto Serif', serif;
}

.font-body {
  font-family: 'Public Sans', sans-serif;
}

/* --- Material Symbols --- */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* --- Top Navigation Bar --- */
.sireven-topnav {
  background-color: #13322B;
  color: #fff;
  position: fixed;
  top: 85px;
  left: 0;
  right: 0;
  z-index: 100;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sireven-topnav .brand {
  font-family: 'Noto Serif', serif;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
}

.sireven-topnav .brand span {
  font-family: 'Public Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  color: #D4AF37;
  margin-left: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sireven-topnav .topnav-inicio {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Boton que muestra u oculta la barra lateral */
.sireven-menu-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
}

.sireven-menu-btn:hover { background: rgba(255, 255, 255, 0.12); }
.sireven-menu-btn:focus-visible { outline: 2px solid #D4AF37; outline-offset: 2px; }

.sireven-topnav .nav-links a {
  font-family: 'Noto Serif', serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: #d1d5db;
  text-decoration: none;
  padding-bottom: 0.375rem;
  transition: color 0.2s;
}

.sireven-topnav .nav-links a:hover {
  color: #fff;
}

.sireven-topnav .nav-links a.active {
  color: #fff;
  border-bottom: 2px solid #D4AF37;
}

.sireven-topnav .nav-actions button {
  background: transparent;
  border: none;
  color: #fff;
  padding: 0.625rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 1.5rem;
}

.sireven-topnav .nav-actions button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sireven-topnav .user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.5rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.sireven-topnav .user-info .user-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.sireven-topnav .user-info .user-role {
  font-size: 0.875rem;
  color: #d1d5db;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sireven-topnav .user-avatar {
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: #611232;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

/* --- Sidebar --- */
.sireven-sidebar {
  background: #fbf9f8;
  width: 320px;
  position: fixed;
  left: 0;
  top: 161px;
  bottom: 0;
  overflow-y: auto;
  z-index: 40;
  display: flex;
  flex-direction: column;
}

/* La barra se oculta completa desde el boton de la barra superior */
.nom-menu-cerrado .sireven-sidebar {
  display: none;
}

.nom-menu-cerrado .sireven-main,
.nom-menu-cerrado .sireven-footer {
  margin-left: 0;
}

.sireven-sidebar .sidebar-profile {
  padding: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.sireven-sidebar .sidebar-profile-card {
  background: #f5f3f3;
  padding: 1.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.sireven-sidebar .sidebar-profile-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.5rem;
  background: #611232;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sireven-sidebar .sidebar-profile-name {
  font-family: 'Public Sans', sans-serif;
  font-size: 1.375rem;
  font-weight: 700;
  color: #611232;
}

.sireven-sidebar .sidebar-profile-org {
  font-size: 1.125rem;
  color: #545454;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Hora de PHP; solo se pinta en entorno de desarrollo */
.sireven-sidebar .sidebar-profile-hora {
  font-family: monospace;
  font-size: 0.875rem;
  color: #6f6f6f;
  margin-top: 0.25rem;
}

.sireven-sidebar nav {
  flex: 1;
  padding: 0 1rem;
}

.sireven-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  color: #545454;
  text-decoration: none;
  font-family: 'Public Sans', sans-serif;
  font-size: 1.375rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  margin-bottom: 0.125rem;
}

.sireven-sidebar nav a .material-symbols-outlined {
  font-size: 1.75rem;
}

.sireven-sidebar nav a:hover {
  background: #e4e2e2;
  color: #1b1c1c;
}

.sireven-sidebar nav a.active {
  background: #f5f3f3;
  color: #611232;
  font-weight: 700;
  border-left: 4px solid #611232;
  border-radius: 0 0.5rem 0.5rem 0;
}

/* --- Main Content --- */
.sireven-main {
  margin-left: 320px;
  padding: 20px 2rem 3rem 2rem;
  min-height: 100vh;
  background: #fbf9f8;
}

/* --- App Footer --- */
.sireven-footer {
  margin-left: 320px;
  background: #f5f3f3;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.sireven-footer p {
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #545454;
}

/* Leyenda "powered by" con el logo de notLand: flex para centrar el texto
   y la imagen en vertical (vertical-align los deja desfasados con mayúsculas) */
.sireven-footer .powered-by {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sireven-footer .logo-notland {
  height: 20px;
  width: auto;
  display: block;
  /* Las letras del logo quedan 1px por debajo del centro de su caja:
     se sube la imagen para que su línea base coincida con la del texto */
  position: relative;
  top: -1px;
}

.sireven-footer a {
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #545454;
  text-decoration: none;
  transition: color 0.2s;
}

.sireven-footer a:hover {
  color: #611232;
}

/* --- KPI Cards --- */
.kpi-card {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: 0.75rem;
  border-top: 4px solid #611232;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s;
}

.kpi-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.kpi-card.accent-gold {
  border-top-color: #D4AF37;
}

.kpi-card.accent-green {
  border-top-color: #13322B;
}

.kpi-card.accent-wine {
  border-top-color: #42001d;
}

.kpi-card .kpi-icon {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.kpi-card .kpi-label {
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #545454;
  margin-bottom: 0.25rem;
}

.kpi-card .kpi-value {
  font-size: 2.75rem;
  font-weight: 900;
  color: #1b1c1c;
}

.kpi-card .kpi-change {
  font-size: 1.25rem;
  font-weight: 700;
}

.kpi-change.positive {
  color: #16a34a;
}

.kpi-change.warning {
  color: #ab2f53;
}

.kpi-change.neutral {
  color: #545454;
}

.kpi-change.negative {
  color: #ba1a1a;
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success {
  background: #dcfce7;
  color: #166534;
}

.badge-error {
  background: #ffdad6;
  color: #93000a;
}

.badge-warning {
  background: #ffdea3;
  color: #5d4200;
}

.badge-neutral {
  background: #e4e2e2;
  color: #545454;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* --- Data Tables --- */
.data-table {
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}

.data-table thead {
  background: #e4e2e2;
}

.data-table th {
  padding: 1.25rem 1.5rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #544246;
}

.data-table tbody tr {
  transition: background 0.15s;
}

.data-table tbody tr:hover {
  background: #f5f3f3;
}

.data-table td {
  padding: 1.375rem 1.5rem;
  font-size: 1.5rem;
  border-bottom: 1px solid #f5f3f3;
}

/* --- Cards / Containers --- */
.card {
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.card-muted {
  background: #f5f3f3;
  border-radius: 0.75rem;
}

.card-dark {
  background: #42001d;
  color: #fff;
  border-radius: 0.75rem;
}

/* --- Buttons --- */
.btn-primary {
  background: #611232;
  color: #fff;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s, transform 0.1s;
  text-decoration: none;
  font-family: 'Public Sans', sans-serif;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: transparent;
  color: #611232;
  padding: 0.875rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  border: 1px solid #d9c0c5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
  text-decoration: none;
  font-family: 'Public Sans', sans-serif;
}

.btn-secondary:hover {
  background: #eae8e7;
}

.btn-ghost {
  background: #eae8e7;
  color: #42001d;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s;
  text-decoration: none;
  font-family: 'Public Sans', sans-serif;
}

.btn-ghost:hover {
  background: #e4e2e2;
}

.btn-icon {
  background: transparent;
  border: none;
  padding: 0.375rem;
  border-radius: 0.25rem;
  cursor: pointer;
  color: #42001d;
  transition: background 0.15s;
}

.btn-icon:hover {
  background: #e4e2e2;
}

/* --- Form Elements --- */
.form-label {
  display: block;
  font-family: 'Public Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #544246;
  margin-bottom: 0.5rem;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: #f5f3f3;
  border: none;
  border-radius: 0.5rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 1.375rem;
  color: #1b1c1c;
  transition: background 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(97, 18, 50, 0.2);
}

.form-input::placeholder {
  color: #867276;
  opacity: 0.5;
}

.form-select {
  width: 100%;
  padding: 1rem 1.25rem;
  background: #f5f3f3;
  border: none;
  border-radius: 0.5rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 1.375rem;
  color: #1b1c1c;
  cursor: pointer;
}

.form-select:focus {
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(97, 18, 50, 0.2);
}

/* --- Section numbers --- */
.section-number {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: #611232;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

/* --- Progress bars --- */
.progress-bar {
  height: 0.375rem;
  width: 100%;
  background: #eae8e7;
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.5s ease;
}

.progress-fill.green {
  background: #16a34a;
}

.progress-fill.red {
  background: #ba1a1a;
}

.progress-fill.amber {
  background: #f59e0b;
}

.progress-fill.gray {
  background: #9ca3af;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.pagination button {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.pagination button:hover {
  background: #e4e2e2;
}

.pagination button.active {
  background: #611232;
  color: #fff;
  font-weight: 700;
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* --- Login page --- */
.login-bg {
  background-color: #13322B;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.login-header {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 3rem 1.5rem 1.5rem;
}

.login-header .logos {
  display: flex;
  align-items: center;
  gap: 2rem;
  opacity: 0.9;
}

.login-header .divider {
  width: 1px;
  height: 3rem;
  background: rgba(255, 255, 255, 0.3);
}

.login-card {
  width: 100%;
  max-width: 34rem;
  background: #fff;
  border-radius: 0.75rem;
  padding: 3.5rem 3.5rem;
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.login-card .accent-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(to right, #42001d, #611232, #ab2f53);
}

.login-footer {
  width: 100%;
  padding: 2rem 1.5rem;
  background: rgba(0, 0, 0, 0.1);
}

.login-footer p,
.login-footer a {
  font-family: 'Public Sans', sans-serif;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: color 0.2s;
}

.login-footer a:hover {
  color: #fff;
}

/* --- Cumplimiento ring (SVG) --- */
.ring-container {
  position: relative;
  width: 6rem;
  height: 6rem;
}

.ring-container .ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.25rem;
}

/* --- Activity list --- */
.activity-item {
  background: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}

.activity-item:hover {
  background: #efeded;
}

.activity-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 0.25rem;
  background: #eae8e7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #42001d;
}

/* --- Quick actions grid --- */
.quick-action {
  padding: 1.25rem;
  background: #fbf9f8;
  border-radius: 0.5rem;
  text-align: center;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #1b1c1c;
  font-family: 'Public Sans', sans-serif;
}

.quick-action .material-symbols-outlined {
  font-size: 2.25rem;
  color: #42001d;
}

.quick-action:hover {
  background: #611232;
  color: #fff;
}

.quick-action:hover .material-symbols-outlined {
  color: #fff;
}

.quick-action span.label {
  font-size: 1.375rem;
  font-weight: 700;
  color: #1b1c1c;
}

.quick-action:hover span.label {
  color: #fff;
}

/* --- Responsive: ocultar sidebar en mobile --- */
@media (max-width: 768px) {
  .sireven-sidebar {
    display: none;
  }

  /* Sin barra que mostrar, el boton no tiene nada que alternar */
  .sireven-menu-btn {
    display: none;
  }

  .sireven-main,
  .sireven-footer {
    margin-left: 0;
  }
}

/* --- Checkbox styling --- */
.form-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 0.25rem;
  accent-color: #611232;
  cursor: pointer;
}

/* --- Brand tags / chips --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: #611232;
  color: #fff;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.chip button {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  font-size: 0.875rem;
}

/* --- Decorative elements --- */
.decorative-icon {
  position: absolute;
  bottom: -3rem;
  right: -3rem;
  opacity: 0.05;
  pointer-events: none;
  font-size: 200px;
}

/* --- Info callout --- */
.callout {
  padding: 1rem;
  background: #fff;
  border-radius: 0.5rem;
  border-left: 4px solid #432f00;
  display: flex;
  gap: 0.75rem;
}

.callout .material-symbols-outlined {
  color: #bd9540;
  flex-shrink: 0;
}

.callout p {
  font-size: 1.25rem;
  color: #544246;
}

/* --- Brand circles for table --- */
.brand-circle {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  background: #eae8e7;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: #1b1c1c;
}

/* --- Utility --- */
.text-primary {
  color: #42001d;
}

.text-primary-container {
  color: #611232;
}

.text-secondary {
  color: #ab2f53;
}

.text-muted {
  color: #545454;
}

.text-error {
  color: #ba1a1a;
}

.bg-surface {
  background: #fbf9f8;
}

.bg-surface-low {
  background: #f5f3f3;
}

.bg-surface-high {
  background: #eae8e7;
}

.bg-surface-highest {
  background: #e4e2e2;
}

/* --- Modal overlay --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(27, 28, 28, 0.6);
  backdrop-filter: blur(4px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-window {
  background: #fff;
  width: 100%;
  max-width: 640px;
  border-radius: 0.75rem;
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  animation: modalIn 0.2s ease-out;
}

.modal-window.wide {
  max-width: 800px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  background: #611232;
  color: #fff;
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}

.modal-header .modal-close {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s;
}

.modal-header .modal-close:hover {
  transform: rotate(90deg);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1.5rem 2rem;
  background: #f5f3f3;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  border-top: 1px solid #eae8e7;
}

/* --- Detail rows in modal --- */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f5f3f3;
  font-size: 1.375rem;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: #544246;
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-weight: 700;
  color: #1b1c1c;
  text-align: right;
}
/* ============================================================
   EXTENSIONES DEL PROTOTIPO COMPLETO (todas las pantallas)
   ============================================================ */

/* --- Selector de rol flotante --- */
.role-switcher {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 150;
  background: #42001d;
  color: #fff;
  border-radius: 0.75rem;
  padding: 0.875rem 1.25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Public Sans', sans-serif;
  cursor: pointer;
  border: none;
}

.role-switcher:hover { background: #611232; }

.role-switcher .role-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.7;
}

.role-switcher .role-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.role-popover {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 151;
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  width: 320px;
  display: none;
  overflow: hidden;
}

.role-popover.open { display: block; }

.role-popover .role-popover-header {
  padding: 1rem 1.25rem;
  background: #42001d;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
}

.role-popover .role-option {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f5f3f3;
  text-decoration: none;
  color: #1b1c1c;
  font-family: 'Public Sans', sans-serif;
}

.role-popover .role-option:last-child { border-bottom: none; }
.role-popover .role-option:hover { background: #f5f3f3; }
.role-popover .role-option.active { background: #ffe8ee; color: #611232; font-weight: 700; }

.role-popover .role-option .material-symbols-outlined {
  color: #611232;
  font-size: 1.5rem;
}

/* --- Selector de rol fullscreen (seleccionar-rol.html) --- */
.role-select-bg {
  background: #13322B;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.role-select-title {
  color: #fff;
  font-family: 'Noto Serif', serif;
  font-size: 2.5rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  text-align: center;
}

.role-select-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 1.125rem;
  margin-bottom: 3rem;
  text-align: center;
}

.role-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 880px;
  width: 100%;
}

.role-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  text-decoration: none;
  color: #1b1c1c;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  border-top: 6px solid #611232;
  display: block;
}

.role-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0,0,0,0.2);
}

.role-card .material-symbols-outlined {
  font-size: 4rem;
  color: #611232;
  margin-bottom: 1rem;
}

.role-card h3 {
  font-family: 'Noto Serif', serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #42001d;
}

.role-card p {
  color: #545454;
  font-size: 1rem;
  margin: 0;
  line-height: 1.4;
}

/* --- Page header (titulo + acciones) --- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-family: 'Noto Serif', serif;
  font-size: 2.25rem;
  color: #42001d;
  margin: 0 0 0.25rem 0;
}

.page-header .page-subtitle {
  color: #545454;
  font-size: 1.125rem;
}

.page-header .page-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 0.95rem;
  color: #545454;
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: #611232;
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { margin: 0 0.5rem; color: #aaa; }

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e4e2e2;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.875rem 1.5rem;
  font-family: 'Public Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #545454;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -2px;
  text-decoration: none;
}

.tab:hover { color: #611232; }

.tab.active {
  color: #611232;
  border-bottom-color: #611232;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e4e2e2;
}

.timeline-item {
  position: relative;
  padding: 1rem 0 1.5rem 1rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.625rem;
  top: 1.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #611232;
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px #611232;
}

.timeline-item.done::before { background: #16a34a; box-shadow: 0 0 0 1px #16a34a; }
.timeline-item.active::before { background: #D4AF37; box-shadow: 0 0 0 1px #D4AF37; animation: pulse 1.5s infinite; }
.timeline-item.pending::before { background: #fff; border-color: #aaa; box-shadow: 0 0 0 1px #aaa; }
.timeline-item.error::before { background: #ba1a1a; box-shadow: 0 0 0 1px #ba1a1a; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.timeline-date {
  font-size: 0.875rem;
  color: #867276;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.timeline-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #1b1c1c;
  margin: 0.25rem 0;
}

.timeline-desc {
  color: #545454;
  font-size: 1rem;
}

/* --- Alert banners --- */
.alert-banner {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  display: flex;
  gap: 0.875rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.alert-banner .material-symbols-outlined { flex-shrink: 0; }

.alert-banner.alert-info { background: #dbeafe; color: #1e40af; }
.alert-banner.alert-success { background: #dcfce7; color: #166534; }
.alert-banner.alert-warning { background: #fef3c7; color: #854d0e; }
.alert-banner.alert-error { background: #ffdad6; color: #93000a; }

.alert-banner h4 {
  margin: 0 0 0.25rem 0;
  font-size: 1rem;
  font-weight: 700;
}

.alert-banner p { margin: 0; font-size: 0.95rem; }

/* --- File upload area --- */
.upload-area {
  border: 2px dashed #d9c0c5;
  border-radius: 0.75rem;
  padding: 3rem 2rem;
  text-align: center;
  background: #fbf9f8;
  transition: all 0.2s;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #611232;
  background: #fff;
}

/* Alerta que lleva al campo señalado, en la ficha del vehículo (EP013) */
.ancla-campo {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  color: #611232;
  text-decoration: underline;
  cursor: pointer;
}

.fila-resaltada > td {
  background: #f5e9ec;
  transition: background 0.4s ease-out;
}

/* Valores que intervienen en una alerta comparativa */
.valores-alerta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.valor-alerta {
  background: #fff;
  border: 1px solid #e4e2e2;
  border-radius: 0.375rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.valor-alerta a {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #611232;
  text-decoration: none;
  border-bottom: 1px dotted #611232;
}

.valor-alerta a:hover {
  border-bottom-style: solid;
}

/* Catálogo de placeholders de las plantillas (EP011) */
.placeholder-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0eded;
}

.placeholder-item:last-child {
  border-bottom: none;
}

.placeholder-item .btn-ghost {
  align-self: flex-start;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
}

.placeholder-item span {
  font-size: 0.8125rem;
  color: #867276;
}

/* Buscador con lista de resultados (NOM.combo) */
.combo {
  position: relative;
}

/* Flota sobre todo, incluido el modal (z-index 200), y la coloca el JS
   sobre el campo: dentro del modal quedaba recortada por su overflow */
.combo-lista {
  display: none;
  position: fixed;
  z-index: 300;
  background: #fff;
  border: 1px solid #e4e2e2;
  border-radius: 0.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  max-height: 22rem;
  overflow-y: auto;
}

.combo-lista.active {
  display: block;
}

.combo-opcion {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
}

.combo-opcion strong {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1b1c1c;
}

.combo-opcion:hover,
.combo-opcion.marcada {
  background: #f5e9ec;
}

.combo-opcion span {
  font-size: 0.8rem;
  color: #867276;
}

.combo-vacio {
  padding: 0.75rem 0.875rem;
  font-size: 0.875rem;
  color: #867276;
}

/* Mientras se arrastra un archivo encima (EP004.2) */
.upload-area.is-dragging {
  border-color: #611232;
  background: #f5e9ec;
}

.upload-area .material-symbols-outlined {
  font-size: 3.5rem;
  color: #611232;
  margin-bottom: 0.5rem;
}

.upload-area .upload-text {
  font-size: 1.125rem;
  color: #1b1c1c;
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.upload-area .upload-hint {
  font-size: 0.875rem;
  color: #867276;
}

/* --- File list --- */
.file-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: #fff;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid #611232;
}

.file-row .file-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.25rem;
  background: #ffe8ee;
  color: #611232;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-row .file-info { flex: 1; min-width: 0; }
.file-row .file-name { font-weight: 700; font-size: 0.95rem; color: #1b1c1c; }
.file-row .file-meta { font-size: 0.8rem; color: #867276; }

/* --- Stat grid --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #545454;
}

.empty-state .material-symbols-outlined {
  font-size: 4rem;
  color: #ccc;
  margin-bottom: 1rem;
}

.empty-state h3 { color: #545454; font-size: 1.25rem; margin-bottom: 0.5rem; }
.empty-state p { font-size: 1rem; margin-bottom: 1.5rem; }

/* --- Filter bar --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  background: #fff;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.filter-bar .filter-input {
  flex: 1;
  min-width: 200px;
  padding: 0.625rem 1rem;
  background: #f5f3f3;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
}

.filter-bar .filter-select {
  padding: 0.625rem 1rem;
  background: #f5f3f3;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  min-width: 160px;
}

/* --- Section divider --- */
.section-divider {
  margin: 2rem 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e4e2e2;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-divider h2 {
  font-family: 'Noto Serif', serif;
  font-size: 1.5rem;
  color: #42001d;
  margin: 0;
}

/* --- Two-column layout --- */
.two-col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
}

/* --- Form grid --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.form-grid .full { grid-column: 1 / -1; }

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* --- Cascade indicator (CA1-CA4) --- */
.cascade {
  display: flex;
  align-items: center;
  gap: 0;
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e4e2e2;
}

.cascade-step {
  flex: 1;
  padding: 0.875rem 1rem;
  text-align: center;
  position: relative;
  font-weight: 700;
  font-size: 0.875rem;
}

.cascade-step.pass { background: #dcfce7; color: #166534; }
.cascade-step.fail { background: #ffdad6; color: #93000a; }
.cascade-step.applied { background: #611232; color: #fff; }
.cascade-step.pending { background: #f5f3f3; color: #867276; }

.cascade-step + .cascade-step::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0,0,0,0.1);
}

/* --- Avatar circle --- */
.avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #611232;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.avatar.lg { width: 3.5rem; height: 3.5rem; font-size: 1.125rem; }
.avatar.sm { width: 2rem; height: 2rem; font-size: 0.75rem; }

/* --- Status pill (with dot) --- */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.status-pill::before {
  content: '';
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
}

.status-pill.green::before { background: #16a34a; }
.status-pill.amber::before { background: #f59e0b; }
.status-pill.red::before { background: #ba1a1a; }
.status-pill.gray::before { background: #aaa; }
.status-pill.blue::before { background: #2563eb; }

/* --- Validation indicator (formularios largos) --- */
.field-help {
  font-size: 0.825rem;
  color: #867276;
  margin-top: 0.25rem;
}

.field-error {
  font-size: 0.825rem;
  color: #ba1a1a;
  margin-top: 0.25rem;
}

.form-input.error,
.form-select.error {
  box-shadow: 0 0 0 2px #ba1a1a;
  background: #fff5f4;
}

/* --- Stepper (multi-step forms) --- */
.stepper {
  display: flex;
  margin-bottom: 2rem;
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid #e4e2e2;
}

.stepper-step {
  flex: 1;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #f5f3f3;
  color: #867276;
  border-right: 1px solid #e4e2e2;
}

.stepper-step:last-child { border-right: none; }

.stepper-step.active {
  background: #611232;
  color: #fff;
}

.stepper-step.done {
  background: #dcfce7;
  color: #166534;
}

.stepper-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.stepper-step.done .stepper-num {
  background: #16a34a;
  color: #fff;
}

/* --- Sidebar group --- */
.sidebar-group-label {
  padding: 1rem 1.25rem 0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #867276;
  font-weight: 700;
  margin-top: 0.5rem;
}

/* Sidebar tighter spacing for prototype */
.sireven-sidebar nav a {
  font-size: 1rem;
  padding: 0.625rem 1rem;
  margin-bottom: 0;
}

.sireven-sidebar nav a .material-symbols-outlined {
  font-size: 1.25rem;
}

.sireven-sidebar .sidebar-profile-name { font-size: 1rem; }
.sireven-sidebar .sidebar-profile-org { font-size: 0.75rem; }
.sireven-sidebar .sidebar-profile-hora { font-size: 0.7rem; }

.sireven-sidebar .sidebar-profile { padding: 1rem; margin-top: 1rem; }

.sireven-sidebar { width: 260px; }
.sireven-main { margin-left: 260px; padding: 1.5rem 2rem 3rem; }
.sireven-footer { margin-left: 260px; }

/* Reduce tabla font in prototype shell */
.data-table th { padding: 0.875rem 1rem; font-size: 0.8rem; }
.data-table td { padding: 0.875rem 1rem; font-size: 0.95rem; }

.kpi-card { padding: 1rem 1.25rem; }
.kpi-card .kpi-value { font-size: 1.875rem; }
.kpi-card .kpi-label { font-size: 0.75rem; }
.kpi-card .kpi-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }

.detail-row { font-size: 1rem; }
.detail-label { font-size: 0.825rem; }

.form-label { font-size: 0.875rem; }
.form-input, .form-select { font-size: 1rem; padding: 0.75rem 1rem; }

.btn-primary, .btn-secondary, .btn-ghost { font-size: 1rem; padding: 0.625rem 1.25rem; }


/* ============================================================
   EXTENSIONES DEL FRONTEND (no vienen del mockup)

   El prototipo no tiene estados de error a nivel de campo ni
   indicadores de carga, porque no llama a ninguna API. Estas
   clases las consume NOM.ui al pintar los errores de validacion
   que devuelve el backend (400 VALIDATION.FAILED) y el estado de
   las tablas mientras cargan.
   ============================================================ */

.form-input.is-invalid,
.form-select.is-invalid,
.field-input.is-invalid {
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.35);
  background: #fef2f2;
}

.form-error {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #b91c1c;
}

/* Entrada del menu cuyo modulo todavia no se programa */
.sireven-sidebar nav a.nav-pendiente {
  opacity: 0.45;
  cursor: not-allowed;
}

.sireven-sidebar nav a.nav-pendiente:hover {
  background: transparent;
}

/* Estado de carga y vacio de las tablas */
.tabla-estado {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #867276;
  font-size: 0.9375rem;
}

.tabla-estado .material-symbols-outlined {
  display: block;
  font-size: 2.5rem;
  opacity: 0.35;
  margin-bottom: 0.5rem;
}

/* Aviso flotante de NOM.ui.banner() */
.nom-banner-zona {
  position: fixed;
  top: 5.5rem;
  right: 1.5rem;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 26rem;
}

.nom-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.3);
  font-size: 0.9375rem;
  animation: nom-banner-entra 0.18s ease-out;
}

.nom-banner-exito  { background: #dcfce7; color: #14532d; }
.nom-banner-error  { background: #fee2e2; color: #7f1d1d; }
.nom-banner-aviso  { background: #fef3c7; color: #78350f; }

@keyframes nom-banner-entra {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* El boton deshabilitado mientras vuela la peticion */
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* Bloques de resultados del motor de calculo (EP014.2) */
.resultado-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
}

.resultado-item .resultado-label {
  color: #867276;
  font-size: 0.8125rem;
}

.resultado-item .resultado-valor {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
}

.resultado-item .resultado-ayuda {
  color: #867276;
  font-size: 0.75rem;
}

/* Campos que solo admiten mayusculas (RFC, CURP): el valor lo convierte
   app.js; esto es solo para que se vea igual mientras se escribe */
.form-input.mayusculas {
  text-transform: uppercase;
}

/* Tablero (EP022 v8): título de la tarjeta que abre la gráfica ampliada en el modal */
.tablero-card h3 .grafica-ampliar {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.tablero-card h3 .grafica-ampliar .material-symbols-outlined {
  font-size: 1.1rem;
  vertical-align: -0.15em;
  margin-left: 0.25rem;
  color: #611232;
}

.tablero-card h3 .grafica-ampliar:hover,
.tablero-card h3 .grafica-ampliar:focus-visible {
  text-decoration: underline;
}

.tablero-card h3 .grafica-ampliar:focus-visible {
  outline: 2px solid #611232;
  outline-offset: 3px;
  border-radius: 0.25rem;
}

#modal-tablero-grafica .modal-window.grafica-modal { max-width: 1100px; width: 95vw; }
#modal-tablero-grafica .grafica-modal-nota { color: #5c5c5c; font-size: 0.85rem; margin: 0.5rem 0 0 0; }
#modal-tablero-grafica .grafica-modal-nota:empty { display: none; }

/* Tablero (EP022 v10): botón de información antes del título de cada gráfica */
.tablero-info {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  line-height: 1;
  color: #611232;
  cursor: pointer;
  flex-shrink: 0;
}

.tablero-info .material-symbols-outlined { font-size: 1.2rem; }

.tablero-info:focus-visible {
  outline: 2px solid #611232;
  outline-offset: 2px;
  border-radius: 50%;
}

/* Tablero: filtros de casillas (año modelo, tecnología) en una fila, alineados a la izquierda */
.tablero-filtro {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem 1.25rem;
  text-align: left;
}

.tablero-filtro-titulo {
  font-size: 15px;
  font-weight: 600;
  margin-right: 0.25rem;
}

/* El framework pinta las etiquetas en bloque y en negritas: aquí van en línea y ligeras.
   Tamaños en px porque GobMX cambia la base de rem */
.tablero-filtro .tablero-opcion {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: auto;
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}

.tablero-filtro .tablero-opcion input {
  width: auto;
  margin: 0;
}
