/* ═══ BRAND ORGANIZATION — organization.php ══════════════ */
@keyframes rh-fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* ── Page header ── */
.b-page-head {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 1.1rem;
    padding: 1rem 1.2rem;
    margin-bottom: 1.1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    animation: rh-fadeUp .28s ease;
}
.b-page-head h1 { font-weight: 900; font-size: 1.1rem; color: #111827; margin: 0; }
.b-page-head p  { font-size: .81rem; color: #6B7280; margin: .18rem 0 0; }

/* ── Buttons ── */
.btn-bh-outline {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    color: #374151;
    border-radius: .55rem;
    padding: .4rem .9rem;
    font-size: .8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    transition: all .15s;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-bh-outline:hover { border-color: #F97316; color: #F97316; }

.btn-icon {
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    background: #F9FAFB;
    border: 1.5px solid #E5E7EB;
    border-radius: .5rem;
    color: #6B7280;
    cursor: pointer;
    font-size: .9rem;
    transition: all .15s;
    flex-shrink: 0;
}
.btn-icon:hover { border-color: #F97316; color: #F97316; background: #FFF7ED; }

.btn-primary-sm {
    background: #F97316; color: #fff; border: none;
    border-radius: .55rem; padding: .45rem 1rem;
    font-size: .82rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: .32rem;
    transition: all .15s; cursor: pointer; font-family: inherit;
}
.btn-primary-sm:hover { background: #EA580C; transform: translateY(-1px); }
.btn-primary-sm:disabled { background: #D1D5DB; cursor: not-allowed; transform: none; color: #6B7280; }

.btn-outline-sm {
    background: #fff; border: 1.5px solid #E5E7EB; color: #374151;
    border-radius: .55rem; padding: .42rem .9rem;
    font-size: .82rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: .32rem;
    transition: all .15s; cursor: pointer; font-family: inherit;
}
.btn-outline-sm:hover  { border-color: #F97316; color: #F97316; }
.btn-outline-sm:disabled { opacity: .5; cursor: not-allowed; }

.btn-reload {
    background: none; border: none; color: #9CA3AF;
    font-size: .85rem; cursor: pointer;
    display: flex; align-items: center; gap: .3rem;
    transition: color .15s; padding: .2rem .4rem; border-radius: .4rem;
}
.btn-reload:hover { color: #F97316; background: #FFF7ED; }

/* ── Alert ── */
.b-alert {
    border-radius: .75rem; padding: .65rem .95rem;
    font-size: .83rem; font-weight: 600;
    display: flex; align-items: center; gap: .5rem;
    margin-bottom: .9rem; animation: rh-fadeUp .22s ease;
}
.ba-success { background: #D1FAE5; border: 1.5px solid #6EE7B7; color: #065F46; }
.ba-danger  { background: #FEE2E2; border: 1.5px solid #FECACA; color: #991B1B; }
.ba-warning { background: #FFFBEB; border: 1.5px solid #FDE68A; color: #92400E; }

/* ── Layout ── */
.b-org-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1rem;
    align-items: start;
}
@media (max-width: 860px) {
    .b-org-layout { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.b-card {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 1.1rem;
    overflow: hidden;
    animation: rh-fadeUp .3s ease both;
    margin-bottom: .75rem;
}
.b-card:last-child { margin-bottom: 0; }

.b-card-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: .8rem 1.1rem;
    border-bottom: 1.5px solid #F3F4F6;
}
.b-card-head h2 {
    font-weight: 800; font-size: .88rem; color: #111827;
    margin: 0; display: flex; align-items: center; gap: .4rem;
}
.b-card-body { padding: 1.1rem; }

/* ── Inline create form ── */
.b-inline-form {
    padding: 1rem 1.1rem;
    background: #F9FAFB;
    border-bottom: 1.5px solid #E5E7EB;
}
.b-inline-form-title {
    font-weight: 800; font-size: .82rem; color: #374151;
    margin-bottom: .75rem;
    display: flex; align-items: center; gap: .35rem;
}

/* ── Form elements ── */
.flabel {
    font-weight: 700; font-size: .74rem;
    text-transform: uppercase; letter-spacing: .5px;
    color: #6B7280; display: block; margin-bottom: .28rem;
}
.flabel .req  { color: #F97316; }
.flabel .hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: #9CA3AF; margin-left: .3rem; }

.finp {
    width: 100%; background: #fff;
    border: 1.5px solid #E5E7EB; border-radius: .6rem;
    padding: .5rem .78rem; font-size: .85rem;
    font-family: inherit; color: #111827;
    transition: border-color .16s, box-shadow .16s;
}
.finp:focus { outline: none; border-color: #F97316; box-shadow: 0 0 0 3px rgba(249,115,22,.1); }
.finp::placeholder { color: #D1D5DB; }
.b-inline-form .finp { background: #fff; }

select.finp {
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .75rem center;
}

.form-hint { font-size: .73rem; color: #9CA3AF; margin-top: .22rem; }

/* ── Org list ── */
.b-org-item {
    display: flex; align-items: flex-start; gap: .7rem;
    padding: .7rem .9rem;
    border: 1.5px solid #E5E7EB; border-radius: .7rem;
    margin-bottom: .45rem; cursor: pointer;
    transition: all .16s; background: #fff;
}
.b-org-item:last-child { margin-bottom: 0; }
.b-org-item:hover  { border-color: #FDBA74; background: #FFF7ED; }
.b-org-item.selected { border-color: #F97316; background: #FFF7ED; }

.b-org-avatar {
    width: 34px; height: 34px; border-radius: .6rem;
    background: #F97316; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: .74rem; flex-shrink: 0;
}
.b-org-info { flex: 1; min-width: 0; }
.b-org-name { font-weight: 700; font-size: .86rem; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-org-sub  { font-size: .71rem; color: #6B7280; margin-top: .1rem; }

.b-org-role {
    font-size: .67rem; font-weight: 800;
    padding: .1rem .45rem; border-radius: 99px;
    background: #FFF7ED; color: #C2410C; flex-shrink: 0; margin-top: 2px;
}

.b-org-perms { margin-top: .28rem; }
.b-org-perm {
    display: inline-flex; align-items: center; gap: .22rem;
    font-size: .67rem; font-weight: 700;
    padding: .08rem .45rem; border-radius: 99px;
}
.b-org-perm.allowed { background: #D1FAE5; color: #065F46; }
.b-org-perm.blocked { background: #FEE2E2; color: #991B1B; }

.b-org-count {
    display: inline-block; font-size: .67rem; font-weight: 700;
    background: #EEF2FF; color: #4338CA;
    padding: .04rem .38rem; border-radius: 99px; margin-left: .25rem;
}

.b-org-empty {
    text-align: center; padding: 1.5rem; color: #9CA3AF;
    font-size: .84rem; border: 1.5px dashed #E5E7EB; border-radius: .75rem;
}
.b-org-empty .emo { font-size: 1.8rem; margin-bottom: .4rem; }

/* ── Org summary card ── */
.b-org-summary {
    background: #fff;
    border: 1.5px solid #E5E7EB;
    border-radius: 1rem;
    padding: 0;
    margin-bottom: .75rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    animation: rh-fadeUp .2s ease;
    overflow: hidden;
}
.b-sum-item {
    padding: .9rem 1.1rem;
    border-right: 1.5px solid #F3F4F6;
    border-bottom: 1.5px solid #F3F4F6;
    display: flex; flex-direction: column; gap: .18rem;
}
.b-sum-item:nth-child(3n) { border-right: none; }
.b-sum-item:nth-last-child(-n+3) { border-bottom: none; }

.b-sum-lbl {
    font-size: .67rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .55px;
    color: #9CA3AF;
}
.b-sum-val {
    font-size: .95rem; font-weight: 700;
    color: #111827; line-height: 1.3;
}

@media (max-width: 600px) {
    .b-org-summary { grid-template-columns: repeat(2, 1fr); }
    .b-sum-item:nth-child(3n)   { border-right: 1.5px solid #F3F4F6; }
    .b-sum-item:nth-child(2n)   { border-right: none; }
    .b-sum-item:nth-last-child(-n+2) { border-bottom: none; }
}

/* ── Tabs ── */
.b-tabs {
    display: flex; gap: .3rem;
    margin-bottom: .6rem;
}
.b-tab {
    background: #fff; border: 1.5px solid #E5E7EB;
    border-radius: .6rem; padding: .42rem .9rem;
    font-size: .8rem; font-weight: 700; color: #6B7280;
    cursor: pointer; font-family: inherit; transition: all .15s;
    display: inline-flex; align-items: center;
}
.b-tab:hover  { border-color: #F97316; color: #F97316; }
.b-tab.active { background: #F97316; border-color: #F97316; color: #fff; }

/* ── Member list ── */
.b-member-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .75rem;
    background: #F9FAFB; border: 1.5px solid #E5E7EB;
    border-radius: .65rem; margin-bottom: .4rem;
}
.b-member-row:last-child { margin-bottom: 0; }
.b-member-info { flex: 1; min-width: 0; }
.b-member-email { display: block; font-size: .84rem; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-member-id    { font-size: .69rem; color: #9CA3AF; }

.b-member-badge {
    font-size: .66rem; font-weight: 800;
    padding: .1rem .46rem; border-radius: 99px;
    background: #F3F4F6; color: #374151; flex-shrink: 0;
}
.b-member-badge.owner { background: #FEF3C7; color: #92400E; }

/* ── Toast ── */
#b-toast-wrap {
    position: fixed; bottom: 1.2rem; left: 50%;
    transform: translateX(-50%); z-index: 9999;
    display: flex; flex-direction: column; gap: .35rem;
    align-items: center; pointer-events: none;
}
.b-toast {
    background: #1F2937; color: #F9FAFB;
    border-radius: 50px; padding: .5rem 1.1rem;
    font-size: .8rem; font-weight: 600;
    display: flex; align-items: center; gap: .4rem;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    animation: rh-fadeUp .22s ease; pointer-events: all;
}
.bt-s { background: #065F46; }
.bt-e { background: #991B1B; }
.bt-w { background: #92400E; }
