body {
    background: #f5f7fa;
    color: #1d2733;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.body-content {
    margin-top: 16px;
}

.custom-navbar {
    min-height: 46px;
    padding: 3px 0;
    background-color: #005da4 !important;
    box-shadow: 0 2px 8px rgba(0, 54, 96, 0.14);
}

.custom-navbar .navbar-brand,
.custom-navbar .nav-link {
    color: #ffffff !important;
}

.custom-navbar .navbar-brand {
    padding: 4px 0;
    font-size: 16px;
    font-weight: 700;
}

@media (min-width: 768px) {
    .body-content > .container,
    .body-content .container {
        max-width: 1180px;
    }

    .body-content .row > .col-md-2 {
        display: flex;
        flex: 0 0 100%;
        flex-wrap: wrap;
        gap: 4px;
        max-width: 100%;
        margin-bottom: 16px;
        padding: 10px;
        background: #ffffff;
        border: 1px solid #d7e0ea;
        border-radius: 8px;
        box-shadow: 0 6px 18px rgba(15, 38, 64, 0.05);
        position: relative;
        z-index: 5;
    }

    .body-content .row > .col-md-10 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.department-list,
.menu-section {
    background: transparent;
    border: 0;
    border-radius: 0;
}

.department-list {
    order: 2;
    width: 100%;
    margin-top: 8px;
    margin-bottom: 0;
    padding: 10px 0 0;
    border-top: 1px solid #e2e8ef;
}

@media (min-width: 768px) {
    .department-list {
        display: grid;
        grid-template-columns: minmax(240px, 1fr) 120px 140px;
        align-items: center;
        gap: 8px;
    }
}

.department-list .form-control {
    max-width: none;
    height: 36px;
    margin-bottom: 0;
    border-color: #c6d3df;
    border-radius: 999px;
    font-size: 13px;
    padding-left: 14px;
}

.department-list .btn-primary {
    width: 100%;
    height: 36px;
    border: 0;
    background: #005da4;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.department-list br {
    display: none;
}

.department-link,
.menu-title {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-height: 34px;
    margin: 0 !important;
    padding: 7px 12px !important;
    background: transparent !important;
    color: #2f4b63 !important;
    border: 0 !important;
    border-radius: 999px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.25;
    text-align: center;
    text-decoration: none !important;
    cursor: pointer;
}

.department-link {
    margin-top: 0 !important;
    background: #e8f2fb !important;
    color: #005da4 !important;
    text-align: center;
}

.department-link:hover,
.department-list .btn-primary:hover {
    background: #00487e !important;
    color: #ffffff !important;
}

.menu-section {
    order: 1;
    position: relative;
    flex: 0 1 auto;
    margin-bottom: 0;
    overflow: visible;
}

.menu-title:hover {
    background: #eef5fb !important;
    color: #005da4 !important;
}

.menu-content {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    width: 300px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #d7e0ea;
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(15, 38, 64, 0.16);
}

.menu-content-programs {
    width: 340px;
    max-height: 70vh;
    overflow-y: auto;
}

.menu-link-heading {
    display: block;
    margin: 8px 0 3px;
    padding: 7px 10px 4px;
    color: #005da4;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
}

.menu-link-heading-action {
    border-radius: 6px;
    text-decoration: none;
}

.menu-link-heading-action:hover {
    background: #eef5fb;
    color: #005da4;
    text-decoration: none;
}

.menu-link-child {
    padding-left: 18px;
}

.submenu-section {
    margin-top: 4px;
}

.submenu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 2px;
    padding: 8px 10px;
    background: transparent;
    color: #425466;
    border: 0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
}

.submenu-toggle::after {
    content: "\25BE";
    margin-left: 10px;
    color: #005da4;
    font-size: 10px;
}

.submenu-toggle:hover {
    background: #eef5fb;
    color: #005da4;
}

.submenu-content {
    display: none;
    padding-left: 8px;
    border-left: 2px solid #d7e0ea;
}

.menu-link {
    display: block;
    margin-top: 2px;
    padding: 8px 10px;
    color: #425466;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.25;
    text-decoration: none;
}

.menu-link:hover {
    background: #eef5fb;
    color: #005da4;
    text-decoration: none;
}

.directory-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #d7e0ea;
}

.directory-eyebrow {
    display: inline-block;
    margin-bottom: 3px;
    color: #005da4;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.directory-toolbar h1 {
    margin: 0;
    color: #172033;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
}

.directory-hint {
    color: #637587;
    font-size: 12px;
    text-align: right;
}

.directory-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.directory-pdf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 14px;
    border: 1px solid #005da4;
    border-radius: 6px;
    background: #005da4;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.directory-pdf-button:hover,
