/* Estilos para la vista de configuración de NotIA */

:root {
  /* Paleta oficial de NotIA */
  --primary-color: #0288D1;
  --secondary-color: #26C6DA;
  --background-color: #FFFFFF;
  --primary-text: #263238;
  --secondary-text: #546E7A;
  --soft-border: #E0E0E0;
  --hover-primary: #0277BD;
  --disabled: #B0BEC5;
  --success: #26A69A;
  --error: #FF7043;
  --shadow: rgba(0, 0, 0, 0.12);
}

/* Definición principal de config-container - consolidada */
.config-container {
  background-color: #FFFFFF !important;
  padding: 0 20px 20px 20px;
  padding-top: 0 !important;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
  max-height: none !important;
}

/* Definición principal de config-header - consolidada */
.config-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
  color: white !important;
  padding: 30px !important;
  border-radius: 12px !important;
  margin-bottom: 30px !important;
  margin-top: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-shadow: 0 4px 20px var(--shadow) !important;
}

.config-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.config-subtitle {
  font-size: 1.2rem;
  margin: 10px 0 0 0;
  opacity: 0.9;
}

/* Recordatorio discreto del centro educativo en vistas académicas */
.centro-activo-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
  padding: 0.35rem 0.7rem;
  max-width: 100%;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
}
.centro-activo-hint i {
  color: #64748b;
  font-size: 0.75rem;
}
.centro-activo-hint span:first-of-type {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(42ch, 70vw);
}
.centro-activo-hint__hint {
  color: #94a3b8;
  font-weight: 400;
  white-space: nowrap;
}

/* —— Acciones de página (píldoras: Lista, Nuevo, …) —— */
.notia-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: 0 0 0.9rem;
  padding: 0.25rem 0.1rem;
}

.notia-action-bar--between {
  justify-content: space-between;
}

.notia-action-bar--inline {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.notia-action-link,
a.notia-action-link,
button.notia-action-link,
.horario-action-link,
.cierre-ano-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}

.notia-action-link i,
.horario-action-link i,
.cierre-ano-action-link i {
  font-size: 0.75rem;
  opacity: 0.85;
}

.notia-action-link:hover,
.notia-action-link:focus-visible,
.horario-action-link:hover,
.horario-action-link:focus-visible,
.cierre-ano-action-link:hover,
.cierre-ano-action-link:focus-visible {
  color: #0f172a;
  border-color: #cbd5e1;
  background: #f8fafc;
  text-decoration: none;
  outline: none;
}

.notia-action-link--accent,
.horario-action-link--accent,
.cierre-ano-action-link--soft {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.06);
}

.notia-action-link--accent:hover,
.notia-action-link--accent:focus-visible,
.horario-action-link--accent:hover,
.horario-action-link--accent:focus-visible,
.cierre-ano-action-link--soft:hover,
.cierre-ano-action-link--soft:focus-visible {
  color: #115e59;
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(15, 118, 110, 0.1);
}

.notia-action-link--muted {
  color: #64748b;
  border-color: #e2e8f0;
  background: #fff;
}

.notia-action-link--sm {
  min-height: 1.9rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  gap: 0.3rem;
}

.notia-action-link--sm i {
  font-size: 0.68rem;
}

