:root {
    --navy: #08234b;
    --navy-2: #0f4778;
    --blue: #1d6fe3;
    --green: #13965a;
    --purple: #7134c7;
    --orange: #ff8b26;
    --ink: #061943;
    --muted: #55657f;
    --line: #dce6f1;
    --panel: rgba(255, 255, 255, .9);
    --shadow: 0 16px 40px rgba(8, 35, 75, .12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: #f4f8fc;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.portal-shell {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.portal-header {
    background: linear-gradient(90deg, var(--navy), var(--navy-2));
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 10px 26px rgba(3, 18, 44, .22);
}

.header-grid {
    min-height: 76px;
    display: grid;
    grid-template-columns: 1.5fr 1.35fr 2fr 1.45fr;
    gap: 24px;
    align-items: center;
}

.brand,
.area-brand,
.date-box,
.top-nav {
    display: flex;
    align-items: center;
}

.brand {
    gap: 14px;
}

.brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
}

.brand strong,
.area-brand strong {
    display: block;
    font-size: 1rem;
    line-height: 1.1;
    text-transform: uppercase;
}

.brand small,
.area-brand small {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, .78);
}

.area-brand {
    gap: 12px;
    border-left: 1px solid rgba(255, 255, 255, .35);
    padding-left: 24px;
}

.area-icon {
    font-size: 2rem;
}

.top-nav {
    justify-content: center;
    gap: 8px;
}

.top-nav a {
    padding: 12px 10px;
    border-radius: 6px;
    font-size: .95rem;
    color: rgba(255, 255, 255, .92);
}

.top-nav a:hover {
    background: rgba(255, 255, 255, .12);
}

.top-nav i {
    margin-right: 6px;
}

.date-box {
    gap: 12px;
    border-left: 1px solid rgba(255, 255, 255, .2);
    padding-left: 24px;
    font-size: .9rem;
    line-height: 1.4;
}

.date-box i {
    width: 42px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, .75);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
}

.hero {
    min-height: 330px;
    background:
        linear-gradient(90deg, rgba(247, 250, 255, .98) 0%, rgba(247, 250, 255, .82) 42%, rgba(247, 250, 255, .28) 72%),
        url("../img/cajamarca.jpg") center/cover no-repeat;
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr);
    gap: 36px;
    align-items: center;
    padding: 42px 0 56px;
}

.hero-copy p {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 700;
}

.hero-copy h1 {
    margin: 4px 0 0;
    font-size: clamp(2.3rem, 6vw, 4.6rem);
    line-height: .98;
    letter-spacing: 0;
}

.hero-copy h2 {
    margin: 8px 0;
    font-size: clamp(1.1rem, 2vw, 1.55rem);
}

.hero-copy > span {
    display: block;
    max-width: 760px;
    font-size: 1.05rem;
}

.search-box {
    margin-top: 24px;
    width: min(520px, 100%);
    height: 48px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 10px 26px rgba(8, 35, 75, .08);
}

.search-box i {
    font-size: 1.2rem;
}

.search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
}

.quote-box {
    justify-self: start;
    max-width: 330px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 20px 22px;
    border-radius: 16px;
    color: #1a365d;
    background: rgba(255, 255, 255, .72);
    backdrop-filter: blur(8px);
}

.quote-box i {
    color: #0f5aa0;
}

.systems-section {
    margin-top: -34px;
    position: relative;
    z-index: 2;
}

