:root {
  /* Modal base */
  --modal-base: #737373;
  --modal-base-900: #5e5e5e;
  --modal-base-800: #6a6a6a;
  --modal-accent: #d1f7e6;
  --modern-border: rgba(255, 255, 255, 0.12);
  --modern-hr: rgba(255, 255, 255, 0.16);

  /* Material-ish tokens */
  --md-primary: #1a73e8;
  --md-outline: #dadce0;
  --md-outline-strong: #c7c9cc;
  --md-surface: #ffffff;
  --md-text: #202124;
  --md-muted: #5f6368;
  --md-focus-ring: rgba(26, 115, 232, 0.18);

  /* Urgencias stepper */
  --urgencias-primary: #2e7d32;
  --urgencias-primary-soft: rgba(46, 125, 50, 0.08);
  --urgencias-line: #c8e6c9;

  /* Acordeón urgencias */
  --urg-main: #4caf50;
  --urg-main-soft: #e5f6e9;

  /* Urgencias (cards) */
  --urg-radius: 18px;
  --urg-green-1: #2ea745;
  --urg-green-2: #3db354;
  --urg-green-3: #1e7a35;
  --urg-green-4: #155f2a;
  --urg-red: #f04b63;
  --urg-red-dark: #d73a52;
  --urg-orange: #f08a3c;
  --urg-orange-dark: #d86c1e;
  --urg-white: #ffffff;
  --urg-soft: #eaf5ec;
  --urg-shadow: rgba(0, 0, 0, 0.2);
  --urg-shadow-strong: rgba(0, 0, 0, 0.35);
}

/* Tabla moderna */
.table-modern {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table-modern thead {
  background: linear-gradient(135deg, #66bb6a 0%, #2e7d32 100%);
  color: #fff;
  font-size: 1rem;
  text-align: center;
}

.table-modern tbody tr {
  transition: background-color 0.2s ease-in-out;
}

.table-modern thead tr th {
  color: #fff !important;
}

.table-modern tbody tr:hover {
  background-color: #f0f5f5;
}

.offcanvas-header-modern {
  background: #4caf50;
}

/* Contenedor general */
#expedienteContent .doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Tarjeta de documento */
#expedienteContent .doc-item {
  border: 1px solid var(--bs-border-color);
  background: #4caf50;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease,
    background-color 0.12s ease;
}

#expedienteContent .doc-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
  border-color: color-mix(
    in srgb,
    var(--bs-success) 35%,
    var(--bs-border-color)
  );
}

/* Círculo de icono */
#expedienteContent .doc-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  background: #fff;
  border: 1px solid color-mix(in srgb, #4caf50 30%, #000 10%);
}

#expedienteContent .doc-icon i {
  font-size: 1.25rem;
  color: #4caf50;
}

/* Texto */
#expedienteContent .doc-main {
  min-width: 0;
  /* truncado */
}

#expedienteContent .doc-name {
  font-weight: 600;
  line-height: 1.1;
}

#expedienteContent .doc-key {
  color: var(--bs-secondary-color);
}

/* Badge de tipo/extensión */
#expedienteContent .ext-badge {
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 0.5rem;
}

/* Acciones */
#expedienteContent .doc-actions .btn {
  border-radius: 0.65rem;
  padding: 0.3rem 0.55rem;
}

/* Contenedor general de la lista */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.35rem 0 0.75rem;
  padding: 0;
}

/* Cada ítem */
.doc-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.9);
  /* azul oscuro translúcido */
  border: 1px solid rgba(148, 163, 253, 0.18);
  /* borde tenue */
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
}

/* Hover / foco */
.doc-item:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.45);
  transform: translateY(-1px);
}

/* Icono a la izquierda */
.doc-icon {
  width: 34px;
  height: 34px;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 1);
  border: 1px solid rgba(148, 163, 253, 0.4);
  flex-shrink: 0;
}

.doc-icon i {
  font-size: 1rem;
  color: #60a5fa;
  /* celestito legible sobre oscuro */
}

/* Zona de texto */
.doc-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.doc-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e5e7eb;
}

.doc-key {
  font-size: 0.7rem;
  color: rgba(148, 163, 253, 0.8);
}

/* Badge de extensión / tipo */
.ext-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(15, 23, 42, 1);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.5);
  flex-shrink: 0;
}

/* Acciones (ver / descargar / eliminar) */
.doc-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

.doc-actions .btn {
  padding: 0.18rem 0.35rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-width: 1px;
  background: transparent;
  color: #e5e7eb;
  border-color: rgba(148, 163, 253, 0.4);
}

.doc-actions .btn i {
  font-size: 0.8rem;
}

/* Hover sutil botones */
.doc-actions .btn:hover {
  background: rgba(79, 70, 229, 0.18);
  border-color: rgba(129, 140, 248, 0.9);
  color: #bfdbfe;
}

/* Variante "peligro" solo para borrar */
.doc-actions .btn.btn-delete-file:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}

/* Responsive: en pantallas muy pequeñas apila acciones abajo */
@media (max-width: 576px) {
  .doc-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .doc-actions {
    margin-left: 0;
    margin-top: 0.25rem;
    justify-content: flex-start;
  }
}

#estudiosContent .doc-item {
  background: rgba(24, 24, 35, 0.98);
  border-color: rgba(45, 212, 191, 0.28);
}

#estudiosContent .ext-badge {
  background: rgba(6, 78, 59, 1);
  border-color: rgba(45, 212, 191, 0.55);
  color: #a7f3d0;
}

/* Llenar alto, permitir scroll interno */
.modal-body-fill {
  display: flex;
  flex-direction: column;
  height: 100%;
}

#consulta-content {
  flex: 1 1 auto;
}

/* Botón cerrar flotante (porque quitamos el header) */
.btn-close-fab {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Compactar controles sin perder legibilidad */
.g-ctl-sm {
  padding-top: 0.6rem !important;
  padding-bottom: 0.6rem !important;
  min-height: 2.25rem;
  /* ~36px */
  font-size: 0.9rem;
}

/* Variante compacta para floating labels */
.form-floating-sm > .form-control,
.form-floating-sm > .form-select {
  height: calc(2.5rem + 2px);
  min-height: calc(2.5rem + 2px);
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.25;
}

.form-floating-sm > label {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  height: auto;
  /* evita que el label “estire” el contenedor */
  pointer-events: none;
}

/* Estado flotado del label (cuando hay valor o focus) */
.form-floating-sm > .form-control:focus ~ label,
.form-floating-sm > .form-control:not(:placeholder-shown) ~ label,
.form-floating-sm > .form-select:focus ~ label,
.form-floating-sm > .form-select:not([value=""]) ~ label {
  transform: scale(0.85) translateY(-0.55rem) translateX(0.15rem);
  opacity: 0.75;
}

/* Textareas en floating: define altura y paddings */
.form-floating-sm textarea.form-control {
  min-height: 5.25rem;
  /* ~84px */
  height: 5.25rem;
  padding-top: 1.1rem;
  /* deja aire para el label dentro */
  padding-bottom: 0.6rem;
}

/* Opcional: separación más compacta entre campos */
#consulta-form .row.g-2 > [class^="col-"],
#consulta-form .row.g-2 > [class*=" col-"] {
  margin-bottom: 0.15rem;
}

