/* =====================================================
   Bahonar Management Page
   Completely scoped CSS
===================================================== */

.bh-management-page {
    --bh-navy: #0d2945;
    --bh-navy-light: #19466d;
    --bh-gold: #b99355;
    --bh-text: #172b3d;
    --bh-muted: #718096;
    --bh-border: #e5ebf1;
    --bh-bg: #f5f8fb;
    --bh-white: #ffffff;

    width: 100%;
    min-height: 100vh;
    padding: 48px 20px 72px;
    background: #F7FAFC;
    color: var(--bh-text);
    box-sizing: border-box;
}

.bh-management-page *,
.bh-management-page *::before,
.bh-management-page *::after {
    box-sizing: border-box;
}

.bh-management-container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

/* Header */

.bh-management-header {
    text-align: center;
    margin: 0 auto 38px;
}

.bh-management-kicker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--bh-gold);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .5px;
}

.bh-management-kicker-line {
    width: 32px;
    height: 1px;
    background: var(--bh-gold);
    opacity: .7;
}

.bh-management-title {
    margin: 13px 0 8px;
    color: var(--bh-navy);
    font-size: clamp(25px, 3vw, 38px);
    font-weight: 900;
    line-height: 1.4;
}

.bh-management-intro {
    max-width: 580px;
    margin: 0 auto;
    color: var(--bh-muted);
    font-size: 14px;
    line-height: 2;
}

/* Toolbar */

.bh-management-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px;
    margin-bottom: 38px;
    background: rgba(255, 255, 255, .85);
    border: 1px solid var(--bh-border);
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(13, 41, 69, .06);
}

.bh-management-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.bh-management-tab {
    appearance: none;
    border: 0;
    cursor: pointer;
    padding: 11px 15px;
    border-radius: 11px;
    background: transparent;
    color: var(--bh-muted);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    transition: .2s ease;
}

.bh-management-tab:hover {
    color: var(--bh-navy);
    background: #f0f4f8;
}

.bh-management-tab.is-active {
    color: #fff;
    background: var(--bh-navy);
    box-shadow: 0 5px 14px rgba(13, 41, 69, .18);
}

.bh-management-search {
    position: relative;
    flex: 0 0 230px;
}

.bh-management-search svg {
    position: absolute;
    top: 50%;
    right: 13px;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    fill: none;
    stroke: var(--bh-muted);
    stroke-width: 1.8;
    pointer-events: none;
}

.bh-management-search input {
    width: 100%;
    height: 42px;
    padding: 0 40px 0 13px;
    border: 1px solid var(--bh-border);
    border-radius: 11px;
    outline: none;
    background: #f9fbfd;
    color: var(--bh-text);
    font-family: inherit;
    font-size: 12px;
}

.bh-management-search input:focus {
    border-color: var(--bh-gold);
    background: #fff;
}

/* Groups */

.bh-management-group {
    display: none;
    margin-bottom: 42px;
    animation: bhManagementFade .3s ease both;
}

.bh-management-group.is-visible {
    display: block;
}

.bh-management-group-heading {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 18px;
}

.bh-management-group-number {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--bh-navy);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.bh-management-group-heading h2 {
    margin: 0;
    color: var(--bh-navy);
    font-size: 20px;
    font-weight: 900;
}

.bh-management-group-heading p {
    margin: 3px 0 0;
    color: var(--bh-muted);
    font-size: 12px;
}

/* Grid */

.bh-management-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

/* Cards */

.bh-management-card {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 116px;
    overflow: hidden;
    background: var(--bh-white);
    border: 1px solid var(--bh-border);
    border-radius: 16px;
    box-shadow: 0 5px 18px rgba(13, 41, 69, .055);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.bh-management-card:hover {
    transform: translateY(-4px);
    border-color: rgba(185, 147, 85, .55);
    box-shadow: 0 12px 28px rgba(13, 41, 69, .12);
}

.bh-management-card-photo {
    flex: 0 0 92px;
    align-self: stretch;
    min-height: 116px;
    background: #e9eff5;
}

.bh-management-card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bh-management-card-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--bh-navy), var(--bh-navy-light));
    color: #fff;
    font-size: 25px;
    font-weight: 900;
}

.bh-management-card-content {
    min-width: 0;
    padding: 14px 13px;
}

.bh-management-card-label {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 7px;
    overflow: hidden;
    color: var(--bh-gold);
    font-size: 10px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bh-management-card-name {
    margin: 0;
    overflow: hidden;
    color: var(--bh-navy);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.7;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bh-management-card-position {
    display: -webkit-box;
    margin: 4px 0 0;
    overflow: hidden;
    color: var(--bh-muted);
    font-size: 11px;
    line-height: 1.8;
    -webkit-box-orient: vertical;
}

/* Search empty state */

.bh-management-empty {
    display: none;
    padding: 45px 20px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    color: var(--bh-muted);
    text-align: center;
    background: rgba(255,255,255,.7);
}

.bh-management-empty.is-visible {
    display: block;
}

.bh-management-card.is-hidden {
    display: none;
}

.bh-management-group-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;

    border: 1px solid rgba(185, 147, 85, 0.45);
    border-radius: 50%;

    background: linear-gradient(
        145deg,
        #0d2945 0%,
        #19466d 100%
    );

    color: #d8b878;
    font-size: 17px;
    line-height: 1;

    box-shadow:
        0 6px 16px rgba(13, 41, 69, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);

    transition:
        transform 0.25s ease,
        background 0.25s ease,
        color 0.25s ease,
        box-shadow 0.25s ease;
}

.bh-management-group-heading:hover .bh-management-group-icon {
    transform: translateY(-2px) rotate(-4deg);

    background: linear-gradient(
        145deg,
        #b99355 0%,
        #d8b878 100%
    );

    color: #0d2945;

    box-shadow:
        0 9px 20px rgba(185, 147, 85, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.bh-management-group-icon i {
    display: block;
}

@keyframes bhManagementFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */

@media (max-width: 1100px) {
    .bh-management-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .bh-management-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .bh-management-tabs {
        justify-content: center;
    }

    .bh-management-search {
        flex-basis: auto;
        width: 100%;
    }

    .bh-management-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .bh-management-page {
        padding: 30px 13px 50px;
    }

    .bh-management-toolbar {
        padding: 9px;
    }

    .bh-management-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bh-management-tab {
        width: 100%;
        padding: 10px 6px;
        font-size: 11px;
    }

    .bh-management-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .bh-management-card {
        min-height: 105px;
    }

    .bh-management-card-photo {
        flex-basis: 84px;
        min-height: 105px;
    }

    .bh-management-group-heading h2 {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bh-management-card,
    .bh-management-group {
        transition: none;
        animation: none;
    }
}
