.project-switcher__label {
    letter-spacing: .04em;
    font-size: .7rem;
}

.project-switcher__select {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    color: #fff !important;
    font-size: 0.875rem;
}

.project-switcher__select:focus {
    border-color: rgba(13, 110, 253, 0.65) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.project-switcher__select option {
    color: #212529;
    background: #fff;
}

.project-switcher__compact {
    display: none;
}

.project-switcher__btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0.65rem auto 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    padding: 0;
}
.project-switcher__btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}
.project-switcher__dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.55);
}

/* Свёрнутое меню: только кнопка проекта */
@media (min-width: 992px) {
    html.crewdev-aside-collapsed .project-switcher__full,
    body.crewdev-aside-collapsed .project-switcher__full {
        display: none !important;
    }

    html.crewdev-aside-collapsed .project-switcher__compact,
    body.crewdev-aside-collapsed .project-switcher__compact {
        display: flex !important;
        justify-content: center;
        width: 100%;
    }

    html.crewdev-aside-collapsed .project-switcher,
    body.crewdev-aside-collapsed .project-switcher {
        padding: 0;
    }
}

/* ===== Profile ===== */
.crewdev-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}

.crewdev-profile__user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
    text-decoration: none !important;
    color: inherit;
}

.crewdev-profile__avatar {
    flex: 0 0 auto !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    object-position: center !important;
    aspect-ratio: 1 / 1 !important;
    display: block;
}

