/* Header Styles */
.top-bar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 0 1.25rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    color: var(--text-light);
    border-bottom: none !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-bar .display-4 {
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
    padding: 0;
    font-size: var(--font-size-title, 1.25rem);
    color: var(--text-light);
    text-decoration: none;
    white-space: nowrap;
}

.top-bar .display-4:hover {
    color: var(--text-light);
    text-decoration: none;
}

/* Logo styles */
.top-bar > div:first-child {
    margin-right: 0;
}

.top-bar img {
    height: 40px !important;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    margin-right: 0;
}

.top-bar > div:first-child a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

/* Scrollable content area */
.content-scrollable {
    overflow-y: auto;
}

/* Header navigation buttons - все кнопки в шапке белого цвета без бордеров */
.top-bar .btn,
.top-bar .btn-outline-light,
.top-bar .btn-outline-info,
.top-bar .btn-outline-warning {
    color: var(--text-light) !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0.35rem 0.65rem;
}

.top-bar .btn:hover,
.top-bar .btn-outline-light:hover,
.top-bar .btn-outline-info:hover,
.top-bar .btn-outline-warning:hover {
    color: var(--text-light) !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    border: none !important;
    box-shadow: none !important;
}

.top-bar .btn:focus,
.top-bar .btn-outline-light:focus,
.top-bar .btn-outline-info:focus,
.top-bar .btn-outline-warning:focus {
    color: var(--text-light) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Единые отступы между элементами в шапке */
.top-bar > div {
    display: flex;
    align-items: center;
}

/* Контейнер с логотипом и заголовком — занимает место слева, кнопки справа */
.top-bar > div:nth-child(2) {
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

/* Навигация с кнопками */
.top-bar nav {
    gap: 0.35rem !important;
    margin: 0;
    display: flex;
    align-items: center;
}

/* «Назад» в шапке — слева от «Сотрудник», на всех страницах кабинета */
.top-bar .header-back-btn {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
}

/* Dropdown меню пользователя и уведомлений — не flex-ряд (иначе меню сжимается) */
.top-bar > .dropdown,
.top-bar > .header-notifications-dropdown {
    display: block;
    position: relative;
    flex: 0 0 auto;
}

/* Badges в шапке */
.top-bar .badge {
    color: var(--text-dark);
}

.top-bar .badge.bg-info,
.top-bar .badge.bg-warning,
.top-bar .badge.bg-danger {
    color: var(--text-light);
}

/* Колокольчик уведомлений в шапке */
.header-notifications-dropdown .header-notifications-toggle {
    min-width: 2.25rem;
}

.header-notifications-badge {
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
}

.header-notifications-panel.dropdown-menu {
    --bs-dropdown-min-width: 22rem;
    width: 22rem;
    max-width: min(22rem, calc(100vw - 1.5rem));
    max-height: min(70vh, 28rem) !important;
    margin-top: 0.5rem !important;
    padding: 0;
    overflow: hidden;
    color: #212529;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.15) !important;
    z-index: 1055;
}

.header-notifications-panel .dropdown-header {
    color: #212529;
    background-color: #f8f9fa;
    font-size: 0.875rem;
}

.header-notifications-list {
    max-height: min(65vh, 24rem);
    overflow-y: auto;
}

.header-notifications-empty {
    text-align: center;
    padding: 1.25rem 1rem !important;
}

.header-notification-item {
    position: relative;
    display: block;
    padding: 0.875rem 2.25rem 0.875rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background-color: #fff;
}

.header-notification-item:last-child {
    border-bottom: none;
}

.header-notification-item--warning {
    border-left: 4px solid #e9a100;
    background-color: #fffbeb;
}

.header-notification-item--danger {
    border-left: 4px solid #dc3545;
    background-color: #fff5f5;
}

.header-notification-item--info {
    border-left: 4px solid var(--accent-color);
    background-color: var(--section-color);
}

.header-notification-body {
    min-width: 0;
}

.header-notification-title {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.35;
    color: #212529;
    margin-bottom: 0.35rem;
    padding-right: 0.25rem;
}

.header-notification-message {
    font-size: 0.8125rem;
    line-height: 1.45;
    color: #5c636a;
    margin-bottom: 0.5rem;
}

.header-notification-action {
    display: inline-block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary-color, #2d5a27) !important;
    text-decoration: none;
    padding: 0.25rem 0;
}

.header-notification-action:hover {
    text-decoration: underline;
    color: var(--secondary-color, #1f3d1a) !important;
}

.header-notification-dismiss {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    margin: 0;
    padding: 0.35rem;
    opacity: 0.45;
    filter: none;
}

.header-notification-dismiss:hover {
    opacity: 0.85;
}

/* Изоляция панели от белого текста шапки (.top-bar { color: white }) */
.top-bar .header-notifications-panel {
    color: #212529 !important;
}

.top-bar .header-notifications-panel .dropdown-header {
    color: #212529 !important;
}

.top-bar .header-notifications-panel .header-notification-title {
    color: #212529 !important;
}

.top-bar .header-notifications-panel .header-notification-message {
    color: #5c636a !important;
}

.top-bar .header-notifications-panel .header-notifications-empty {
    color: #6c757d !important;
}

.top-bar .header-notifications-panel .btn-close {
    color: #212529;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    filter: none;
    opacity: 0.5;
}

.top-bar .header-notifications-panel .btn-close:hover {
    opacity: 0.85;
}