/* =========================================================
   DIREKTORI STAF
   UI DNA: JOHOR GOVERNMENT / ENTERPRISE DIRECTORY
   ========================================================= */

:root {
    --johor-navy: #092c6c;
    --johor-blue: #174fbd;
    --johor-blue-2: #2563eb;
    --johor-blue-soft: #edf4ff;

    --green: #25a477;
    --green-soft: #eafaf4;

    --purple: #7c3aed;
    --purple-soft: #f4edff;

    --gold: #b78a16;

    --ink: #10264f;
    --text: #344563;
    --muted: #71809b;

    --surface: #ffffff;
    --surface-soft: #f8fafd;
    --page: #f6f8fc;

    --line: #dfe6f1;
    --line-soft: #edf1f6;

    --shadow-sm: 0 5px 18px rgba(19, 45, 87, 0.05);
    --shadow-md: 0 12px 32px rgba(19, 45, 87, 0.08);
    --shadow-lg: 0 20px 52px rgba(19, 45, 87, 0.12);

    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 20px;

    --transition: 0.22s ease;
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font-family:
        Inter,
        "Segoe UI",
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        Arial,
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* =========================================================
   CONTAINER
   ========================================================= */

.container {
    width: min(1480px, calc(100% - 64px));
    max-width: 1480px;
}

/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    min-height: 84px;
    display: flex;
    align-items: center;

    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--line);

    position: sticky;
    top: 0;
    z-index: 100;

    backdrop-filter: blur(15px);
}

.site-header .container {
    min-height: 84px;
}

.brand {
    color: var(--johor-navy);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.site-header .btn {
    border-radius: 8px;
    font-weight: 600;
}

/* =========================================================
   HERO
   ========================================================= */

.hero {
    position: relative;
    overflow: hidden;

    min-height: 370px;

    padding-top: 66px !important;
    padding-bottom: 120px !important;

    background:
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(255, 255, 255, 0.96) 22%,
            rgba(255, 255, 255, 0.88) 36%,
            rgba(255, 255, 255, 0.47) 62%,
            rgba(255, 255, 255, 0.10) 100%
        ),
        url("../images/bg-direktori-johor.jpg");

    background-size: cover;
    background-position: center 58%;
    background-repeat: no-repeat;

    border-bottom: 1px solid var(--line);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            180deg,
            rgba(247, 250, 255, 0.05),
            rgba(239, 245, 255, 0.05)
        );

    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 110px;

    background:
        linear-gradient(
            to bottom,
            rgba(246, 248, 252, 0),
            rgba(246, 248, 252, 0.92)
        );

    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1,
.hero .display-5,
.hero .display-6 {
    margin: 0 0 18px;

    max-width: 650px;

    color: var(--johor-navy);

    font-weight: 850;
    font-size: clamp(2.6rem, 4vw, 4.25rem);
    line-height: 1;
    letter-spacing: -0.045em;
}

.hero p,
.hero .lead {
    max-width: 570px;

    color: #445777;

    font-size: 1.08rem;
    line-height: 1.75;
}

.hero p:last-child {
    margin-bottom: 0;
}

.hero .eyebrow {
    margin-bottom: 12px;
}

/* small decorative blue line */

.hero .container::after {
    content: "";
    display: block;

    width: 46px;
    height: 4px;

    margin-top: 28px;

    border-radius: 99px;
    background: var(--johor-blue);
}

/* =========================================================
   EYEBROW
   ========================================================= */