/* Píldoras con relleno sólido (dashboard y CTAs de color) */
.notia-action-link--solid,
.notia-action-link--solid-blue,
.notia-action-link--solid-teal,
.notia-action-link--solid-violet,
.notia-action-link--solid-orange {
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.notia-action-link--solid,
.notia-action-link--solid-blue {
  background: #0288d1 !important;
}

.notia-action-link--solid:hover,
.notia-action-link--solid:focus-visible,
.notia-action-link--solid-blue:hover,
.notia-action-link--solid-blue:focus-visible {
  color: #fff !important;
  background: #0277bd !important;
  border-color: transparent !important;
}

.notia-action-link--solid-teal {
  background: #0d9488 !important;
}

.notia-action-link--solid-teal:hover,
.notia-action-link--solid-teal:focus-visible {
  color: #fff !important;
  background: #0f766e !important;
  border-color: transparent !important;
}

.notia-action-link--solid-violet {
  background: #7c3aed !important;
}

.notia-action-link--solid-violet:hover,
.notia-action-link--solid-violet:focus-visible {
  color: #fff !important;
  background: #6d28d9 !important;
  border-color: transparent !important;
}

.notia-action-link--solid-orange {
  background: #ea580c !important;
}

.notia-action-link--solid-orange:hover,
.notia-action-link--solid-orange:focus-visible {
  color: #fff !important;
  background: #c2410c !important;
  border-color: transparent !important;
}

.notia-action-link--solid i,
.notia-action-link--solid-blue i,
.notia-action-link--solid-teal i,
.notia-action-link--solid-violet i,
.notia-action-link--solid-orange i {
  opacity: 1;
}

.notia-action-dropdown {
  position: relative;
  display: inline-flex;
}

.notia-action-dropdown .dropdown-toggle::after {
  margin-left: 0.25rem;
}

@media (max-width: 576px) {
  .notia-action-bar {
    width: 100%;
  }

  .notia-action-link,
  .horario-action-link,
  .cierre-ano-action-link {
    min-height: 2.4rem;
    padding: 0.35rem 0.8rem;
  }
}

/* Banner config-header fuerza color blanco en <p>; el chip del centro debe verse */
.config-header .centro-activo-hint,
body.notia-panel-app .config-header .centro-activo-hint {
  color: #334155 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(226, 232, 240, 0.95) !important;
}
.config-header .centro-activo-hint i,
body.notia-panel-app .config-header .centro-activo-hint i,
.config-header .centro-activo-hint span,
body.notia-panel-app .config-header .centro-activo-hint span {
  color: #334155 !important;
}
.config-header .centro-activo-hint__hint,
body.notia-panel-app .config-header .centro-activo-hint__hint {
  color: #64748b !important;
}

@media (max-width: 576px) {
  .centro-activo-hint__hint {
    display: none;
  }
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

/* Asegurar que las filas con tarjetas tengan la misma altura */
.row > [class*="col-md-6"].d-flex {
  display: flex;
  align-items: stretch; /* Estirar las tarjetas para igualar alturas */
}

.row > [class*="col-md-6"].d-flex > .config-card {
  height: auto; /* Altura automática basada en contenido */
  min-height: 100%; /* Mínimo para igualar con la tarjeta más alta */
}

/* Asegurar que las filas con columnas igualen alturas en el formulario de materias */
#materiaForm .row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch; /* Estirar columnas para igualar alturas */
}

#materiaForm .row > [class*="col-md-6"] {
  display: flex;
  flex-direction: column;
  align-items: stretch; /* Estirar contenido para igualar alturas */
}

.config-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 10px var(--shadow);
  border: 1px solid var(--soft-border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: auto; /* Altura automática basada en contenido */
}

/* Solo estirar cuando está dentro de una columna con d-flex para igualar alturas */
.row > [class*="col-"].d-flex > .config-card {
  height: 100%; /* Solo en este caso, igualar altura con otras tarjetas de la misma fila */
}

.config-card .card-body {
  flex-grow: 0; /* No estirar el body más allá del contenido */
  display: flex;
  flex-direction: column;
}

/* Cuando el card-body tiene flex-grow-1, permitir que crezca */
.config-card .card-body.flex-grow-1 {
  flex-grow: 1;
}

.config-card:hover {
  box-shadow: 0 4px 20px var(--shadow);
  transform: translateY(-2px);
}

.card-title {
  color: var(--primary-color);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--soft-border);
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  color: var(--primary-text);
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.traslados-form .form-label {
  margin-bottom: 0.35rem;
}

.traslados-form .form-control,
.traslados-form .form-select {
  width: 100%;
  min-height: 44px;
}

.traslados-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--soft-border);
}

.traslados-form__actions .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #BDBDBD !important; /* Borde más visible */
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: white !important;
  color: var(--primary-text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important; /* Sombra sutil para mejor visibilidad */
}

.form-control:hover {
  border-color: #9E9E9E !important; /* Borde más oscuro al pasar el mouse */
}

.form-control:focus {
  outline: none !important;
  border-color: var(--primary-color) !important;
  border-width: 2px !important;
  box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.15) !important;
  background-color: white !important;
}

.form-control::placeholder {
  color: #9E9E9E !important;
  opacity: 0.7;
}

.form-control.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.1);
}

.percentage-input {
  display: flex;
  align-items: center;
  gap: 10px;
}

.config-card .materia-campos-fila {
  margin-bottom: 1rem;
}

.config-card .materia-campos-fila + .percentage-summary {
  margin-top: 0.5rem;
}

.percentage-input input {
  flex: 1;
}

.percentage-symbol {
  color: var(--secondary-text);
  font-weight: 600;
  font-size: 1.1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--hover-primary));
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(2, 136, 209, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 136, 209, 0.4);
}

.btn-primary:disabled {
  background: var(--disabled);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: var(--primary-color);
  color: white;
}

