* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 1.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

#user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #4a6fc1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

button {
    background-color: #4a6fc1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 1rem;
}

button:hover {
    background-color: #3a5bb0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button.logout {
    background-color: #e74c3c;
}

button.logout:hover {
    background-color: #c0392b;
}

.back-button {
    background-color: #6c757d;
}

.back-button:hover {
    background-color: #5a6268;
}

.admin-link {
    text-decoration: none;
}

.admin-link button {
    display: flex;
    align-items: center;
    gap: 8px;
}

main {
    padding: 30px 0;
    min-height: calc(100vh - 140px);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #1e3c72;
    padding-bottom: 10px;
    border-bottom: 3px solid #4a6fc1;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.news-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.news-image {
    height: 200px;
    background-color: #ddd;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.news-content {
    padding: 20px;
}

.news-category {
    display: inline-block;
    background-color: #eef2ff;
    color: #4a6fc1;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.news-title {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #1e3c72;
}

.news-date {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-summary {
    color: #555;
    margin-bottom: 15px;
    line-height: 1.5;
}

.read-more {
    color: #4a6fc1;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

/* Vista detallada de noticia */
.news-detail-container {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.news-detail-header {
    padding: 30px;
    border-bottom: 1px solid #eee;
}

.news-detail-title {
    font-size: 2.2rem;
    margin-bottom: 15px;
    color: #1e3c72;
    line-height: 1.3;
}

.news-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.news-detail-category {
    font-size: 1rem;
}

.news-detail-author {
    color: #777;
    font-size: 0.9rem;
}

.news-detail-image {
    height: 400px;
    background-color: #ddd;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 30px;
}

.news-detail-body {
    padding: 30px;
    font-size: 1.1rem;
    line-height: 1.8;
}

.news-detail-content {
    margin-bottom: 30px;
    white-space: pre-line;
}

.news-detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-top: 1px solid #eee;
    color: #777;
}

/* Panel de administración */
.admin-panel {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #4a6fc1;
    box-shadow: 0 0 0 3px rgba(74, 111, 193, 0.1);
}

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

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.help-text {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85rem;
}

.help-text a {
    color: #4a6fc1;
    text-decoration: none;
}

.help-text a:hover {
    text-decoration: underline;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.form-actions button {
    flex: 1;
}

#preview-news {
    background-color: #6c757d;
}

#preview-news:hover {
    background-color: #5a6268;
}

.published-news {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

#news-count {
    color: #4a6fc1;
    font-size: 1.2rem;
}

/* Estilos para CKEditor 5 */
.ck-editor__editable {
    min-height: 400px;
    font-size: 16px;
    line-height: 1.6;
    padding: 20px;
}

.ck.ck-editor__main > .ck-editor__editable {
    border: 1px solid #ddd;
    border-radius: 0 0 5px 5px;
}

.ck.ck-toolbar {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
    border-bottom: none;
}

/* Asegurarse de que el textarea original esté oculto cuando CKEditor esté activo */
#news-content {
    display: none;
}

/* Para cuando CKEditor no carga */
.editor-fallback {
    min-height: 400px;
    width: 100%;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    line-height: 1.6;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Contador de caracteres */
.char-counter {
    text-align: right;
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.char-counter.warning {
    color: #f39c12;
}

.char-counter.error {
    color: #e74c3c;
    font-weight: bold;
}

/* Instrucciones del editor */
.editor-instructions {
    background-color: #e8f4fd;
    border-left: 4px solid #4a6fc1;
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 3px;
    font-size: 0.9rem;
}

.editor-instructions p {
    margin: 0;
    color: #2c3e50;
}

.editor-instructions i {
    color: #4a6fc1;
    margin-right: 8px;
}

/* Estilos para contenido enriquecido */
.news-detail-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}

.news-detail-content h1,
.news-detail-content h2,
.news-detail-content h3,
.news-detail-content h4 {
    color: #1e3c72;
    margin-top: 1.5em;
    margin-bottom: 0.8em;
    line-height: 1.3;
}

.news-detail-content h1 {
    font-size: 2rem;
    border-bottom: 2px solid #eef2ff;
    padding-bottom: 10px;
}

.news-detail-content h2 {
    font-size: 1.7rem;
}

.news-detail-content h3 {
    font-size: 1.4rem;
}

.news-detail-content p {
    margin-bottom: 1.2em;
    text-align: justify;
}

.news-detail-content strong, .news-detail-content b {
    color: #1e3c72;
    font-weight: 700;
}

.news-detail-content em, .news-detail-content i {
    font-style: italic;
}

.news-detail-content u {
    text-decoration: underline;
}

.news-detail-content ul, 
.news-detail-content ol {
    margin-left: 2em;
    margin-bottom: 1.5em;
}

.news-detail-content li {
    margin-bottom: 0.5em;
}

.news-detail-content blockquote {
    border-left: 4px solid #4a6fc1;
    padding-left: 20px;
    margin: 1.5em 0;
    font-style: italic;
    color: #555;
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-radius: 0 5px 5px 0;
}

.news-detail-content pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5em 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.news-detail-content code {
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #c7254e;
}

.news-detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.news-detail-content table th {
    background-color: #1e3c72;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.news-detail-content table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.news-detail-content table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.news-detail-content table tr:hover {
    background-color: #eef2ff;
}

.news-detail-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    display: block;
}

