/* DOK-290 — app shell top bar (PlaygroundLayout).
   Global on purpose: these classes style MudBlazor component roots (MudAppBar,
   MudIconButton) and popovers (rendered under MudPopoverProvider), which never
   receive Blazor scoped-CSS attributes — rules for them in
   PlaygroundLayout.razor.css silently don't apply.
   DOK-300 — white shell bar + Docker-style apps menu, Atlassian-style settings
   menu and the user menu with the appearance selector. */

.dok-app-header {
    height: 72px;
    min-height: 72px;
    padding: 0 28px;
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.dok-app-header__leading {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1 1 auto;
}

.dok-app-header__page-name {
    margin-left: 10px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dok-app-header__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.dok-app-header__search {
    width: clamp(240px, 25vw, 390px);
}

.dok-app-header__icon-button {
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    color: var(--mud-palette-text-secondary) !important;
    border: none !important;
    background: transparent !important;
}

.dok-app-header__icon-button:hover {
    background-color: rgba(32, 196, 184, 0.12) !important;
    color: #159a90 !important;
}

/* DOK-300 — the areas launcher keeps the brand navy as the single accent on the white bar. */
.dok-app-header__icon-button--primary {
    background: linear-gradient(180deg, #17355a, #14304f) !important;
    border-color: #14304f !important;
    color: #e8eef5 !important;
}

.dok-app-header__icon-button--primary:hover {
    background: #1d4370 !important;
    border-color: #1d4370 !important;
    color: #ffffff !important;
}

.dok-app-header__notification {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.dok-app-header__notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--mud-palette-error);
    color: var(--mud-palette-error-text);
    border: 2px solid var(--mud-palette-surface);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.dok-app-header__search .mud-input-outlined {
    border-radius: 10px;
    background-color: var(--mud-palette-background);
    min-height: 42px;
    color: var(--mud-palette-text-primary);
}

.dok-app-header__search .mud-input-outlined-border {
    border-color: var(--mud-palette-lines-default);
}

.dok-app-header__search .mud-input-slot {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--mud-palette-text-primary);
}

.dok-app-header__search input::placeholder {
    color: var(--mud-palette-text-secondary);
    opacity: 1;
}

.dok-app-header__search .mud-input-adornment .mud-icon-root,
.dok-app-header__search .mud-icon-button {
    color: var(--mud-palette-text-secondary);
}

/* ---- DOK-300: apps menu (Docker-Desktop style) --------------------------------------------- */

.dok-apps-popover {
    min-width: 320px;
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.dok-apps-popover .mud-list {
    padding: 6px;
}

.dok-apps-item {
    border-radius: 10px;
}

.dok-apps-item__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 2px;
}

.dok-apps-item__tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(23, 53, 90, 0.08);
    color: #17355a;
}

.dok-apps-item__copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dok-apps-item__title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--mud-palette-text-primary);
}

.dok-apps-item__desc {
    font-size: 0.76rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- DOK-300: settings menu (Atlassian style) ---------------------------------------------- */

.dok-settings-popover {
    min-width: 320px;
    max-height: min(78vh, 720px);
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.dok-settings-popover .mud-list {
    padding: 6px;
}

.dok-settings-section-label {
    padding: 10px 14px 4px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--mud-palette-text-secondary);
}

.dok-settings-item {
    border-radius: 10px;
}

.dok-settings-item .mud-menu-item-icon {
    align-self: flex-start;
    margin-top: 2px;
}

.dok-settings-item__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dok-settings-item__text {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--mud-palette-text-primary);
}

.dok-settings-item__desc {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- DOK-300: user menu (appearance selector lives here) ----------------------------------- */

.dok-user-popover {
    min-width: 300px;
    border-radius: 12px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
}

.dok-user-trigger {
    min-width: 0 !important;
    padding: 4px 6px !important;
    border-radius: 10px !important;
}

.dok-user-trigger__avatar {
    background: #1c66d6;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

.dok-user-trigger__arrow {
    margin-left: 2px;
    color: var(--mud-palette-text-secondary);
}

.dok-user-dropdown {
    min-width: 300px;
}

.dok-user-dropdown__header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.dok-user-dropdown__avatar {
    background: #1c66d6;
    color: #ffffff;
    font-weight: 700;
}

.dok-user-dropdown__identity {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dok-user-dropdown__name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--mud-palette-text-primary);
}

.dok-user-dropdown__meta {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dok-user-dropdown__meta--muted {
    font-size: 0.72rem;
    opacity: 0.85;
}

.dok-user-dropdown__section {
    padding: 6px;
}

.dok-user-dropdown__section-label {
    padding: 8px 10px 6px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.dok-user-appearance {
    display: flex;
    gap: 0;
    margin: 0 10px 8px;
    padding: 3px;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    background: var(--mud-palette-background);
}

.dok-user-appearance__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0 !important;
    padding: 7px 10px !important;
    border: 0;
    border-radius: 8px !important;
    background: transparent;
    color: var(--mud-palette-text-secondary) !important;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: none;
    cursor: pointer;
}

.dok-user-appearance__option:hover {
    color: var(--mud-palette-text-primary);
}

.dok-user-appearance__option--active {
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.dok-user-item {
    border-radius: 10px;
}

.dok-user-item__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dok-user-item__text {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--mud-palette-text-primary);
}

.dok-user-item__desc {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.dok-user-item--active .dok-user-item__text {
    font-weight: 700;
}

.dok-user-item--danger .mud-menu-item-icon,
.dok-user-item--danger {
    color: var(--mud-palette-error) !important;
}

@media (max-width: 960px) {
    .dok-app-header {
        padding: 0 16px;
    }

    .dok-app-header__search {
        width: 180px;
    }
}

@media (max-width: 720px) {
    .dok-app-header {
        height: auto;
        min-height: 72px;
        padding: 10px 14px;
    }

    .dok-app-header__leading {
        margin-right: 8px;
    }

    .dok-app-header__page-name {
        margin-left: 6px;
        font-size: 0.9rem;
    }

    .dok-app-header__actions {
        gap: 6px;
    }

    .dok-app-header__icon-button {
        width: 38px !important;
        height: 38px !important;
    }

    .dok-app-header__search {
        display: none;
        min-width: 0;
        flex: 1 1 auto;
        width: auto;
    }
}