/* Estética moderna existente (si ya la tienes, no dupliques) */
.modern-modal {
  background: #fff;
}

.gcard {
  background: #fff;
  border: 1px solid #eceff3;
}

.gcard-header {
  padding: 1rem 1rem 0.5rem;
}

.gcard-body {
  padding: 0.75rem 1rem 1rem;
}

.gavatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f6f9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #5f6368;
}

.gtitle {
  font-size: 1.05rem;
  font-weight: 600;
}

.gsubtitle {
  color: #6b7280;
}

.gsection-label {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #5f6368;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.ginfo-list {
  display: grid;
  gap: 0.45rem;
}

.ginfo-item {
  padding: 0.55rem 0.65rem;
  border: 1px solid #edf0f4;
  border-radius: 12px;
  background: #f1f1f1;
}

.ginfo-label {
  font-size: 0.75rem;
  color: #1a524f;
  margin-bottom: 0.15rem;
  font-weight: 500;
}

.ginfo-value {
  font-size: 0.93rem;
  color: #1f2937;
}

.logo-img {
  height: clamp(28px, 4vw, 48px);
  /* tamaño tipo logo y responsivo */
  width: auto;
  /* mantiene proporción */
  max-width: 100%;
  /* no se desborda del contenedor */
  object-fit: contain;
  /* por si el contenedor fuerza tamaños */
  image-rendering: auto;
  /* se ve nítido en la mayoría de pantallas */
  display: inline-block;
}

/* ===== Material-ish tokens (Google style) ===== */
:root {
  --md-primary: #1a73e8;
  /* Google Blue */
  --md-outline: #dadce0;
  /* Borde gris */
  --md-outline-strong: #c7c9cc;
  /* Hover */
  --md-surface: #ffffff;
  --md-text: #202124;
  /* On surface */
  --md-muted: #5f6368;
  /* Labels/ayuda */
  --md-focus-ring: rgba(26, 115, 232, 0.18);
}

/* ===== Card ligera tipo Google ===== */
.gcard {
  background: linear-gradient(180deg, #fff, #fbfbfc);
  box-shadow: 0 6px 16px rgba(60, 64, 67, 0.08) !important;
}

/* ===== Campo "outlined" con label-chip ===== */
.gmd-select {
  position: relative;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Noto Sans",
    "Apple Color Emoji",
    "Segoe UI Emoji";
}

.gmd-control {
  color: var(--md-text);
  background: var(--md-surface);
  border: 1px solid var(--md-outline);
  border-radius: 0.5rem;
  padding: 0.7rem 0.95rem;
  height: calc(2.75rem + 2px);
  line-height: 1.2;
  box-shadow: none;
  appearance: none;
  /* mantiene un aspecto limpio; el ícono nativo sigue */
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
  text-transform: uppercase;
}

/* Hover */
.gmd-control:hover {
  border-color: var(--md-outline-strong);
  background-color: #fcfdff;
}

/* Focus visible */
.gmd-select:focus-within .gmd-control {
  border-color: var(--md-primary);
  box-shadow: 0 0 0 0.25rem var(--md-focus-ring);
  outline: 0;
}

/* Label tipo "chip" que cruza el borde */
.gmd-label {
  position: absolute;
  top: -0.6rem;
  left: 0.85rem;
  padding: 0 0.35rem;
  background: #87bf8a;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #fff;
  pointer-events: none;
  border-radius: 5px;
}

/* Realce de label en focus */
.gmd-select:focus-within .gmd-label {
  color: var(--md-primary);
}

/* Texto de ayuda */
.gmd-support {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--md-muted);
}

/* Estados */
.gmd-control:disabled {
  background-color: #f5f6f7;
  color: #9aa0a6;
  border-color: var(--md-outline);
  cursor: not-allowed;
}

/* Afinado responsive */
@media (max-width: 576px) {
  .gmd-control {
    height: calc(2.5rem + 2px);
    padding: 0.55rem 0.8rem;
  }

  .gmd-label {
    top: -0.55rem;
    left: 0.75rem;
  }
}

.calendario-wrapper {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 0.5rem;
}

@media (max-width: 992px) {
  .calendario-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 576px) {
  .calendario-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

.cal-dia {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.8rem;
  padding: 0.85rem;
  text-align: center;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease;
}

.cal-dia:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.cal-dia.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f4f5f6;
}

.cal-dia .titulo {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.cal-dia .badge-count {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.5rem;
  background: rgba(26, 82, 79, 0.1);
  /* #1a524f con opacidad */
  color: #1a524f;
}

/* =========================================
   CONTENEDOR DE HORARIOS DISPONIBLES
========================================= */
#horariosDisponibles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  width: 100%;
  max-width: 100%;
  padding: 0.5rem 0.25rem;
  box-sizing: border-box;
  align-items: stretch;
}

/* Header que agrega el JS */
#horariosDisponibles > .mb-2 {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.75rem 0.95rem;
  border-radius: 0.95rem;
  background: #314559;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.07);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.2px;
  color: #e5e7eb;
  cursor: default;
  min-width: 0;
  overflow-wrap: anywhere;
}

#horariosDisponibles > .mb-2::before {
  content: "🕒";
  font-size: 1rem;
  line-height: 1;
  opacity: 0.95;
  flex-shrink: 0;
}

/* Mensajes vacíos o de error */
#horariosDisponibles > .text-muted,
#horariosDisponibles > .text-danger {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 0.85rem;
  background: #f8f9fa;
  border: 1px dashed #d0d7de;
}

#horariosDisponibles > .text-danger {
  background: #fff5f5;
  border-color: #f1b0b7;
  color: #b42318 !important;
}

/* =========================================
   BOTONES DE HORARIO
========================================= */
#horariosDisponibles .h-slot {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  appearance: none;
  border: 1px solid #d0d7de;
  border-radius: 0.9rem;
  background: #ffffff;
  color: #314559;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  padding: 0.8rem 0.9rem;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.12s ease;
  cursor: pointer;
}

#horariosDisponibles .h-slot:hover {
  background: #f3f6f9;
  border-color: #314559;
  color: #213140;
  box-shadow: 0 8px 20px rgba(49, 69, 89, 0.12);
  transform: translateY(-1px);
}

#horariosDisponibles .h-slot:focus {
  outline: none;
  border-color: #314559;
  box-shadow: 0 0 0 0.22rem rgba(49, 69, 89, 0.18);
}

#horariosDisponibles .h-slot.sel {
  background: #314559;
  color: #ffffff;
  border-color: #314559;
  box-shadow: 0 10px 24px rgba(49, 69, 89, 0.2);
}

#horariosDisponibles .h-slot:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* =========================================
   RESPONSIVE
========================================= */