.eyebrow {
    display: inline-block;

    color: var(--johor-blue);

    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

/* =========================================================
   GENERAL PANELS
   ========================================================= */

.panel,
.cardx,
.metric,
.admin-card,
.login-card {
    background: var(--surface);

    border: 1px solid var(--line);

    border-radius: var(--radius-md);

    box-shadow: var(--shadow-sm);
}

.panel {
    padding: 22px;
}

/* =========================================================
   STAT / METRIC CARDS
   ========================================================= */

.metric {
    position: relative;

    min-height: 120px;

    padding: 26px 30px;

    display: flex;
    align-items: center;

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.metric:hover {
    transform: translateY(-2px);

    border-color: #cfdbed;

    box-shadow: var(--shadow-md);
}

.metric strong {
    display: block;

    color: var(--johor-navy);

    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1;
}

.metric .muted,
.metric span {
    font-size: 0.9rem;
}

/* =========================================================
   SEARCH / FILTER PANEL
   ========================================================= */

form.panel {
    margin-top: 0;

    padding: 26px 24px;

    border-radius: 17px;

    box-shadow:
        0 8px 24px rgba(19, 45, 87, 0.04);
}

.form-label {
    margin-bottom: 8px;

    color: var(--ink);

    font-size: 0.82rem;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 51px;

    border: 1px solid #d5deea;
    border-radius: 10px;

    color: var(--ink);

    background-color: #fff;

    transition:
        border-color var(--transition),
        box-shadow var(--transition);
}

.form-control::placeholder {
    color: #8795aa;
}

.form-control:focus,
.form-select:focus {
    border-color: #8eacec;

    box-shadow:
        0 0 0 4px rgba(37, 99, 235, 0.09);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    min-height: 42px;

    border-radius: 9px;

    font-weight: 650;

    transition:
        transform var(--transition),
        background var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.btn-primary {
    background:
        linear-gradient(
            135deg,
            #123f99,
            var(--johor-blue)
        );

    border-color: var(--johor-blue);
}

.btn-primary:hover,
.btn-primary:focus {
    background:
        linear-gradient(
            135deg,
            #0d3689,
            #1749ad
        );

    border-color: #1749ad;

    transform: translateY(-1px);

    box-shadow:
        0 8px 18px rgba(31, 86, 216, 0.18);
}

.btn-outline-primary {
    color: var(--johor-blue);
    border-color: #aac0ef;
}

.btn-outline-primary:hover {
    color: #fff;

    background: var(--johor-blue);

    border-color: var(--johor-blue);
}

/* =========================================================
   STAFF GRID
   ========================================================= */

/*
 Bootstrap current view uses:
 col-sm-6 col-xl-4

 To achieve 4 columns on larger desktop,
 override the XL item width.
*/

@media (min-width: 1200px) {
    .row > .col-xl-4 {
        flex: 0 0 auto;
        width: 25%;
    }
}

/* =========================================================
   STAFF CARD
   ========================================================= */

.cardx {
    height: 100%;

    overflow: hidden;

    border-radius: 15px;

    box-shadow:
        0 7px 24px rgba(19, 45, 87, 0.055);

    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
}

.cardx:hover {
    transform: translateY(-5px);

    border-color: #cfd9e9;

    box-shadow:
        0 18px 38px rgba(19, 45, 87, 0.11);
}

/* =========================================================
   STAFF IMAGE
   ========================================================= */

.photo-wrap {
    position: relative;

    width: 100%;
    height: 295px;

    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            145deg,
            #eef3fa,
            #e7edf6
        );

    border-radius: 15px 15px 0 0;
}

/*
 Important:
 top priority portrait crop.
*/

.photo {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    /*
     Naikkan muka sedikit ke bahagian atas.
     Sesuai untuk gambar 800x1000.
    */
    object-position: center 20%;
}

.cardx:hover .photo {
    transform: scale(1.015);
}

.photo {
    transition: transform 0.45s ease;
}

/* =========================================================
   FALLBACK AVATAR
   ========================================================= */

.avatar {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--johor-blue);

    font-size: 3.5rem;
    font-weight: 800;

    background:
        radial-gradient(
            circle at 50% 25%,
            #ffffff 0%,
            #f2f6fc 42%,
            #e8eef7 100%
        );
}

/* =========================================================
   STAFF CARD BODY
   ========================================================= */

.cardx .p-4 {
    padding: 20px 20px 22px !important;
}

.cardx h2 {
    margin-top: 15px;
    margin-bottom: 7px;

    color: #081f4c;

    font-size: 1.08rem;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.018em;
}

.cardx p {
    color: #667691;
    line-height: 1.55;
}

.cardx .small {
    margin-top: 4px;

    color: #687894;

    line-height: 1.45;
}

/* =========================================================
   UNIT CHIP
   ========================================================= */

.unit {
    display: inline-flex;
    align-items: center;

    max-width: 100%;

    padding: 6px 10px;

    border-radius: 999px;

    background: #eef4ff;

    color: #1751c4;

    font-size: 0.7rem;
    font-weight: 750;
    line-height: 1.2;
}

/* =========================================================
   MUTED
   ========================================================= */

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

/* =========================================================
   CARD ACTION
   ========================================================= */

.cardx .btn-outline-primary {
    min-height: 41px;

    margin-top: 19px !important;

    border-color: #7fa4fa;

    border-radius: 8px;

    font-size: 0.89rem;
}

/* =========================================================
   PROFILE PAGE
   ========================================================= */

.profile-photo {
    display: block;

    width: 100%;
    max-width: 380px;

    aspect-ratio: 4 / 5;

    object-fit: cover;
    object-position: center 18%;

    border: 1px solid var(--line);

    border-radius: 18px;

    box-shadow: var(--shadow-md);
}

.profile-avatar {
    width: 100%;
    max-width: 380px;

    aspect-ratio: 4 / 5;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--line);

    border-radius: 18px;

    background:
        linear-gradient(
            145deg,
            #eef4ff,
            #f8faff
        );

    color: var(--johor-blue);

    font-size: 4.5rem;
    font-weight: 800;
}

