:root {
    --unit-primary: #082c5c;
    --unit-primary-dark: #041b3d;
    --unit-primary-soft: #0d6efd;
    --unit-accent: #8f0422;
    --unit-gold: #c68400;
    --unit-bg: #f5f8fc;
    --unit-card: #ffffff;
    --unit-text: #1d2939;
    --unit-muted: #667085;
    --unit-border: #e4e7ec;
    --unit-shadow: 0 12px 30px rgba(16, 24, 40, 0.08);
    --unit-shadow-hover: 0 20px 42px rgba(8, 44, 92, 0.14);
}

/* =========================================================
   ASAS PAGE
========================================================= */

.unit-page-section {
    padding: 48px 0 70px;
    background:
        radial-gradient(
            circle at top left,
            rgba(8, 44, 92, 0.055),
            transparent 30%
        ),
        var(--unit-bg);
}

.unit-page-section .container {
    max-width: 1180px;
}

/* =========================================================
   HERO UNIT
========================================================= */

.unit-hero {
    position: relative;
    overflow: hidden;
    padding: 58px 0;
    color: #ffffff;
    background:
        radial-gradient(
            circle at 85% 25%,
            rgba(255, 255, 255, 0.12),
            transparent 26%
        ),
        linear-gradient(
            135deg,
            var(--unit-primary-dark) 0%,
            var(--unit-primary) 52%,
            #0d4d96 100%
        );
}

.unit-hero::before {
    content: "";
    position: absolute;
    top: -110px;
    right: -70px;
    width: 330px;
    height: 330px;
    border: 65px solid rgba(255, 255, 255, 0.045);
    border-radius: 50%;
}

.unit-hero::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 5px;
    background: var(--unit-accent);
}

.unit-hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.unit-hero-icon {
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(8px);
}

.unit-hero-icon i {
    color: #ffffff;
    font-size: 38px;
}

.unit-hero-text span {
    display: inline-flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.unit-hero-text h1 {
    max-width: 930px;
    margin: 0 0 13px;
    color: #ffffff;
    font-size: clamp(30px, 4vw, 46px);
    font-weight: 900;
    line-height: 1.12;
    letter-spacing: -0.035em;
}

.unit-hero-text p {
    max-width: 950px;
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 16px;
    line-height: 1.8;
}

/* =========================================================
   PENGENALAN / FUNGSI UNIT
========================================================= */

.unit-intro-card {
    position: relative;
    overflow: hidden;
    margin-bottom: 24px;
    padding: 30px 34px;
    border: 1px solid var(--unit-border);
    border-radius: 24px;
    background: var(--unit-card);
    box-shadow: var(--unit-shadow);
}

.unit-intro-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 7px;
    height: 100%;
    background: linear-gradient(
        180deg,
        var(--unit-accent),
        var(--unit-primary)
    );
}

.unit-intro-card span {
    display: block;
    margin-bottom: 7px;
    color: var(--unit-accent);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.unit-intro-card h2 {
    margin: 0 0 12px;
    color: var(--unit-primary);
    font-size: clamp(23px, 3vw, 31px);
    font-weight: 900;
    line-height: 1.22;
}

.unit-intro-card p {
    max-width: 1050px;
    margin: 0;
    color: var(--unit-text);
    font-size: 15px;
    line-height: 1.85;
}

/* =========================================================
   PANEL KANDUNGAN
========================================================= */

.unit-content-card {
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid var(--unit-border);
    border-radius: 24px;
    background: var(--unit-card);
    box-shadow: var(--unit-shadow);
}

.unit-content-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--unit-border);
}

.unit-content-heading i {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    color: #ffffff;
    background: linear-gradient(
        135deg,
        var(--unit-primary),
        var(--unit-primary-soft)
    );
    font-size: 18px;
}

.unit-content-heading h2 {
    margin: 0;
    color: var(--unit-primary);
    font-size: 23px;
    font-weight: 900;
    line-height: 1.25;
}

/* =========================================================
   AKTIVITI UTAMA
========================================================= */

