/* Portal navigation: white surfaces, slate typography and blue accents. */
.portal-layout { background: #f4f7fb; }
.portal-layout .content-body > main { min-width: 0; flex: 1; }
.portal-layout .portal-sidebar { background: #ffffff; width: 208px; min-width: 208px; padding: 16px 12px; color: #475569; border-right: 1px solid #f1f5f9; z-index: 1030; }
.portal-sidebar .dashboard-menu { width: 100%; margin-bottom: 24px !important; padding-bottom: 18px !important; border-bottom: 1px solid #e2e8f0; }
.portal-sidebar .dashboard-menu > a { display: flex; align-items: center; gap: 12px; padding: 12px; height: auto; line-height: 1.4; background: transparent; color: #1e293b; border-radius: 10px; text-align: left; }
.portal-sidebar .dashboard-menu > a > i { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #0284c7; color: #fff; font-size: 16px; }
.portal-sidebar .sidebar-dashboard-label { font-size: 14px; font-weight: 600; }
.portal-sidebar .main-menu { width: 100%; margin: 0 0 28px; }
.portal-sidebar .main-menu > li { padding: 0; margin-bottom: 6px; }
.portal-sidebar .main-menu > li::before, .portal-sidebar .main-menu > li::after { display: none; }
.portal-sidebar .main-menu > li > a, .portal-sidebar .main-menu > li > .dropdown > a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 11px 12px !important; border-radius: 9px !important; text-align: left; color: #475569; background: transparent; font-size: 12px; font-weight: 500; transition: background .15s, color .15s; }
.portal-sidebar .main-menu > li > a > i, .portal-sidebar .main-menu > li > .dropdown > a > i { flex: 0 0 22px; text-align: center; font-size: 16px; color: #64748b; }
.portal-sidebar .main-menu > li > .dropdown > a::after { content: '›'; margin-left: auto; color: #64748b; font-size: 20px; line-height: 1; }
.portal-sidebar .main-menu > li:not(.active) > a:hover, .portal-sidebar .main-menu > li:not(.active) > .dropdown > a:hover, .portal-sidebar .dashboard-menu > a:hover { background: #f1f5f9; color: #1e293b; }
.portal-sidebar .main-menu > li.active > a, .portal-sidebar .main-menu > li.active > .dropdown > a { background: #eff6ff !important; color: #0369a1 !important; box-shadow: inset 3px 0 #0284c7; }
.portal-sidebar .main-menu > li.active > a > i, .portal-sidebar .main-menu > li.active > .dropdown > a > i { color: #0369a1; }
.portal-sidebar .dropdown-menu.show { transform: translate3d(196px, 0, 0) !important; padding: 7px; min-width: 220px; border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 12px 40px #0f172a0a; font-size: 12px; }
.portal-sidebar .dropdown-menu::after { display: none; }
.portal-sidebar .dropdown .dropdown-item { color: #475569; padding: 10px 12px; border-radius: 6px; white-space: normal; }
.portal-sidebar .dropdown .dropdown-item:hover, .portal-sidebar .dropdown .dropdown-item:focus { background: #eff6ff; color: #0369a1; }
.portal-sidebar .secondary-menu { position: static; margin-top: auto; margin-bottom: 0; padding-top: 14px; width: 100%; border-top: 1px solid #e2e8f0; }
.portal-sidebar .secondary-menu > li:first-child { display: none; }
.portal-sidebar .secondary-menu a { display: flex; align-items: center; gap: 12px; border-radius: 8px; text-align: left; padding: 9px 12px !important; color: #64748b; font-size: 12px; }
.portal-sidebar .secondary-menu a > i { width: 22px; text-align: center; font-size: 15px; }
.portal-sidebar .secondary-menu a:hover { background: #f1f5f9; color: #1e293b; }
.portal-sidebar a:focus-visible, .portal-header a:focus-visible, .portal-header button:focus-visible { outline: 2px solid #0284c7; outline-offset: 2px; }
.portal-layout .portal-header { border-bottom: 1px solid #e2e8f0; box-shadow: 0 2px 8px #0f172a03; background: #ffffff !important; z-index: 1020; }
.portal-header > .w-100 { padding-top: 12px !important; padding-bottom: 12px !important; }
.portal-header .header-search { max-width: 360px; margin-right: 20px; }
.portal-header .header-search input { height: 42px; border: 1px solid #e2e8f0; border-radius: 9px; padding-left: 14px; padding-right: 38px; background: #ffffff; font-size: 12px; color: #475569; }
.portal-header .header-search input:focus { border-color: #0284c7; background: #fff; box-shadow: 0 0 0 3px #0284c714; }
.portal-header .header-search i { top: 14px; color: #64748b; font-size: 13px; }
.portal-header .header-menu { align-items: center; gap: 8px; }
.portal-header .header-menu > .nav-item { margin-right: 0 !important; }
.portal-header .header-menu > .nav-item > .nav-link { min-width: 38px; min-height: 38px; padding: 9px 10px; border-radius: 9px; color: #64748b; display: flex; align-items: center; justify-content: center; gap: 6px; }
.portal-header .header-menu > .nav-item > .nav-link:hover, .portal-header .header-menu > .show > .nav-link { background: #f1f5f9; color: #0284c7 !important; }
.portal-header .header-menu > .nav-item > .nav-link > i { font-size: 18px; }
.portal-header .profile-img-ico { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; border: 2px solid #e2e8f0; }
.portal-header .dropdown-menu { border: 1px solid #e2e8f0; border-radius: 12px; box-shadow: 0 14px 40px #0f172a0a; }
.portal-header .dropdown-menu .dropdown-item { font-size: 12px; color: #475569; }
.portal-header .dropdown-menu .dropdown-item:hover { background: #f1f5f9; }
.portal-header .badge-count { border: 2px solid #fff; border-radius: 10px; font-size: 9px; min-width: 18px; }
.portal-header .navbar-toggler { border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 8px; }
@media (min-width: 768px) { .portal-layout .portal-sidebar { display: flex !important; flex-direction: column; } }
@media (min-width: 768px) and (max-width: 1199px) {
    .portal-layout .portal-sidebar { width: 176px; min-width: 176px; padding-left: 8px; padding-right: 8px; }
    .portal-sidebar .dropdown-menu.show { transform: translate3d(168px, 0, 0) !important; }
    .portal-header .header-search { max-width: 240px; margin-right: 10px; }
    .portal-header .header-menu { gap: 2px; }
    .portal-header .header-menu > .nav-item > .nav-link { padding-left: 7px; padding-right: 7px; }
}
@media (max-width: 767px) {
    .portal-header .header-search { max-width: none; margin-right: 0; margin-bottom: 12px; }
    .portal-header #header-menu { padding-top: 12px; }
    .portal-header #header-menu > .nav > .nav-item > .nav-link { padding: 10px 12px; color: #475569; border-radius: 8px; }
    .portal-header #header-menu > .nav > .nav-item > .nav-link:hover { background: #f1f5f9; }
    .portal-header .mobile-menu .col-auto > a { color: #64748b; }
    .portal-header .dropdown-menu { max-width: calc(100vw - 32px); }
}

/* Floating sidebar and matching header, scoped to the authenticated layout. */
.portal-layout .portal-sidebar { width: 232px; min-width: 232px; margin: 16px 0 16px 16px; min-height: calc(100vh - 32px); border: 1px solid #e2e8f0; border-radius: 20px; padding: 22px 14px 14px; box-shadow: 0 8px 30px #0f172a05; }
.portal-sidebar .portal-brand { display: flex; align-items: center; gap: 12px; width: 100%; padding: 4px 10px 24px; margin-bottom: 18px; border-bottom: 1px solid #e2e8f0; text-decoration: none; color: #1e293b; }
.portal-brand-logo { display: block; max-width: 100%; max-height: 64px; object-fit: contain; object-position: left center; }
.portal-brand-symbol { display: grid; place-items: center; flex: 0 0 42px; height: 42px; background: #0284c7; color: #fff; border-radius: 12px; }
.portal-brand-title { font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.portal-sidebar .portal-nav-heading { padding: 12px 12px 10px; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: #94a3b8; }
.portal-sidebar .dashboard-menu { margin-bottom: 8px !important; padding-bottom: 0 !important; border: 0; }
.portal-sidebar .dashboard-menu > a { padding: 11px 12px; font-size: 13px; font-weight: 500; color: #475569; }
.portal-sidebar .dashboard-menu > a > i { width: 22px; height: 24px; border-radius: 0; background: transparent; color: #64748b; font-size: 17px; }
.portal-sidebar .sidebar-dashboard-label { font-size: 13px; font-weight: 500; }
.portal-sidebar .main-menu { margin-bottom: 8px; }
.portal-sidebar .main-menu > li > a, .portal-sidebar .main-menu > li > .dropdown > a { font-size: 13px; border-radius: 12px !important; min-height: 46px; }
.portal-sidebar .main-menu > li.active > a, .portal-sidebar .main-menu > li.active > .dropdown > a { box-shadow: none; font-weight: 600; color: #0284c7 !important; background: #eff6ff !important; }
.portal-sidebar .main-menu > li.active > a > i, .portal-sidebar .main-menu > li.active > .dropdown > a > i { color: #0284c7; }
.portal-sidebar .secondary-menu { border-top: 0; padding-top: 0; margin-top: 0; }
.portal-sidebar .secondary-menu a { font-size: 12px; }
.portal-sidebar .portal-account-item { margin-top: 20px; }
.portal-sidebar .portal-account-item > a { display: flex; gap: 10px; background: #f4f7fb; border: 1px solid #edf2f7; border-radius: 14px; padding: 12px !important; }
.portal-account-avatar { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 10px; color: #fff; background: #0284c7; font-size: 12px; font-weight: 700; }
.portal-account-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.portal-account-copy strong { color: #1e293b; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-account-copy > span { color: #64748b; font-size: 11px; }
.portal-account-chevron { margin-left: auto; color: #64748b; font-size: 20px; }
.portal-layout .portal-header { margin: 16px 16px 0; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 6px 24px #0f172a04; }
.portal-header .header-search input { border-radius: 10px; background: #f8fafc; }
.portal-sidebar .dropdown-menu.show { transform: translate3d(218px, 0, 0) !important; }
@media (min-width: 768px) and (max-width: 1199px) {
    .portal-layout .portal-sidebar { width: 196px; min-width: 196px; margin-left: 10px; padding-left: 10px; padding-right: 10px; }
    .portal-brand-title { font-size: 13px; }
    .portal-brand-symbol { flex-basis: 34px; height: 34px; }
    .portal-sidebar .dropdown-menu.show { transform: translate3d(186px, 0, 0) !important; }
    .portal-layout .portal-header { margin-left: 10px; margin-right: 10px; }
}
@media (max-width: 767px) {
    .portal-layout .portal-header { margin: 10px 8px 0; border-radius: 12px; }
}

/* Let the sidebar follow its own content instead of stretching with long pages. */
.portal-layout .portal-sidebar { align-self: flex-start; box-sizing: border-box; }
.portal-sidebar .portal-nav-icon { flex: 0 0 20px; width: 20px; height: 20px; color: #64748b; }
.portal-sidebar .main-menu > li.active > a > .portal-nav-icon,
.portal-sidebar .main-menu > li.active > .dropdown > a > .portal-nav-icon { color: #0284c7; }
.portal-sidebar .portal-nav-heading { padding-top: 16px; padding-bottom: 8px; }
.portal-sidebar .main-menu { margin-bottom: 0; }
.portal-sidebar .secondary-menu { display: flex; flex-direction: column; flex: 1; }
.portal-sidebar .secondary-menu .portal-account-item { margin-top: auto; padding-top: 16px; }

/* Consistent, readable menu typography across primary and utility navigation. */
.portal-sidebar .sidebar-dashboard-label,
.portal-sidebar .main-menu > li > a,
.portal-sidebar .main-menu > li > .dropdown > a,
.portal-sidebar .secondary-menu a { font-size: 14px; font-weight: 600; }
.portal-sidebar .main-menu > li.active > a,
.portal-sidebar .main-menu > li.active > .dropdown > a { font-weight: 700; }
.portal-sidebar .portal-nav-heading { font-size: 10px; font-weight: 600; }
.portal-sidebar .dropdown .dropdown-item { font-size: 13px; font-weight: 500; }

/* Navigation state applies to every section, including dashboard and utilities. */
.portal-sidebar a,
.portal-sidebar a:hover,
.portal-sidebar a:focus { text-decoration: none !important; }
.portal-sidebar .dashboard-menu.active > a,
.portal-sidebar .secondary-menu > li.active > a { background: #eff6ff; color: #0284c7; font-weight: 700; }
.portal-sidebar .dashboard-menu.active > a > .portal-nav-icon,
.portal-sidebar .secondary-menu > li.active > a > .portal-nav-icon { color: #0284c7; }
.portal-sidebar .dropdown .dropdown-item.active { background: #eff6ff; color: #0284c7; font-weight: 600; }
