:root {
    --navy: #2a3546;
    --navy-deep: #1e2735;
    --green: #5d8036;
    --green-dark: #4c6b2c;
    --white: #ffffff;
    --bg: #f4f6f8;
    --text: #253042;
    --muted: #728093;
    --line: #e5e9ee;
    --danger: #a53c3c;
    --danger-bg: #fff1f1;
    --info: #315f82;
    --info-bg: #eef7ff;
    --shadow: 0 24px 70px rgba(28, 39, 55, .16);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
}

/* ============================================================
   LOGIN
============================================================ */

.access-page {
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 10%, rgba(93,128,54,.16), transparent 34%),
        radial-gradient(circle at 88% 86%, rgba(255,255,255,.08), transparent 32%),
        linear-gradient(145deg, var(--navy-deep), var(--navy));
}

.portal-background {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    opacity: .9;
}

.orb-one {
    width: 320px;
    height: 320px;
    left: -110px;
    top: -90px;
    background: rgba(93,128,54,.26);
}

.orb-two {
    width: 430px;
    height: 430px;
    right: -160px;
    bottom: -180px;
    background: rgba(255,255,255,.07);
}

.orb-three {
    width: 170px;
    height: 170px;
    right: 10%;
    top: 12%;
    background: rgba(93,128,54,.13);
}

.access-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    width: min(100% - 32px, 470px);
    margin: 0 auto;
    padding: 32px 0 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.back-home {
    align-self: flex-start;
    margin-bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.78);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.back-home:hover {
    color: #fff;
}

.access-card {
    padding: 34px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 28px;
    background: rgba(255,255,255,.97);
    box-shadow: var(--shadow);
}

.access-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 22px;
}

.access-brand img {
    max-width: 220px;
    width: 72%;
    height: auto;
    object-fit: contain;
}

.security-badge {
    width: fit-content;
    margin: 0 auto 16px;
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(93,128,54,.18);
    border-radius: 999px;
    background: rgba(93,128,54,.08);
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.access-card h1 {
    margin: 0;
    color: var(--navy);
    text-align: center;
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1.08;
    letter-spacing: -.03em;
}

.access-intro {
    margin: 13px auto 24px;
    max-width: 360px;
    color: var(--muted);
    text-align: center;
    font-size: 14px;
    line-height: 1.65;
}

.message {
    margin-bottom: 16px;
    padding: 12px 13px;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    border-radius: 12px;
    font-size: 12.5px;
    line-height: 1.5;
}

.message.error {
    border: 1px solid #f1c8c8;
    background: var(--danger-bg);
    color: var(--danger);
}

.message.info {
    border: 1px solid #cfe2f1;
    background: var(--info-bg);
    color: var(--info);
}

.access-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--navy);
    font-size: 12px;
    font-weight: 800;
}

.password-field {
    position: relative;
}

.password-field input {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 43px;
    border: 1px solid #dce2e8;
    border-radius: 14px;
    outline: none;
    background: #f9fafb;
    color: var(--navy);
    font-size: 15px;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.password-field input:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(93,128,54,.12);
}

.field-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--green);
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #7f8a98;
    cursor: pointer;
}

.toggle-password:hover {
    background: #edf0f3;
    color: var(--navy);
}

.primary-button {
    width: 100%;
    min-height: 54px;
    margin-top: 14px;
    padding: 0 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 0;
    border-radius: 14px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 12px 28px rgba(93,128,54,.24);
    transition: transform .18s ease, background .18s ease;
}

.primary-button span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.primary-button:hover:not(:disabled) {
    transform: translateY(-2px);
    background: var(--green-dark);
}

.primary-button:disabled,
.password-field input:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.access-help {
    margin-top: 18px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: #8490a0;
    font-size: 11.5px;
    line-height: 1.5;
}

.access-help i {
    margin-top: 2px;
    color: var(--green);
}

.access-footer {
    margin: 18px 0 0;
    color: rgba(255,255,255,.64);
    text-align: center;
    font-size: 11px;
}

/* ============================================================
   DIRECTORIO
============================================================ */

.directory-page {
    min-height: 100vh;
    background: #f4f6f8;
}

.directory-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.directory-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid rgba(42,53,70,.08);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.directory-brand img {
    width: 180px;
    max-height: 52px;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.secure-session,
.logout-link {
    min-height: 40px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 800;
}

.secure-session {
    background: rgba(93,128,54,.09);
    color: var(--green);
}

.logout-link {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--navy);
    text-decoration: none;
}

.logout-link:hover {
    border-color: #ccd3dc;
    background: #f7f8fa;
}

.directory-hero {
    position: relative;
    overflow: hidden;
    padding: 62px 0 48px;
    background:
        radial-gradient(circle at 88% 15%, rgba(93,128,54,.22), transparent 30%),
        linear-gradient(135deg, var(--navy-deep), var(--navy));
    color: #fff;
}

.directory-hero::after {
    content: "";
    position: absolute;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    right: -150px;
    top: -170px;
}

