/* ============================================
   COMPONENTES REUTILIZABLES - CETO
   Estilos compartidos extraídos de todos los módulos
   ============================================ */

/* --- LAYOUT GENERAL --- */
.main-content {
    flex: 1;
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* --- PAGE HEADER (Usado en todas las páginas) --- */
.page-header {
    display: flex;
    align-items: center;
    gap: 50px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.hero-text h1 {
    font-size: 3rem !important;
    margin: 0;
    background: linear-gradient(to right, #1f2937, #4b5563);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-text h1 .year-centered-trick {
    display: block;
    text-align: center;
    width: 100%;
    margin-top: -20px;
    color: #0072ff !important;
    -webkit-text-fill-color: initial !important;
}

.hero-text h1 .year-left-trick {
    display: block;
    text-align: left;
    width: 100%;
    margin-top: -20px;
    color: #0072ff !important;
    -webkit-text-fill-color: initial !important;
}

.text-lead {
    color: #6b7280;
    font-size: 1.1rem;
    margin: -15px 0 0;
}

.page-header-logo {
    width: 100px;
    height: auto;
    opacity: 0.2;
    filter: grayscale(100%);
    transform: translateY(-12px);
    position: relative;
    top: 13px;
}

/* ============================================
   TARJETAS UNIFICADAS
   Un solo estilo para todas las tarjetas (.tech-card)
   ============================================ */

/* Estilo base de tarjeta */
.tech-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.02);
    display: block;
    /* Asegurar block para links */
    text-decoration: none;
    /* Para links */
    color: inherit;
    /* Para links */
}

.tech-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 114, 255, 0.1);
}

/* Títulos dentro de tarjetas */
.tech-card h3,
.tech-card .folder-title {
    margin: 0 0 20px 0;
    color: #1f2937;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Párrafos dentro de tarjetas */
.tech-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 10px 0;
}

/* Card Icon - Icono decorativo en tarjetas */
.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: rgba(0, 114, 255, 0.1);
    color: #0072ff;
    margin-bottom: 18px;
}

/* Listas dentro de tarjetas */
.tech-card ul {
    margin: 12px 0;
    padding-left: 20px;
    color: #374151;
    list-style-type: disc;
}

.tech-card ol {
    margin: 12px 0;
    padding-left: 20px;
    color: #374151;
    list-style-type: decimal;
}

.tech-card ul li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Section Title - Títulos de sección */
.section-title {
    font-size: 1.8rem;
    color: #1f2937;
    margin-bottom: 25px;
    font-weight: 700;
}

/* Iconos informativos */
.fas.fa-info-circle,
.fas.fa-exclamation-circle {
    color: #0072ff;
    margin-right: 8px;
}

/* --- Componentes específicos de tarjetas --- */

/* Header de tarjeta con icono grande (usado en admin) */
.link-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.link-icon-large {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0, 114, 255, 0.1) 0%, rgba(0, 198, 255, 0.1) 100%);
    border-radius: 12px;
    font-size: 2rem;
    color: #0072ff;
    flex-shrink: 0;
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 5px 0;
    word-break: break-word;
}

.link-meta {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

.link-description {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 10px 0 15px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    margin-top: 5px;
}

.link-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e5e7eb;
}

/* --- Componentes específicos de tarjetas --- */


.image-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.image-info {
    padding: 10px;
}

.image-name {
    font-size: 0.8rem;
    color: #4b5563;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px;
}

.image-delete {
    width: 100%;
    padding: 5px;
    background: #fee2e2;
    color: #b91c1c;
    border: none;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.image-delete:hover {
    background: #fecaca;
}

/* --- BOTONES UNIFICADOS --- */

/* Botón Principal con Gradiente */
.btn-principal {
    color: white;
    border: 2px solid white;
    border-radius: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    padding: 7.5px 25px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    box-shadow: 0 4px 20px rgba(0, 114, 255, 0.3);
    text-decoration: none;
}

.btn-principal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 114, 255, 0.5);
}

.btn-principal:active {
    transform: translateY(0);
}

/* Botón de Peligro */
.btn-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    border: 2px solid white;
    border-radius: 20px;
    padding: 7.5px 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(238, 90, 111, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(238, 90, 111, 0.5);
}