.news-detail-content img.align-left {
    float: left;
    margin-right: 20px;
    margin-bottom: 10px;
    max-width: 50%;
}

.news-detail-content img.align-right {
    float: right;
    margin-left: 20px;
    margin-bottom: 10px;
    max-width: 50%;
}

.news-detail-content img.align-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.news-detail-content .image-caption {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: -10px;
    margin-bottom: 1.5em;
    font-size: 0.9rem;
}

.news-detail-content a {
    color: #4a6fc1;
    text-decoration: underline;
    transition: color 0.3s;
}

.news-detail-content a:hover {
    color: #3a5bb0;
    text-decoration: none;
}

/* Videos responsivos */
.news-detail-content .video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin: 1.5em 0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.news-detail-content .video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Resumen grande */
.news-summary-large {
    font-size: 1.3rem;
    line-height: 1.6;
    color: #555;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #4a6fc1;
    border-radius: 0 5px 5px 0;
}

/* Botones de acción mejorados */
.publish-btn {
    background-color: #27ae60;
}

.publish-btn:hover {
    background-color: #229954;
}

.preview-btn {
    background-color: #f39c12;
}

.preview-btn:hover {
    background-color: #d68910;
}

.draft-btn {
    background-color: #7f8c8d;
}

.draft-btn:hover {
    background-color: #6c757d;
}

.reset-btn {
    background-color: #95a5a6;
}

.reset-btn:hover {
    background-color: #7f8c8d;
}

.refresh-btn {
    background-color: #3498db;
    padding: 8px 15px;
    font-size: 0.9rem;
}

.refresh-btn:hover {
    background-color: #2980b9;
}

/* Modal de vista previa */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    background-color: #1e3c72;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #eee;
}

/* Barra de búsqueda */
.news-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* Información del pie de página */
.footer-info {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #bdc3c7;
}

.footer-info i {
    margin: 0 3px;
}

/* Noticias destacadas */
.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 1;
}

/* Sección de login */
#login-section {
    max-width: 500px;
    margin: 50px auto;
    background-color: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
    color: #1e3c72;
}