/* Desktop grande */
@media (min-width: 1400px) {
  #horariosDisponibles {
    grid-template-columns: repeat(6, minmax(140px, 1fr));
  }
}

/* Laptop / desktop normal */
@media (min-width: 992px) and (max-width: 1399.98px) {
  #horariosDisponibles {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991.98px) {
  #horariosDisponibles {
    grid-template-columns: repeat(3, minmax(130px, 1fr));
  }

  #horariosDisponibles .h-slot {
    min-height: 46px;
    font-size: 0.93rem;
  }
}

/* Móvil */
@media (max-width: 767.98px) {
  #horariosDisponibles {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 0.35rem 0;
  }

  #horariosDisponibles > .mb-2 {
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
  }

  #horariosDisponibles .h-slot {
    min-height: 44px;
    font-size: 0.9rem;
    padding: 0.7rem 0.75rem;
    border-radius: 0.8rem;
  }
}

/* Móvil muy pequeño */
@media (max-width: 420px) {
  #horariosDisponibles {
    grid-template-columns: 1fr;
  }

  #horariosDisponibles .h-slot {
    width: 100%;
  }
}

/* Botones de horario */
.h-slot {
  border: 1px solid #314559;
  border-radius: 0.85rem;
  padding: 0.85rem 0.95rem;
  background: #314559;
  font-weight: 700;
  font-size: 0.96rem;
  text-align: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease;
  cursor: pointer;
  user-select: none;
}

.h-slot:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  background: #fbfeff;
}

.h-slot:focus-visible {
  outline: 3px solid rgba(26, 82, 79, 0.35);
  outline-offset: 2px;
}

/* Responsivo: conserva tu comportamiento original */
@media (max-width: 992px) {
  #horariosDisponibles {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 576px) {
  #horariosDisponibles {
    grid-template-columns: repeat(2, 1fr);
  }

  .h-slot {
    padding: 0.75rem 0.85rem;
    font-size: 0.93rem;
  }
}

/* Dark mode opcional */
@media (prefers-color-scheme: dark) {
  #horariosDisponibles > .mb-2 {
    background: #314559;
    color: #e5e7eb;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  }

  .h-slot {
    background: #314559;
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  }

  .h-slot:hover {
    background: #314559;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
  }

  .h-slot.sel {
    background: #4caf50;
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
  }
}

/* ======= Cabecera / Logo ======= */
.brand-logo {
  max-height: 48px;
  width: auto;
}

/* ======= Formulario de filtros (sustituye el inline style original) ======= */
.agenda-form {
  background: #f1f1f1;
  border-radius: 10px;
  color: white;
  /* (igual que tenías) */
  margin-top: 5px;
  padding: 5px;
  padding-bottom: 15px;
}

/* Opcional: mejora contraste de labels si usas texto blanco */
.agenda-form .gmd-label,
.agenda-form .gmd-support {
  color: #fff;
  /* Si prefieres bajo contraste sobre gris */
}

/* ======= Calendario semanal simple (si usas el contenedor plano) ======= */
.calendario-wrapper {
  display: grid;
  grid-template-columns: repeat(7, minmax(100px, 1fr));
  gap: 0.5rem;
}

@media (max-width: 992px) {
  .calendario-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 576px) {
  .calendario-wrapper {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Slots (botones de hora) */
.h-slot {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0.6rem;
  padding: 0.6rem 0.7rem;
  text-align: center;
  background: #e7607b;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

/* ======= Estilos del calendario mensual (si usas el render mensual por JS) ======= */
.cal-month-wrapper {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #4d4d4d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 0.75rem;
}

.cal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.75rem;
}

.cal-bar .cal-title {
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: capitalize;
}

.cal-nav-btn {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.cal-nav-btn:hover {
  background: #f6f7f8;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  gap: 0.25rem;
  color: #fff;
  font-size: 0.8rem;
  margin: 0 0.25rem 0.25rem;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.cal-cell {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0.5rem;
  min-height: 70px;
  position: relative;
}

.cal-cell .num {
  font-weight: 700;
  font-size: 0.9rem;
}

.cal-cell.other {
  background: #fafafa;
  color: #9ca3af;
}

.cal-cell.blocked {
  opacity: 0.6;
}

.cal-cell.enabled {
  cursor: pointer;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    background 0.1s ease;
}

.cal-cell.enabled:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
  background: #f9fbfb;
}

.cal-cell.enabled.selected {
  outline: #4caf50;
  background: #4caf50;
  color: white;
}

/* El host del calendario y de horarios ocupan todo el ancho del card */
#calendarioDisponibilidades {
  display: block;
  width: 100%;
  max-width: 100%;
  clear: both;
  /* por si hay floats previos */
}

/* Separación natural debajo del formulario */
#calendarioDisponibilidades {
  margin-top: 0.75rem;
}

/* Asegura que el calendario se adapte al contenedor */
.cal-month-wrapper {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  /* evita que la grid se “salga” */
}

/* Grid de días sin desbordes */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  /* evita overflow al reducir */
  gap: 0.25rem;
}

/* Ajustes responsivos por si tu card es angosto */
@media (max-width: 576px) {
  .cal-cell {
    min-height: 56px;
    padding: 0.4rem;
  }

  .cal-cell .num {
    font-size: 0.85rem;
  }
}

.cita-header-badge {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.cita-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--bs-secondary-color);
}

.cita-card + .cita-card {
  margin-top: 0.75rem;
}

.cita-kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0.25rem 0.75rem;
  color: #fff;
}

@media (max-width: 576px) {
  .cita-kv {
    grid-template-columns: 1fr;
  }
}

.cita-card {
  background-color: #4d4d4d;
}

/* =========================================================
   Accordion urgencias (nota)
========================================================= */
.accordion-urgencias .accordion-item {
  background-color: #ffffff;
}

.accordion-urgencias .accordion-button {
  background: linear-gradient(
    90deg,
    rgba(76, 175, 80, 0.08),
    rgba(255, 255, 255, 0.98)
  );
  font-size: 0.9rem;
  color: #333;
}

.accordion-urgencias .accordion-button.collapsed {
  background: #f8f9fa;
  color: #495057;
}

.accordion-urgencias .accordion-button:not(.collapsed) {
  color: var(--urg-main);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.accordion-urgencias .accordion-button:focus {
  box-shadow: 0 0 0 0.15rem rgba(76, 175, 80, 0.25);
}

.accordion-urgencias .accordion-body {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

#notaUrgenciasForm .form-control,
#notaUrgenciasForm .form-select,
#notaUrgenciasForm textarea {
  border-radius: 0.6rem;
  border-color: #dde2e6;
}

#notaUrgenciasForm .form-control:focus,
#notaUrgenciasForm .form-select:focus,
#notaUrgenciasForm textarea:focus {
  border-color: var(--urg-main);
  box-shadow: 0 0 0 0.15rem rgba(76, 175, 80, 0.2);
}

#notaUrgenciasForm .form-label {
  letter-spacing: 0.02em;
}

@media (max-width: 576px) {
  .accordion-urgencias .accordion-button {
    align-items: flex-start;
  }
}

