/* ═══════════════════════════════════════════════════════════════
   header.css — ICAS Portal header enhancements
   Layers on top of the theme's .app-header without breaking it.
   ═══════════════════════════════════════════════════════════════ */

/* ── Header base: gradient background + stronger shadow ──── */
.app-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%) !important;
    box-shadow: 0 2px 12px rgba(30, 58, 95, 0.35) !important;
    border-bottom: none !important;
    justify-content: flex-start !important;
}

/* ── Brand / Logo area ──────────────────────────────────────
   Keep the theme width (15rem) but give it a darker accent strip
   ────────────────────────────────────────────────────────── */
.app-header .brand {
    background: rgba(0, 0, 0, 0.18);
    padding: 0 1rem;
    gap: .6rem;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.app-header .brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.app-header .brand .brand-text .brand-title {
    font-size: .82rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: .5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-header .brand .brand-text .brand-subtitle {
    font-size: .65rem;
    color: rgba(255, 255, 255, .65);
    letter-spacing: .3px;
    white-space: nowrap;
}

/* ── Toggler bars — white on dark header ────────────────── */
.app-header .menu-toggler .bar,
.app-header .mobile-toggler .bar {
    background: rgba(255, 255, 255, .85) !important;
}

/* ── Portal title (center area) ─────────────────────────── */
.app-header .header-portal-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 0 1rem;
    overflow: hidden;
}

.app-header .header-portal-title .portal-name {
    font-size: .95rem;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .3px;
}

.app-header .header-portal-title .portal-sub {
    font-size: .68rem;
    color: rgba(255, 255, 255, .65);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Right-side menu items (icons + profile) ─────────────── */
.app-header .menu {
    flex: 0 0 auto !important;  /* override theme's flex:1 so portal-title takes all growth */
    margin-left: auto !important;  /* push the menu block to the far right */
    width: auto !important;
}

.app-header .menu .menu-item .menu-link {
    color: rgba(255, 255, 255, .85) !important;
    border-radius: 8px;
    transition: background .15s ease, color .15s ease;
}

.app-header .menu .menu-item .menu-link:hover {
    background: rgba(255, 255, 255, .12) !important;
    color: #ffffff !important;
}

/* ── Notification bell ───────────────────────────────────── */
.app-header .notif-icon {
    position: relative;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, .85);
}

.app-header .notif-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: .55rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    border: 2px solid transparent;
}

/* ── User avatar ─────────────────────────────────────────── */
.app-header .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, .4);
}

.app-header .user-avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, .4);
    letter-spacing: .5px;
    flex-shrink: 0;
}

.app-header .user-name-text {
    font-size: .82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .92);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header .user-role-badge {
    font-size: .62rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
    background: rgba(255, 255, 255, .18);
    color: rgba(255, 255, 255, .85);
    white-space: nowrap;
}

/* ── Profile dropdown ────────────────────────────────────── */
.app-header .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .15);
    padding: 0;
    overflow: hidden;
    min-width: 220px;
}

.app-header .dropdown-user-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%);
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-header .dropdown-user-header .duh-name {
    font-size: .88rem;
    font-weight: 700;
    color: #fff;
}

.app-header .dropdown-user-header .duh-role {
    font-size: .72rem;
    color: rgba(255, 255, 255, .7);
}

.app-header .dropdown-user-header .duh-lmno {
    font-size: .7rem;
    color: rgba(255, 255, 255, .6);
    margin-top: 1px;
}

.app-header .dropdown-user-header .duh-center {
    font-size: .68rem;
    color: rgba(255, 255, 255, .55);
}

.app-header .dropdown-menu .dropdown-item {
    padding: .6rem 1rem;
    font-size: .84rem;
    color: #374151;
    display: flex;
    align-items: center;
    gap: .55rem;
    transition: background .12s ease;
}

.app-header .dropdown-menu .dropdown-item:hover {
    background: #f0f4ff;
    color: #1e3a5f;
}

.app-header .dropdown-menu .dropdown-item i {
    font-size: 1rem;
    color: #6b7280;
    width: 18px;
    text-align: center;
}

.app-header .dropdown-menu .dropdown-item:hover i {
    color: #1e3a5f;
}

.app-header .dropdown-menu .dropdown-divider {
    margin: .25rem 0;
    border-color: #e5e7eb;
}

.app-header .dropdown-menu .dropdown-item.text-danger { color: #dc2626 !important; }
.app-header .dropdown-menu .dropdown-item.text-danger i { color: #dc2626 !important; }

/* ── Responsive: hide portal title on small screens ─────── */
@media (max-width: 768px) {
    .app-header .header-portal-title { display: none; }
    .app-header .user-name-text      { display: none; }
}