.status-message {
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.hidden {
    display: none !important;
}

footer {
    background-color: #1e3c72;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.loading {
    text-align: center;
    padding: 30px;
    color: #666;
}

.loading i {
    font-size: 2rem;
    margin-bottom: 15px;
    color: #4a6fc1;
}

.actions-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .news-detail-title {
        font-size: 1.8rem;
    }
    
    .news-detail-image {
        height: 250px;
    }
    
    .news-detail-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .news-actions {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    .news-detail-content img.align-left,
    .news-detail-content img.align-right {
        float: none;
        margin: 1em auto;
        max-width: 100%;
    }
    
    .modal-content {
        width: 95%;
        height: 95vh;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer button {
        width: 100%;
    }
}

/* Estilos para el contenedor de video */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    margin: 20px 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ===== ESTILOS PARA VIDEOS ===== */
.video-embed {
    margin: 30px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background-color: #000;
}

.video-embed iframe {
    display: block;
    width: 100%;
    height: 400px;
    border: none;
}

.video-note {
    background-color: #f8f9fa;
    padding: 10px;
    margin: 0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

.video-note i {
    color: #ff0000;
    margin-right: 8px;
}

.video-link {
    background-color: #e8f4fd;
    padding: 15px;
    border-radius: 5px;
    border-left: 4px solid #4a6fc1;
    margin: 20px 0;
}

.video-link a {
    color: #4a6fc1;
    font-weight: bold;
    text-decoration: none;
}

.video-link a:hover {
    text-decoration: underline;
}

/* Indicador de video en tarjetas de noticias */
.has-video::after {
    content: '🎬';
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1;
}

.news-image {
    height: 200px;
    background-color: #ddd;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.news-detail-image {
    height: 400px;
    background-color: #ddd;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* Estilos para mensajes de estado */
.publish-message {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
    padding: 15px;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    animation: slideIn 0.3s ease;
}

.publish-message.success {
    background-color: #27ae60;
}

.publish-message.error {
    background-color: #e74c3c;
}

.publish-message.warning {
    background-color: #f39c12;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Controles de filtro en admin */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.category-filter-admin {
    display: flex;
    align-items: center;
}

/* Indicador de categoría activa */
.category-active {
    background-color: #4a6fc1 !important;
    color: white !important;
}

/* Badge para mostrar categoría en vista detalle */
.category-badge {
    display: inline-flex;
    align-items: center;
    background-color: #4a6fc1;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-right: 10px;
    font-weight: 600;
}

.category-badge i {
    margin-right: 5px;
}

/* Estadísticas de filtro */
.filter-stats {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    font-size: 0.9rem;
    color: #666;
}

/* Mejorar visualización de filtros activos */
.filter-active {
    border-color: #27ae60 !important;
    background-color: #f8fff9 !important;
}

.search-active {
    border-color: #3498db !important;
    background-color: #f0f8ff !important;
}

/* ===== ESTILOS PARA CATEGORÍAS CON RECUADROS ===== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.category-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.category-card-header {
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.category-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.category-card-title {
    font-size: 1.4rem;
    margin: 0;
    flex-grow: 1;
}

.category-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.category-card-body {
    padding: 20px;
    flex-grow: 1;
}

.category-news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.category-news-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s;
    border: 1px solid #eee;
}

.category-news-item:hover {
    background: #e9ecef;
    border-color: #4a6fc1;
}

.category-news-image {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.category-news-content {
    flex-grow: 1;
}

.category-news-title {
    font-size: 0.95rem;
    margin: 0 0 5px 0;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-news-date {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.category-card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.view-category-btn {
    width: 100%;
    padding: 12px;
    background: #4a6fc1;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.view-category-btn:hover {
    background: #3a5bb0;
}

/* Responsive para categorías */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .category-card-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .category-card-title {
        font-size: 1.2rem;
    }
    
    .category-news-item {
        flex-direction: column;
    }
    
    .category-news-image {
        width: 100%;
        height: 120px;
    }
}

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

.category-card {
    animation: fadeIn 0.4s ease-out;
}

/* Estilos para la vista de categoría detallada */
.category-actions {
    display: flex;
    gap: 10px;
}

/* Ajustes para el buscador en vista de categorías */
.filter-section {
    margin-top: 10px;
}

/* Mejoras para los mensajes de no resultados */
.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    margin: 20px 0;
}

.no-results-message i {
    font-size: 3rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

.no-results-message h3 {
    color: #495057;
    margin-bottom: 10px;
}

.no-results-message p {
    color: #6c757d;
    margin-bottom: 20px;
}

/* Estilos para el grid de noticias en vista de categoría */
#category-news-container.news-grid {
    margin-top: 20px;
}

/* ===== NUEVOS ESTILOS PARA FUNCIONALIDAD DE IMÁGENES ===== */

/* Contenedor de entrada de imagen */
.image-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.image-input-container input {
    flex: 1;
}

.test-url-btn {
    background-color: #3498db;
    padding: 10px 15px;
    white-space: nowrap;
}

.test-url-btn:hover {
    background-color: #2980b9;
}

/* Vista previa de imagen */
.image-preview-container {
    margin: 20px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.image-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.image-preview-header span {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

.remove-btn {
    background-color: #e74c3c;
    padding: 5px 10px;
    font-size: 0.9rem;
}

.remove-btn:hover {
    background-color: #c0392b;
}

.image-preview {
    text-align: center;
}

.preview-success, .preview-error {
    padding: 20px;
}

.preview-success i {
    color: #27ae60;
    font-size: 3rem;
    margin-bottom: 15px;
}

.preview-error i {
    color: #e74c3c;
    font-size: 3rem;
    margin-bottom: 15px;
}

.preview-img {
    width: 100%;
    height: 200px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.preview-info {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: left;
}

.preview-info p {
    margin: 5px 0;
    font-size: 0.9rem;
}

.error-tip {
    background-color: #fff3cd;
    padding: 10px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: #856404;
    border-left: 3px solid #ffc107;
}

/* Sección de servicios recomendados */
.image-services-section {
    margin: 25px 0;
    padding: 20px;
    background-color: #e8f4fd;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.image-services-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.image-services-section h4 i {
    color: #3498db;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.service-card {
    display: flex;
    background: white;
    border-radius: 8px;
    padding: 15px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border: 1px solid #dee2e6;
    align-items: center;
    gap: 15px;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.service-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.service-info h5 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1rem;
}

.service-info p {
    margin: 0;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Sección de imágenes de prueba */
.test-images-section {
    margin: 25px 0;
    padding: 20px;
    background-color: #f9f7fd;
    border-radius: 10px;
    border-left: 4px solid #9b59b6;
}

.test-images-section h4 {
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.test-images-section h4 i {
    color: #9b59b6;
}

.test-images-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.test-img-btn {
    background-color: #9b59b6;
    padding: 10px 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 150px;
    justify-content: center;
}

.test-img-btn:hover {
    background-color: #8e44ad;
}

/* Responsive para nuevas secciones */
@media (max-width: 768px) {
    .image-input-container {
        flex-direction: column;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .test-images-buttons {
        flex-direction: column;
    }
    
    .test-img-btn {
        min-width: 100%;
    }
    
    .service-card {
        flex-direction: column;
        text-align: center;
    }
    
    .service-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
}

/* Estilo para mensajes de error con enlaces */
.error-message-link {
    color: #4a6fc1;
    text-decoration: underline;
    font-weight: bold;
}

.error-message-link:hover {
    text-decoration: none;
    color: #3a5bb0;
}

/* ===== ESTILOS PARA ADMINISTRACIÓN ===== */

/* Toggle de vista */
.view-toggle {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.view-toggle-btn {
    padding: 10px 20px;
    background-color: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.view-toggle-btn.active {
    background-color: #4a6fc1;
    color: white;
    border-color: #4a6fc1;
}

.view-toggle-btn:hover:not(.active) {
    background-color: #e9ecef;
}

/* Cabecera de categoría detallada en admin */
.category-detail-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a6fc1;
}

.category-detail-header h4 {
    margin: 0;
    color: #1e3c72;
    font-size: 1.5rem;
}

/* Acciones en tarjetas de categoría admin */
.category-news-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.category-news-actions button {
    padding: 5px 10px;
    font-size: 0.8rem;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.category-news-actions button.edit-news-admin {
    background-color: #3498db;
}

.category-news-actions button.delete-news-admin {
    background-color: #e74c3c;
}

.category-news-actions button:hover {
    opacity: 0.9;
}

/* Item de noticia en categoría admin */
.category-news-item-admin {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background-color 0.3s;
    border: 1px solid #eee;
    position: relative;
}

.category-news-item-admin:hover {
    background: #e9ecef;
    border-color: #4a6fc1;
}

/* Botones de filtro en admin */
.admin-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.category-filter-admin {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
    color: #333;
    font-size: 0.9rem;
    min-width: 180px;
    cursor: pointer;
}

/* ===== ESTILOS PARA BÚSQUEDA EN CATEGORÍA ===== */
.category-search-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a6fc1;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.category-search-section .search-box {
    flex-grow: 1;
    min-width: 300px;
}

.category-search-section .search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 2px solid #4a6fc1;
    border-radius: 8px;
    font-size: 1rem;
}

.category-search-section .search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #4a6fc1;
}

/* Resultados de búsqueda en categoría */
.category-search-results {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #666;
}

.category-search-results strong {
    color: #4a6fc1;
}

/* Mensaje de sin resultados en categoría */
.category-no-results {
    text-align: center;
    padding: 40px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    margin: 20px 0;
}

.category-no-results i {
    font-size: 2.5rem;
    color: #adb5bd;
    margin-bottom: 15px;
}

.category-no-results h4 {
    color: #495057;
    margin-bottom: 10px;
}

/* Botón para volver a mostrar todas las noticias de la categoría */
.back-to-all-category {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 10px auto;
}

.back-to-all-category:hover {
    background-color: #5a6268;
}

/* Botón para limpiar búsqueda en vista pública */
.clear-filter-btn {
    background: none;
    border: none;
    color: #e74c3c;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.clear-filter-btn:hover {
    background-color: rgba(231, 76, 60, 0.1);
}

/* ===== ESTILOS MEJORADOS PARA SUBCATEGORÍAS (MÁS ESTÉTICOS) ===== */

/* Badge de subcategoría en tarjetas - VERSIÓN MEJORADA */
.news-subcategory-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    margin: 5px 0 8px 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
    border: none;
    text-transform: uppercase;
}

/* Lista mini de subcategorías en tarjetas de categoría - VERSIÓN MEJORADA */
.subcategories-mini-list {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px dashed #e0e7ff;
    background: linear-gradient(to bottom, transparent, #fafbff);
    border-radius: 0 0 8px 8px;
}

.subcategories-label {
    font-size: 0.8rem;
    color: #4a5568;
    margin-right: 10px;
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subcategory-mini-btn {
    background: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    border-radius: 25px;
    font-size: 0.75rem;
    margin: 0 6px 8px 0;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.subcategory-mini-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px) scale(1.05);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.more-subcats {
    font-size: 0.75rem;
    color: #718096;
    margin-left: 8px;
    font-weight: 500;
    background: #edf2f7;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

/* Filtro de subcategorías en vista detalle - VERSIÓN MEJORADA */
.subcategory-filter-container {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f5f7ff 0%, #ffffff 100%);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.subcategory-filter {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.subcategory-filter .filter-label {
    font-weight: 700;
    color: #2d3748;
    font-size: 0.95rem;
    background: white;
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.subcategory-filter .filter-label i {
    color: #667eea;
    margin-right: 8px;
}

.subcategory-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subcat-filter-btn {
    background: white;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.subcat-filter-btn:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    transform: translateY(-1px);
}

.subcat-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Resultados con filtros activos - VERSIÓN MEJORADA */
.category-search-results.active-filters {
    background: linear-gradient(135deg, #ebf4ff 0%, #ffffff 100%);
    border-left: 4px solid #667eea;
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.category-search-results.active-filters i {
    color: #667eea;
}

/* Subcategoría en vista detalle - VERSIÓN MEJORADA */
.news-detail-subcategory {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    color: #4a5568;
    font-size: 0.95rem;
    font-weight: 500;
    margin-left: 10px;
    padding: 4px 12px;
    border-radius: 30px;
    display: inline-block;
    border: 1px solid #667eea40;
}

.news-detail-subcategory::before {
    content: '›';
    margin-right: 8px;
    color: #667eea;
    font-weight: bold;
}

/* Estilos para news-card-header en admin */
.news-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.news-card-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.news-card-actions button {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.edit-news {
    background-color: #3498db;
}

.delete-news {
    background-color: #e74c3c;
}

/* Ajustes responsive */
@media (max-width: 768px) {
    .admin-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .category-filter-admin {
        width: 100%;
        min-width: unset;
    }
    
    .view-toggle {
        flex-direction: column;
    }
    
    .category-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-search-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .category-search-section .search-box {
        min-width: 100%;
    }
    
    .subcategory-filter {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .subcategory-buttons {
        width: 100%;
    }
    
    .subcat-filter-btn {
        flex: 1;
        text-align: center;
    }
}
/* ===== MODO OSCURO ===== */

/* Botón de toggle */
.dark-mode-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dark-mode-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: none;
    box-shadow: none;
}

/* Variables de modo oscuro */
body.dark-mode {
    background-color: #0f1117;
    color: #e2e8f0;
}

body.dark-mode header {
    background: linear-gradient(135deg, #0d1b3e 0%, #162150 100%);
}

body.dark-mode main {
    background-color: #0f1117;
}

body.dark-mode footer {
    background-color: #0d1117;
    color: #94a3b8;
}

/* Tarjetas de categoría */
body.dark-mode .category-card,
body.dark-mode .news-card,
body.dark-mode .news-detail-container,
body.dark-mode .admin-panel {
    background-color: #1e2433;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    border: 1px solid #2d3748;
}

body.dark-mode .category-card-body {
    background-color: #1e2433;
}

body.dark-mode .category-news-item {
    background-color: #252d3d;
    border-color: #2d3748;
}

body.dark-mode .category-news-item:hover {
    background-color: #2d3748;
    border-color: #4a6fc1;
}

body.dark-mode .category-news-title,
body.dark-mode .news-title,
body.dark-mode .news-detail-title,
body.dark-mode .section-title {
    color: #93c5fd;
}

body.dark-mode .news-summary,
body.dark-mode .news-detail-content {
    color: #cbd5e1;
}

body.dark-mode .news-date,
body.dark-mode .news-detail-author,
body.dark-mode .news-detail-footer {
    color: #94a3b8;
}

body.dark-mode .news-detail-header,
body.dark-mode .news-detail-footer {
    border-color: #2d3748;
}

/* Barra de búsqueda */
body.dark-mode .search-box input,
body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
    background-color: #1e2433;
    color: #e2e8f0;
    border-color: #374151;
}

body.dark-mode .search-box input::placeholder {
    color: #64748b;
}

body.dark-mode .filter-section,
body.dark-mode .actions-bar {
    background-color: transparent;
}

/* Sección de búsqueda en categoría */
body.dark-mode .category-search-section {
    background-color: #1a2035;
    border-left-color: #4a6fc1;
}

body.dark-mode .category-search-section .search-box input {
    background-color: #252d3d;
    border-color: #4a6fc1;
    color: #e2e8f0;
}

/* Subcategorías */
body.dark-mode .subcategory-filter-container {
    background: linear-gradient(135deg, #1a2035 0%, #1e2433 100%);
    border-color: rgba(102, 126, 234, 0.3);
}

body.dark-mode .subcat-filter-btn,
body.dark-mode .subcategory-mini-btn {
    background-color: #252d3d;
    color: #cbd5e1;
    border-color: #374151;
}

body.dark-mode .subcat-filter-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-mode .subcat-filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-mode .subcategory-filter .filter-label {
    background-color: #252d3d;
    border-color: #374151;
    color: #e2e8f0;
}

/* Estadísticas de filtro */
body.dark-mode .filter-stats {
    color: #94a3b8;
}

body.dark-mode .subcategories-mini-list {
    border-top-color: #2d3748;
    background: linear-gradient(to bottom, transparent, #1e2433);
}

body.dark-mode .subcategories-label {
    color: #94a3b8;
}

/* Botones de volver */
body.dark-mode .back-button {
    background-color: #374151;
    color: #e2e8f0;
}

body.dark-mode .back-button:hover {
    background-color: #4b5563;
}

/* Mensajes de sin resultados */
body.dark-mode .no-results-message,
body.dark-mode .category-no-results {
    background-color: #1e2433;
    border-color: #374151;
    color: #94a3b8;
}

/* Loading */
body.dark-mode .loading {
    color: #94a3b8;
}

/* Ícono de luna/sol en el botón */
body.dark-mode #dark-mode-toggle .fa-moon::before {
    content: "\f185"; /* sol */
}

/* ===== AVISOS URGENTES ===== */
#urgent-alerts-wrapper {
    width: 100%;
}

.alerts-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
}

.alert-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 12px;
    margin-bottom: 12px;
    position: relative;
    animation: alertSlideIn 0.4s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

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

.alert-card.emergency {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 100%);
    border-left: 5px solid #e74c3c;
}

.alert-card.warning {
    background: linear-gradient(135deg, #fffbf0 0%, #ffecc0 100%);
    border-left: 5px solid #e67e22;
}

.alert-card.info {
    background: linear-gradient(135deg, #f0f7ff 0%, #d0e8ff 100%);
    border-left: 5px solid #2980b9;
}

.alert-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-card.emergency .alert-icon { color: #e74c3c; }
.alert-card.warning  .alert-icon { color: #e67e22; }
.alert-card.info     .alert-icon { color: #2980b9; }

.alert-body { flex: 1; }

.alert-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.alert-card.emergency .alert-label { color: #c0392b; }
.alert-card.warning  .alert-label { color: #d35400; }
.alert-card.info     .alert-label { color: #1a6fa0; }

.alert-message {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.4;
}

.alert-expires {
    font-size: 0.78rem;
    color: #718096;
    margin-top: 5px;
}

/* Botones flotantes */
.float-btn {
    position: fixed;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 900;
    text-decoration: none;
}

.float-btn:hover {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.whatsapp-float-btn {
    bottom: 90px;
    right: 24px;
    background: #25d366;
    color: white;
}

.report-float-btn {
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, #e67e22, #e74c3c);
    color: white;
}

/* Modal reporte vecino */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.modal-box {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.modal-header h3 {
    font-size: 1.2rem;
    color: #1e3c72;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #999;
    padding: 4px 8px;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: #e74c3c;
    background: none;
    transform: none;
    box-shadow: none;
}

.modal-subtitle {
    font-size: 0.88rem;
    color: #718096;
    margin-bottom: 20px;
    line-height: 1.4;
}

.char-counter {
    font-size: 0.78rem;
    color: #999;
    text-align: right;
    display: block;
    margin-top: 4px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.modal-actions button { flex: 1; }

/* Admin tabs */
.admin-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 28px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
}

.admin-tab {
    background: none;
    border: none;
    color: #718096;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.2s;
}

.admin-tab:hover {
    color: #1e3c72;
    background: none;
    transform: none;
    box-shadow: none;
}

.admin-tab.active {
    color: #1e3c72;
    border-bottom-color: #4a6fc1;
    background: none;
    box-shadow: none;
    transform: none;
}

.badge {
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Tarjetas de reporte de vecinos en admin */
.report-card {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 14px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.report-card-body { flex: 1; }

.report-card-name {
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
}

.report-card-phone {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 8px;
}

.report-card-message {
    color: #4a5568;
    line-height: 1.5;
    margin-bottom: 10px;
}

.report-card-date {
    font-size: 0.8rem;
    color: #a0aec0;
}

.report-card-actions {
    display: flex;
    gap: 8px;
    flex-direction: column;
}

.report-card-actions button {
    padding: 7px 14px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.btn-approve { background: #27ae60; }
.btn-approve:hover { background: #1e8449; }
.btn-reject  { background: #e74c3c; }
.btn-reject:hover  { background: #c0392b; }

/* Avisos en admin */
.alert-admin-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 10px;
}

.alert-admin-card .alert-admin-msg { flex: 1; font-weight: 500; color: #2d3748; }
.alert-admin-card .alert-admin-type { font-size: 0.8rem; color: #718096; }
.btn-delete-alert { background: #e74c3c; padding: 6px 12px; font-size: 0.82rem; }
.btn-delete-alert:hover { background: #c0392b; }

/* Modo oscuro — nuevos elementos */
body.dark-mode .modal-box,
body.dark-mode .report-card,
body.dark-mode .alert-admin-card {
    background: #1e2433;
    border-color: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .modal-header h3,
body.dark-mode .report-card-name,
body.dark-mode .alert-admin-msg {
    color: #93c5fd;
}

body.dark-mode .modal-subtitle,
body.dark-mode .report-card-phone,
body.dark-mode .report-card-date,
body.dark-mode .alert-admin-type { color: #94a3b8; }

body.dark-mode .report-card-message,
body.dark-mode .alert-message { color: #cbd5e1; }

body.dark-mode .admin-tabs { border-bottom-color: #2d3748; }
body.dark-mode .admin-tab { color: #94a3b8; }
body.dark-mode .admin-tab.active,
body.dark-mode .admin-tab:hover { color: #93c5fd; background: none; }

body.dark-mode .alert-card.emergency { background: linear-gradient(135deg, #2d1515 0%, #3d1a1a 100%); }
body.dark-mode .alert-card.warning  { background: linear-gradient(135deg, #2d2010 0%, #3d2a10 100%); }
body.dark-mode .alert-card.info     { background: linear-gradient(135deg, #101a2d 0%, #102040 100%); }
body.dark-mode .alert-message { color: #e2e8f0; }

@media (max-width: 600px) {
    .float-btn { width: 50px; height: 50px; font-size: 1.2rem; }
    .whatsapp-float-btn { bottom: 86px; right: 16px; }
    .report-float-btn { bottom: 20px; right: 16px; }
    .admin-tabs { gap: 4px; }
    .admin-tab { padding: 8px 12px; font-size: 0.85rem; }
    .report-card { flex-direction: column; }
    .report-card-actions { flex-direction: row; }
}

/* ===== BOTONES PWA EN HEADER ===== */
.pwa-btn {
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.install-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.4);
}

.install-btn:hover {
    background: rgba(255,255,255,0.28);
    transform: none;
    box-shadow: none;
}

.update-btn {
    background: #f39c12;
    color: white;
    animation: pulse 2s infinite;
}

.update-btn:hover {
    background: #d68910;
    transform: none;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(243,156,18,0.5); }
    50%       { box-shadow: 0 0 0 6px rgba(243,156,18,0); }
}

@media (max-width: 600px) {
    .install-btn span, .pwa-btn span { display: none; }
    .pwa-btn { padding: 7px 10px; }
}