/* =========================================================
   Urg step badge (unificado; última versión gana)
========================================================= */
.urg-step-badge {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;

  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  color: #2e7d32;
  border: 1px solid rgba(46, 125, 50, 0.25);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);

  transition: all 0.2s ease-in-out;
}

.urg-step-badge i {
  line-height: 1;
}

.urgencias-stepper .nav-link.active .urg-step-badge {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  color: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 6px 14px rgba(46, 125, 50, 0.35);
}

.urgencias-stepper .nav-link:not(.active):hover .urg-step-badge {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.25);
}

/* =========================================================
   Close button urgencias (verde)
========================================================= */
.btn-close-urg {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%232e7d32'%3e%3cpath d='M.293 1.707a1 1 0 0 1 1.414-1.414L8 6.586l6.293-6.293a1 1 0 0 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8z'/%3e%3c/svg%3e");
  opacity: 1;
}

.btn-close-urg:hover {
  filter: brightness(0.85);
}

/* =========================================================
   Icon button (g-iconbtn)
========================================================= */
.g-iconbtn {
  --sz: 34px;
  width: var(--sz);
  height: var(--sz);
  display: inline-flex;
  align-items: center;
  justify-content: center;

  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;

  text-decoration: none;
  cursor: pointer;

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.g-iconbtn i {
  font-size: 1.05rem;
  line-height: 1;
}

.g-iconbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
}

.g-iconbtn:active {
  transform: translateY(0px) scale(0.98);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

.g-iconbtn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px rgba(13, 110, 253, 0.18),
    0 10px 22px rgba(0, 0, 0, 0.12);
}

.g-iconbtn--primary {
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.08);
  border-color: rgba(13, 110, 253, 0.2);
}

.g-iconbtn--success {
  color: #198754;
  background: rgba(25, 135, 84, 0.1);
  border-color: rgba(25, 135, 84, 0.22);
}

.g-iconbtn--warning {
  color: #b86a00;
  background: rgba(255, 193, 7, 0.18);
  border-color: rgba(255, 193, 7, 0.35);
}

.g-iconbtn--danger {
  color: #dc3545;
  background: rgba(220, 53, 69, 0.1);
  border-color: rgba(220, 53, 69, 0.22);
}

.g-iconbtn--neutral {
  color: #495057;
  background: rgba(73, 80, 87, 0.08);
  border-color: rgba(73, 80, 87, 0.18);
}

a.g-iconbtn {
  vertical-align: middle;
}

/* =========================================================
   Urgencias Cards (modal-body / cards)
========================================================= */

#urgenciasCards {
  padding-top: 4px;
}

.urg-accordion {
  border-radius: var(--urg-radius);
}

.urg-card {
  border: none !important;
  border-radius: var(--urg-radius) !important;
  overflow: hidden;
  background: #314559;
  box-shadow: 0 18px 40px var(--urg-shadow);
  position: relative;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}

.urg-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.3);
}

.urg-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--urg-radius);
  padding: 2px;
  background: linear-gradient(
    135deg,
    var(--urg-green-4),
    rgba(255, 255, 255, 0.18)
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.urg-card__header {
  background: transparent;
  border: 0;
}

.urg-acc-btn {
  background: transparent !important;
  border: none !important;
  color: var(--urg-white) !important;
  padding: 18px 18px !important;
  box-shadow: none !important;
  border-radius: var(--urg-radius) !important;
}

.urg-acc-btn:not(.collapsed) {
  background: rgba(0, 0, 0, 0.08) !important;
}

.urg-acc-btn::after {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.urg-card__title {
  font-weight: 800;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  line-height: 1.1;
  color: var(--urg-white);
}

.urg-card__title i {
  font-size: 1.2rem;
  opacity: 0.95;
}

.urg-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--urg-soft);
  font-size: 0.92rem;
  margin-top: 6px;
}

.urg-card__meta strong {
  font-weight: 800;
  color: var(--urg-white);
}

.urg-muted {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Pills */
.urg-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  color: var(--urg-white);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(6px);
}

.urg-pill i {
  font-size: 14px;
  opacity: 0.9;
}

.urg-pill-real {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 14px 24px var(--urg-shadow-strong);
  background: linear-gradient(180deg, var(--urg-red), var(--urg-red-dark));
  color: var(--urg-white);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.urg-pill-real i {
  opacity: 0.95;
}

/* Badges */
.urg-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 18px var(--urg-shadow);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
}

.urg-badge--pending,
.urg-badge--warning,
.urg-badge--orange {
  background: linear-gradient(
    180deg,
    var(--urg-orange),
    var(--urg-orange-dark)
  );
  color: var(--urg-white);
}

.urg-badge--success {
  background: rgba(255, 255, 255, 0.16);
  color: var(--urg-white);
}

.urg-badge--danger {
  background: linear-gradient(180deg, var(--urg-red), var(--urg-red-dark));
  color: var(--urg-white);
}

.urg-badge--info {
  background: cadetblue;
  border-color: cadetblue;
  color: #fff;
}

.urg-badge--rz,
.urg-badge--can {
  background: #d73a52;
  border-color: #d73a52;
  color: #fff;
}

.urg-badge--or {
  background: #ff8800;
  border-color: #ff8800;
  color: #fff;
}

.urg-badge--nla {
  background: #074560;
  border-color: #074560;
  color: #fff;
}

.urg-badge--ok {
  background: #4caf50;
  border-color: #4caf50;
  color: #fff;
}

.urg-badge--warn {
  background: #d89e70;
  border-color: #d89e70;
  color: #fff;
}

.urg-badge--muted {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
}

/* Body */
.urg-card__body {
  background-color: #fff !important;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--urg-white);
  padding: 18px;
}

.urg-kv {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 992px) {
  .urg-kv {
    grid-template-columns: 1fr;
  }
}

.urg-kv__item {
  background: #2d4052;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.urg-kv__label {
  font-size: 0.8rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}

.urg-kv__value {
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  line-height: 1.2;
}

/* Detalle */
.urg-detail-wrap {
  padding: 12px 12px 16px;
}

.urg-detail-card {
  background: #2d4052;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
}

.urg-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 12px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.urg-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.urg-label {
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.urg-label i {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #314559;
  color: #fff;
  font-size: 14px;
}

.urg-value {
  font-size: 0.92rem;
  color: var(--urg-soft);
  line-height: 1.35rem;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 576px) {
  .urg-detail-card {
    padding: 12px;
  }

  .urg-item {
    padding: 10px 12px;
  }

  .urg-value {
    font-size: 13.5px;
  }
}

/* Footer */
.urg-card__footer {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 12px;
}

.btn-enviar-validacion {
  border-radius: 999px !important;
  padding: 9px 14px !important;
  font-weight: 800 !important;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease;
}

.btn-enviar-validacion:hover {
  transform: translateY(-1px);
}

.btn-urg-save {
  border: 0;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
  background: #4caf50;
  color: #fff;
  box-shadow:
    0 10px 22px rgba(34, 197, 94, 0.25),
    0 4px 10px rgba(15, 118, 110, 0.18);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.btn-urg-save:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
  box-shadow:
    0 14px 30px rgba(34, 197, 94, 0.3),
    0 6px 14px rgba(15, 118, 110, 0.22);
}

.btn-urg-save:active {
  transform: translateY(0px);
}

.btn-urg-save:focus {
  outline: none;
  box-shadow:
    0 0 0 0.25rem rgba(34, 197, 94, 0.25),
    0 10px 22px rgba(34, 197, 94, 0.22);
}

/* =========================================================
   Nota Larga (notalargaid)
========================================================= */
#notalargaid .form-control,
#notalargaid .form-select {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 11px 14px;
}

