/* ==========================================
ESTILOS PRINCIPALES
Libro de Registro - Aviario Tuloro v1.0
"Hecho por criadores, para criadores."
© 2026 Aviario Tuloro
========================================== */

/* ============ RESET Y BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    line-height: 1.6;
}
.ui-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ============ HEADER ============ */
header {
    background: white;
    padding: 25px 30px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #2c3e50;
}
.header-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}
header p {
    font-size: 14px;
    color: #555;
}

/* ============ NAVEGACIÓN (TABS) ============ */
.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: white;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.tab-btn {
    padding: 10px 18px;
    border: none;
    background: #f8f9fa;
    color: #2c3e50;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}
.tab-btn:hover {
    background: #e8f4f8;
    color: #3498db;
}
.tab-btn.active {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}
/* Rótulos de grupo en la navegación (v1.0) */
.nav-grupo {
    width: 100%;
    font-size: 10px;
    letter-spacing: 1px;
    color: #95a5a6;
    text-transform: uppercase;
    margin: 8px 0 2px 4px;
    font-weight: 700;
}

/* ============ CONTENIDO DE TABS ============ */
.tab-content {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.tab-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 24px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}
.tab-content h3 {
    color: #2c3e50;
    margin: 20px 0 15px 0;
    font-size: 18px;
}

/* ============ ESTADÍSTICAS (DASHBOARD) ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.stat-card {
    color: white;
    padding: 35px 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.stat-card:hover { transform: translateY(-5px); }
.stat-card:nth-child(1) { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-card:nth-child(2) { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-card:nth-child(3) { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-card:nth-child(4) { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.stat-card h3 {
    font-size: 42px;
    margin-bottom: 8px;
    color: white;
    border: none;
    font-weight: 700;
}
.stat-card p {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 500;
}

/* ============ FORMULARIOS ============ */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-group label {
    font-weight: 600;
    margin-bottom: 6px;
    color: #2c3e50;
    font-size: 14px;
}
.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ============ BOTONES ============ */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 8px;
    margin-bottom: 8px;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.btn-primary { background: #3498db; color: white; }
.btn-primary:hover { background: #2980b9; }
.btn-success { background: #27ae60; color: white; }
.btn-success:hover { background: #219652; }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: #f39c12; color: white; }
.btn-warning:hover { background: #d68910; }
.btn-small {
    padding: 5px 12px;
    font-size: 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 5px;
}
.btn-small:hover { background: #2980b9; }
.btn-small.btn-danger { background: #e74c3c; }
.btn-small.btn-danger:hover { background: #c0392b; }
.btn-small.btn-success { background: #27ae60; }
.btn-large {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
}

/* ============ TABLAS ============ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
}
.data-table thead { background: #3498db; color: white; }
.data-table th,
.data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
}
.data-table th { font-weight: 600; }
.data-table tbody tr:hover { background: #f8f9fa; }
.data-table tbody tr:nth-child(even) { background: #fafafa; }

/* ============ BÚSQUEDA ============ */
.search-box {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
}
.search-box:focus {
    outline: none;
    border-color: #3498db;
}

/* ============ CAJAS DE INFORMACIÓN ============ */
.info-box {
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}
.info-box p {
    margin: 0;
    font-size: 14px;
}

/* ============ MODALES ============ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal.active { display: flex; }
.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-content h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ============ SECCIONES DE PERSONALIZACIÓN ============ */
.personalizacion-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.personalizacion-section h3 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

/* ============ CHECKBOXES ============ */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}
.checkbox-item:hover {
    background: #e8f4f8;
    border-color: #3498db;
}
.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}
.checkbox-item label {
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

/* ============ FOOTER ============ */
footer {
    text-align: center;
    padding: 15px;
    background: #2c3e50;
    color: #ecf0f1;
    margin-top: 30px;
    border-radius: 8px;
}
footer a { color: #3498db; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ============ PAREJAS REPRODUCTORAS ============ */
.parejas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.pareja-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}
.pareja-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-3px);
    border-color: #3498db;
}
.pareja-foto-container {
    width: 100%;
    height: 220px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid #e5e7eb;
}
.pareja-foto-container:hover { background: #e8f4f8; }
.pareja-foto-container:hover::after {
    content: '✏️ Editar';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
}
.pareja-foto {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pareja-foto-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #95a5a6;
    gap: 6px;
}
.pareja-foto-placeholder .foto-icon {
    font-size: 32px;
    opacity: 0.5;
}
.pareja-foto-placeholder .foto-texto {
    font-size: 12px;
    font-weight: 500;
}
.pareja-info { padding: 15px; flex: 1; }
.pareja-info h4 {
    margin: 0 0 12px 0;
    font-size: 15px;
    color: #2c3e50;
    font-weight: 600;
    line-height: 1.3;
}
.pareja-dato {
    margin: 6px 0;
    font-size: 13px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pareja-label {
    font-weight: 600;
    color: #2c3e50;
    min-width: 70px;
}
.pareja-acciones {
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
}
.pareja-acciones .btn-small {
    flex: 1;
    margin: 0;
    justify-content: center;
    padding: 8px 12px;
}
.pareja-foto-selector {
    width: 100%;
    height: 220px;
    background: #f8f9fa;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}
.pareja-foto-selector:hover {
    border-color: #3498db;
    background: #e8f4f8;
}
.pareja-foto-selector img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.foto-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #6b7280;
}
.foto-placeholder .foto-icon { font-size: 48px; opacity: 0.6; }
.foto-placeholder .foto-texto { font-size: 15px; font-weight: 600; color: #374151; }
.foto-placeholder .foto-ayuda { font-size: 12px; color: #9ca3af; }
#btn-quitar-foto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ============ CENTRO DE IMPRESIÓN ============ */
.btn-impresion {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.btn-impresion:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.btn-impresion .btn-icon { font-size: 48px; margin-bottom: 15px; }
.btn-impresion .btn-text { font-size: 18px; font-weight: 700; color: #2c3e50; margin-bottom: 8px; }
.btn-impresion .btn-desc { font-size: 13px; color: #7f8c8d; }
.btn-cesion:hover { border-color: #3498db; background: #ebf5fb; }
.btn-certificado:hover { border-color: #27ae60; background: #e9f7ef; }
.btn-ambos:hover { border-color: #9b59b6; background: #f4ecf7; }
.mensaje-vacio { text-align: center; padding: 60px 20px; color: #7f8c8d; }
.mensaje-vacio p { font-size: 18px; margin: 10px 0; }
.mensaje-vacio .texto-ayuda { font-size: 14px; color: #95a5a6; max-width: 600px; margin: 20px auto; }

/* ============ NOTAS Y OBSERVACIONES ============ */
.nota-item {
    background: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
}
.nota-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.nota-urgente { border-left-color: #e74c3c; background: #ffeaea; }
.nota-completada { opacity: 0.6; border-left-color: #27ae60; }
.nota-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}
.nota-tipo { font-weight: bold; color: #2c3e50; }
.nota-fecha { font-size: 12px; color: #7f8c8d; }
.nota-recordatorio {
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
}
.nota-texto { margin-bottom: 10px; line-height: 1.5; }
.nota-acciones { display: flex; gap: 10px; }

/* ============ RECORDATORIOS ============ */
.recordatorio-item {
    background: #f8f9fa;
    border-left: 4px solid #f39c12;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 6px;
}
.recordatorio-hoy {
    border-left-color: #e74c3c;
    background: #ffeaea;
    animation: pulse 2s infinite;
}
.recordatorio-pasado { border-left-color: #95a5a6; opacity: 0.7; }
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}
.recordatorio-fecha { font-weight: bold; color: #2c3e50; margin-bottom: 5px; }
.recordatorio-ave { font-size: 14px; color: #3498db; margin-bottom: 5px; }
.recordatorio-texto { margin-bottom: 10px; }

/* ============ CALENDARIO ============ */
.calendario-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-top: 15px;
}
.calendario-dia-header {
    text-align: center;
    font-weight: bold;
    padding: 8px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}
.calendario-dia {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}
.calendario-dia:hover { background: #e8f4f8; }
.calendario-dia.hoy { background: #3498db; color: white; font-weight: bold; }
.calendario-dia.con-recordatorios { background: #ffeaa7; }
.calendario-dia.vacio { background: transparent; cursor: default; }
.dia-numero { font-size: 14px; }
.dia-indicador {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

/* ============ ALERTAS ============ */
.alerta-item {
    background: #ffeaea;
    border-left: 4px solid #e74c3c;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
}
.alerta-item strong { color: #e74c3c; display: block; margin-bottom: 5px; }

/* ============ VALIDACIÓN ============ */
.campo-opcional { color: #95a5a6; font-size: 12px; font-weight: normal; font-style: italic; }
.field-help { font-size: 12px; display: block; margin-top: 5px; font-weight: 500; }
.input-error { border-color: #e74c3c !important; background-color: #fdf2f2 !important; }
.input-success { border-color: #27ae60 !important; background-color: #f0fff4 !important; }

/* ============ CONTROL DE NIDADAS ============ */
.nidada-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}
.nidada-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.nidada-abierta { border-left: 4px solid #e74c3c; }
.nidada-cerrada { border-left: 4px solid #27ae60; }
.nidada-header {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}
.nidada-estado { font-weight: bold; font-size: 16px; }
.nidada-pareja { font-size: 14px; color: #2c3e50; }
.nidada-fecha { font-size: 13px; color: #7f8c8d; }
.nidada-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}
.nidada-stats span { font-size: 14px; }
.nidada-huevos {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}
.huevo-item {
    display: flex;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}
.huevo-item:last-child { border-bottom: none; }
.nidada-actions { display: flex; gap: 10px; margin-top: 15px; }
.resumen-nidadas { display: flex; gap: 20px; flex-wrap: wrap; }
.resumen-item {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
}
.resumen-item strong { color: #2563eb; }

/* ============ IMPRESIÓN Y PDF ============ */
.print-container { display: none; }
.print-page {
    width: 210mm;
    min-height: 297mm;
    padding: 20mm;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
.cover-page { text-align: center; }
.cover-page h1 { font-size: 28px; margin-bottom: 40px; color: #2c3e50; }
.cover-section { margin-bottom: 30px; text-align: left; }
.cover-section h3 { font-size: 18px; margin-bottom: 15px; color: #3498db; border-bottom: 2px solid #3498db; padding-bottom: 5px; }
.official-table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 11px; }
.official-table th, .official-table td { border: 1px solid #000; padding: 8px; text-align: left; }
.official-table th { background: #f0f0f0; font-weight: bold; }
.page-number { text-align: right; margin-top: 20px; font-size: 12px; }

/* ============ DOCUMENTOS MITECO ============ */
.miteco-documento {
    font-family: 'Arial', sans-serif;
    font-size: 11px;
    padding: 40px;
    max-width: 210mm;
    margin: 0 auto;
    background: white;
    line-height: 1.6;
}
.miteco-encabezado { margin-bottom: 30px; border: 2px solid #000; padding: 10px; }
.miteco-header-table { width: 100%; border-collapse: collapse; }
.miteco-header-cell { padding: 10px; vertical-align: middle; }
.miteco-titulo-doc { text-align: center; font-size: 18px; font-weight: bold; margin: 30px 0; text-decoration: underline; }
.miteco-texto { margin: 20px 0; line-height: 1.8; text-align: justify; }
.miteco-texto-declaracion { margin: 20px 0; line-height: 1.8; text-align: justify; }
.miteco-subtitulo { font-size: 14px; font-weight: bold; margin: 25px 0 15px 0; text-align: center; }
.miteco-lista-declaracion { margin: 20px 0; padding-left: 30px; }
.miteco-lista-declaracion li { margin-bottom: 15px; line-height: 1.6; text-align: justify; }
.miteco-tabla-progenitores, .miteco-tabla-puestas, .miteco-tabla-especimenes { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 10px; }
.miteco-tabla-progenitores th, .miteco-tabla-progenitores td,
.miteco-tabla-puestas th, .miteco-tabla-puestas td,
.miteco-tabla-especimenes th, .miteco-tabla-especimenes td { border: 1px solid #000; padding: 8px; text-align: left; vertical-align: top; }
.miteco-tabla-progenitores th, .miteco-tabla-puestas th, .miteco-tabla-especimenes th { background: #f0f0f0; font-weight: bold; text-align: center; }
.miteco-tabla-puestas td { height: 25px; }
.miteco-pie { margin-top: 40px; line-height: 2; }

/* ============ TOAST NOTIFICATIONS ============ */
.toast-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #1f2937;
    color: white;
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    z-index: 10000;
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .ui-container { padding: 10px; }
    header h1 { font-size: 20px; }
    .tabs { flex-direction: column; }
    .tab-btn { width: 100%; text-align: left; }
    .form-row { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .parejas-grid { grid-template-columns: 1fr; }
    .nidada-header { flex-direction: column; align-items: flex-start; }
    .nidada-stats { flex-direction: column; gap: 10px; }
}
@media (max-width: 480px) {
    .modal-content { padding: 20px; }
    .tab-content { padding: 20px; }
}
@media print {
    body * { visibility: hidden; }
    .print-container, .print-container * { visibility: visible; }
    .print-container { position: absolute; left: 0; top: 0; width: 100%; display: block !important; }
    .print-page { box-shadow: none; margin: 0; padding: 15mm; }
}

/* ============ UTILIDADES ============ */
.no-print { /* Clase para elementos que no se imprimen */ }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* ==========================================
CONTROL DE NIDADAS - ESTILOS PREMIUM
Sistema de pilotos interactivos
========================================== */
.nidadas-grid { display: flex; flex-direction: column; gap: 15px; }
.nidada-tarjeta {
    background: white;
    border-radius: 10px;
    border-left: 5px solid #e67e22;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    overflow: hidden;
}
.nidada-tarjeta:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}
.nidada-cabecera {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}
.nidada-cabecera:hover { background: #fafbfc; }
.nidada-info { flex: 1; }
.nidada-estado-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.nidada-stats-rapidas { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.stat-mini {
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}
.expandir-icono {
    font-size: 16px;
    color: #7f8c8d;
    font-weight: bold;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ecf0f1;
    border-radius: 50%;
}
.nidada-detalle { padding: 0 22px 22px 22px; animation: slideDown 0.3s ease; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.huevos-label {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== PILOTOS DE HUEVOS (FORMA DE HUEVO CON BRILLO) ===== */
.pilotos-contenedor {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #e0e0e0;
}
.piloto-huevo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s;
    position: relative;
}
.piloto-huevo:hover { transform: scale(1.1); }
.piloto-circulo {
    width: 46px;
    height: 60px;
    /* forma de huevo */
    border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    font-weight: bold;
    box-shadow:
        inset -6px -8px 12px rgba(0,0,0,0.18),
        inset 5px 7px 12px rgba(255,255,255,0.22),
        2px 5px 10px rgba(0,0,0,0.28);
    position: relative;
    transition: all 0.3s ease;
}
/* Brillo: reflejo de luz blanco arriba a la izquierda */
.piloto-circulo::before {
    content: '';
    position: absolute;
    top: 9%;
    left: 16%;
    width: 38%;
    height: 26%;
    background: radial-gradient(ellipse at center,
        rgba(255,255,255,0.95) 0%,
        rgba(255,255,255,0.45) 45%,
        rgba(255,255,255,0) 75%);
    border-radius: 50%;
    transform: rotate(-25deg);
    pointer-events: none;
}
.piloto-icono { font-size: 20px; position: relative; z-index: 1; }
.piloto-numero { font-size: 11px; font-weight: 600; color: #555; }
.piloto-anilla {
    font-size: 10px;
    background: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Botón añadir huevo (también con forma de huevo) */
.piloto-add {
    width: 46px;
    height: 60px;
    border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
    border: 3px dashed #bdc3c7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    color: #7f8c8d;
}
.piloto-add:hover {
    border-color: #3498db;
    color: #3498db;
    transform: scale(1.05);
    background: #e8f4f8;
}
.add-icon { font-size: 22px; font-weight: bold; line-height: 1; }
.add-text { font-size: 9px; font-weight: 600; text-transform: uppercase; }

/* ===== LEYENDA DE PILOTOS ===== */
.leyenda-pilotos {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #555;
}
.leyenda-pilotos > span { display: flex; align-items: center; gap: 6px; }
.leyenda-piloto {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ===== MENÚ FLOTANTE DE HUEVO ===== */
.menu-huevo-flotante {
    position: fixed;
    background: #2c3e50;
    color: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 9999;
    min-width: 280px;
    animation: menuPop 0.2s ease;
    overflow: hidden;
}
@keyframes menuPop {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
.menu-huevo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #34495e;
    font-weight: 600;
    font-size: 14px;
}
.menu-huevo-body { padding: 12px; }
.btn-menu-huevo {
    display: block;
    width: 100%;
    padding: 10px;
    margin: 6px 0;
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.btn-menu-huevo:hover {
    filter: brightness(1.15);
    transform: translateX(3px);
}

/* ===== BOTONES DE ACCIÓN EN NIDADA ===== */
.nidada-acciones {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}
.nidada-acciones .btn-small {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.nidada-acciones .btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Responsive para nidadas */
@media (max-width: 768px) {
    .nidada-cabecera { flex-direction: column; align-items: flex-start; gap: 12px; }
    .nidada-stats-rapidas { width: 100%; justify-content: space-between; }
    .pilotos-contenedor { justify-content: center; }
    .piloto-circulo { width: 40px; height: 52px; }
    .piloto-add { width: 40px; height: 52px; }
    .nidada-acciones { flex-direction: column; }
    .nidada-acciones .btn-small { width: 100%; }
    .leyenda-pilotos { justify-content: center; gap: 12px; }
    .menu-huevo-flotante { min-width: 240px; }
}

/* ==========================================
MODAL VISTA PREVIA MITECO - v8.0
========================================== */
#modal-miteco-preview .modal-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.4);
}
#miteco-preview-content { min-height: 300px; }
#miteco-iframe {
    background: #ffffff;
    transition: box-shadow 0.3s;
}
#miteco-iframe:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
/* Pestañas del paginador de documentos */
.tab-doc { opacity: 0.55; }
.tab-doc.active { opacity: 1; outline: 2px solid #2563eb; }
/* Spinner de carga */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* Responsive MITECO Preview */
@media (max-width: 768px) {
    #modal-miteco-preview .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 100vh;
        border-radius: 0;
    }
    #miteco-iframe { min-height: 400px; }
}