.systems-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.system-card,
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.system-card {
    min-height: 238px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.system-card[hidden] {
    display: none;
}

.system-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.system-icon,
.add-icon {
    width: 66px;
    height: 66px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 2rem;
}

.icon-azul { background: linear-gradient(135deg, #2f80ed, #0b56c5); }
.icon-verde { background: linear-gradient(135deg, #22b573, #087f47); }
.icon-morado { background: linear-gradient(135deg, #9254de, #5b2bbd); }
.icon-naranja { background: linear-gradient(135deg, #ffa93a, #ff7118); }
.icon-gris { background: linear-gradient(135deg, #7b8ba3, #526070); }

.status {
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .76rem;
    white-space: nowrap;
    background: #fff;
}

.status::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-radius: 50%;
    background: #8ea0b8;
}

.status-activo::before { background: #18aa62; }
.status-desarrollo::before { background: #f3b51b; }
.status-planeacion::before { background: #7b8ba3; }
.status-inactivo::before { background: #c94848; }

.system-card h3 {
    margin: 14px 0 4px;
    font-size: 1.25rem;
}

.system-card small {
    color: var(--muted);
}

.system-card p {
    margin: 10px 0 18px;
    color: #19385f;
    line-height: 1.35;
    flex: 1;
}

.system-action,
.outline-action,
.support-action {
    height: 44px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    font-weight: 700;
    text-transform: uppercase;
}

.action-azul { color: #fff; background: linear-gradient(135deg, #2f80ed, #0b56c5); }
.action-verde { color: #fff; background: linear-gradient(135deg, #22b573, #087f47); }
.action-morado { color: #fff; background: linear-gradient(135deg, #9254de, #5b2bbd); }
.action-naranja { color: #fff; background: linear-gradient(135deg, #ffa93a, #ff7118); }
.action-gris,
.action-muted {
    color: #29425f;
    background: #eef3f8;
    border: 1px solid #d6e2ee;
}

.add-card {
    align-items: center;
    text-align: center;
    border-style: dashed;
    border-color: #9ec1eb;
}

.add-icon {
    color: #0c59b0;
    background: #dceafa;
}

.outline-action {
    width: 100%;
    color: #0b56a2;
    border: 1px solid #1d6fe3;
    background: #fff;
}

.outline-action.disabled {
    border-color: #d3dfed;
    color: #75859b;
}

.info-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.1fr;
    gap: 14px;
    margin-top: 14px;
    margin-bottom: 14px;
}

.panel {
    padding: 18px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.panel-heading h3 {
    margin: 0;
    font-size: 1.12rem;
}

.panel-heading i {
    margin-right: 8px;
    color: #174f90;
}

.panel-heading a {
    color: #0b56a2;
    font-size: .95rem;
}

.news-list {
    display: grid;
    gap: 0;
}

.news-item {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid #e6edf5;
}

.news-item time {
    width: 50px;
    min-height: 50px;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 8px;
    color: #0d3a73;
    background: #edf3fa;
}

.news-item time strong {
    font-size: 1.05rem;
}

.news-item time span {
    font-size: .75rem;
    font-weight: 700;
}

.news-item strong,
.news-item small {
    display: block;
}

.news-item small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.35;
}

.support-panel p {
    color: var(--muted);
}

.support-panel ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 20px;
    display: grid;
    gap: 12px;
}

.support-panel li {
    display: grid;
    grid-template-columns: 28px 1fr;
    align-items: start;
    color: #123b66;
}

.support-panel li i {
    color: #174f90;
}

.support-action {
    width: 100%;
    color: #0b4d94;
    border: 1px solid #8bb7ee;
    background: #fff;
    text-transform: none;
}

.links-panel {
    display: grid;
    align-content: start;
    gap: 8px;
}

.links-panel .panel-heading {
    margin-bottom: 4px;
}

.links-panel a {
    min-height: 36px;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #174f90;
    background: #f1f5fa;
}

.empty-text {
    color: var(--muted);
}

.portal-footer {
    color: #fff;
    background: linear-gradient(90deg, var(--navy), var(--navy-2));
}

.footer-grid {
    min-height: 86px;
    display: grid;
    grid-template-columns: 1.4fr 1fr auto;
    gap: 24px;
    align-items: center;
}

.footer-grid strong {
    text-align: center;
    font-style: italic;
    font-weight: 500;
}

.footer-grid img {
    width: 170px;
    height: 54px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
}

@media (max-width: 1100px) {
    .header-grid {
        grid-template-columns: 1fr 1fr;
        padding: 12px 0;
    }

    .top-nav {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .date-box {
        border-left: 0;
        padding-left: 0;
    }

    .systems-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .links-panel {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .portal-shell {
        width: min(100% - 24px, 1180px);
    }

    .header-grid,
    .hero-content,
    .systems-grid,
    .info-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .area-brand {
        border-left: 0;
        padding-left: 0;
    }

    .date-box {
        display: none;
    }

    .top-nav {
        gap: 4px;
    }

    .top-nav a {
        padding: 9px 8px;
        font-size: .9rem;
    }

    .hero {
        min-height: auto;
        background:
            linear-gradient(180deg, rgba(247, 250, 255, .98) 0%, rgba(247, 250, 255, .8) 70%),
            url("../img/cajamarca.jpg") center/cover no-repeat;
    }

    .hero-content {
        gap: 20px;
        padding: 30px 0 46px;
    }

    .quote-box {
        max-width: none;
    }

    .systems-section {
        margin-top: -24px;
    }

    .system-card {
        min-height: 0;
    }

    .footer-grid {
        padding: 18px 0;
        text-align: center;
    }

    .footer-grid img {
        margin: 0 auto;
    }
}
