/* Hide farmOS modify and move buttons */
.ol-edit-modify,
.ol-edit-move,
.ol-edit-delete {
  display: none !important;
}

/* Hide the layer switcher button */
.layer-switcher {
  display: none !important;
}

/* Oculta los botones de dibujo */
.ol-edit-buttons.draw {
  display: none !important;
}

/* Oculta boton full screen */
.ol-full-screen-false {
  display: none !important;
}

/* Hide the atrtibution button */
.ol-attribution {
  display: none !important;
}


/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Header */
.header {
    background-color: #2c5530;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 40px;
    width: auto;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Main Container */
.container {
    display: flex;
    height: calc(100vh - 80px);
    gap: 1rem;
    padding: 1rem;
}

/* Side Panel */
.side-panel {
    width: 300px;
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.panel-section label {
    font-weight: bold;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #333;
    display: block;
}

/* Form Elements */
.form-select, .form-input {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-select:focus, .form-input:focus {
    outline: none;
    border-color: #4a7c59;
}

/* Lotes List */
.lotes-container {
    /* max-height: 300px; */
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    /* padding: 0.5rem; */
}

.lotes-list {
    list-style: none;
}

.lotes-list li {
    /* padding: 0.2rem; */
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 0.25rem;
}

.lotes-list li:hover {
    background-color: #f0f0f0;
}

.lotes-list li.selected {
    background-color: #e8f5e8;
    border-left: 4px solid #4a7c59;
}

.lotes-list li.empty {
    text-align: center;
    color: #666;
    font-style: italic;
    cursor: default;
}

.lotes-list li.empty:hover {
    background-color: transparent;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.button-group .btn {
    flex: 1;
    min-width: 80px;
}

.btn {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background-color: #4a7c59;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #3a6b47;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.btn-warning:hover:not(:disabled) {
    background-color: #e0a800;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Map Container */
.map-container {
    flex: 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.map {
    width: 100%;
    height: 100%;
}

/* Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.dialog-overlay.active {
    opacity: 1;
    visibility: visible;
}

.dialog {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.dialog-overlay.active .dialog {
    transform: scale(1);
}

.dialog h3 {
    margin-bottom: 1.5rem;
    color: #2c5530;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #2c5530;
}

.dialog-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.dialog-buttons .btn {
    flex: none;
    min-width: 100px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 80px);
    }
    
    .side-panel {
        width: 100%;
        order: 2;
    }
    
    .map-container {
        order: 1;
        height: 60vh;
        min-height: 400px;
    }
    
    .header {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .button-group .btn {
        flex: none;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .side-panel {
        padding: 1rem;
    }
    
    .dialog {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .dialog-buttons {
        flex-direction: column;
    }
}

/* Estilos para el modal de eliminación */
.delete-content {
    text-align: center;
    padding: 20px 10px;
}

.warning-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.delete-content p {
    margin: 10px 0;
    font-size: 16px;
    line-height: 1.4;
}

.warning-text {
    color: #dc3545;
    font-weight: 500;
    font-size: 14px !important;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}


/* Estilos para gestión de campos */
.farm-management-dialog {
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

.farm-list-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.farm-form-section {
    margin-bottom: 20px;
}

.farms-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background: #f8f9fa;
}

.farms-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.farms-list li {
    padding: 10px;
    margin-bottom: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.farms-list li:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.farms-list li.selected {
    background: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.farm-item-info {
    flex: 1;
}

.farm-item-name {
    font-weight: bold;
    margin-bottom: 4px;
}

.farm-item-details {
    font-size: 12px;
    color: #666;
}

.farm-item-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 3px;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

textarea.form-input {
    resize: vertical;
    min-height: 60px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

/* Estilos adicionales para eliminación de campos */
.farm-details {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    font-size: 14px;
}

.farm-details p {
    margin: 4px 0;
    color: #495057;
}

.farm-details .detail-label {
    font-weight: 600;
    color: #343a40;
}


/* Estilos para modal de información CUIC */
.cuic-info-content {
    text-align: center;
    padding: 30px 20px;
}

.info-icon {
    font-size: 64px;
    margin-bottom: 20px;
    color: #17a2b8;
}

.message-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #343a40;
    line-height: 1.5;
}

.instructions-text {
    font-size: 14px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #17a2b8;
    margin-bottom: 20px;
}

.instructions-text p {
    margin: 8px 0;
}

.instructions-text strong {
    color: #495057;
}

/* Ocultar controles principales cuando no hay acceso */
.app-disabled .side-panel,
.app-disabled .map-container {
    opacity: 0.3;
    pointer-events: none;
}

.app-disabled::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 999;
    backdrop-filter: blur(2px);
}



/* ========================================
   ESTILOS PARA IMPORTACIÓN KML/KMZ
   ======================================== */

   .kml-import-dialog {
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.kml-import-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.kml-import-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.kml-import-section h4 {
    color: #2c5530;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Selector de archivo personalizado para KML */
.kml-file-input-container {
    position: relative;
    display: inline-block;
    width: 100%;
}

.kml-file-input-custom {
    display: inline-block;
    padding: 15px 25px;
    background: #4a7c59;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    width: 100%;
    font-weight: 500;
    font-size: 16px;
    border: 2px dashed rgba(255,255,255,0.3);
}

.kml-file-input-custom:hover {
    background: #3a6b47;
    border-color: rgba(255,255,255,0.5);
    transform: translateY(-1px);
}

.kml-file-input-hidden {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Información del archivo KML */
.kml-file-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
    display: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.kml-file-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 20px;
    align-items: center;
}

.kml-file-info-label {
    font-weight: 600;
    color: #495057;
}

.kml-file-info-value {
    color: #6c757d;
    font-family: monospace;
}

/* Formatos soportados KML */
.kml-supported-formats {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid #2196f3;
}

.kml-supported-formats strong {
    color: #1976d2;
}

.kml-format-list {
    margin-top: 8px;
    display: flex;
    gap: 15px;
}

.kml-format-item {
    background: rgba(255,255,255,0.7);
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* Preview de lotes KML */
.kml-preview-container {
    display: none;
}

.kml-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.kml-lotes-count {
    font-weight: 600;
    color: #4a7c59;
    font-size: 16px;
}

.kml-select-all-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kml-preview-list {
    max-height: 250px;
    overflow-y: auto;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}

.kml-preview-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 15px;
    margin-bottom: 10px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kml-preview-item:hover {
    border-color: #4a7c59;
    box-shadow: 0 3px 8px rgba(74, 124, 89, 0.15);
    transform: translateY(-1px);
}

.kml-preview-item:last-child {
    margin-bottom: 0;
}

.kml-preview-info {
    flex: 1;
}

.kml-preview-name {
    font-weight: 600;
    color: #2c5530;
    margin-bottom: 6px;
    font-size: 15px;
}

.kml-preview-details {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.kml-preview-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
}

.kml-lote-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #4a7c59;
}

.kml-lote-checkbox + label {
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    margin: 0;
    font-weight: 500;
}

/* Opciones de importación KML */
.kml-import-options {
    display: none;
}

.kml-options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.kml-option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.kml-option-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #4a7c59;
}

.kml-option-item label {
    font-size: 14px;
    color: #495057;
    margin: 0;
    font-weight: 500;
}

/* Botones de importación KML */
.kml-import-buttons {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.kml-import-buttons .btn {
    min-width: 140px;
    padding: 12px 24px;
    font-weight: 600;
}

/* Estados de carga para KML */
.kml-importing-state {
    opacity: 0.7;
    pointer-events: none;
}

/* Icono KML */
.kml-icon {
    color: #2196f3;
    font-size: 18px;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .kml-import-dialog {
        width: 95%;
        max-width: none;
        margin: 10px auto;
    }

    .kml-preview-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .kml-preview-actions {
        align-self: flex-end;
        margin-left: 0;
    }

    .kml-import-buttons {
        flex-direction: column;
    }

    .kml-import-buttons .btn {
        min-width: auto;
    }

    .kml-preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* Animación de entrada */
.kml-fade-in {
    animation: kmlFadeIn 0.3s ease-in;
}

@keyframes kmlFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ========================================
   ESTILOS ADICIONALES PARA DIALOG DE OCUPACIONES
   ======================================== */

/* Reemplazar el HTML del dialog existente con el nuevo en index.html */

/* Dialog expandido para ocupaciones */
.lote-dialog-expanded {
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
}

/* Secciones del formulario */
.form-section {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: #4a7c59;
    box-shadow: 0 2px 8px rgba(74, 124, 89, 0.1);
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #2c5530;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #2c5530;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-section h4::before {
    content: "";
    font-size: 14px;
}

.form-section:nth-child(2) h4::before {
    content: "";
}

.form-section:nth-child(3) h4::before {
    content: "";
}

/* Filas del formulario */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row.single-column {
    grid-template-columns: 1fr;
}

/* Grilla de ocupaciones */
.ocupaciones-container {
    position: relative;
    margin-top: 10px;
}

.ocupaciones-grid {
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    min-height: 200px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.grid-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 120px;
    background: linear-gradient(135deg, #2c5530 0%, #4a7c59 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.grid-cell {
    padding: 12px 8px;
    border-right: 1px solid rgba(255,255,255,0.2);
    text-align: left;
    display: flex;
    align-items: center;
}

.grid-cell:last-child {
    border-right: none;
    justify-content: center;
}

.grid-body {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #4a7c59 #f1f1f1;
}

.grid-body::-webkit-scrollbar {
    width: 8px;
}

.grid-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.grid-body::-webkit-scrollbar-thumb {
    background: #4a7c59;
    border-radius: 4px;
}

.ocupacion-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 120px;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    animation: fadeIn 0.3s ease-in;
}

.ocupacion-row:hover {
    background-color: #f8f9fa;
    transform: translateX(2px);
}

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

.ocupacion-cell {
    padding: 12px 8px;
    border-right: 1px solid #eee;
    font-size: 14px;
    align-items: center;
    display: flex;
}

.ocupacion-cell:last-child {
    border-right: none;
    justify-content: center;
}

.ocupacion-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Botones mini */
.btn-mini {
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-edit {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    box-shadow: 0 2px 4px rgba(23, 162, 184, 0.3);
}

.btn-edit:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(23, 162, 184, 0.4);
}

.btn-delete {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.btn-delete:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.4);
}

/* Estado vacío */
.ocupaciones-empty {
    display: none;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-style: italic;
    background: white;
    border: 2px dashed #ddd;
    border-radius: 8px;
    position: relative;
}

.ocupaciones-empty::before {
    content: "📋";
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

.ocupaciones-empty.show {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

/* Campos de fecha mejorados */
input[type="date"] {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

input[type="date"]:focus {
    outline: none;
    border-color: #4a7c59;
    box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
    transform: translateY(-1px);
}

input[type="date"]:hover {
    border-color: #4a7c59;
}

/* Estados de ocupación */
.ocupacion-actual {
    background: linear-gradient(90deg, #d4edda 0%, #c3e6cb 100%);
    border-left: 4px solid #28a745;
}

.ocupacion-futura {
    background: linear-gradient(90deg, #cce7ff 0%, #b3d9ff 100%);
    border-left: 4px solid #007bff;
}

.ocupacion-pasada {
    background: linear-gradient(90deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #6c757d;
    opacity: 0.8;
}

/* Estados del formulario */
.form-section.editing {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    transform: scale(1.02);
}

.form-section.editing h4 {
    color: #856404;
    border-bottom-color: #ffc107;
}

.form-section.editing::before {
    content: "✏️ Editando...";
    position: absolute;
    top: -10px;
    right: 20px;
    background: #ffc107;
    color: #856404;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 1.5s infinite;
}

/* Validación mejorada */
.form-input.error,
.form-select.error {
    border-color: #dc3545;
    background-color: #fff5f5;
    animation: shake 0.3s ease-in-out;
}

.form-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-error::before {
    content: "⚠️";
    font-size: 14px;
}

/* Botón agregar ocupación mejorado */
#add-ocupacion {
    background: linear-gradient(135deg, #4a7c59 0%, #2c5530 100%);
    border: none;
    color: white;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 3px 6px rgba(74, 124, 89, 0.3);
}

#add-ocupacion:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(74, 124, 89, 0.4);
    background: linear-gradient(135deg, #2c5530 0%, #1e3a21 100%);
}

#add-ocupacion:active {
    transform: translateY(0);
}

/* Responsive mejorado */
@media (max-width: 768px) {
    .lote-dialog-expanded {
        width: 98%;
        max-width: none;
        margin: 5px;
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .grid-header,
    .ocupacion-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .grid-cell,
    .ocupacion-cell {
        border-right: none;
        border-bottom: 1px solid #eee;
        text-align: left;
        padding: 8px 12px;
    }
    
    .grid-cell:before,
    .ocupacion-cell:before {
        content: attr(data-label) ": ";
        font-weight: bold;
        margin-right: 5px;
        color: #4a7c59;
    }
    
    .ocupacion-actions {
        justify-content: flex-end;
        margin-top: 8px;
    }
    
    .form-section {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .form-section h4 {
        font-size: 14px;
    }
    
    .ocupaciones-empty {
        padding: 40px 15px;
    }
    
    .ocupaciones-empty::before {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .lote-dialog-expanded {
        padding: 10px;
        margin: 2px;
    }
    
    .form-section {
        padding: 12px;
    }
    
    .btn-mini {
        padding: 4px 6px;
        font-size: 10px;
    }
    
    .ocupacion-cell {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    .grid-cell {
        padding: 10px 6px;
        font-size: 12px;
    }
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Tooltips para botones */
.btn-mini[title] {
    position: relative;
}

.btn-mini[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.btn-mini[title]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

/* Indicadores de estado en tiempo real */
.ocupacion-row.ocupacion-actual .ocupacion-cell:first-child::after {
    content: "🟢";
    margin-left: 8px;
    font-size: 12px;
}

.ocupacion-row.ocupacion-futura .ocupacion-cell:first-child::after {
    content: "🔵";
    margin-left: 8px;
    font-size: 12px;
}

.ocupacion-row.ocupacion-pasada .ocupacion-cell:first-child::after {
    content: "⚫";
    margin-left: 8px;
    font-size: 12px;
}

/* Mejoras en accesibilidad */
.form-input:focus,
.form-select:focus {
    outline: 2px solid #4a7c59;
    outline-offset: 2px;
}

.btn-mini:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(74, 124, 89, 0.3);
}

/* Estados de carga */
.ocupaciones-grid.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.ocupaciones-grid.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4a7c59;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Estilos para el título del dialog */
#lote-dialog-title {
    color: #2c5530;
    font-size: 20px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #4a7c59;
    display: flex;
    align-items: center;
    gap: 10px;
}

#lote-dialog-title::before {
    content: "";
    font-size: 18px;
}

/* Estilos para información de ayuda */
.form-help-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #4a7c59;
}

.field-info {
    font-size: 11px;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

/* Separadores visuales */
.form-section + .form-section {
    position: relative;
}

.form-section + .form-section::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4a7c59, transparent);
}

/* Mejoras en los botones del dialog */
.dialog-buttons {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 2px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.dialog-buttons .btn {
    min-width: 120px;
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.dialog-buttons .btn-primary {
    background: linear-gradient(135deg, #4a7c59 0%, #2c5530 100%);
    box-shadow: 0 4px 8px rgba(74, 124, 89, 0.3);
}

.dialog-buttons .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 124, 89, 0.4);
}

.dialog-buttons .btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
}

.dialog-buttons .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.4);
}

/* Estadísticas de ocupaciones */
.ocupaciones-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.ocupacion-stat {
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ocupacion-stat-number {
    font-size: 18px;
    font-weight: bold;
    color: #4a7c59;
    display: block;
}

.ocupacion-stat-label {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



/* ESTILOS ADICIONALES PARA NUEVO ESQUEMA */
.field-info {
    font-size: 11px;
    color: #666;
    font-weight: normal;
}

.field-required {
    color: #e74c3c;
    font-weight: bold;
}

.form-help-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* Ocultar campos no disponibles en el nuevo esquema */
.form-group[style*="display: none"] {
    display: none !important;
}

/* Mejorar contraste para campos de información */

.detail-label {
    font-weight: bold;
    color: #495057;
}


/* Estilos para información de usuario */
.user-info-container {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 12px;
    color: #666;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.user-name {
    font-weight: bold;
    color: white;
    font-size: 13px;
}

.user-email {
    color: white;
    font-size: 11px;
}

.user-groups {
    color: white;
    font-size: 11px;
    font-weight: bold;
}

/* Estilos para los dropdowns mejorados */


.form-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
}

.form-select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Estados de carga */
.form-select.loading {
    background-image: url("data:image/svg+xml,%3csvg width='20' height='20' xmlns='http://www.w3.org/2000/svg'%3e%3cg fill='none'%3e%3ccircle cx='10' cy='10' r='8' stroke='%23666' stroke-width='2' stroke-dasharray='5 3'/%3e%3c/g%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Estados de error específicos para autenticación por email */
.error-content, .warning-content, .info-content {
    text-align: left;
    line-height: 1.5;
}

.email-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: monospace;
    font-size: 14px;
    margin: 10px 0;
    word-break: break-all;
}

.email-display.invalid {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.help-text {
    margin-top: 15px;
    padding: 15px;
    background-color: #e7f3ff;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
}

.help-text h4 {
    margin: 0 0 10px 0;
    color: #0066cc;
    font-size: 14px;
}

.help-text ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-text li {
    margin-bottom: 5px;
}

.contact-admin {
    margin-top: 15px;
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 13px;
}

.url-examples {
    margin-top: 15px;
}

.url-examples code {
    display: block;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    font-size: 13px;
    margin: 10px 0;
    word-break: break-all;
}		