#notalargaid .form-control:focus,
#notalargaid .form-select:focus {
  border-color: rgba(13, 110, 253, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

#notalargaid .card {
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

#notalargaid .card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

#notalargaid .accordion-button:focus {
  box-shadow: none;
}

#notalargaid .accordion-button::after {
  filter: brightness(10);
}

#notalargaid .accordion-item {
  border-radius: 18px !important;
}

.nl-acc-btn {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.nl-acc-btn:focus {
  outline: none;
  box-shadow: none;
}

.nl-acc-icon {
  opacity: 0.65;
  transition: transform 0.18s ease;
}

.nl-acc-btn[aria-expanded="true"] .nl-acc-icon {
  transform: rotate(180deg);
}

/* =========================================================
   HERO urg (topo) - se queda con la última versión ::before
========================================================= */
.urg-hero-topo {
  --hero-green: #4caf50;
  --hero-green-2: #2e7d32;
  --hero-radius: 22px;

  position: relative;
  border-radius: var(--hero-radius);
  padding: clamp(28px, 4vw, 64px) 18px;
  overflow: hidden;

  background: linear-gradient(135deg, var(--hero-green), var(--hero-green-2));
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);

  isolation: isolate;
}

/* ✅ última versión (multi capas) */
.urg-hero-topo::before {
  content: "";
  position: absolute;
  inset: 0;

  background-image:
    url("../images/banner-overlay-img.png"),
    url("../images/banner-overlay-img.png"),
    url("../images/banner-overlay-img.png"),
    url("../images/banner-overlay-img.png"),
    url("../images/banner-overlay-img.png"),
    url("../images/banner-overlay-img.png");

  background-repeat: repeat;
  background-size: 900px auto;
  background-position:
    center,
    calc(50% + 20px) calc(50% + 10px),
    calc(50% - 18px) calc(50% - 12px),
    calc(50% + 40px) calc(50% - 20px),
    calc(50% - 38px) calc(50% + 22px),
    calc(50% + 60px) calc(50% + 30px);

  opacity: 1;
  mix-blend-mode: screen;
  filter: brightness(1.6) contrast(1.2);
  pointer-events: none;
  z-index: 1;
}

.urg-hero-topo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(
      900px 380px at 50% 35%,
      rgba(255, 255, 255, 0.1),
      transparent 60%
    ),
    radial-gradient(
      900px 500px at 50% 120%,
      rgba(0, 0, 0, 0.1),
      transparent 55%
    );
  pointer-events: none;
}

.urg-hero-topo__content {
  position: relative;
  z-index: 3;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.urg-hero-topo__title {
  margin: 0 0 10px 0;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 3.6vw, 56px);
  line-height: 1.05;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.urg-hero-topo__sub {
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-size: clamp(14px, 1.25vw, 18px);
  line-height: 1.55;
  text-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
}

/* =========================================================
   MODAL NOTA LARGA (FULLSCREEN)
========================================================= */
.nl-modal .modal-dialog {
  margin: 0;
}

.nl-modal__content {
  border: 0;
  background:
    radial-gradient(
      1000px 420px at 12% 0%,
      rgba(76, 175, 80, 0.22),
      transparent 55%
    ),
    radial-gradient(
      820px 380px at 92% 8%,
      rgba(46, 125, 50, 0.18),
      transparent 60%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(248, 250, 252, 0.98)
    );
}

.nl-modal__header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: #fff;
  padding: 18px 18px;
}

.nl-modal__sub {
  opacity: 0.9;
}

.nl-modal__body {
  padding: 18px;
  overflow: auto;
}

.nl-modal__footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  padding: 14px 18px;
}

/* Form card */
.nl-form-wrap {
  max-width: 1180px;
  margin: 0 auto;
}

.nl-form-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 44px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.nl-form-card__top {
  padding: 16px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(
    180deg,
    rgba(76, 175, 80, 0.1),
    rgba(255, 255, 255, 0)
  );
}

.nl-form-card__title {
  margin: 0;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.92);
}

.nl-form-card__hint {
  margin-top: 4px;
  color: rgba(15, 23, 42, 0.62);
}

.nl-form-card__body {
  padding: 16px 16px 18px;
}

.nl-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: rgba(15, 23, 42, 0.9);
  margin: 14px 0 8px;
}

.nl-section-title i {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
}

.nl-label {
  font-weight: 700;
  color: rgba(15, 23, 42, 0.78);
  margin-bottom: 6px;
}

.nl-control {
  border-radius: 14px !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  padding: 12px 12px !important;
  box-shadow: none !important;
}

.nl-control:focus {
  border-color: rgba(76, 175, 80, 0.55) !important;
  box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.18) !important;
}

.nl-help {
  color: rgba(15, 23, 42, 0.55);
  font-size: 0.85rem;
}

.nl-switch .form-check-input {
  width: 2.7em;
  height: 1.45em;
  border-radius: 999px;
  border-color: rgba(15, 23, 42, 0.2);
  box-shadow: none;
}

.nl-switch .form-check-input:checked {
  background-color: #4caf50;
  border-color: #4caf50;
}

.nl-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(248, 250, 252, 0.92);
  color: rgba(15, 23, 42, 0.7);
  font-weight: 700;
  font-size: 0.88rem;
}

.nl-btn-save {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(76, 175, 80, 0.22);
}

/* =========================================================
   Modal Nota Larga Edit
========================================================= */
#modalNotaLargaEdit .modal-content {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.28);
  background: #fff;
}

#modalNotaLargaEdit .modal-header {
  position: sticky;
  top: 0;
  z-index: 5;
  border: 0;
  padding: 16px 18px;
  background: linear-gradient(
    135deg,
    rgba(76, 175, 80, 1),
    rgba(46, 125, 50, 1)
  );
  color: #fff;
}

#modalNotaLargaEdit .modal-title {
  font-weight: 900;
  letter-spacing: 0.2px;
}

#modalNotaLargaEdit .btn-close {
  filter: invert(1);
  opacity: 0.9;
}

#modalNotaLargaEdit .btn-close:hover {
  opacity: 1;
}

#modalNotaLargaEdit .modal-body {
  background:
    radial-gradient(
      1200px 300px at 10% 0%,
      rgba(76, 175, 80, 0.14),
      transparent 60%
    ),
    radial-gradient(
      900px 260px at 90% 10%,
      rgba(46, 125, 50, 0.12),
      transparent 60%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(248, 250, 252, 0.96)
    );
  padding: 18px;
}

