:root {
    --azul-institucional: #003366;
    --azul-secundario: #0d4d8b;
    --verde-bienestar: #28a745;
    --amarillo-pueblo: #ffc107;
    --gris-fondo: #f4f7fb;
    --texto-oscuro: #263238;
    --blanco: #ffffff;
    --rojo-alerta: #c62828;
    --sombra: 0 8px 24px rgba(0,0,0,0.12);
    --radio: 14px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gris-fondo);
    color: var(--texto-oscuro);
}

.top-alert {
    background: linear-gradient(90deg, var(--rojo-alerta), #ef5350);
    color: white;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
}

header {
    background: #fff;
    border-bottom: 4px solid var(--azul-institucional);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-contenedor {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 70px;
    object-fit: contain;
}

.titulo-alcaldia h1 {
    font-size: 1.35rem;
    margin: 0;
    color: var(--azul-institucional);
}

.titulo-alcaldia p {
    margin: 4px 0 0;
    color: #607d8b;
}

nav {
    background: var(--azul-institucional);
    padding: 12px 5%;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 14px;
    border-radius: 8px;
}

nav a:hover {
    background: rgba(255,255,255,0.16);
}

.hero-slider {
    position: relative;
    width: 100%;
    min-height: 78vh;
    overflow: hidden;
    background: #001b33;
}

.slides {
    position: relative;
    width: 100%;
    height: 78vh;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .8s ease-in-out;
    background-size: 70%;
    background-repeat: no-repeat;
    background-position: center center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 1;
}

.slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(0,32,64,.82), rgba(0,0,0,.45));
}

.slide-content {
    position: relative;
    z-index: 2;
    width: min(900px, 90%);
    color: white;
    text-align: center;
}

.slide-content h2 {
    font-size: clamp(2rem, 5vw, 3.4rem);
    margin-bottom: 15px;
}

.slide-content p {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: 24px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-principal,
.btn-secundario,
.btn-accion,
.btn-login {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.btn-principal { background: var(--verde-bienestar); color: white; }
.btn-secundario { background: rgba(255,255,255,.15); color: white; border: 1px solid rgba(255,255,255,.35); }
.btn-azul, .btn-login { background: var(--azul-institucional); color: white; }
.btn-verde { background: var(--verde-bienestar); color: white; }

.slider-controls {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    z-index: 3;
    pointer-events: none;
}

.slider-btn {
    pointer-events: all;
    background: rgba(255,255,255,.2);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
}

.slider-dots {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    cursor: pointer;
}

.dot.active { background: white; }

.quick-access,
.preview-list {
    display: grid;
    gap: 18px;
}

.quick-access {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    padding: 30px 5%;
}

.quick-card,
.admin-card,
.preview-item {
    background: white;
    border-radius: var(--radio);
    box-shadow: var(--sombra);
}

.quick-card {
    padding: 22px;
    text-align: center;
    border-top: 5px solid var(--azul-institucional);
}

.seccion-general,
.admin-banners {
    padding: 45px 5%;
}

.section-title {
    text-align: center;
    margin-bottom: 28px;
}

.section-title h2 {
    margin: 0 0 10px;
    color: var(--azul-institucional);
    font-size: 2rem;
}

.section-title p {
    margin: 0;
    color: #607d8b;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--sombra);
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    margin: 10px 0 16px;
    border: 1px solid #cfd8dc;
    border-radius: 10px;
    font-size: .96rem;
}

.alert-error {
    background: #ffebee;
    color: #b71c1c;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.admin-header {
    background: white;
    padding: 20px 5%;
    border-bottom: 1px solid #dde5ee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 24px;
}

.admin-card {
    border: 1px solid #dde5ee;
    padding: 24px;
    background: #f9fbfd;
}

.preview-list {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-top: 18px;
}

.preview-item {
    overflow: hidden;
    border: 1px solid #d8e2ea;
}

.preview-item img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    display: block;
}

.preview-item span {
    display: block;
    padding: 10px;
    font-size: .86rem;
    text-align: center;
}

footer {
    background: #0e1720;
    color: #d3d9df;
    text-align: center;
    padding: 28px 20px;
    border-top: 4px solid var(--amarillo-pueblo);
}

@media (max-width: 900px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .slides { height: 70vh; }
    .hero-slider { min-height: 70vh; }
}

.breaking-bar {
    display: flex;
    align-items: center;
    width: 100%;
    background: #8e0000;
    color: #fff;
    overflow: hidden;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.breaking-label {
    background: #d50000;
    color: #fff;
    font-weight: 800;
    padding: 12px 18px;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.breaking-track {
    overflow: hidden;
    flex: 1;
    position: relative;
    height: 44px;
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.06);
}

.breaking-content {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation: tickerMove 38s linear infinite;
}

.breaking-content:hover {
    animation-play-state: paused;
}

.breaking-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding-right: 36px;
    font-size: 0.95rem;
}

.breaking-item strong {
    color: #ffe082;
    margin-right: 6px;
}

.breaking-item::after {
    content: "●";
    margin-left: 36px;
    color: rgba(255,255,255,0.55);
}

@keyframes tickerMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}