/*
 * =========================================
 *    BASE
 * =========================================
 */
* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
  margin: 0;
}
body {
  display: flex;
  flex-direction: column;
  font-family: Arial, Helvetica, sans-serif;
}
/*
 * =========================================
 *    HEADER
 * =========================================
 */
.app-header {
  background: linear-gradient(180deg, #c62828, #161212);
  color: #ffffff;
  padding: 1rem 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.app-header h1 {
  margin: 0;
}
.app-name {
  font-size: 1.4rem;
  font-weight: bold;
  opacity: 0.9;
}
.page-title {
  font-size: 1.4rem;
  font-weight: bold;
}
.user-info {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  opacity: 0.9;
}
@media (max-width: 768px) {
  .app-header {
    background: linear-gradient(90deg, #d8261c, #a01813);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: none;
  }
  .app-header h1 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
  }
  .app-name {
    display: none;
    /* Ocultamos nombre largo */
  }
  .page-title {
    font-size: 1.1rem;
  }
  .user-info {
    margin-top: 4px;
    font-size: 0.7rem;
    text-align: center;
    opacity: 0.85;
  }
}
/*
 * =========================================
 *    NAV
 * =========================================
 */
.app-nav {
  background-color: #4d1818;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1rem;
}
.app-nav a {
  color: #ffffff;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.95rem;
}
.app-nav a:hover {
  background: rgba(255,255,255,0.2);
}
.app-nav a.active {
  background-color: #d8261c;
}
.app-nav .nav-logout {
  margin-left: auto;
  background-color: #a01813;
}
/*
 * =====================================================
 *    NAV MÓVIL COMPACTO
 * =====================================================
 */
@media (max-width: 768px) {
  .app-nav {
    min-height: 40px;
    padding: 4px 6px;
    gap: 4px;
    border-top: 1px solid rgba(255,255,255,0.08);
    position: relative;
    z-index: 10000;
    overflow: visible;
  }
  .app-nav a {
    font-size: 0.8rem;
    padding: 6px 8px;
    border-radius: 3px;
  }
  .app-nav a.active {
    font-weight: 600;
  }
  .app-nav .nav-logout {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}
/*
 * =========================================
 *    CONTENIDO
 * =========================================
 */
.app-container {
  flex: 1;
  max-width: 100%;
  margin: 1.5rem 0;
  background-color: #ffffff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  overflow-y: auto;
  /* scroll vertical normal */
}
/*
 * =========================================
 *    FOOTER
 * =========================================
 */
.main-footer {
  background: linear-gradient(180deg, #161212, #c62828);
  color: #fff;
  text-align: center;
  padding: 10px 0;
  font-size: 0.85rem;
  /* un poco más pequeño */
  line-height: 1.3;
  /* interlineado más compacto */
}
.main-footer p {
  margin: 4px 0;
  /* elimina margen grande por defecto */
}
.main-footer a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}
.main-footer a:hover {
  text-decoration: underline;
}
.footer-legal {
  margin-top: 6px;
  /* menos separación */
}
/*
 * =====================================================
 *    FOOTER SOLO MÓVIL (versión definitiva)
 * =====================================================
 */
@media (max-width: 768px) {
  .main-footer {
    padding: 8px 12px !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
  }
  /* Ocultamos completamente los <p> originales */
  .main-footer p {
    display: none !important;
  }
  /* Insertamos línea personalizada */
  .main-footer::before {
    content: "Gestor Documentación LEWG";
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
  }
  .footer-legal {
    margin-top: 2px !important;
    font-size: 0.7rem !important;
  }
}
/*
 * =========================================
 *    LOGIN PAGE – FIX ALTURA DEFINITIVO
 * =========================================
 */
/* Romper layout general SOLO en login */
body.login-page.no-app-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: radial-gradient(circle at top, #2a2a2a, #000000);
}
/* Anular comportamiento de app-container */
body.login-page.no-app-layout .app-container {
  flex: unset !important;
  height: auto !important;
  min-height: unset !important;
}
/* Caja compacta */
.login-box {
  background-color: #ffffff;
  width: 100%;
  max-width: 380px;
  padding: 2rem 2rem 2.2rem;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.65);
}
/* Título */
.login-title {
  margin: 0;
  text-align: center;
  font-size: 1.8rem;
  color: #111;
}
/* Subtítulo */
.login-subtitle {
  text-align: center;
  margin: 0.4rem 0 1.6rem;
  color: #666;
  font-size: 0.95rem;
}
/* Formulario compacto */
.login-box form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
/* Inputs */
.login-box .form-group input {
  width: 100% !important;
  padding: 0.55rem 0.6rem;
  font-size: 0.95rem;
  border-radius: 6px;
  border: 1px solid #bbb;
}
/* Focus */
.login-box .form-group input:focus {
  border-color: #d8261c;
  outline: none;
  box-shadow: 0 0 0 2px rgba(216,38,28,0.2);
}
/* Error */
.login-error {
  background-color: #ffe5e5;
  color: #a01813;
  padding: 0.6rem;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
}
/* Botón */
.login-box .btn-primary {
  margin-top: 0.6rem;
  padding: 0.65rem;
  font-size: 1rem;
  font-weight: 600;
}
/*
 * =====================================================
 *    ADMIN – ESTILO BASE
 * =====================================================
 */
/* Contenedor principal */
.container {
  max-width: auto;
  margin: 30px auto;
  padding: 0 20px;
  /* justify-content: center; */
}
/* Panel */
.panel {
  background: #f0dddd;
  border-radius: 10px;
  padding: 20px 30px 30px 30px;
  /* menos padding arriba */
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
  margin-bottom: 30px;
  width: 100%;
}
.panel h2 {
  color: #c62828;
  margin-top: 0;
  /* quita margen superior del h2 */
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel h2 .contador {
  font-size: 0.9rem;
  color: #666;
  font-weight: normal;
}
/* Para hacer un panel que ocupe el ancho del contenido y centrado */
.panel-centrado {
  width: fit-content;
  margin: 0 auto;
  text-align: center;
}
/* Formularios */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  height: 40px;
  box-sizing: border-box;
}
.form-group textarea {
  resize: horizontal;
  width: 100%;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: #c62828;
}
/* Tabla */
.tabla-admin {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
.tabla-admin th {
  background: #f8f9fa;
  padding: 6px 10px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
}
.tabla-admin td {
  padding: 6px 10px;
  border-bottom: 1px solid #dee2e6;
  vertical-align: middle;
}
.tabla-admin tr:hover {
  background: #f8f9fa;
}
.tabla-admin tr.inactiva {
  opacity: 0.7;
  background-color: #f8f9fa;
}
/* Estados */
.estado {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.estado.activa {
  background: #d4edda;
  color: #155724;
}
.estado.inactiva {
  background: #f8d7da;
  color: #721c24;
}
/* Acciones */
/*
 * .acciones {
 *     display: flex;
 *     gap: 6px;
 *     flex-wrap: wrap;
 * }
 */
/* Botones */
.btn {
  padding: 8px 16px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.btn-primary {
  background: linear-gradient(135deg, #c62828, #d32f2f);
  color: #fff;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #d32f2f, #c62828);
}
.btn-danger {
  background: #dc3545;
  color: #fff;
}
.btn-warning {
  background: #ffc107;
  color: #212529;
}
.btn-info {
  background: #17a2b8;
  color: #fff;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 0.85rem;
}
/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  .panel {
    padding: 20px;
  }
}
/*
 * ===========================
 *    LOGS – COLORES DE EVENTOS
 * ===========================
 */
.log-event {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
/* LOGIN */
.log-login {
  background-color: #2e7d32;
  /* verde */
}
/* CREAR */
.log-create {
  background-color: #1976d2;
  /* azul */
}
/* EDITAR */
.log-update {
  background-color: #f9a825;
  /* amarillo */
  color: #000;
}
/* BORRAR */
.log-delete {
  background-color: #c62828;
  /* rojo */
}
/* CRON */
.log-cron {
  background-color: #74d7f5;
  /* rojo */
  color: rgb(19, 18, 18);
}
/* OTROS */
.log-other {
  background-color: #616161;
  /* gris */
}
/*
 * ===========================
 *    DOCUMENTACION DE PILOTOS
 * ===========================
 */
/* ===== Estado neutral (no subido) ===== */
.status-neutral {
  background: #e2e3e5;
  color: #383d41;
}
.badge-neutral {
  background: #e2e3e5;
  color: #383d41;
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
}
.status-card {
  padding: 15px;
  border-radius: 6px;
  text-align: center;
  font-weight: bold;
}
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-ok {
  background: #d4edda;
  color: #155724;
}
.badge-warning {
  background: #fff3cd;
  color: #856404;
}
.badge-danger {
  background: #f8d7da;
  color: #721c24;
}
.badge-neutral {
  background: #e2e3e5;
  color: #383d41;
}
.doc-letter {
  display: inline-block;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 5px;
  border-radius: 3px;
  margin-right: 2px;
  color: white;
}
/* Colores */
.doc-green {
  background: #28a745;
}
.doc-orange {
  background: #fd7e14;
}
.doc-red {
  background: #dc3545;
}
.doc-blue {
  background: #007bff;
}
.doc-gray {
  background: #6c757d;
}
.status-card {
  padding: 20px;
  border-radius: 8px;
  text-align: center;
}
.status-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.85;
}
.status-value {
  display: block;
  font-size: 18px;
  font-weight: bold;
}
.form-line {
  display: flex;
  gap: 6px;
  line-height: 1.6;
}
.form-line strong {
  white-space: nowrap;
}
.form-line span {
  font-weight: normal;
}
/* Modal oculto por defecto */
/* Contenedor del modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Fondo oscuro */
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
/* Ventana */
.modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  width: 420px;
  max-width: 90%;
  padding: 20px;
  z-index: 1;
}
/* Cabecera */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
/* Cierre */
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}
/* Acciones */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 15px;
}
.panel-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.panel-header-actions h2 {
  margin: 0;
}
.btn-outline {
  background: transparent;
  border: 1px solid #ccc;
  color: #555;
}
.btn-outline:hover {
  background: #f5f5f5;
}
/* Ventana de cambio de contraseña */
.password-modal-box {
  background: #fff;
  width: 420px;
  max-width: 90%;
  padding: 20px;
  border-radius: 8px;
  max-height: 80vh;
  /* 🔑 evita que ocupe toda la pantalla */
  overflow-y: auto;
  /* scroll interno si hiciera falta */
}
/*
 * =====================================================
 *    LOGBOOK – ACCIONES EN UNA LINEA MÓVIL
 * =====================================================
 */
.logbook-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.logbook-actions .actions-right {
  display: flex;
  gap: 6px;
}
.logbook-actions .actions-right a {
  margin-right: 6px;
}
.logbook-summary {
  margin-left: 20px;
  font-size: 18px;
  font-weight: bold;
  align-self: center;
}
.actions-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
/* Botones export compactos */
.btn-export {
  padding: 6px 10px;
  font-size: 16px;
  background: #f1f1f1;
  color: #333;
  border: 1px solid #ddd;
}
.btn-export:hover {
  background: #e4e4e4;
}
/* Móvil */
@media (max-width: 768px) {
  .logbook-actions {
    flex-direction: row;
    gap: 8px;
  }
  .logbook-actions .actions-left .btn {
    font-size: 0.85rem;
    padding: 6px 10px;
  }
  .btn-export {
    width: 40px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
  }
}
/*
 * =========================================================
 *    MENÚ RESPONSIVE – SCROLL HORIZONTAL EN MÓVIL
 *    =========================================================
 */

.app-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: visible;
  width: 100%;
}
.app-header {
  width: 100%;
  position: relative;
  z-index: 10;
}

/* --- MÓVIL Y TABLET --- */
@media (max-width: 900px) {

    .app-nav {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .app-nav a,
    .nav-dropdown {
        flex: 0 0 auto;
    }

    .app-nav .nav-logout {
        margin-left: 0;
    }
}

/* --- MÓVIL Y TABLET --- 
@media (max-width: 900px) {
  .app-nav {
    min-height: 48px;
    padding: 8px 10px;
  }
  .app-nav a {
    padding: 8px 10px;
    line-height: 1.2;
  }
  .app-nav .nav-logout {
    padding: 8px 12px;
    font-weight: 600;
  }
}*/

/*
 * =========================================================
 *    MENÚ MÓVIL – ALTURA TÁCTIL ADECUADA
 *    =========================================================
 */
@media (max-width: 900px) {
  .app-nav {
    min-height: 48px;
    /* altura cómoda táctil */
    padding: 8px 10px;
  }
  .app-nav a {
    padding: 8px 10px;
    /* agranda área clicable */
    line-height: 1.2;
  }
  /* Botón salir un poco más destacado */
  .app-nav .nav-logout {
    padding: 8px 12px;
    font-weight: 600;
  }
}
/*
 * ======================================================
 *    FORMATOS PAGINA DE LIBRO DE PILOTO DE AESA
 * ======================================================
 */
body {
  background: #e6e6e6;
  font-family: Arial, Helvetica, sans-serif;
}
/*
 * ======================================================
 *    DOBLE PÁGINA ABIERTA (EFECTO LIBRO)
 * ======================================================
 */
.aesa-spread {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 60px auto;
}
.aesa-page {
  width: 100%;
  max-width: 1100px;
  /* ancho cómodo en pantalla */
  margin: 40px auto;
  /* separación vertical entre páginas */
  padding: 30px 40px;
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(0,0,0,0.12);
  border-radius: 4px;
}
/*
 * ======================================================
 *    CABECERA
 * ======================================================
 */
.aesa-header {
  margin-bottom: 14px;
}
.aesa-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.aesa-pilot {
  font-size: 10px;
  margin-top: 4px;
}
/*
 * ======================================================
 *    TABLA ESTILO AESA
 * ======================================================
 */
.aesa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5px;
}
.aesa-table th, .aesa-table td {
  border: 0.5px solid #777;
  padding: 2px;
  height: 17px;
  text-align: center;
  vertical-align: middle;
}
.aesa-table th {
  font-weight: 600;
}
/*
 * ======================================================
 *    BLOQUE DE TOTALES INTEGRADO
 * ======================================================
 */
.aesa-table tfoot td {
  border: 0.5px solid #777;
  height: 22px;
}
/* Texto del concepto */
.totals-label {
  text-align: right;
  font-size: 15px;
  font-weight: 600;
  padding-right: 6px;
}
/* Valores de tiempo y aterrizajes */
.totals-value {
  text-align: center;
  font-size: 15px;
  /* más grande */
  font-weight: 700;
  /* negrita fuerte */
  letter-spacing: 0.3px;
}
/*
 * ======================================================
 *    NUMERO DE PAGINA INFERIOR
 * ======================================================
 */
.aesa-page-number {
  position: absolute;
  bottom: 10mm;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 9px;
  color: #555;
}
.btn-pdf {
  display: inline-block;
  background: #2c3e50;
  color: #fff;
  padding: 8px 14px;
  font-size: 13px;
  text-decoration: none;
  border-radius: 4px;
}
.btn-pdf:hover {
  background: #1a252f;
}
@page {
  margin: 15mm;
}
body {
  margin: 0;
}
.form-actions-inline {
  display: flex;
  gap: 12px;
  /* separación entre botones */
  align-items: center;
  margin-top: 15px;
}
.btn-pdf {
  background: #2c3e50;
  color: #fff;
  border: none;
}
.btn-pdf:hover {
  background: #1a252f;
}
/*
 * ======================================================
 *    IMPRESIÓN
 * ======================================================
 */
@media print {
  body {
    background: none;
  }
  .aesa-page {
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    page-break-after: always;
    /* solo para imprimir */
  }
}
/*
 * =========================================================
 *    MODAL DE CONFIGURACION DE EMAILS
 *    =========================================================
 */
.modal-body {
  border-top: 1px solid #ddd;
  padding-top: 15px;
}
.accordion-header {
  cursor: pointer;
  padding: 10px;
  background: #f0f0f0;
  border-radius: 6px;
  margin-bottom: 8px;
  font-weight: bold;
}
.accordion-content {
  display: none;
  margin-bottom: 20px;
}
.accordion-content.active {
  display: block;
}
.cron-indicator {
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 15px;
}
.cron-on {
  background: #d4edda;
  color: #155724;
}
.cron-off {
  background: #f8d7da;
  color: #721c24;
}
/*
 * textarea {
 * 	width: 50vw;
 * 	max-width: 1400px;
 * 	min-height: 300px;
 * 	resize: both;
 * }
 */
.btn-success {
  background: #28a745;
  color: white;
}
.btn-success:hover {
  background: #218838;
}
.btn-secondary {
  background: #6c757d;
  color: white;
}
.btn-secondary:hover {
  background: #5a6268;
}
.btn-warning {
  background: #ffc107;
  color: black;
}
.btn-warning:hover {
  background: #e0a800;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.modal-content {
  background: #fff;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 8px;
  padding: 20px;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cron-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background: white;
  transition: .4s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #28a745;
}
input:checked + .slider:before {
  transform: translateX(26px);
}
/*
 * =====================================================
 *    CRON RESULT MODAL (AISLADO)
 * =====================================================
 */
.cron-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-in-out;
}
.cron-modal.hidden {
  display: none;
}
.cron-modal-box {
  background: #ffffff;
  width: 440px;
  max-width: 92%;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.25);
  animation: slideUp 0.25s ease-out;
}
.cron-modal-title {
  margin: 0 0 18px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #c62828;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}
.cron-modal-body {
  font-size: 0.95rem;
  line-height: 1.6;
}
.cron-modal-body p {
  margin: 8px 0;
}
.cron-modal-body strong {
  display: inline-block;
  min-width: 180px;
}
.cron-modal-actions {
  margin-top: 25px;
  text-align: right;
}
/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(15px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
/*
 * =====================================================
 *    TABLA DE ACCIONES - BOTONES EN UNA LINEA
 * =====================================================
 */
td.acciones {
  white-space: nowrap;
}
td.acciones form {
  display: inline-block;
  margin: 0;
}
td.acciones .btn {
  display: inline-flex;
}
/*
 * =====================================================
 *    PANEL DE FILTROS PILOTO
 * =====================================================
 */
.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  /* Espacio entre filtros */
  align-items: flex-end;
  /* Alinea los inputs abajo */
}
.form-grid .form-group {
  display: flex;
  flex-direction: column;
  min-width: 160px;
  /* Ajustable */
}
.form-grid input {
  height: 36px;
  padding: 4px 8px;
}
.form-grid select {
  padding: 4px 8px;
}
/*
 * =====================================================
 *    PILOT – OPTIMIZACIÓN MÓVIL GLOBAL
 * =====================================================
 */
@media (max-width: 768px) {
  .app-container {
    margin: 10px 0;
    padding: 12px;
    position: relative;
    z-index: 1;
  }
  body.pilot-page .container {
    max-width: 100%;
    margin: 0;
    padding: 10px;
  }
  body.pilot-page .panel {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
  }
  /* Títulos más compactos */
  body.pilot-page .panel h2 {
    font-size: 1.1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  /* Líneas tipo: Nombre / Teléfono / Email */
  body.pilot-page .form-line {
    flex-direction: column;
    gap: 2px;
  }
  body.pilot-page .form-line strong {
    white-space: normal;
  }
  body.pilot-page .tabla-admin th, body.pilot-page .tabla-admin td {
    padding: 6px 8px;
  }
  .pilot-page .panel {
    /* width: fit-content; */
    justify-content: center;
    min-width: 0;
  }
}
/*
 * ===============================
 *    ESTILOS CONTENIDO INFORMATIVO / LEGAL
 * =================================
 */
.legal-page {
  padding: 40px 20px;
  background-color: #f5f7fa;
}
/* Contenedor reutilizable */
.legal-container {
  max-width: 1000px;
  margin: 0 auto;
  background: #ffffff;
  padding: 40px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.6;
  color: #333;
}
/* Títulos */
.legal-container h1 {
  color: #1e3a5f;
  margin-bottom: 30px;
}
.legal-container h2 {
  margin-top: 35px;
  color: #2c5282;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 5px;
}
.legal-container h3 {
  margin-top: 20px;
  color: #2c5282;
}
/* Texto */
.legal-container p {
  margin-bottom: 15px;
}
.legal-container ul {
  margin-left: 20px;
}
.legal-container a {
  color: #1e3a5f;
  text-decoration: none;
}
.legal-container a:hover {
  text-decoration: underline;
}
/*
 * ===============================
 *    INDICADOR DE ESTADO DE DOCUMENTACION
 * =================================
 */
.badge-doc {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
.badge-green {
  background: #28a745;
}
.badge-orange {
  background: #fd7e14;
}
.badge-red {
  background: #dc3545;
}
.badge-blue {
  background: #007bff;
}
.badge-gray {
  background: #6c757d;
}
/*
 * =========================================
 *    RESUMEN DOCUMENTACIÓN
 * =========================================
 */
.doc-summary {
  display: flex;
  gap: 25px;
  align-items: center;
  margin: 15px 0 20px 0;
  font-size: 1.5  rem;
}
.doc-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.badge-doc {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
}
.badge-green {
  background: #28a745;
}
.badge-orange {
  background: #fd7e14;
}
.badge-red {
  background: #dc3545;
}
.badge-blue {
  background: #007bff;
}
.badge-gray {
  background: #6c757d;
}
/*
 * =========================================
 *    DASHBOARD DOCUMENTACIÓN - ULTRA COMPACTO
 * =========================================
 */
.doc-dashboard {
  display: flex;
  gap: 14px;
  /* menos separación */
  margin: 10px 0 14px 0;
  /* menos espacio vertical */
  flex-wrap: wrap;
}
.doc-card {
  flex: 1;
  min-width: 120px;
  /* ligeramente menor */
  padding: 6px 10px;
  /* 🔥 más bajo */
  border-radius: 6px;
  /* un poco menos redondeado */
  text-align: center;
  text-decoration: none;
  color: white;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.doc-card-top {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  /* más compacto */
  line-height: 1.1;
}
.doc-card-number {
  font-size: 1.05rem;
  /* antes 1.2rem */
  font-weight: 600;
  line-height: 1.1;
}
.doc-card-percent {
  font-size: 0.7rem;
  opacity: 0.9;
}
.doc-card-label {
  font-size: 0.65rem;
  /* antes 0.75rem */
  margin-top: 2px;
  /* menos separación */
  opacity: 0.95;
  line-height: 1.1;
}
/* Colores */
.doc-green {
  background: #28a745;
}
.doc-orange {
  background: #fd7e14;
}
.doc-red {
  background: #dc3545;
}
.doc-blue {
  background: #007bff;
}
.doc-gray {
  background: #6c757d;
}
/* Activo */
.active-doc-card {
  outline: 2px solid rgba(0,0,0,0.2);
}
/*
 * =========================================
 *    FILTROS PLEGABLES
 * =========================================
 */
.filters-title {
  user-select: none;
}
.filters-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  margin-bottom: 20px;
}
.filters-panel.open {
  max-height: 600px;
  /* suficiente para tu contenido */
}
/*
 * =========================================
 *    TABLAS ADMIN - SCROLL HORIZONTAL
 * =========================================
 */
.tabla-scroll {
  width: auto;
  overflow-x: auto;
}
.tabla-admin {
  /* width: 100%; */
  /* min-width: 1000px; */
  border-collapse: collapse;
}
.tabla-admin th, .tabla-admin td {
  white-space: nowrap;
  line-height: 1.2;
}
/* Botones más compactos en tablas */
.tabla-admin .btn {
  padding: 4px 10px;
  font-size: 0.85rem;
  height: 28px;
}
@media (max-width: 768px) {
  .tabla-admin th, .tabla-admin td {
    padding: 4px 8px;
    font-size: 13px;
  }
  .tabla-admin .btn {
    padding: 3px 8px;
    height: 26px;
    font-size: 0.8rem;
  }
}
/*
 * =========================================
 *    VARIOS
 * =========================================
 */
#btnSubmit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #999 !important;
  border-color: #999 !important;
}
.btn-icon {
  padding: 4px 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
}
.form-group select[multiple] {
  height: 100px;
}
/*
 * =========================================
 *    ESTILOS PARA LA BARRA DE MENUS DE HEADER
 * =========================================
 */
.app-nav {
  display: flex;
  align-items: center;
  gap: 0;
}
.nav-dropdown {
  position: relative;
  z-index: 10001;
}
.nav-dropbtn {
  background: none;
  border: none;
  color: #fff;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}
.nav-dropbtn:hover {
  background: rgba(255,255,255,.2);
}
.nav-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  z-index: 10002;
  overflow: visible;
}
.nav-dropdown-content a {
  display: block;
  color: #333;
  padding: 10px 15px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-dropdown-content a:hover {
  background: #f2f2f2;
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

.nav-dropdown.active-group > .nav-dropbtn {
  background: #d50000;
  color: #fff;
}
.nav-dropdown-content a.active {
  background: #d50000;
  color: #fff;
}

/*
 * =====================================================
 *    PANEL MENÚ MÓVIL
 * =====================================================
 */
#mobile-menu-panel {
    display: none;
}

@media (max-width: 900px) {

    #mobile-menu-panel {
        display: none;
        background: #4d1818;              /* mismo color que la barra */
        border-top: 1px solid rgba(255,255,255,.08);
        border-bottom: 1px solid rgba(0,0,0,.35);
        box-shadow: 0 3px 8px rgba(0,0,0,.20);
    }

    #mobile-menu-panel.open {
        display: block;
    }

    #mobile-menu-panel a {
        display: block;
        padding: 12px 16px;
        color: #ffffff;
        text-decoration: none;
        border-bottom: 1px solid rgba(255,255,255,.08);
        transition: background .15s;
    }

    #mobile-menu-panel a:hover {
        background: rgba(255,255,255,.12);
    }

    #mobile-menu-panel a.active {
        background: #d8261c;      /* mismo rojo que el menú activo */
        color: #ffffff;
        font-weight: 600;
    }

    #mobile-menu-panel a:last-child {
        border-bottom: none;
    }

    .nav-dropdown-content{
        display: none !important;
    }

    .nav-dropdown:hover .nav-dropdown-content{
        display: none !important;
    }
}