.unit-activity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.unit-activity-item {
    min-height: 100%;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 13px;
    align-items: flex-start;
    padding: 16px;
    border: 1px solid #e7ecf3;
    border-radius: 16px;
    background: #f9fbfe;
    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.unit-activity-item:hover {
    transform: translateY(-2px);
    border-color: #ccd9ea;
    box-shadow: 0 10px 22px rgba(8, 44, 92, 0.07);
}

.unit-activity-item > span {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: #ffffff;
    background: var(--unit-primary);
    font-size: 13px;
    font-weight: 900;
}

.unit-activity-item p {
    margin: 0;
    color: var(--unit-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.65;
}

/* =========================================================
   TAB UNIT PERKHIDMATAN
========================================================= */

.unit-tabs {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 22px;
    padding: 8px;
    border: 1px solid var(--unit-border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.06);
}

.unit-tab-button {
    flex: 1;
    min-height: 52px;
    padding: 12px 18px;
    border: 0;
    border-radius: 13px;
    color: var(--unit-primary);
    background: transparent;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.unit-tab-button:hover {
    background: #eef4fb;
}

.unit-tab-button.active {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        var(--unit-primary),
        var(--unit-primary-soft)
    );
    box-shadow: 0 8px 18px rgba(8, 44, 92, 0.2);
}

.unit-tab-panel {
    display: none;
}

.unit-tab-panel.active {
    display: block;
    animation: unitTabFade 0.25s ease;
}

@keyframes unitTabFade {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   DIREKTORI STAFF
========================================================= */

.directory-group {
    margin-bottom: 28px;
}

.directory-group:last-child {
    margin-bottom: 0;
}

.directory-group-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 12px;
    padding: 14px 18px;
    border: 1px solid #dce5f0;
    border-left: 6px solid var(--unit-accent);
    border-radius: 14px;
    background: #f5f8fc;
}

.directory-group-heading > i {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    color: #ffffff;
    background: var(--unit-primary);
    font-size: 15px;
}

.directory-group-heading span {
    display: block;
    margin-bottom: 2px;
    color: var(--unit-muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.directory-group-heading h3 {
    margin: 0;
    color: var(--unit-primary);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.35;
}

.directory-group-supervisor .directory-group-heading {
    border-left-color: var(--unit-gold);
    background: #fffaf1;
}

.directory-group-supervisor .directory-group-heading > i {
    background: linear-gradient(135deg, #a76300, #d79a22);
}

.directory-list {
    overflow: hidden;
    border: 1px solid #dfe6ef;
    border-radius: 16px;
    background: #ffffff;
}

.directory-person {
    display: grid;
    grid-template-columns: 145px minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    min-height: 176px;
    padding: 22px 28px;
    border-bottom: 1px solid #e8edf3;
    transition: background 0.2s ease;
}

.directory-person:last-child {
    border-bottom: 0;
}

.directory-person:nth-child(even) {
    background: #fafcff;
}

.directory-person:hover {
    background: #f3f7fc;
}

.directory-photo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.directory-photo,
.directory-photo-placeholder {
    width: 110px;
    height: 140px;
    border: 2px solid #d8e0ea;
    border-radius: 12px;
    background: #eef3f8;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.1);
}

.directory-photo {
    display: block;
    object-fit: cover;
    object-position: center top;
}

.directory-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: linear-gradient(
        145deg,
        var(--unit-primary),
        #176bc0
    );
    font-size: 28px;
    font-weight: 900;
}

.directory-person-details {
    min-width: 0;
}

.directory-person-details h4 {
    margin: 0 0 6px;
    color: var(--unit-primary);
    font-size: 17px;
    font-weight: 900;
    line-height: 1.4;
    text-transform: uppercase;
}

.directory-position {
    margin: 0 0 14px;
    color: #344054;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

.directory-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
}

.directory-contact > div {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.directory-contact i {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--unit-primary);
    background: #edf4fc;
    font-size: 11px;
}

.directory-contact span,
.directory-contact a {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
}

.directory-contact a:hover {
    color: var(--unit-accent);
}

/* =========================================================
   TAB DIREKTORI PEGAWAI
========================================================= */

.directory-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    padding: 8px;
    border: 1px solid #dce5f0;
    border-radius: 16px;
    background: #f6f9fd;
}

.directory-tab-button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--unit-primary);
    background: transparent;
    font-size: 13px;
    font-weight: 850;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.directory-tab-button:hover {
    transform: translateY(-1px);
    border-color: #d0dceb;
    background: #ffffff;
}

.directory-tab-button i {
    font-size: 13px;
}

.directory-tab-button strong {
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--unit-primary);
    background: #e4edf8;
    font-size: 11px;
    font-weight: 900;
}

.directory-tab-button.active {
    color: #ffffff;
    border-color: var(--unit-primary);
    background: linear-gradient(
        135deg,
        var(--unit-primary),
        #14599f
    );
    box-shadow: 0 8px 18px rgba(8, 44, 92, 0.18);
}

.directory-tab-button.active strong {
    color: var(--unit-primary);
    background: #ffffff;
}

.directory-tab-panel {
    display: none;
}

.directory-tab-panel.active {
    display: block;
    animation: directoryTabFade 0.22s ease;
}

.directory-tab-panel .directory-group-heading {
    display: none;
}

.directory-tab-panel .directory-group {
    margin-bottom: 0;
}

@keyframes directoryTabFade {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================================
   EMPTY STATE
========================================================= */

.unit-empty {
    padding: 28px 20px;
    border: 1px dashed #cfd8e6;
    border-radius: 17px;
    color: var(--unit-muted);
    background: #f8fafc;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {
    .unit-hero {
        padding: 45px 0;
    }

    .unit-hero-content {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: 18px;
    }

    .unit-hero-icon {
        width: 76px;
        height: 76px;
        border-radius: 20px;
    }

    .unit-hero-icon i {
        font-size: 30px;
    }

    .unit-activity-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .unit-page-section {
        padding: 30px 0 50px;
    }

    .unit-hero-content {
        grid-template-columns: 1fr;
    }

    .unit-hero-icon {
        width: 68px;
        height: 68px;
    }

    .unit-hero-text h1 {
        font-size: 28px;
    }

    .unit-hero-text p {
        font-size: 14px;
    }

    .unit-intro-card,
    .unit-content-card {
        padding: 20px;
        border-radius: 19px;
    }

    .unit-tabs {
        flex-direction: column;
    }

    .directory-person {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 16px;
        min-height: 130px;
        padding: 16px;
    }

    .directory-photo,
    .directory-photo-placeholder {
        width: 92px;
        height: 118px;
    }

    .directory-contact {
        flex-direction: column;
        gap: 8px;
    }

    .directory-tabs {
        display: grid;
        grid-template-columns: 1fr;
    }

    .directory-tab-button {
        width: 100%;
        justify-content: flex-start;
    }

    .directory-tab-button strong {
        margin-left: auto;
    }
}

@media (max-width: 430px) {
    .directory-person {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .directory-photo-wrap {
        justify-content: center;
    }

    .directory-contact {
        align-items: center;
    }

    .directory-contact > div {
        justify-content: center;
    }
}