/* =========================================================
   ADMIN
   ========================================================= */

.admin-card {
    overflow: hidden;
}

.admin-card table {
    margin-bottom: 0;
}

.admin-card thead th {
    padding: 15px 17px;

    background: #f8fafd;

    border-bottom-color: var(--line);

    color: #697891;

    font-size: 0.72rem;
    font-weight: 750;

    text-transform: uppercase;

    letter-spacing: 0.06em;
}

.admin-card tbody td {
    padding: 16px 17px;

    border-bottom-color: #edf1f5;
}

.admin-card tbody tr:last-child td {
    border-bottom: 0;
}

.admin-card tbody tr:hover td {
    background: #fbfcff;
}

/* =========================================================
   ADMIN FORM SIDE PANEL
   ========================================================= */

.form-side-panel {
    padding: 18px;

    background: #f8fafd;

    border: 1px solid var(--line);

    border-radius: 13px;
}

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

.login-shell {
    min-height: calc(100vh - 130px);

    display: grid;
    place-items: center;
}

.login-card {
    width: min(450px, 100%);

    padding: 34px;

    border-radius: 20px;

    box-shadow: var(--shadow-lg);
}

/* =========================================================
   BADGES
   ========================================================= */

.badge {
    padding: 0.48em 0.72em;

    font-size: 0.72rem;

    border-radius: 999px;
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 55px 30px;

    text-align: center;

    background: #fff;

    border: 1px dashed #cbd6e6;

    border-radius: 17px;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
    color: #77869c;

    background: transparent;
}

/* =========================================================
   TABLE RESPONSIVE
   ========================================================= */

.table-responsive {
    border-radius: 15px;
}

/* =========================================================
   RESPONSIVE — LARGE
   ========================================================= */

@media (max-width: 1399.98px) {

    .container {
        width: min(1320px, calc(100% - 48px));
    }

    .photo-wrap {
        height: 285px;
    }

}

/* =========================================================
   RESPONSIVE — LAPTOP / TABLET
   ========================================================= */

@media (max-width: 1199.98px) {

    .hero {
        min-height: 340px;

        padding-top: 55px !important;
        padding-bottom: 95px !important;

        background-position: center center;
    }

    .hero h1,
    .hero .display-5,
    .hero .display-6 {
        font-size: 3.2rem;
    }

    .photo-wrap {
        height: 315px;
    }

}

/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 991.98px) {

    .container {
        width: calc(100% - 36px);
    }

    .hero {
        min-height: 340px;

        background:
            linear-gradient(
                90deg,
                rgba(255, 255, 255, 0.97),
                rgba(255, 255, 255, 0.88) 55%,
                rgba(255, 255, 255, 0.45)
            ),
            url("../images/bg-direktori-johor.jpg");

        background-size: cover;
        background-position: center center;
    }

    .photo-wrap {
        height: 340px;
    }

}

/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 767.98px) {

    .container {
        width: calc(100% - 28px);
    }

    .site-header,
    .site-header .container {
        min-height: 70px;
    }

    .hero {
        min-height: 360px;

        padding-top: 42px !important;
        padding-bottom: 70px !important;

        background:
            linear-gradient(
                180deg,
                rgba(255, 255, 255, 0.96) 0%,
                rgba(255, 255, 255, 0.89) 55%,
                rgba(255, 255, 255, 0.70) 100%
            ),
            url("../images/bg-direktori-johor.jpg");

        background-size: cover;
        background-position: center center;
    }

    .hero h1,
    .hero .display-5,
    .hero .display-6 {
        font-size: 2.7rem;
    }

    .hero p,
    .hero .lead {
        font-size: 1rem;
    }

    .photo-wrap {
        height: 390px;
    }

    .photo {
        object-position: center 15%;
    }

    form.panel {
        padding: 18px;
    }

}

/* =========================================================
   RESPONSIVE — SMALL MOBILE
   ========================================================= */

@media (max-width: 575.98px) {

    .container {
        width: calc(100% - 22px);
    }

    .hero {
        min-height: 340px;
    }

    .hero h1,
    .hero .display-5,
    .hero .display-6 {
        font-size: 2.35rem;
    }

    .photo-wrap {
        height: 410px;
    }

    .cardx,
    .photo-wrap {
        border-radius: 14px;
    }

    .photo-wrap {
        border-radius: 14px 14px 0 0;
    }

    .cardx .p-4 {
        padding: 19px !important;
    }

}

/* =========================================================
   ULTRA SMALL
   ========================================================= */

@media (max-width: 399px) {

    .photo-wrap {
        height: 365px;
    }

    .hero h1,
    .hero .display-5 {
        font-size: 2.1rem;
    }

}