.rating-group,
.aircraft-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.rating-group label,
.aircraft-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

.rating-group input,
.aircraft-item input {
    margin: 0;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.option-group {
    border: 1px solid #cdb8b8;
    border-radius: 6px;
    padding: 10px 12px;
}

.option-group legend {
    padding: 0 6px;
    font-weight: 600;
}

.flight-tooltip {
  font-size: 14px;
  padding: 6px 10px;
}

.route-timeline {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: #fff;
  border-top: 1px solid #ddd;
  padding: 8px 20px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.timeline-info {
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 4px;
}

.route-timeline input[type="range"] {
  width: 100%;
  margin: 0;
}

.engine-hours-row {
  display: flex;
  gap: 15px;
}

.engine-hour {
  flex: 1;
}

.form-value {
  padding: 12px 14px;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-weight: 600;
  color: #333;
}

/* =========================================================
   DASHBOARD PILOTO
   ========================================================= */

.dashboard-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dashboard-card {
    padding: 20px;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.dashboard-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.dashboard-card-model {
    margin-top: 4px;
    color: #666;
    font-size: 1rem;
}

.dashboard-card-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: right;
}

.dashboard-card-info-item {
    font-size: 0.95rem;
}

.dashboard-card-body {
    margin-top: 20px;
}

.dashboard-card-footer {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dashboard-other-flight {
    text-align: center;
}

.dashboard-other-flight-title {
    font-size: 1.4rem;
    font-weight: 700;
}

.dashboard-other-flight-text {
    margin-top: 6px;
    color: #666;
}

.dashboard-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* =========================================================
   CABECERA AERONAVE
   ========================================================= */

.aircraft-title {
    font-size: 24px;
    font-weight: 700;
    color: #8b0000;
    line-height: 1.2;
}

.aircraft-subtitle {
    margin-top: 3px;
    font-size: 15px;
    color: #666;
}

/* =========================================================
   DASHBOARD ACORDEÓN
   ========================================================= */

.dashboard-card-summary {
    margin-top: 12px;
    color: #555;
    font-size: 0.95rem;
}

.dashboard-card-toggle {
    margin-top: 15px;
}

.dashboard-card-details {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.dashboard-card-details.active {
    display: block;
}