.branding-header {
    background-color: #1a0f4d;
    color: #fff;
    padding: 6px 12px;
    border-bottom: 2px solid #c5b38b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
    width: 100%;
    box-sizing: border-box;
}

.branding-header-inner {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center !important;
    column-gap: 12px;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
}

.branding-header-left,
.branding-header-brand {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-self: start;
    gap: 0.55rem;
    min-width: 0;
    max-width: 100%;
    grid-column: 1;
    overflow: hidden;
}

.branding-header-home {
    display: inline-flex;
    line-height: 0;
    text-decoration: none;
}

.branding-header img.branding-header-logo,
.branding-header-logo {
    display: block !important;
    height: 40px !important;
    width: auto !important;
    max-height: 40px !important;
    max-width: 200px !important;
    object-fit: contain !important;
    object-position: left center;
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.35));
}

.branding-header-text {
    justify-self: center;
    text-align: center;
    min-width: 0;
    max-width: 100%;
    grid-column: 2;
}

.branding-header-title {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.branding-header-sub {
    display: none;
}

.branding-header-right {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end;
    justify-self: end;
    gap: 0.45rem;
    min-width: 0;
    grid-column: 3;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.branding-header-welcome {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.45rem;
    min-width: 0;
    flex: 1 1 auto;
    max-width: min(42vw, 320px);
    border-left: 1px solid rgba(197, 179, 139, 0.35);
    padding-left: 0.55rem;
    margin-left: 0.15rem;
}

.branding-header-avatar-link {
    display: inline-flex !important;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    line-height: 0;
    overflow: hidden;
    border-radius: 50%;
}

.branding-header img.branding-header-avatar,
.branding-header-avatar {
    display: block !important;
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
    border: 2px solid #c5b38b;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.branding-header-welcome-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

.branding-header-welcome-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.branding-header-welcome-sub {
    display: none;
}

.branding-header-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    flex: 0 0 auto;
}

.branding-header-btn,
.branding-header .btn {
    border-color: rgba(197, 179, 139, 0.65);
    color: #f4efe4;
    background: transparent;
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
    line-height: 1.2;
}

.branding-header-actions-mobile {
    display: none;
    align-items: center;
    gap: 0.4rem;
}

.branding-header-menu-details {
    position: relative;
}

.branding-header-menu-details > summary {
    list-style: none;
    cursor: pointer;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.branding-header-menu-details > summary::-webkit-details-marker {
    display: none;
}

.branding-header-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.65rem 0.75rem 0.85rem;
    background: rgba(10, 6, 40, 0.96);
    border-top: 1px solid rgba(197, 179, 139, 0.35);
}

.branding-header-menu-details .branding-header-menu-links {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 1050;
    min-width: min(78vw, 260px);
    border: 1px solid rgba(197, 179, 139, 0.4);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.branding-header-menu-link {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.75rem !important;
    font-size: 0.9rem !important;
    text-align: left;
    white-space: normal;
}

.branding-header .btn:hover,
.branding-header-btn:hover {
    border-color: #c5b38b;
    color: #1a0f4d;
    background: #c5b38b;
}

.branding-header .btn-warning {
    border-color: #f0c14b;
    color: #1a0f4d;
    background: #f0c14b;
    font-weight: 600;
}

.branding-header .btn-warning:hover {
    background: #ffd666;
    border-color: #ffd666;
    color: #1a0f4d;
}

.branding-header .btn-outline-success {
    border-color: #6ee7b7;
    color: #d1fae5;
}

.branding-header .btn-outline-success:hover {
    background: #6ee7b7;
    border-color: #6ee7b7;
    color: #064e3b;
}

.branding-header .btn-outline-primary {
    border-color: #93c5fd;
    color: #dbeafe;
}

.branding-header .btn-outline-primary:hover {
    background: #93c5fd;
    border-color: #93c5fd;
    color: #1e3a8a;
}

.branding-header .btn-primary {
    border-color: #60a5fa;
    background: #3b82f6;
    color: #fff;
}

.branding-header .btn-danger {
    border-color: #f87171;
    background: #dc2626;
    color: #fff;
}

.branding-header .btn-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
}

@media (max-width: 991.98px) {
    .branding-header--portal .branding-header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 0.35rem;
    }

    .branding-header--portal .branding-header-text {
        display: none;
    }

    .branding-header--portal .branding-header-right {
        grid-column: 2;
        overflow: visible;
    }

    .branding-header--portal .branding-header-welcome {
        max-width: min(52vw, 220px);
        padding-left: 0.4rem;
    }

    .branding-header--portal .branding-header-actions-desktop {
        display: none !important;
    }

    .branding-header--portal .branding-header-actions-mobile {
        display: flex !important;
    }

    .branding-header--portal .branding-header-actions-mobile .btn {
        min-height: 40px;
        padding: 0.4rem 0.7rem;
        font-size: 0.82rem;
    }

    .branding-header img.branding-header-logo,
    .branding-header-logo {
        max-width: 140px !important;
        height: 34px !important;
        max-height: 34px !important;
    }
}

@media (min-width: 992px) {
    .branding-header {
        padding: 8px 16px;
    }

    .branding-header img.branding-header-logo,
    .branding-header-logo {
        height: 44px !important;
        max-height: 44px !important;
        max-width: 240px !important;
    }

    .branding-header-title {
        font-size: 1.05rem;
    }

    .branding-header-avatar-link,
    .branding-header img.branding-header-avatar,
    .branding-header-avatar {
        width: 40px !important;
        height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
    }

    .branding-header-welcome-name {
        font-size: 0.92rem;
    }

    .branding-header .btn {
        font-size: 0.8125rem;
        padding: 0.3rem 0.65rem;
    }

    .branding-header-actions-mobile {
        display: none !important;
    }
}

.workspace-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.workspace-banner-member {
    background: #1a0f4d;
    color: #f4efe4;
    border-bottom: 3px solid #c5b38b;
}

.workspace-banner-admin {
    background: #111827;
    color: #e5e7eb;
    border-bottom: 3px solid #f59e0b;
}

.workspace-banner-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.workspace-banner-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.45rem;
    border-radius: 0.25rem;
}

.workspace-banner-member .workspace-banner-badge {
    background: #c5b38b;
    color: #1a0f4d;
}

.workspace-banner-admin .workspace-banner-badge {
    background: #f59e0b;
    color: #111827;
}
