@charset "utf-8";
        /* ===== VARIABLES CSS ===== */
        :root {
            --primary-color: #3498db;
            --primary-hover: #2980b9;
            --primary-gradient: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
            --secondary-color: #2c3e50;
            --text-color: #34495e;
            --light-gray: #f2eeed;
            --border-color: #b3b7bbff;
            --success-color: #27ae60;
            --danger-color: #e74c3c;
            --danger-hover: #c0392b;
            --shadow-color: rgba(0, 0, 0, 0.1);
        }

        /* ===== RESET Y ESTILOS GLOBALES ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                "Helvetica Neue", Arial, sans-serif;
            color: var(--text-color);
            line-height: 1.6;
        }

        /* ===== CONTENEDOR PRINCIPAL ===== */
        .container {
            top: 110px;
            max-width: 1200px;
            margin: 0 auto;
            background: var(--primary-gradient);
            border-radius: 15px;
            box-shadow: 0 20px 40px var(--shadow-color);
            overflow: hidden;
        }

        /* ===== ENCABEZADO ===== */
        .header {
            background: var(--primary-gradient);
            color: white;
            padding: 30px;
            text-align: center;
            position: relative;
            padding-right: 180px;
        }

        .header h1 {
            font-size: 2.5rem;
            margin-bottom: 10px;
            font-weight: 300;
        }

        .header p {
            opacity: 0.9;
            font-size: 1.1rem;
        }

        .status-bar {
            background: var(--success-color);
            color: white;
            padding: 10px 30px;
            text-align: center;
            font-size: 0.9rem;
        }

        /* ===== CONTENEDOR DE FORMULARIO ===== */
        .form-container {
            padding: 40px;
        }

        .form-section {
            background: var(--light-gray);
            border-radius: 8px;
            padding: 25px;
            border: 1px solid #e9ecef;
            margin-bottom: 20px;
        }

        .section-title {
            color: var(--secondary-color);
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 2px solid var(--primary-color);
            text-align: center;
        }

        /* ===== GRID DE FORMULARIOS ===== */
        .form-fields {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
            gap: 20px;
            align-items: flex-start;
        }

        /* ===== GRUPOS DE FORMULARIO ===== */
        .form-group {
            display: flex;
            flex-direction: column;
            margin-bottom: 10px;
        }

        .form-group1 {
            display: grid;
            grid-template-rows: 45px auto;
            margin-bottom: 20px;
        }

        .form-group.full-width {
            grid-column: 1 / -1;
        }

        /* ===== ETIQUETAS ===== */
        .form-group label,
        .form-group1 label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-color);
            font-weight: 600;
            font-size: 14px;
            font-family: sans-serif;
            line-height: 1.4;
            white-space: normal;
            word-wrap: break-word;
        }

        .requerido {
            color: red;
            font-size: 18px;
            font-weight: bold;
            position: relative;
            top: 3px;
            vertical-align: middle;
            line-height: 0;
            display: inline-block;
        }

        /* ===== CONTROLES DE ENTRADA ===== */
        .form-control,
        .select-control {
            width: 100%;
            padding: 8px 11px;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            font-size: 1rem;
            background: white;
            transition: all 0.3s ease;
            min-height: 40px;
        }

        .form-control:not(textarea) {
            height: 45px;
        }

        textarea.form-control {
            height: auto;
            min-height: 120px;
            resize: vertical;
        }

        .form-control:hover,
        .select-control:hover {
            border-color: #bdc3c7;
        }

        .form-control:focus,
        .select-control:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
            transform: translateY(-1px);
        }

        /* ===== BÚSQUEDA ===== */
        .search-container {
            display: flex;
            gap: 10px;
            align-items: center;
            background: #fff;
            border-radius: 8px;
        }

        .search-input-wrapper {
            flex: 1;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid var(--primary-color);
            border-radius: 8px;
            font-size: 1rem;
            transition: all 0.3s ease;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--primary-hover);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
        }

        .btn-search {
            padding: 12px 24px;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            transition: background 0.3s ease;
        }

        .btn-search:hover {
            background: var(--primary-hover);
        }

        /* ===== INDICADOR DE CARGA ===== */
        .search-loading {
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            display: none;
        }

        .search-loading.active {
            display: block;
        }

        .spinner {
            width: 20px;
            height: 20px;
            border: 3px solid #f3f3f3;
            border-top: 3px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

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

            100% {
                transform: rotate(360deg);
            }
        }

        /* ===== SUGERENCIAS DE BÚSQUEDA ===== */
        .suggestions-dropdown {
            position: absolute;
            top: calc(100% + 5px);
            left: 0;
            right: 0;
            background: white;
            border: 2px solid var(--primary-color);
            border-radius: 8px;
            max-height: 300px;
            overflow-y: auto;
            z-index: 1000;
            box-shadow: 0 4px 6px var(--shadow-color);
            display: none;
        }

        .suggestions-dropdown.active {
            display: block;
        }

        .suggestion-item {
            padding: 12px 15px;
            cursor: pointer;
            border-bottom: 1px solid #ecf0f1;
            transition: background-color 0.2s ease;
        }

        .suggestion-item:last-child {
            border-bottom: none;
        }

        .suggestion-item:hover {
            background-color: #e8f4f8;
        }

        .suggestion-item.selected {
            background-color: #d4edda;
        }

        .suggestion-text {
            font-weight: 600;
            color: var(--secondary-color);
            margin-bottom: 4px;
        }

        .suggestion-subtext {
            font-size: 0.85rem;
            color: #7f8c8d;
        }

        .no-suggestions {
            padding: 15px;
            text-align: center;
            color: #95a5a6;
            font-style: italic;
        }

        /* ===== TABLAS ===== */
        .tabla-container {
            overflow-x: auto;
            margin-top: 20px;
        }

        .tabla-registros {
            width: 100%;
            border-collapse: collapse;
            background: white;
            border-radius: 8px;
            overflow: hidden;
        }

        .tabla-registros th {
            background: var(--primary-color);
            color: white;
            padding: 12px;
            text-align: left;
            font-weight: 600;
        }

        .tabla-registros td {
            padding: 10px 12px;
            border-bottom: 1px solid #e9ecef;
        }

        .tabla-registros tr:hover {
            background: #f8f9fa;
        }

        .tabla-registros img {
            width: 50px;
            height: 50px;
            object-fit: cover;
            border-radius: 4px;
        }

        /* ===== IMÁGENES - SUBIDA Y VISTA PREVIA ===== */
        .image-upload-container {
            position: absolute;
            top: 100px;
            right: 110px;
            text-align: center;
            z-index: 10;
        }

        .image-preview-wrapper {
            width: 120px;
            height: 120px;
            border: 3px solid var(--primary-color);
            border-radius: 10px;
            overflow: hidden;
            background-color: #f8f9fa;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
        }

        .image-preview-wrapper:hover {
            border-color: var(--primary-hover);
            box-shadow: 0 4px 8px var(--shadow-color);
        }

        .image-preview-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .image-placeholder {
            font-size: 60px;
            color: #bdc3c7;
        }

        .image-upload-label {
            display: block;
            margin-top: 10px;
            padding: 8px 15px;
            background-color: var(--primary-color);
            color: white;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: background-color 0.3s ease;
        }

        .image-upload-label:hover {
            background-color: var(--primary-hover);
        }

        #imagen_input {
            display: none;
        }

        .image-remove-btn {
            position: absolute;
            top: 5px;
            right: 5px;
            background-color: var(--danger-color);
            color: white;
            border: none;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            cursor: pointer;
            font-size: 18px;
            display: none;
            align-items: center;
            justify-content: center;
            transition: background-color 0.3s ease;
        }

        .image-remove-btn:hover {
            background-color: var(--danger-hover);
        }

        .image-preview-wrapper.has-image .image-remove-btn {
            display: flex;
        }

        /* Vista previa en formularios */
        .image-preview-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .image-preview {
            width: 200px;
            height: 200px;
            border: 2px dashed var(--border-color);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            background: white;
        }

        .image-preview img {
            max-width: 100%;
            max-height: 100%;
            object-fit: cover;
        }

        .image-preview-text {
            color: #95a5a6;
            text-align: center;
            padding: 20px;
        }

        /* ===== DISEÑO RESPONSIVE ===== */

        /* Tablets y pantallas medianas */
        @media screen and (max-width: 768px) {
            .form-fields {
                grid-template-columns: 1fr;
            }

            .header {
                padding: 20px;
                padding-bottom: 160px;
            }

            .header h1 {
                font-size: 2rem;
            }

            .form-container,
            .form-section {
                padding: 20px;
            }

            .image-upload-container {
                position: relative;
                top: auto;
                right: auto;
                left: 0;
                margin: 20px auto;
                display: flex;
                justify-content: center;
                align-items: center;
                flex-direction: column;
            }

            .image-preview-wrapper {
                width: 130px;
                height: 130px;
            }

            .image-placeholder {
                font-size: 50px;
            }

            .image-upload-label {
                font-size: 0.85rem;
                padding: 7px 12px;
            }
        }

        /* Smartphones */
        @media screen and (max-width: 480px) {
            body {
                padding: 10px;
            }

            .header {
                padding: 15px;
                padding-bottom: 150px;
            }

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

            .image-upload-container {
                margin: 15px auto;
            }

            .image-preview-wrapper {
                width: 120px;
                height: 120px;
                border-width: 2px;
                margin: 0 auto;
            }

            .image-placeholder {
                font-size: 40px;
            }

            .image-upload-label {
                font-size: 0.8rem;
                padding: 6px 10px;
                margin: 10px auto 0;
            }

            .image-remove-btn {
                width: 26px;
                height: 26px;
                font-size: 16px;
            }
        }

        /* Pantallas muy pequeñas */
        @media screen and (max-width: 360px) {
            .header {
                padding-bottom: 140px;
            }

            .image-preview-wrapper {
                width: 100px;
                height: 100px;
            }

            .image-placeholder {
                font-size: 35px;
            }

            .image-upload-label {
                font-size: 0.75rem;
                padding: 5px 8px;
            }
        }

        @media (max-width: 768px) {
            .header {
                margin-bottom: 10px;
                /* reduce el espacio debajo del título */
                padding-bottom: 0;
                /* elimina relleno adicional */
            }

            .form-container {
                margin-top: 0;
                /* elimina margen superior */
                padding-top: 0;
                /* elimina relleno superior */
            }

            .container {
                padding-top: 10px;
                /* ajusta el margen superior general */
            }
        }