.btn-danger {
  background: var(--error);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: #e64a19;
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-success:hover {
  background: #1e7d6b;
  transform: translateY(-1px);
}

.indicators-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow);
}

.indicators-table th {
  background: var(--primary-color);
  color: white;
  padding: 15px;
  text-align: left;
  font-weight: 600;
}

.indicators-table td {
  padding: 15px;
  border-bottom: 1px solid var(--soft-border);
}

.indicators-table tr:hover {
  background-color: #ffffff;
}

.indicators-table tr:last-child td {
  border-bottom: none;
}

.percentage-display {
  background: var(--success);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.9rem;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.validation-message {
  padding: 12px 16px;
  border-radius: 8px;
  margin-top: 15px;
  font-weight: 500;
}

.validation-message.success {
  background: #e8f5e8;
  color: #2e7d32;
  border: 1px solid #4caf50;
}

.validation-message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid var(--error);
}

.validation-message.warning {
  background: #fff3e0;
  color: #ef6c00;
  border: 1px solid #ff9800;
}

.add-indicator-form {
  background: #ffffff;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  border: 2px dashed var(--soft-border);
}

.add-indicator-form .form-group {
  margin-bottom: 15px;
}

.add-indicator-form .form-group:last-child {
  margin-bottom: 0;
}

.materia-selector {
  background: white;
  border: 2px solid var(--soft-border);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 1rem;
  color: var(--primary-text);
  cursor: pointer;
  transition: all 0.3s ease;
}

.materia-selector:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(2, 136, 209, 0.1);
}

.config-section {
  background-color: #FFFFFF !important;
  margin-bottom: 40px;
}

.section-title {
  color: var(--primary-text);
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-left: 15px;
  border-left: 4px solid var(--primary-color);
}

.percentage-summary {
  background: #FFFFFF !important;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
  border: 1px solid var(--soft-border);
}

.percentage-summary h4 {
  color: var(--primary-text);
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}

.percentage-summary .total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.percentage-summary .total.valid {
  color: var(--success);
}

.percentage-summary .total.invalid {
  color: var(--error);
}

/* ── Configuración pedagógica: espaciado label/campo/botón ── */
.config-card-desc {
  margin: 0 0 1.5rem;
  line-height: 1.55;
}

.config-pedagogica-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.config-grid .config-card {
  display: flex;
  flex-direction: column;
}

.config-porcentajes-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem 1rem;
  margin-bottom: 1.25rem;
}

.config-campo {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.config-campo .form-label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--primary-text);
}

.config-campo .percentage-input {
  width: 100%;
}

.config-campo .percentage-input .form-control {
  flex: 1;
  min-width: 0;
}

.config-pedagogica-form > .form-group {
  margin-bottom: 1.25rem;
}

.config-pedagogica-form > .form-group .form-label {
  margin-bottom: 0.5rem;
}

.config-pedagogica-form .materia-selector {
  width: 100%;
  display: block;
  min-height: 48px;
}

.config-form-summary {
  margin: 0;
  padding: 1rem 1.25rem;
}

/* Separación entre formulario "Agregar indicador" y total de indicadores */
.add-indicator-form + .config-form-summary {
  margin-top: 1.25rem;
}

.config-form-summary h4 {
  margin: 0;
}

.config-form-actions {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--soft-border);
}

.config-grid .config-pedagogica-form .config-form-actions {
  margin-top: auto;
}

.config-form-actions .btn-primary,
.config-form-actions .btn-success {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.config-indicadores-titulo {
  margin: 1.25rem 0 1rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-text);
}

.add-indicator-form__title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-text);
}

.config-indicadores-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 140px;
  gap: 1rem;
  align-items: end;
}