/* Botones Secundarios (para acciones en tarjetas) */
.btn-secondary {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-secondary.view {
    background: #f0fdf4;
    color: #16a34a;
}

.btn-secondary.view:hover {
    background: #dcfce7;
}

.btn-secondary.edit {
    background: #eff6ff;
    color: #2563eb;
}

.btn-secondary.edit:hover {
    background: #dbeafe;
}

.btn-secondary.delete {
    background: #fef2f2;
    color: #dc2626;
}

.btn-secondary.delete:hover {
    background: #fee2e2;
}

/* Botones Mini (para galería y acciones pequeñas) */
.btn-mini {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Botones Extra Pequeños */
.btn-xs {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* DESPLEGABLE */
.desplegable {
    padding-top: 10px;
    padding-bottom: 10px;
    height: 45px;
    font-size: 1.1rem;
    border-radius: 12px;
    background: #f7f7f7;
    cursor: pointer;
    min-width: 100%;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
}

/* --- TOGGLE SWITCH UNIFICADO --- */
.toggle-container {
    display: inline-flex;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 50px;
    gap: 2px;
}

.toggle-item {
    position: relative;
}

.toggle-item input {
    display: none;
}

.toggle-item span {
    padding: 6px 24px;
    border-radius: 40px;
    cursor: pointer;
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #6b7280;
}

.toggle-item input:checked+span {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 114, 255, 0.3);
}

/* Toggle Switch Compacto (para tarjetas) */
.mode-toggle-container {
    display: flex;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 8px;
    gap: 2px;
}

.mode-toggle-container .toggle-item span {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- TECH TABLE (Tablas de administración) --- */
.tech-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.tech-table thead {
    background: #f9fafb;
}

.tech-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 2px solid #e5e7eb;
}

.tech-table td {
    padding: 15px;
    border-bottom: 1px solid #f3f4f6;
    color: #4b5563;
}

.tech-table tbody tr:hover {
    background: #f9fafb;
}

.table-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* --- LINKS GRID --- */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* --- IMAGE GRID --- */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

/* --- ICON SELECTOR --- */
.icon-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.icon-preview i {
    font-size: 2rem;
    color: #0072ff;
}

.icon-preview span {
    font-size: 0.9rem;
    color: #6b7280;
    font-family: monospace;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 10px 0;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-item:hover {
    border-color: #0072ff;
    background: #eff6ff;
}

.icon-item i {
    font-size: 1.5rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.icon-item:hover i {
    color: #0072ff;
}

.icon-item span {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
}

/* --- TAB CONTENT --- */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* --- ALERT CONTAINER --- */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- INPUTS UNIFICADOS --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

input:focus,
textarea:focus,
select:focus {
    border-color: #0072ff;
    box-shadow: 0 0 0 4px rgba(0, 114, 255, 0.1);
    outline: none;
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* --- FORM GROUPS --- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    color: #1f2937;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.3s;
    font-family: 'Outfit', sans-serif;
    display: block !important;
}

.form-control:focus {
    outline: none;
    border-color: #0072ff;
    box-shadow: 0 0 0 4px rgba(0, 114, 255, 0.1);
}

textarea.form-control {
    resize: vertical;
    line-height: 1.6;
}

/* --- ALERTAS UNIFICADAS --- */
.alert {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.alert i {
    font-size: 1.2rem;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.alert-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* --- BADGES UNIFICADOS --- */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid;
}

.badge-primary {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #dbeafe;
}

.badge-success {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #bbf7d0;
}

.badge-warning {
    background: #fffbeb;
    color: #d97706;
    border-color: #fde68a;
}

.badge-danger {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.badge-gray {
    background: #f9fafb;
    color: #6b7280;
    border-color: #e5e7eb;
}

/* --- MODALES UNIFICADOS --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active,
.modal-overlay.show,
.modal-overlay.is-open,
.modal-overlay[style*="display: flex"] {
    display: flex !important;
    opacity: 1;
}

.modal-overlay.show,
.modal-overlay[style*="display: flex"] {
    display: flex !important;
}

.modal-overlay .modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-overlay .modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-overlay .modal-close-btn:hover {
    color: #1f2937;
}

.modal-overlay .modal-img {
    max-width: 100%;
    max-height: 85vh;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* Modal estándar (también usado como .modal) */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.modal.is-open {
    display: block;
}

.modal-content {
    background-color: #ffffff;
    margin: 5vh auto;
    padding: 0;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    margin: 0;
    color: #1f2937;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title i {
    color: #0072ff;
}

.close-modal {
    font-size: 32px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    color: #ef4444;
}

.modal-body {
    padding: 30px;
    flex-grow: 1;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
    margin-top: 20px;
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #9ca3af;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    color: #ef4444;
}

.btn-close-modal {
    cursor: pointer;
}

/* --- GRIDS RESPONSIVOS --- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

/* --- UTILIDADES --- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 10px;
}

.mb-2 {
    margin-bottom: 20px;
}

.mb-3 {
    margin-bottom: 30px;
}

.mb-4 {
    margin-bottom: 40px;
}

.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 10px;
}

.mt-2 {
    margin-top: 20px;
}

.mt-3 {
    margin-top: 30px;
}

.mt-4 {
    margin-top: 40px;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-normal {
    font-weight: 400;
}

/* --- MODAL DE CONFIRMACIÓN PERSONALIZADO --- */
.confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.confirm-modal-overlay.show {
    display: flex !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.confirm-modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.confirm-modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
}

.confirm-modal-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #0072ff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 114, 255, 0.2);
}

.confirm-modal-title {
    margin: 0;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
}

.confirm-modal-body {
    padding: 30px;
}

.confirm-modal-message {
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
}

.confirm-modal-footer {
    padding: 20px 30px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.confirm-modal-btn {
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Outfit', sans-serif;
}

.confirm-modal-btn-cancel {
    background: white;
    color: #6b7280;
    border: 2px solid #d1d5db;
}

.confirm-modal-btn-cancel:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    color: #374151;
}

.confirm-modal-btn-confirm {
    background: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    color: white;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 114, 255, 0.3);
}

.confirm-modal-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 114, 255, 0.4);
}

.confirm-modal-btn-confirm:active {
    transform: translateY(0);
}

/* --- RESPONSIVE --- */
/* --- GRID SYSTEM --- */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* --- RESPONSIVE --- */
@media (max-width: 1100px) {

    .grid-2,
    .grid-3,
    .grid-4,
    .links-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .page-header-logo {
        transform: translateY(0) !important;
        align-self: flex-end;
        margin-top: 5px;
    }

    .hero-text h1 {
        font-size: 2rem !important;
    }

    .tech-card {
        padding: 20px;
    }

    .desplegable {
        min-width: 100%;
    }
}

/* --- WYSIWYG EDITOR STYLES --- */
.editor-toolbar {
    display: flex;
    gap: 8px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}

.editor-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.editor-btn:hover,
.editor-btn.active {
    background: #eff6ff;
    border-color: #0072ff;
    color: #0072ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.editor-separator {
    width: 1px;
    height: 30px;
    background: #e5e7eb;
    margin: 0 8px;
}

.editor-color-picker {
    width: 42px;
    height: 42px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: white;
}

.editor-content {
    min-height: 300px;
    padding: 20px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    line-height: 1.8;
}

.editor-content:focus {
    outline: none;
    border-color: #0072ff;
    box-shadow: 0 0 0 4px rgba(0, 114, 255, 0.1);
}

.editor-content ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 10px 0;
}

.editor-content ol {
    list-style-type: decimal;
    padding-left: 20px;
    margin: 10px 0;
}

.editor-content li {
    margin-bottom: 5px;
}

/* ============================================
   RESPONSIVIDAD MÓVIL (TABLETS Y TELÉFONOS)
   ============================================ */
@media (max-width: 992px) {
    .main-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .page-header {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .hero-text h1 {
        font-size: 2rem !important;
    }

    .text-lead {
        font-size: 1rem;
    }

    .tech-card {
        padding: 15px;
        overflow-x: auto;
        /* Evita que tablas o grids rompan la tarjeta en móvil */
    }

    /* Tablas responsivas */
    table,
    .tech-table {
        min-width: 600px;
        /* Fuerza scroll si es necesario */
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        display: block;
    }

    .desplegable {
        font-size: 1rem;
        height: auto;
        padding: 8px 12px;
    }

    .btn-principal,
    .btn-secondary,
    .btn-danger {
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    .card-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-action {
        width: 100%;
        text-align: left;
    }

    .tech-card h3,
    .section-title {
        font-size: 1.3rem;
    }

    .modal-overlay .modal-content {
        padding: 20px;
        width: 95%;
    }
}