#modalNotaLargaEdit .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  border: 0;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.08);
}

#modalNotaLargaEdit .nl-edit-wrap {
  max-width: 100%;
  margin: 0 auto;
}

#modalNotaLargaEdit .nl-edit-card {
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.1);
}

#modalNotaLargaEdit .nl-edit-card__head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(
    180deg,
    rgba(76, 175, 80, 0.1),
    rgba(255, 255, 255, 0)
  );
}

#modalNotaLargaEdit .nl-edit-card__head .nl-edit-title {
  margin: 0;
  font-weight: 900;
  color: rgba(15, 23, 42, 0.92);
  display: flex;
  align-items: center;
  gap: 10px;
}

#modalNotaLargaEdit .nl-edit-card__body {
  padding: 16px;
}

#modalNotaLargaEdit .nl-field {
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(248, 250, 252, 0.9);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    border-color 0.12s ease;
}

#modalNotaLargaEdit .nl-field:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  border-color: rgba(76, 175, 80, 0.2);
}

#modalNotaLargaEdit .nl-field .form-label {
  font-weight: 800;
  color: rgba(15, 23, 42, 0.72);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#modalNotaLargaEdit .nl-field .form-control,
#modalNotaLargaEdit .nl-field .form-select {
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  padding: 10px 12px;
  background: #fff;
  box-shadow: none;
}

#modalNotaLargaEdit .nl-field textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

#modalNotaLargaEdit .nl-field .form-control:focus,
#modalNotaLargaEdit .nl-field .form-select:focus {
  border-color: rgba(76, 175, 80, 0.55);
  box-shadow: 0 0 0 0.22rem rgba(76, 175, 80, 0.16);
}

#modalNotaLargaEdit .invalid-feedback {
  font-weight: 600;
}

/* ================================================
   CSS EXTRAÍDO — Solo clases usadas en el HTML
   del modal #fullMoadalDocument
   ================================================ */

/* === VARIABLES RAÍZ === */
:root {
  --brand-1: #1a524f;
  --brand-2: #4caf50;
  --accent-1: #e7607b;
  --surface: #0f1115;
  --card: #151922;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e7e9ee;

  --cta: #4caf50;
  --cta-hover: #43a047;
  --cta-active: #2e7d32;
  --cta-ring: rgba(76, 175, 80, 0.35);
  --cta-border: rgba(76, 175, 80, 0.65);
}

/* === HEADER DEL MODAL (.urg-modal-header) === */
.urg-modal-header {
  position: relative;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  padding: 16px 18px;
  background:
    radial-gradient(
      900px 240px at 10% 0%,
      rgba(76, 175, 80, 0.18),
      transparent 55%
    ),
    radial-gradient(
      700px 220px at 90% 10%,
      rgba(46, 125, 50, 0.14),
      transparent 55%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.98),
      rgba(255, 255, 255, 0.92)
    );
  backdrop-filter: blur(6px);
}

.urg-modal-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  border-radius: 0 10px 10px 0;
  background: linear-gradient(180deg, #4caf50, #2e7d32);
  opacity: 0.95;
}

/* === TABS (.gk-tabs, .gk-tabpanes) === */
.gk-tabs {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 6px;
  gap: 6px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.05);
}

.gk-tabs .nav-link {
  position: relative;
  border-radius: 12px !important;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #334155;
  background: transparent;
  transition:
    transform 0.12s ease,
    background-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  user-select: none;
}

.gk-tabs .nav-link:hover {
  background: rgba(51, 65, 85, 0.06);
  transform: translateY(-1px);
}

.gk-tabs .nav-link.active {
  background: #43a047;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
}

.gk-tabs .nav-link.active::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.gk-tabpanes {
  padding-top: 8px;
}

@media (max-width: 576px) {
  .gk-tabs .nav-link {
    padding: 10px 10px;
    font-size: 0.82rem;
  }
}

/* === ACORDEÓN BOTÓN CTA (.accordion-btn-cta) === */
.accordion-btn-cta {
  font-weight: 700;
  letter-spacing: 0.2px;
  border: 1px solid var(--cta-border);
  border-radius: 14px;
  margin: 8px 0;
  background: var(--cta);
  color: #fff;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.1);
  padding: 14px 16px;
  transition:
    background 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.accordion-btn-cta > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.accordion-btn-cta:hover {
  background: var(--cta-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(2, 6, 23, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.accordion-btn-cta:focus {
  box-shadow:
    0 0 0 0.25rem var(--cta-ring),
    0 10px 26px rgba(2, 6, 23, 0.16);
}

.accordion-button:not(.collapsed).accordion-btn-cta {
  background: var(--cta-active);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.accordion-button:not(.collapsed).accordion-btn-cta > i {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.34);
}

.accordion-button.accordion-btn-cta::after {
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

/* === LISTAS DE DOCUMENTOS / EXPEDIENTE === */

/* Contenedor grid */
.expediente-wrap {
  --bg: #ffffff;
  --muted: #64748b;
  --text: #0f172a;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.06);
  --shadow-hover: 0 18px 50px rgba(2, 6, 23, 0.1);
  --radius: 16px;
  --chip: #f1f5f9;
  --danger: #ef4444;
  --primary: #2563eb;
  width: 100%;
  max-width: 100%;
}

.expediente-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

/* Tarjeta individual de documento */
.expediente-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.expediente-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-hover);
  border-color: #cbd5e1;
}

/* Ícono circular */
.expediente-ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e0f2fe, #eff6ff);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
}

.expediente-ico i {
  font-size: 22px;
  color: #43a047;
}

.expediente-main {
  min-width: 0;
  flex: 1 1 auto;
}

.expediente-title {
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.expediente-sub {
  margin-top: 6px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.expediente-chip {
  background: var(--chip);
  color: #334155;
  border: 1px solid var(--border);
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.expediente-chip code {
  font-size: 11px;
  color: #334155;
}

.expediente-key {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.expediente-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.expediente-btn {
  border-radius: 12px !important;
  padding: 7px 10px !important;
  display: inline-flex !important;
  gap: 6px;
  align-items: center;
  font-weight: 600;
}

.expediente-btn i {
  font-size: 16px;
}

.expediente-btn-outline {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  color: #0f172a !important;
}

.expediente-btn-outline:hover {
  border-color: #cbd5e1 !important;
  background: #f8fafc !important;
}

.expediente-btn-primary {
  background: #4caf50 !important;
  border-color: #4caf50 !important;
}

.expediente-btn-danger {
  background: #fff !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  color: #e7607b !important;
}

.expediente-btn-danger:hover {
  background: rgba(239, 68, 68, 0.06) !important;
  border-color: rgba(239, 68, 68, 0.55) !important;
}

.expediente-empty {
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 18px;
  color: #64748b;
  background: #f8fafc;
  width: 100%;
  max-width: 100%;
}

.expediente-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  width: 100%;
}

.expediente-count {
  font-size: 12px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: 999px;
}

#expedienteFilesList {
  width: 100%;
  max-width: 100%;
}

/* Responsive */
@media (max-width: 576px) {
  .expediente-card {
    flex-direction: column;
  }

  .expediente-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .expediente-btn {
    width: 100%;
    justify-content: center;
  }

  .expediente-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === DOC LIST GENÉRICO (.doc-list, .doc-item, etc.) === */
.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.35rem 0 0.75rem;
  padding: 0;
}

.doc-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.6rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 253, 0.18);
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    transform 0.12s ease;
}

.doc-item:hover {
  background: rgba(15, 23, 42, 1);
  border-color: rgba(129, 140, 248, 0.6);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.45);
  transform: translateY(-1px);
}

.doc-icon {
  width: 34px;
  height: 34px;
  border-radius: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 1);
  border: 1px solid rgba(148, 163, 253, 0.4);
  flex-shrink: 0;
}