.directory-pdf-button:focus {
    background: #004b85;
    border-color: #004b85;
    color: #ffffff;
    text-decoration: none;
}

.employee-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #d7e0ea;
    border-radius: 6px;
}

.employee-card {
    background: #ffffff;
    border-bottom: 1px solid #edf1f5;
}

.employee-card:last-child {
    border-bottom: 0;
}

.employee-card:hover {
    background: #f8fbfe;
}

.employee-info {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 0.9fr) 104px;
    align-items: center;
    gap: 14px;
    min-height: 46px;
    padding: 8px 12px;
}

.employee-unit {
    display: block;
    margin: 0;
    color: #607284;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.25;
    text-transform: uppercase;
}

.employee-info h2 {
    margin: 0;
    color: #101928;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.employee-detail-button {
    justify-self: end;
    padding: 5px 10px;
    border: 1px solid #005da4;
    border-radius: 999px;
    color: #005da4;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.employee-detail-button:hover,
.employee-detail-button:focus {
    background: #005da4;
    color: #ffffff;
    text-decoration: none;
}

.directory-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.pagination-button {
    min-width: 92px;
    padding: 7px 12px;
    border: 1px solid #005da4;
    border-radius: 999px;
    color: #005da4;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
}

.pagination-button:hover,
.pagination-button:focus {
    background: #005da4;
    color: #ffffff;
    text-decoration: none;
}

.pagination-button.disabled,
.pagination-button.disabled:hover,
.pagination-button.disabled:focus {
    border-color: #c8d3de;
    background: #eef2f6;
    color: #8090a0;
    cursor: default;
    pointer-events: none;
}

.pagination-status {
    min-width: 104px;
    color: #425466;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.alert.alert-warning {
    margin-top: 12px;
}

.modal-dialog {
    max-width: 680px;
}

.modal-content {
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 18px 48px rgba(12, 31, 51, 0.22);
}

.employee-modal-header {
    padding: 12px 16px;
    background: #005da4;
    color: #ffffff;
}

.employee-modal-header .modal-title {
    font-size: 16px;
    font-weight: 800;
}

.employee-profile {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.employee-profile-photo .img-thumbnail {
    width: 150px;
    height: 180px;
    padding: 0;
    border: 1px solid #d7e0ea;
    border-radius: 6px;
    object-fit: cover;
}

.employee-profile-info h3 {
    margin: 0 0 18px;
    color: #101928;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
}

.employee-profile-details {
    display: grid;
    gap: 12px;
    margin: 0;
}

.employee-profile-details div {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 6px;
}

.employee-profile-details dt {
    margin: 0;
    color: #101928;
    font-size: 14px;
    font-weight: 800;
}

.employee-profile-details dd {
    margin: 0;
    color: #101928;
    font-size: 14px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.employee-profile-details a {
    color: #005da4;
    text-decoration: none;
}

.employee-profile-details a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 10px 16px;
    background: #f8fafc;
}

.modal-footer .btn-primary {
    min-width: 90px;
    padding: 7px 16px;
    border: 0;
    border-radius: 999px;
    background: #005da4;
    font-size: 13px;
    font-weight: 700;
}

@media (max-width: 991.98px) {
    .body-content .row > .col-md-2 {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-bottom: 16px;
        padding: 10px;
        background: #ffffff;
        border: 1px solid #d7e0ea;
        border-radius: 8px;
        box-shadow: 0 6px 18px rgba(15, 38, 64, 0.05);
    }

    .department-list {
        order: 2;
        width: 100%;
    }

    .menu-section {
        order: 1;
        position: relative;
        flex: 0 1 auto;
        overflow: visible;
    }

    .menu-content {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        z-index: 20;
        width: min(300px, 90vw);
        border: 1px solid #d7e0ea;
        border-radius: 8px;
        box-shadow: 0 16px 34px rgba(15, 38, 64, 0.16);
    }

    .directory-toolbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .directory-hint {
        text-align: left;
    }

    .directory-actions {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 767.98px) {
    .body-content {
        margin-top: 10px;
    }

    .body-content .row > .col-md-2 {
        display: flex;
        flex-wrap: wrap;
    }

    .department-list,
    .menu-section {
        margin-bottom: 0;
    }

    .department-list {
        display: grid;
        gap: 8px;
    }

    .menu-content {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 0 0 6px 6px;
    }

    .directory-toolbar h1 {
        font-size: 21px;
    }

    .employee-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .employee-unit {
        order: 2;
    }

    .employee-detail-button {
        justify-self: start;
        order: 3;
    }

    .directory-pagination {
        flex-wrap: wrap;
    }

    .employee-profile-details div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .employee-profile {
        grid-template-columns: 1fr;
    }

    .employee-profile-photo .img-thumbnail {
        width: 140px;
        height: 168px;
    }
}