.config-campo--action .btn-success {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

@media (max-width: 991.98px) {
  .config-porcentajes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-indicadores-grid {
    grid-template-columns: 1fr 1fr;
  }

  .config-campo--action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 575.98px) {
  .config-porcentajes-grid,
  .config-indicadores-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .config-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .config-title {
    font-size: 2rem;
  }
  
  .config-card {
    padding: 20px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.config-card {
  animation: fadeIn 0.5s ease-out;
}

/* Estados de validación */
.form-group.has-error .form-label {
  color: var(--error);
}

.form-group.has-success .form-label {
  color: var(--success);
}

/* Indicadores de carga */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--soft-border);
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   RESPONSIVE DESIGN - Configuración
   ======================================== */

/* Pantallas pequeñas (móviles) */
@media (max-width: 575.98px) {
  .config-container {
    padding: 0.75rem;
  }
  
  .config-header {
    padding: 1rem 0.75rem !important;
    margin-bottom: 1rem !important;
  }
  
  .config-title {
    font-size: 1.25rem !important;
    margin-bottom: 0.5rem !important;
  }
  
  .config-subtitle {
    font-size: 0.8rem !important;
  }
  
  .config-card {
    margin-bottom: 1rem;
  }
  
  .config-card .card-header {
    padding: 0.75rem;
  }
  
  .config-card .card-body {
    padding: 1rem;
  }
  
  /* Tablas responsivas */
  .table-responsive {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.5rem 0.25rem;
  }
  
  /* Botones full width en móvil */
  .btn-group {
    flex-direction: column;
    width: 100%;
  }
  
  .btn-group .btn {
    width: 100%;
    margin-bottom: 0.5rem;
    border-radius: 0.375rem !important;
  }
  
  .btn-group .btn:last-child {
    margin-bottom: 0;
  }
  
  /* Formularios */
  .form-control,
  .form-select {
    font-size: 16px; /* Previene zoom en iOS */
    min-height: 44px;
  }
  
  /* Input groups */
  .input-group {
    flex-direction: column;
  }
  
  .input-group .input-group-text {
    border-radius: 0.375rem 0.375rem 0 0;
    border-right: 1px solid #ced4da;
    width: 100%;
  }
  
  .input-group .form-control {
    border-radius: 0 0 0.375rem 0.375rem;
    border-left: 1px solid #ced4da;
  }
}

/* Pantallas medianas (tablets) */
@media (min-width: 576px) and (max-width: 991.98px) {
  .config-container {
    padding: 1rem;
  }
  
  .config-title {
    font-size: 1.5rem !important;
  }
  
  .table-responsive {
    font-size: 0.9rem;
  }
}

/* Panel autenticado: lienzo degradado; tarjetas flotan (ver panel-notia.css) */
body.notia-panel-app .config-container:not(.perfil-page) {
  background-color: transparent !important;
}

body.notia-panel-app .config-section {
  background-color: transparent !important;
  background: transparent !important;
}

body.notia-panel-app .config-container:not(.perfil-page) .config-card {
  border: 1px solid rgba(2, 136, 209, 0.1);
  box-shadow:
    0 1px 2px rgba(38, 50, 56, 0.04),
    0 8px 24px rgba(2, 136, 209, 0.1),
    0 20px 40px rgba(124, 58, 237, 0.07);
}

/* Planes de suscripción: tarjetas misma altura, botón al fondo */
.billing-planes-row > [class*="col-"].d-flex {
  align-items: stretch;
}

.plan-pricing-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
}

.plan-pricing-card--featured {
  border: 2px solid rgba(124, 58, 237, 0.35) !important;
}

.plan-pricing-card__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.plan-pricing-features {
  flex: 1 1 auto;
  margin-top: 0.25rem;
  color: #263238 !important;
}

.plan-pricing-features li {
  color: #263238 !important;
  line-height: 1.4;
}

.plan-pricing-features .text-muted {
  color: #64748b !important;
}

.plan-pricing-card__footer {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 1.25rem;
  width: 100%;
  min-height: 3rem;
}

.plan-pricing-card__footer .btn {
  white-space: normal;
  line-height: 1.25;
  min-height: 2.75rem;
}

@media (max-width: 575.98px) {
  .billing-planes-page .config-header {
    padding: 1.15rem 1rem !important;
  }

  .billing-planes-page .billing-plans-group > summary {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: 0.9rem 1rem;
  }

  .billing-planes-page .billing-plans-group__meta {
    font-size: 0.78rem;
  }

  .billing-planes-page .billing-plans-group__content {
    padding: 0 0.75rem 1rem;
  }

  .billing-planes-row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .plan-pricing-card {
    text-align: left !important;
  }

  .plan-pricing-card .display-6 {
    font-size: 1.85rem;
  }

  .plan-pricing-card .badge {
    max-width: 100%;
    white-space: normal;
    line-height: 1.3;
    padding: 0.4rem 0.7rem;
  }

  .plan-institutional-banner {
    padding: 1rem;
  }

  .plan-institutional-banner .badge,
  .billing-planes-page .badge.rounded-pill {
    max-width: 100%;
    white-space: normal;
  }
}

.plan-pricing-card__footer form {
  margin: 0;
}

.plan-institutional-banner {
  max-width: 960px;
  padding: 1.5rem 1.75rem;
  border: 2px dashed rgba(2, 119, 189, 0.35);
  background: linear-gradient(135deg, rgba(2, 119, 189, 0.06), rgba(94, 53, 181, 0.04));
}

/* Planes — grupos colapsables por tipo de cobro */
.billing-planes-page .billing-plans-group {
  max-width: 960px;
  margin: 0 auto 1rem;
  border: 1px solid rgba(2, 136, 209, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(2, 119, 189, 0.06);
}

.billing-planes-page .billing-plans-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, #fafcfe 0%, #f0f7ff 100%);
  user-select: none;
}

.billing-planes-page .billing-plans-group > summary::-webkit-details-marker {
  display: none;
}

.billing-planes-page .billing-plans-group__head {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.billing-planes-page .billing-plans-group__title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
}

.billing-planes-page .billing-plans-group__meta {
  font-size: 0.82rem;
  color: #64748b;
}

.billing-planes-page .billing-plans-group__chevron {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 136, 209, 0.1);
  color: #0277bd;
  transition: transform 0.2s ease, background 0.2s ease;
}