.doc-icon i {
  font-size: 1rem;
  color: #60a5fa;
}

.doc-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.doc-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e5e7eb;
}

.doc-key {
  font-size: 0.7rem;
  color: rgba(148, 163, 253, 0.8);
}

.ext-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  font-size: 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(15, 23, 42, 1);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.5);
  flex-shrink: 0;
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

.doc-actions .btn {
  padding: 0.18rem 0.35rem;
  border-radius: 0.5rem;
  font-size: 0.7rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-width: 1px;
  background: transparent;
  color: #e5e7eb;
  border-color: rgba(148, 163, 253, 0.4);
}

.doc-actions .btn i {
  font-size: 0.8rem;
}

.doc-actions .btn:hover {
  background: rgba(79, 70, 229, 0.18);
  border-color: rgba(129, 140, 248, 0.9);
  color: #bfdbfe;
}

.doc-actions .btn.btn-delete-file:hover {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
}

@media (max-width: 576px) {
  .doc-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .doc-actions {
    margin-left: 0;
    margin-top: 0.25rem;
    justify-content: flex-start;
  }
}

/* === ESTUDIOS (sobreescritura para #estudiosContent) === */
#estudiosContent .doc-item {
  background: rgba(24, 24, 35, 0.98);
  border-color: rgba(45, 212, 191, 0.28);
}

#estudiosContent .ext-badge {
  background: rgba(6, 78, 59, 1);
  border-color: rgba(45, 212, 191, 0.55);
  color: #a7f3d0;
}

/* === BADGE UTILIDADES === */
.badge-kind {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.55rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: transparent;
  border: 1px dashed rgba(0, 0, 0, 0.28);
  color: #111;
  white-space: nowrap;
}