.crewdev-profile__avatar--fallback {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: var(--crewdev-avatar-bg, #64748b);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.crewdev-profile__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    line-height: 1.15;
}

.crewdev-profile__name {
    display: block;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crewdev-profile__sub {
    display: block;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crewdev-profile__notify {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: visible;
    position: relative;
}

.crewdev-profile__notify > a,
.crewdev-profile__notify .btn,
.crewdev-profile__notify button {
    overflow: visible !important;
    position: relative;
}

/* Красная точка вместо большого badge */
.crewdev-profile__notify [data-notification-target="badge"] {
    width: 7px !important;
    height: 7px !important;
    min-width: 7px !important;
    min-height: 7px !important;
    max-width: 7px !important;
    max-height: 7px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    border-radius: 50% !important;
    top: 1px !important;
    right: 0 !important;
    left: auto !important;
    transform: none !important;
    translate: none !important;
    border: 1.5px solid #1c1b22 !important;
    box-shadow: none !important;
    background: #ef4444 !important;
    z-index: 2;
}
.crewdev-profile__notify [data-notification-target="badge"] svg,
.crewdev-profile__notify [data-notification-target="badge"] * {
    display: none !important;
}

/* ===== Search compact ===== */
.crewdev-search__compact {
    display: none;
}

.crewdev-search__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    padding: 0;
}
.crewdev-search__btn:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

@media (min-width: 992px) {
    html.crewdev-aside-collapsed .crewdev-profile,
    body.crewdev-aside-collapsed .crewdev-profile {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        padding: 0.55rem 0.25rem !important;
        overflow: visible !important;
    }

    html.crewdev-aside-collapsed .crewdev-profile__user,
    body.crewdev-aside-collapsed .crewdev-profile__user {
        width: auto !important;
        flex: 0 0 auto !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    html.crewdev-aside-collapsed .crewdev-profile__meta,
    body.crewdev-aside-collapsed .crewdev-profile__meta {
        display: none !important;
    }

    html.crewdev-aside-collapsed .crewdev-profile__avatar,
    body.crewdev-aside-collapsed .crewdev-profile__avatar {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
    }

    html.crewdev-aside-collapsed .crewdev-profile__notify,
    body.crewdev-aside-collapsed .crewdev-profile__notify {
        width: auto;
        display: flex !important;
        justify-content: center !important;
        overflow: visible !important;
    }

    html.crewdev-aside-collapsed .crewdev-profile__notify .btn,
    body.crewdev-aside-collapsed .crewdev-profile__notify .btn,
    html.crewdev-aside-collapsed .crewdev-profile__notify button,
    body.crewdev-aside-collapsed .crewdev-profile__notify button,
    html.crewdev-aside-collapsed .crewdev-profile__notify > a,
    body.crewdev-aside-collapsed .crewdev-profile__notify > a {
        margin: 0 !important;
        padding: 0.3rem !important;
        overflow: visible !important;
    }

    html.crewdev-aside-collapsed .crewdev-profile__notify [data-notification-target="badge"],
    body.crewdev-aside-collapsed .crewdev-profile__notify [data-notification-target="badge"] {
        top: 0 !important;
        right: 0 !important;
        width: 6px !important;
        height: 6px !important;
        min-width: 6px !important;
        min-height: 6px !important;
    }

    html.crewdev-aside-collapsed .crewdev-search,
    body.crewdev-aside-collapsed .crewdev-search {
        padding: 0.25rem 0 0.55rem !important;
        display: flex;
        justify-content: center;
    }

    html.crewdev-aside-collapsed .crewdev-search__full,
    body.crewdev-aside-collapsed .crewdev-search__full {
        display: none !important;
    }

    html.crewdev-aside-collapsed .crewdev-search__compact,
    body.crewdev-aside-collapsed .crewdev-search__compact {
        display: flex !important;
        justify-content: center;
        width: 100%;
    }
}

.project-context-banner {
    border-left: 4px solid #0d6efd;
    background: linear-gradient(90deg, rgba(13, 110, 253, 0.08), transparent);
}

.time-preset-btn {
    min-width: 3.2rem;
}

.estimate-vs-spent {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.estimate-vs-spent .metric {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.estimate-vs-spent .metric .value {
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.2;
}

.estimate-vs-spent .metric.overspent {
    background: #fff5f5;
    border-color: #f5c2c7;
}

.overdue-badge {
    font-size: 0.7rem;
    vertical-align: middle;
}

/* Priority badges */
.priority-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem;
    border-radius: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.priority-badge__code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.72rem;
    opacity: 0.9;
}

.priority-badge--p0 { background: #dc3545; color: #fff; }
.priority-badge--p1 { background: #fd7e14; color: #fff; }
.priority-badge--p2 { background: #ffc107; color: #212529; }
.priority-badge--p3 { background: #e9ecef; color: #495057; }
.priority-badge--p4 { background: #f1f3f5; color: #868e96; }
.priority-badge--p5 { background: #f8f9fa; color: #adb5bd; border: 1px solid #e9ecef; }

/* Priority rows in task tables */
.tasks-priority-table > tbody > tr.task-row--p0 > td {
    background-color: rgba(220, 53, 69, 0.14) !important;
    box-shadow: inset 4px 0 0 #dc3545;
}

.tasks-priority-table > tbody > tr.task-row--p1 > td {
    background-color: rgba(253, 126, 20, 0.12) !important;
    box-shadow: inset 4px 0 0 #fd7e14;
}

.tasks-priority-table > tbody > tr.task-row--p2 > td {
    background-color: rgba(255, 193, 7, 0.14) !important;
    box-shadow: inset 4px 0 0 #ffc107;
}

.tasks-priority-table > tbody > tr.task-row--p3 > td {
    box-shadow: inset 4px 0 0 #ced4da;
}

.tasks-priority-table > tbody > tr.task-row--p4 > td,
.tasks-priority-table > tbody > tr.task-row--p5 > td {
    color: #6c757d;
    box-shadow: inset 4px 0 0 #e9ecef;
}

.tasks-priority-table > tbody > tr.task-row--p0:hover > td,
.tasks-priority-table > tbody > tr.task-row--p1:hover > td,
.tasks-priority-table > tbody > tr.task-row--p2:hover > td {
    filter: brightness(0.97);
}