.billing-planes-page .billing-plans-group[open] > summary .billing-plans-group__chevron {
  transform: rotate(180deg);
  background: rgba(2, 136, 209, 0.16);
}

.billing-planes-page .billing-plans-group > summary:hover .billing-plans-group__chevron {
  background: rgba(2, 136, 209, 0.18);
}

.billing-planes-page .billing-plans-group__content {
  padding: 0 1rem 1.25rem;
}

.billing-planes-page .billing-plans-free {
  max-width: 420px;
  margin: 0 auto 1.25rem;
}

.billing-planes-page .billing-plans-free .plan-pricing-card {
  margin-bottom: 0;
}

/* Código promocional: una sola fila, baja y discreta */
.billing-planes-page .billing-promo-bar,
.billing-promo-bar {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center !important;
  justify-content: flex-start;
  gap: 0.65rem 0.85rem;
  width: 100%;
  max-width: none;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 0 0.85rem;
  padding: 0.45rem 0.75rem !important;
  border: 1px solid rgba(13, 92, 99, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.billing-promo-bar:hover {
  transform: none;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.billing-promo-bar__label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: #475569;
  white-space: nowrap;
  line-height: 1;
}

.billing-promo-bar__label i {
  color: #0d5c63;
  font-size: 0.85rem;
}

.billing-promo-bar__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  background: rgba(13, 92, 99, 0.1);
  color: #0d5c63;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.billing-promo-bar__form {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0;
}

.billing-promo-bar__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 2.1rem !important;
  height: 2.1rem;
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.billing-promo-bar__form .notia-action-link {
  flex: 0 0 auto;
}

@media (max-width: 575.98px) {
  .billing-promo-bar {
    flex-wrap: wrap;
    border-radius: 14px;
    padding: 0.55rem 0.7rem !important;
  }

  .billing-promo-bar__form {
    flex: 1 1 100%;
  }
}

/* Filtros de búsqueda: botón alineado con los selects */
.filtros-busqueda-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 0.85rem;
}

.filtros-busqueda-bar__field {
  flex: 1 1 11rem;
  min-width: 9rem;
}

.filtros-busqueda-bar__field .form-label {
  display: block;
  margin-bottom: 0.35rem;
}

.filtros-busqueda-bar__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
}

.filtros-busqueda-bar__btn {
  min-height: calc(1.5em + 24px + 4px); /* padding 12px*2 + borde 2px*2 del form-select */
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  white-space: nowrap;
}

@media (max-width: 575.98px) {
  .filtros-busqueda-bar__actions,
  .filtros-busqueda-bar__btn {
    width: 100%;
  }
}

/* Filtro de centro en Auditoría (píldora) */
.auditoria-filtro-centro {
  margin: 0;
}

.auditoria-filtro-centro__pill {
  cursor: default;
  gap: 0.45rem;
  padding-right: 0.4rem;
  max-width: min(100%, 22rem);
}

.auditoria-filtro-centro__select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 10rem;
  max-width: 16rem;
  min-height: 1.85rem;
  margin: 0;
  padding: 0.15rem 1.4rem 0.15rem 0.45rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background-color: #f8fafc;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230d5c63' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.75rem;
  color: #0f172a;
  font: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  line-height: 1.2;
  cursor: pointer;
}

.auditoria-filtro-centro__select:focus {
  outline: none;
  border-color: rgba(15, 118, 110, 0.45);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.solicitud-acceso-acciones {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  min-width: 11rem;
}

.solicitud-acceso-acciones__label {
  align-self: stretch;
  text-align: right;
}

.solicitud-acceso-acciones__rol {
  width: 100%;
  max-width: 11rem;
}

.solicitud-acceso-acciones__botones {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.solicitud-acceso-acciones__botones form {
  margin: 0;
}