.badge-datetime {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.55rem;
  letter-spacing: 0.02em;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #111;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}

/* === INPUT FILE: ícono de calendario visible en oscuro === */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* =========================
   AUDITORÍA - MODERN FORMAL UI
========================= */

:root {
  --aud-primary: #4caf50;
  --aud-primary-dark: #2e7d32;
  --aud-primary-soft: rgba(76, 175, 80, 0.1);
  --aud-primary-ring: rgba(76, 175, 80, 0.22);

  --aud-bg: #f3f6f8;
  --aud-surface: #ffffff;
  --aud-surface-soft: #f8faf9;

  --aud-text: #1f2933;
  --aud-text-muted: #6b7280;

  --aud-border: rgba(17, 24, 39, 0.08);
  --aud-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --aud-shadow-hover: 0 18px 45px rgba(15, 23, 42, 0.13);
}

/* CONTENEDOR GENERAL */
.auditoria-wrap {
  position: relative;
  background:
    radial-gradient(
      circle at top left,
      rgba(76, 175, 80, 0.12),
      transparent 34%
    ),
    linear-gradient(180deg, #f8fbf9 0%, var(--aud-bg) 100%);
  border: 1px solid var(--aud-border);
  border-radius: 24px;
  padding: 1.4rem;
  overflow: hidden;
}

.auditoria-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(31, 41, 51, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 41, 51, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

/* HEADER RESUMEN */
.auditoria-summary {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid var(--aud-border);
  border-left: 5px solid var(--aud-primary);
  border-radius: 20px;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.35rem;
  box-shadow: var(--aud-shadow);
}

.auditoria-summary h5,
.auditoria-summary h6 {
  color: var(--aud-text);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auditoria-summary p {
  color: var(--aud-text-muted);
}

/* TIMELINE */
.auditoria-timeline {
  position: relative;
  z-index: 1;
  padding-left: 2.5rem;
}

.auditoria-timeline::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 0.65rem;
  bottom: 0.65rem;
  width: 3px;
  background: linear-gradient(
    to bottom,
    var(--aud-primary-dark),
    var(--aud-primary),
    rgba(76, 175, 80, 0.12)
  );
  border-radius: 999px;
  box-shadow: 0 0 0 5px rgba(76, 175, 80, 0.06);
}

/* ITEM */
.auditoria-item {
  position: relative;
  margin-bottom: 1.35rem;
  animation: auditoriaFadeUp 0.35s ease both;
}

@keyframes auditoriaFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auditoria-dot {
  position: absolute;
  left: -2.05rem;
  top: 1.25rem;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, #ffffff 0 12%, transparent 13%),
    linear-gradient(135deg, var(--aud-primary), var(--aud-primary-dark));
  border: 4px solid #ffffff;
  box-shadow:
    0 0 0 5px var(--aud-primary-ring),
    0 8px 18px rgba(76, 175, 80, 0.35);
}

/* CARD */
.auditoria-card {
  position: relative;
  overflow: hidden;
  background: var(--aud-surface);
  border: 1px solid var(--aud-border);
  border-radius: 22px;
  box-shadow: var(--aud-shadow);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.auditoria-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(
    180deg,
    var(--aud-primary),
    var(--aud-primary-dark)
  );
  opacity: 0.95;
}

.auditoria-card:hover {
  transform: translateY(-3px);
  border-color: rgba(76, 175, 80, 0.25);
  box-shadow: var(--aud-shadow-hover);
}

/* CARD HEADER */
.auditoria-card-header {
  position: relative;
  padding: 1rem 1.25rem 1rem 1.4rem;
  background:
    linear-gradient(135deg, rgba(76, 175, 80, 0.11), rgba(255, 255, 255, 0.86)),
    #ffffff;
  border-bottom: 1px solid var(--aud-border);
}

.auditoria-card-header::after {
  content: "";
  position: absolute;
  right: 1.2rem;
  top: 50%;
  width: 46px;
  height: 46px;
  transform: translateY(-50%);
  background: rgba(76, 175, 80, 0.08);
  border-radius: 14px;
}

.auditoria-card-header h6,
.auditoria-card-header .fw-semibold {
  color: var(--aud-text);
  font-weight: 800 !important;
  letter-spacing: -0.015em;
}

/* BODY */
.auditoria-card-body {
  padding: 1.25rem 1.35rem 1.35rem;
}

/* BADGES */
.auditoria-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.42rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.auditoria-badge-primary {
  background: linear-gradient(
    135deg,
    rgba(76, 175, 80, 0.14),
    rgba(76, 175, 80, 0.06)
  );
  color: var(--aud-primary-dark);
  border: 1px solid rgba(76, 175, 80, 0.28);
}

.auditoria-badge-secondary {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid rgba(17, 24, 39, 0.08);
}

/* KEY VALUE */
.auditoria-kv {
  position: relative;
  height: 100%;
  background: linear-gradient(180deg, #ffffff, var(--aud-surface-soft));
  border: 1px solid var(--aud-border);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.auditoria-kv:hover {
  background: #ffffff;
  border-color: rgba(76, 175, 80, 0.28);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.auditoria-label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--aud-text-muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}

.auditoria-value {
  color: var(--aud-text);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

/* OPERACIÓN */
.auditoria-operation {
  margin-top: 1.15rem;
  padding: 1rem;
  background: linear-gradient(
    135deg,
    rgba(76, 175, 80, 0.07),
    rgba(248, 250, 249, 0.9)
  );
  border: 1px dashed rgba(76, 175, 80, 0.35);
  border-radius: 18px;
}

.auditoria-operation-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
  color: var(--aud-primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ICONOS */
.auditoria-card i {
  opacity: 0.9;
}

.auditoria-card-header i,
.auditoria-operation-title i {
  color: var(--aud-primary-dark);
}

/* BOTÓN MOSTRAR MÁS */
.auditoria-load-more,
#btnMostrarMasAuditorias {
  border: 1px solid rgba(76, 175, 80, 0.35);
  background: #ffffff;
  color: var(--aud-primary-dark);
  font-weight: 800;
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: all 0.18s ease;
}

.auditoria-load-more:hover,
#btnMostrarMasAuditorias:hover {
  background: var(--aud-primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(76, 175, 80, 0.28);
}

/* EMPTY / ERROR */
.auditoria-empty,
.auditoria-error {
  background: #ffffff;
  border: 1px solid var(--aud-border);
  border-radius: 20px;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--aud-text-muted);
  box-shadow: var(--aud-shadow);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .auditoria-wrap {
    border-radius: 18px;
    padding: 1rem;
  }

  .auditoria-summary {
    border-radius: 16px;
    padding: 1rem;
  }

  .auditoria-timeline {
    padding-left: 1.8rem;
  }

  .auditoria-timeline::before {
    left: 0.65rem;
  }

  .auditoria-dot {
    left: -1.55rem;
    width: 15px;
    height: 15px;
    border-width: 3px;
  }

  .auditoria-card {
    border-radius: 18px;
  }

  .auditoria-card-header {
    padding: 0.9rem 1rem 0.9rem 1.15rem;
  }

  .auditoria-card-header::after {
    display: none;
  }

  .auditoria-card-body {
    padding: 1rem;
  }

  .auditoria-badge {
    font-size: 0.63rem;
    padding: 0.38rem 0.62rem;
  }

  .auditoria-value {
    font-size: 0.84rem;
  }
}

@media (max-width: 420px) {
  .auditoria-wrap {
    padding: 0.75rem;
  }

  .auditoria-timeline {
    padding-left: 1.45rem;
  }

  .auditoria-timeline::before {
    left: 0.5rem;
  }

  .auditoria-dot {
    left: -1.28rem;
    top: 1.15rem;
  }

  .auditoria-card-header,
  .auditoria-card-body {
    padding: 0.85rem;
  }

  .auditoria-operation {
    padding: 0.85rem;
  }
}



/* ═══════════════════════════════════════════════
   Auditoría — Timeline vertical
   ═══════════════════════════════════════════════ */

/* ── Wrapper ── */
.aud-wrap {
  max-width: 820px;
  margin: 0 auto;
}

/* ── Timeline container ── */
.aud-timeline {
  position: relative;
}

/* ── Nodo ── */
.aud-nodo {
  display: flex;
  gap: 1rem;
  position: relative;
  padding-bottom: 1.5rem;
}

.aud-nodo:last-child {
  padding-bottom: 0;
}

/* ── Track (dot + línea) ── */
.aud-nodo-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 28px;
}

.aud-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px currentColor;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.aud-dot-update {
  color: #0d6efd;
  background: #e7f1ff;
}

.aud-dot-create {
  color: #198754;
  background: #d1e7dd;
}

.aud-dot-delete {
  color: #dc3545;
  background: #f8d7da;
}

.aud-nodo-line {
  flex: 1;
  width: 2px;
  background: #dee2e6;
  margin-top: 4px;
}

.aud-nodo:last-child .aud-nodo-line {
  display: none;
}

/* ── Tarjeta del nodo ── */
.aud-nodo-content {
  flex: 1;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  min-width: 0;
}

/* ── Header del nodo ── */
.aud-nodo-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.aud-nodo-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.aud-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #6c757d;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0.03em;
}

.aud-nodo-info {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.aud-nodo-fecha {
  white-space: nowrap;
}

/* ── Ruta HTTP ── */
.aud-nodo-ruta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
  font-size: 0.83rem;
}

.aud-ruta-path {
  font-size: 0.8rem;
  color: #495057;
  background: #f8f9fa;
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
  word-break: break-all;
}

/* ── Lista de cambios ── */
.aud-cambios-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.aud-cambio {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.82rem;
  padding: 0.25rem 0.5rem;
  background: #f8f9fa;
  border-radius: 0.4rem;
  border-left: 3px solid #ced4da;
}

.aud-cambio-create {
  border-left-color: #198754;
  color: #198754;
  background: #f0faf4;
}

.aud-cambio-delete {
  border-left-color: #dc3545;
  color: #dc3545;
  background: #fff5f5;
}

.aud-cambio-arrow {
  color: #adb5bd;
  font-size: 1rem;
}

.aud-cambio-campo {
  font-weight: 600;
  color: #343a40;
  font-family: monospace;
  font-size: 0.78rem;
}

.aud-cambio-antes {
  color: #dc3545;
  background: #fff0f0;
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.78rem;
  text-decoration: line-through;
  opacity: 0.85;
}

.aud-cambio-sep {
  color: #6c757d;
  font-size: 0.85rem;
}

.aud-cambio-despues {
  color: #198754;
  background: #f0faf4;
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 600;
}

.aud-cambio-label {
  font-weight: 600;
}

/* ── Badges de acción ── */
.aud-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  text-transform: uppercase;
}

.aud-badge-update {
  background: #cfe2ff;
  color: #0a58ca;
  border-radius: 5px;
}

.aud-badge-create {
  background: #d1e7dd;
  color: #146c43;
}

.aud-badge-delete {
  background: #f8d7da;
  color: #b02a37;
}

.aud-badge-default {
  background: #e2e3e5;
  color: #495057;
}

/* ── Responsive ── */
@media (max-width: 576px) {
  .aud-nodo-header {
    flex-direction: column;
  }

  .aud-ruta-path {
    word-break: break-all;
  }

  .aud-nodo-ip {
    display: none;
  }
}