.directory-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 13px;
    color: #b9ce9f;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.directory-hero h1 {
    max-width: 650px;
    margin: 0;
    font-size: clamp(32px, 5vw, 50px);
    line-height: 1.04;
    letter-spacing: -.035em;
}

.directory-hero > .directory-container > p {
    max-width: 600px;
    margin: 14px 0 25px;
    color: rgba(255,255,255,.74);
    font-size: 15px;
    line-height: 1.65;
}

.search-box {
    position: relative;
    width: min(100%, 650px);
}

.search-box > i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--green);
    font-size: 17px;
}

.search-box input {
    width: 100%;
    height: 58px;
    padding: 0 50px 0 50px;
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 16px;
    outline: none;
    background: #fff;
    color: var(--navy);
    font-size: 15px;
    box-shadow: 0 18px 35px rgba(0,0,0,.16);
}

.search-box input::placeholder {
    color: #97a1ad;
}

.search-box input:focus {
    box-shadow: 0 0 0 4px rgba(93,128,54,.22), 0 18px 35px rgba(0,0,0,.16);
}

#clearSearch {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) scale(.92);
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: #eef1f4;
    color: #758191;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

#clearSearch.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
}

.directory-meta {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 22px;
    color: rgba(255,255,255,.66);
    font-size: 11.5px;
}

.directory-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.directory-meta i {
    color: #b9ce9f;
}

.directory-content {
    padding: 38px 0 56px;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.person-card {
    position: relative;
    min-width: 0;
    padding: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 11px 30px rgba(35,46,63,.06);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.person-card:hover {
    transform: translateY(-3px);
    border-color: #d5dce4;
    box-shadow: 0 18px 42px rgba(35,46,63,.11);
}

.person-card[hidden] {
    display: none !important;
}

.person-photo-wrap {
    position: relative;
    flex: 0 0 auto;
}

.person-photo {
    width: 82px;
    height: 82px;
    border: 3px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(93,128,54,.22), 0 10px 25px rgba(0,0,0,.10);
}

.person-placeholder {
    display: grid;
    place-items: center;
    background: var(--navy);
    color: #fff;
    font-size: 24px;
    font-weight: 800;
}

.person-status {
    position: absolute;
    right: 0;
    bottom: 2px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 8px;
}

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

.person-label {
    display: block;
    margin-bottom: 3px;
    color: var(--green);
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.person-info h2 {
    margin: 0;
    overflow: hidden;
    color: var(--navy);
    font-size: 18px;
    line-height: 1.18;
    text-overflow: ellipsis;
}

.person-info p {
    min-height: 34px;
    margin: 5px 0 13px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.45;
}

.open-card-button {
    min-height: 39px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    border-radius: 10px;
    background: #f1f4ee;
    color: var(--green-dark);
    text-decoration: none;
    font-size: 11px;
    font-weight: 900;
}

.open-card-button span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.open-card-button:hover {
    background: var(--green);
    color: #fff;
}

.empty-results {
    padding: 70px 20px;
    text-align: center;
}

.empty-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(93,128,54,.10);
    color: var(--green);
    font-size: 25px;
}

.empty-results h2 {
    margin: 0 0 7px;
    color: var(--navy);
    font-size: 23px;
}

.empty-results p {
    margin: 0 0 17px;
    color: var(--muted);
    font-size: 13px;
}

.empty-results button {
    padding: 11px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}

.directory-footer {
    border-top: 1px solid var(--line);
    background: #fff;
}

.directory-footer .directory-container {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    color: #8490a0;
    font-size: 11px;
}

@media (max-width: 980px) {
    .people-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 650px) {
    .access-shell {
        width: min(100% - 22px, 470px);
        padding: 18px 0;
    }

    .access-card {
        padding: 25px 20px;
        border-radius: 22px;
    }

    .access-brand img {
        width: 70%;
    }

    .directory-container {
        width: min(100% - 22px, 1180px);
    }

    .header-inner {
        min-height: 68px;
    }

    .directory-brand img {
        width: 145px;
    }

    .secure-session {
        display: none;
    }

    .logout-link {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }

    .logout-link span {
        display: none;
    }

    .directory-hero {
        padding: 42px 0 35px;
    }

    .directory-hero h1 {
        font-size: 34px;
    }

    .directory-hero > .directory-container > p {
        font-size: 13.5px;
    }

    .search-box input {
        height: 54px;
        font-size: 14px;
    }

    .directory-meta {
        display: grid;
        gap: 7px;
    }

    .directory-content {
        padding: 24px 0 38px;
    }

    .people-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .person-card {
        padding: 17px;
        gap: 14px;
        border-radius: 17px;
    }

    .person-photo {
        width: 72px;
        height: 72px;
    }

    .person-info h2 {
        font-size: 16px;
    }

    .person-info p {
        margin-bottom: 10px;
        min-height: 0;
        font-size: 11px;
    }

    .open-card-button {
        min-height: 37px;
    }

    .directory-footer .directory-container {
        min-height: 76px;
        padding: 14px 0;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}