/* 
   TechIP Design System - Tokens & Base
   
   Source of truth for visual styling across LMP-Portal.
   Loaded BEFORE custom.css and primefaces-overrides.css so all
   downstream rules can reference these tokens via var(...).
    */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

:root {
    /*  Brand  */
    --ds-color-primary: #305476;
    --ds-color-primary-hover: #264563;
    --ds-color-primary-soft: #eef3f8;
    --ds-color-secondary: #393b41;
    --ds-color-accent: #2ea3f2;

    /*  Surfaces  */
    /* Semantic roles:
       --ds-color-bg            primary surface - cards, panels, dialogs, tables, forms
       --ds-color-surface       secondary surface - table headers, toolbars, hover states
       --ds-color-surface-alt   ultra-light surface - striped table rows
       --ds-color-surface-muted page background - subtle neutral behind everything */
    --ds-color-bg: #ffffff;
    --ds-color-surface: #f4f6f8;
    --ds-color-surface-alt: #fafbfc;
    --ds-color-surface-muted: #f5f7fa;

    /*  Text  */
    --ds-color-text-primary: #4d5058;
    --ds-color-text-strong: #0a1118;
    --ds-color-text-secondary: #666666;
    --ds-color-text-muted: #94969b;
    --ds-color-text-light: #b8b9bc;
    --ds-color-text-on-primary: #ffffff;

    /*  Borders  */
    --ds-color-border: #e5e7eb;
    --ds-color-border-soft: #e8e8e8;
    --ds-color-border-strong: #dbdcde;
    --ds-color-border-alpha: rgba(0, 0, 0, 0.1);

    /*  Status colors (for badges / messages / metric icons)  */
    --ds-color-success: #16a34a;
    --ds-color-success-bg: #ecfdf5;
    --ds-color-success-text: #166534;
    --ds-color-warning: #d97706;
    --ds-color-warning-bg: #fffbeb;
    --ds-color-warning-text: #92400e;
    --ds-color-danger: #dc2626;
    --ds-color-danger-bg: #fef2f2;
    --ds-color-danger-text: #991b1b;
    --ds-color-info: #2ea3f2;
    --ds-color-info-bg: #eff6ff;
    --ds-color-info-text: #1e40af;

    /*  Effects  */
    --ds-shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.10);
    --ds-shadow-md: 0 2px 5px rgba(0, 0, 0, 0.10);
    --ds-shadow-header: 0 12px 12px -19px rgba(0, 0, 0, 0.30);
    --ds-shadow-inner-soft: inset 0 0 7px rgba(0, 0, 0, 0.07);
    --ds-shadow-card-hover: 0 1px 3px 0 rgba(0, 0, 0, 0.10), 0 1px 2px -1px rgba(0, 0, 0, 0.10);

    /*  Radius  */
    --ds-radius-sm: 3px;
    --ds-radius-md: 4px;
    --ds-radius-lg: 6px;
    --ds-radius-full: 9999px;

    /*  Typography  */
    --ds-font-sans: "Plus Jakarta Sans", "Helvetica", "Arial", sans-serif;
    --ds-font-fallback: "Open Sans", Arial, sans-serif;

    --ds-font-size-caption: 13px;
    --ds-font-size-small: 14px;
    --ds-font-size-body: 16px;
    --ds-font-size-h6: 16px;
    --ds-font-size-h5: 18px;
    --ds-font-size-h4: 21px;
    --ds-font-size-h3: 24px;
    --ds-font-size-h2: 32px;
    --ds-font-size-h1: 40px;

    --ds-line-height-body: 1.6;
    --ds-line-height-tight: 1.3;

    --ds-font-weight-regular: 400;
    --ds-font-weight-medium: 500;
    --ds-font-weight-semibold: 600;
    --ds-font-weight-bold: 700;

    /*  Spacing scale  */
    --ds-space-xs: 4px;
    --ds-space-sm: 8px;
    --ds-space-10: 10px;
    --ds-space-12: 12px;
    --ds-space-md: 16px;
    --ds-space-20: 20px;
    --ds-space-lg: 24px;
    --ds-space-xl: 32px;
    --ds-space-2xl: 40px;
    --ds-space-3xl: 54px;
    --ds-space-4xl: 64px;

    /*  Layout  */
    --ds-max-width-content: 1200px;
    --ds-max-width-wide: none;

    /*  Motion  */
    --ds-ease-default: ease;
    --ds-dur-fast: 200ms;
    --ds-dur-base: 300ms;
    --ds-dur-slow: 400ms;

    /*  Gradient (premium / hero accents only)  */
    --ds-gradient-brand-dark: linear-gradient(135deg, #1a1230 0%, #110c1d 100%);

    /* 
       Backwards-compat aliases - existing custom.css and theme.css
       reference these older variable names. We re-bind them to the
       new design-system tokens so legacy code automatically picks
       up the new styling.
        */
    --paragraph-font: "Plus Jakarta Sans";
    --button-primary-background: var(--ds-color-primary);
    --button-primary-border-color: var(--ds-color-primary);
    --button-border-radius: var(--ds-radius-md);
    /* Breadcrumbs use text-primary instead of secondary so the trail is
       readable while still letting the active item stand out. */
    --breadcrumb-item-color: var(--ds-color-text-primary);
    --breadcrumb-item-color-active: var(--ds-color-primary);
    --chip-background: var(--ds-color-surface);
    --chip-color: var(--ds-color-secondary);
    --chip-padding-y: 4px;
    --chip-padding-x: 10px;
    --chip-gap: 6px;
    --chip-border-radius: var(--ds-radius-md);
}

/* 
   Base typography
    */

html {
    font-size: 14px;
}

body,
body.authBody {
    font-family: var(--ds-font-sans);
    color: var(--ds-color-text-primary);
    background-color: var(--ds-color-bg);
    font-size: var(--ds-font-size-small);
    line-height: var(--ds-line-height-body);
    letter-spacing: 0;
    font-weight: var(--ds-font-weight-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ds-font-sans);
    color: var(--ds-color-text-strong);
    font-weight: var(--ds-font-weight-semibold);
    line-height: var(--ds-line-height-tight);
    margin-top: 0;
}

h1 { font-size: var(--ds-font-size-h1); line-height: 1.2; }
h2 { font-size: var(--ds-font-size-h2); line-height: 1.25; }
h3 { font-size: var(--ds-font-size-h3); }
h4 { font-size: var(--ds-font-size-h4); line-height: 1.4; }
h5 { font-size: var(--ds-font-size-h5); font-weight: var(--ds-font-weight-medium); line-height: 1.5; }
h6 { font-size: var(--ds-font-size-h6); font-weight: var(--ds-font-weight-medium); line-height: 1.5; }

a {
    color: var(--ds-color-primary);
    text-decoration: none;
    transition: opacity var(--ds-dur-base) var(--ds-ease-default);
}

a:hover {
    opacity: 0.85;
}

small, .ds-text-small {
    font-size: var(--ds-font-size-caption);
}

.ds-text-muted   { color: var(--ds-color-text-muted) !important; }
.ds-text-strong  { color: var(--ds-color-text-strong) !important; }
.ds-text-primary { color: var(--ds-color-primary) !important; }

/* 
   Layout chrome
    */

.layout-wrapper {
    background-color: var(--ds-color-bg);
}

/* The page background shared across all LMP screens.
   Pages used to repeat this inline; we now centralise it. */
body .layout-main > .layout-content {
    background: var(--ds-color-surface-muted);
}

/* 
   Layout chrome: top-nav layout
   
   The legacy rain-layout sidebar has been retired in favour of a
   horizontal top navigation. We override the rain-layout sidebar
   reservation so the main content area takes the full viewport
   width on every breakpoint.
    */

body .menu-wrapper {
    /* The container is empty (see /private/menu.xhtml) but the rain-layout
       CSS still positions a 240px fixed pane. Hide it everywhere. */
    display: none !important;
}

body .layout-wrapper.layout-static .layout-main,
body .layout-wrapper.layout-static.layout-static-active .layout-main,
body .layout-wrapper.layout-overlay .layout-main,
body .layout-wrapper.layout-horizontal .layout-main,
body .layout-wrapper .layout-main {
    margin-left: 0 !important;
    /* Top padding accommodates the fixed top-nav bar (60px). */
    padding-top: 60px;
}

@media (max-width: 992px) {
    body .layout-wrapper .layout-main {
        padding-top: 60px;
    }
}

/* Hide the legacy hamburger inside rain-layout's topbar wrapper -
   our new top-nav has its own mobile toggle. */
body .layout-topbar-wrapper .menu-button-wrapper {
    display: none !important;
}

/* The legacy .layout-topbar wrapper from rain-layout is no longer
   our chrome - we render our own .lmp-topbar. Hide the legacy shell. */
body .layout-topbar {
    display: none !important;
}

/* Layout footer override (brand-aligned) */
body .layout-footer {
    background: var(--ds-color-bg) !important;
    border-top: 1px solid var(--ds-color-border) !important;
    color: var(--ds-color-text-secondary);
    display: flex !important;
    font-family: var(--ds-font-sans);
    justify-content: center !important;
    padding: 0 !important;
    width: 100%;
}

body .layout-footer .lmp-footer-inner {
    box-sizing: border-box;
    max-width: var(--ds-max-width-wide);
    margin: 0 auto;
    padding: 0 var(--ds-space-lg);
    width: 100%;
}

body .footer-copyright,
body .footer-copyright span {
    font-family: var(--ds-font-sans);
    color: var(--ds-color-text-secondary);
}

body .footer-menu .ui-link,
body .footer-menu a {
    font-family: var(--ds-font-sans);
    color: var(--ds-color-text-secondary) !important;
}

body .footer-menu .ui-link:hover,
body .footer-menu a:hover {
    background: var(--ds-color-surface);
    color: var(--ds-color-text-strong) !important;
}

/* Content max width - desktop comfort */
.layout-content {
    max-width: none;
}

/* 
   Utility classes (used selectively in markup)
    */

.ds-stack-xs > * + * { margin-top: var(--ds-space-xs); }
.ds-stack-sm > * + * { margin-top: var(--ds-space-sm); }
.ds-stack-md > * + * { margin-top: var(--ds-space-md); }
.ds-stack-lg > * + * { margin-top: var(--ds-space-lg); }

.ds-divider {
    border: 0;
    border-top: 1px solid var(--ds-color-border);
    margin: var(--ds-space-lg) 0;
}

/* 
   LMP Top Navigation

   Single-row enterprise top navigation: brand, primary workflow
   groups, and user account controls. Dropdown visibility is controlled
   by `.lmp-topnav-item--open` so CSS and JavaScript share one state.

   Z-index stack:
   1200 topbar and skip link
   1210 desktop dropdowns and mobile nav panel
   1220 mobile user dropdown
    */

/*  Skip link  */
.lmp-skip-link {
    position: absolute;
    top: 0;
    left: 0;
    padding: 8px 16px;
    background: var(--ds-color-primary);
    color: var(--ds-color-text-on-primary);
    font-family: var(--ds-font-sans);
    font-size: 14px;
    font-weight: var(--ds-font-weight-semibold);
    border-radius: 0 0 var(--ds-radius-md) 0;
    text-decoration: none;
    transform: translateY(-100%);
    transition: transform var(--ds-dur-fast) var(--ds-ease-default);
    z-index: 1200;
}

.lmp-skip-link:focus,
.lmp-skip-link:focus-visible {
    transform: translateY(0);
    outline: 2px solid var(--ds-color-text-strong);
    outline-offset: -4px;
    color: var(--ds-color-text-on-primary);
    text-decoration: none;
}

.lmp-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 1200;
    background: var(--ds-color-bg);
    border-bottom: 1px solid var(--ds-color-border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05), 0 10px 24px rgba(15, 23, 42, 0.035);
    font-family: var(--ds-font-sans);
}

.lmp-topbar-inner {
    height: 100%;
    max-width: var(--ds-max-width-wide);
    margin: 0 auto;
    padding: 0 var(--ds-space-lg);
    display: flex;
    align-items: center;
    gap: var(--ds-space-lg);
    min-width: 0;
}

/*  Brand  */

.lmp-topbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
    transition: opacity var(--ds-dur-fast) var(--ds-ease-default);
}

.lmp-topbar-brand:hover {
    opacity: 0.9;
    text-decoration: none;
}

.lmp-topbar-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-color-primary);
    color: var(--ds-color-text-on-primary);
    font-family: var(--ds-font-sans);
    font-weight: var(--ds-font-weight-bold);
    font-size: 13px;
    letter-spacing: 0;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.lmp-topbar-brand-text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.15;
}

.lmp-topbar-brand-name {
    font-size: 14px;
    font-weight: var(--ds-font-weight-semibold);
    color: var(--ds-color-text-strong);
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.lmp-topbar-brand-tenant {
    font-size: 11px;
    font-weight: var(--ds-font-weight-medium);
    color: var(--ds-color-text-secondary);
    letter-spacing: 0;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Hide tenant chip below the tablet breakpoint so it never wraps the
   brand name onto a second line - the brand alone reads cleaner there. */
@media (max-width: 768px) {
    .lmp-topbar-brand-tenant { display: none; }
}

@media (max-width: 480px) {
    .lmp-topbar-brand-name { max-width: 160px; }
}

/*  Mobile toggle  */

.lmp-topbar-mobile-toggle {
    display: none;
    margin-left: auto;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--ds-color-text-strong);
    border: 1px solid transparent;
    border-radius: var(--ds-radius-md);
    cursor: pointer;
    transition: background var(--ds-dur-fast) var(--ds-ease-default),
                border-color var(--ds-dur-fast) var(--ds-ease-default);
}

.lmp-topbar-mobile-toggle:hover {
    background: var(--ds-color-surface);
    border-color: var(--ds-color-border);
}

.lmp-topbar-mobile-toggle i {
    font-size: 18px;
}

/*  Primary nav  */

.lmp-topnav {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.lmp-topnav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.lmp-topnav-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

/* The link element sits inside an <h:link> wrapper.
   We target both the wrapper (when JSF renders <a>) and the inner
   .lmp-topnav-link button so styling is consistent. */
.lmp-topnav-list .lmp-topnav-item > a.lmp-topnav-link,
.lmp-topnav-list .lmp-topnav-item > .lmp-topnav-link,
.lmp-topnav-list .lmp-topnav-item > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    margin: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ds-radius-md);
    color: var(--ds-color-text-primary);
    font-family: var(--ds-font-sans);
    font-size: 14px;
    font-weight: var(--ds-font-weight-medium);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--ds-dur-fast) var(--ds-ease-default),
                color var(--ds-dur-fast) var(--ds-ease-default),
                box-shadow var(--ds-dur-fast) var(--ds-ease-default);
    white-space: nowrap;
}

.lmp-topnav-list .lmp-topnav-item > a.lmp-topnav-link > .lmp-topnav-link-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lmp-topnav-list .lmp-topnav-item > a.lmp-topnav-link:hover,
.lmp-topnav-list .lmp-topnav-item > .lmp-topnav-link:hover,
.lmp-topnav-list .lmp-topnav-item > a:hover {
    background: var(--ds-color-surface);
    color: var(--ds-color-text-strong);
    text-decoration: none;
    opacity: 1;
    box-shadow: inset 0 0 0 1px rgba(219, 220, 222, 0.72);
}

.lmp-topnav-list .lmp-topnav-item > a.lmp-topnav-link:focus-visible,
.lmp-topnav-list .lmp-topnav-item > .lmp-topnav-link:focus-visible {
    outline: 2px solid var(--ds-color-primary);
    outline-offset: 2px;
}

.lmp-topnav-link i {
    font-size: 14px;
    color: var(--ds-color-text-secondary);
    transition: color var(--ds-dur-fast) var(--ds-ease-default);
}

.lmp-topnav-list .lmp-topnav-item > .lmp-topnav-link:hover i,
.lmp-topnav-list .lmp-topnav-item > a:hover i {
    color: var(--ds-color-primary);
}

.lmp-topnav-link-label {
    display: inline-block;
}

.lmp-topnav-caret {
    font-size: 10px !important;
    margin-left: 2px;
    opacity: 0.7;
    transition: transform var(--ds-dur-fast) var(--ds-ease-default);
}

/* Active state - adds a colored underline accent and brand text */
.lmp-topnav-item.is-active > a.lmp-topnav-link,
.lmp-topnav-item.is-active > .lmp-topnav-link,
.lmp-topnav-item.is-active > a,
.lmp-topnav-item.is-active-group > .lmp-topnav-link {
    color: var(--ds-color-primary);
    background: var(--ds-color-primary-soft);
    box-shadow: inset 0 0 0 1px rgba(48, 84, 118, 0.10);
}

.lmp-topnav-item.is-active > .lmp-topnav-link i,
.lmp-topnav-item.is-active > a i,
.lmp-topnav-item.is-active-group > .lmp-topnav-link i {
    color: var(--ds-color-primary);
}

/* Open dropdown rotates the caret */
.lmp-topnav-item--open > .lmp-topnav-link .lmp-topnav-caret,
.lmp-topnav-item--open > .lmp-topbar-user-button .lmp-topnav-caret {
    transform: rotate(180deg);
}

/*  Dropdown panel  */

.lmp-topnav-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    left: 0;
    min-width: 280px;
    max-width: calc(100vw - 24px);
    margin-top: 0;
    padding: 10px;
    background: var(--ds-color-bg);
    border: 1px solid var(--ds-color-border);
    border-radius: var(--ds-radius-md);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14), 0 3px 12px rgba(15, 23, 42, 0.08);
    /* Use pointer-events instead of `visibility` so the open/close
       transition doesn't introduce a 200ms unclickable window when
       the panel becomes visible via hover. */
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity var(--ds-dur-fast) var(--ds-ease-default),
                transform var(--ds-dur-fast) var(--ds-ease-default);
    z-index: 1210;
}

.lmp-topnav-item--open > .lmp-topnav-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.lmp-topnav-dropdown--narrow { min-width: 220px; }
.lmp-topnav-dropdown--user   { min-width: 220px; right: 0; left: auto; }

/* The right-most dropdown trigger (Administration) is anchored close
   to the viewport edge; flip its panel to grow leftward so it doesn't
   clip past the right edge on narrow desktop widths (~1024px). */
.lmp-topnav-list .lmp-topnav-item--has-dropdown:last-of-type > .lmp-topnav-dropdown {
    left: auto;
    right: 0;
}

.lmp-topnav-dropdown-section {
    display: block;
    padding: 8px 12px 4px 12px;
    font-size: 11px;
    font-weight: var(--ds-font-weight-semibold);
    color: var(--ds-color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0;
}

.lmp-topnav-dropdown-section + .lmp-topnav-dropdown-section {
    margin-top: 4px;
    border-top: 1px solid var(--ds-color-border);
    padding-top: 12px;
}

.lmp-topnav-dropdown-divider {
    height: 1px;
    background: var(--ds-color-border);
    margin: 6px 0;
}

.lmp-topnav-dropdown-form {
    display: block;
    margin: 0;
    padding: 0;
}

/* Dropdown items - all selectors below cover both <h:link> (renders <a>)
   and <p:commandLink> (renders <a>) cases. */
.lmp-topnav-dropdown a.lmp-topnav-dropdown-item,
.lmp-topnav-dropdown .lmp-topnav-dropdown-item {
    display: block;
    padding: 10px 12px;
    border-radius: var(--ds-radius-md);
    color: var(--ds-color-text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--ds-dur-fast) var(--ds-ease-default),
                color var(--ds-dur-fast) var(--ds-ease-default),
                transform var(--ds-dur-fast) var(--ds-ease-default);
}

.lmp-topnav-dropdown a.lmp-topnav-dropdown-item:hover,
.lmp-topnav-dropdown .lmp-topnav-dropdown-item:hover {
    background: var(--ds-color-primary-soft);
    color: var(--ds-color-primary);
    text-decoration: none;
    opacity: 1;
    transform: translateX(1px);
}

.lmp-topnav-dropdown a.lmp-topnav-dropdown-item:focus-visible,
.lmp-topnav-dropdown .lmp-topnav-dropdown-item:focus-visible {
    outline: 2px solid var(--ds-color-primary);
    outline-offset: -2px;
}

.lmp-topnav-dropdown-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.lmp-topnav-dropdown-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ds-radius-md);
    background: var(--ds-color-surface);
    color: var(--ds-color-primary);
    flex-shrink: 0;
    font-size: 14px;
    transition: background var(--ds-dur-fast) var(--ds-ease-default);
}

.lmp-topnav-dropdown-item:hover .lmp-topnav-dropdown-icon {
    background: var(--ds-color-bg);
}

.lmp-topnav-dropdown-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.35;
    min-width: 0;
}

.lmp-topnav-dropdown-title {
    font-family: var(--ds-font-sans);
    font-size: 14px;
    font-weight: var(--ds-font-weight-semibold);
    color: var(--ds-color-text-strong);
    transition: color var(--ds-dur-fast) var(--ds-ease-default);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lmp-topnav-dropdown-item:hover .lmp-topnav-dropdown-title {
    color: var(--ds-color-primary);
}

.lmp-topnav-dropdown-desc {
    font-size: 12px;
    font-weight: var(--ds-font-weight-regular);
    color: var(--ds-color-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Compact dropdown variant - single-line items used by Administration */
.lmp-topnav-dropdown-item--compact {
    padding: 8px 12px;
}

.lmp-topnav-dropdown-item--compact .lmp-topnav-dropdown-row {
    align-items: center;
    gap: 8px;
}

.lmp-topnav-dropdown-glyph {
    color: var(--ds-color-text-secondary);
    font-size: 14px;
    width: 18px;
    text-align: center;
    transition: color var(--ds-dur-fast) var(--ds-ease-default);
}

.lmp-topnav-dropdown-item:hover .lmp-topnav-dropdown-glyph {
    color: var(--ds-color-primary);
}

.lmp-topnav-dropdown-item.is-active .lmp-topnav-dropdown-title,
.lmp-topnav-dropdown-item.is-active .lmp-topnav-dropdown-glyph,
.lmp-topnav-dropdown-item.is-active .lmp-topnav-dropdown-icon {
    color: var(--ds-color-primary);
}

.lmp-topnav-dropdown-item.is-active {
    background: var(--ds-color-primary-soft);
}

.lmp-topnav-dropdown-item.is-active .lmp-topnav-dropdown-icon {
    background: var(--ds-color-bg);
}

.lmp-topnav-dropdown-item--danger:hover .lmp-topnav-dropdown-title,
.lmp-topnav-dropdown-item--danger:hover .lmp-topnav-dropdown-glyph {
    color: var(--ds-color-danger);
}

.lmp-topnav-dropdown-item--danger:hover {
    background: var(--ds-color-danger-bg);
}

/*  User menu  */

.lmp-topbar-user {
    position: relative;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 100%;
}

.lmp-topbar-user-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 12px 0 4px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ds-radius-md);
    color: var(--ds-color-text-primary);
    cursor: pointer;
    font-family: var(--ds-font-sans);
    font-size: 13px;
    transition: background var(--ds-dur-fast) var(--ds-ease-default),
                border-color var(--ds-dur-fast) var(--ds-ease-default);
}

.lmp-topbar-user-button:hover {
    background: var(--ds-color-surface);
    border-color: var(--ds-color-border);
}

.lmp-topbar-user-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ds-color-primary);
    color: var(--ds-color-text-on-primary);
    font-size: 12px;
    font-weight: var(--ds-font-weight-bold);
    letter-spacing: 0;
    flex-shrink: 0;
}

.lmp-topbar-user-info {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
    min-width: 0;
}

.lmp-topbar-user-name {
    font-size: 13px;
    font-weight: var(--ds-font-weight-semibold);
    color: var(--ds-color-text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.lmp-topbar-user-email {
    font-size: 11px;
    color: var(--ds-color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

@media (max-width: 1100px) {
    .lmp-topbar-user-info { display: none; }
}

/* Responsive: collapse to a mobile menu under 960px. The user menu
   stays in the topbar as an avatar control while workflow navigation
   moves into the slide-down panel. */

@media (max-width: 960px) {
    .lmp-topbar-inner {
        gap: 8px;
    }

    .lmp-topbar-mobile-toggle {
        display: inline-flex;
        margin-left: auto;
        order: 2;
    }

    /* Ordered after the hamburger so [brand] [...] [hamburger] [user]. */
    .lmp-topbar-user {
        order: 3;
        margin-left: 0;
        height: 40px;
    }

    .lmp-topbar-user-button {
        padding: 0;
        height: 40px;
        width: 40px;
        justify-content: center;
        background: var(--ds-color-bg);
        border-color: var(--ds-color-border);
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    }

    .lmp-topbar-user.lmp-topnav-item--open .lmp-topbar-user-button {
        background: var(--ds-color-primary-soft);
        border-color: rgba(48, 84, 118, 0.20);
    }

    .lmp-topbar-user-button .lmp-topnav-caret {
        display: none;
    }

    .lmp-topnav {
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        height: auto;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        background: var(--ds-color-bg);
        border-bottom: 1px solid var(--ds-color-border);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
        display: none;
        z-index: 1210;
    }

    .lmp-topbar.lmp-topbar--mobile-open .lmp-topnav {
        display: block;
    }

    .lmp-topnav-list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        height: auto;
        padding: 8px;
    }

    .lmp-topnav-item {
        height: auto;
        flex-direction: column;
        align-items: stretch;
    }

    .lmp-topnav-list .lmp-topnav-item > a.lmp-topnav-link,
    .lmp-topnav-list .lmp-topnav-item > .lmp-topnav-link {
        height: 44px;
        justify-content: flex-start;
        width: 100%;
    }

    /* Mobile: dropdown becomes inline disclosure, not a popover. */
    .lmp-topnav-dropdown {
        position: static;
        transform: none;
        opacity: 1;
        pointer-events: auto;
        margin: 0 0 4px 0;
        padding: 4px 0 4px 16px;
        background: transparent;
        border: none;
        box-shadow: none;
        min-width: 0;
        display: none;
    }

    .lmp-topnav-item--open > .lmp-topnav-dropdown {
        display: block;
    }

    /* User dropdown still anchors to the avatar (top-right of bar). */
    .lmp-topnav-dropdown--user {
        position: absolute;
        top: 60px;
        right: 8px;
        left: auto;
        min-width: 220px;
        max-width: calc(100vw - 24px);
        padding: 8px;
        background: var(--ds-color-bg);
        border: 1px solid var(--ds-color-border);
        border-radius: var(--ds-radius-md);
        box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16), 0 3px 12px rgba(15, 23, 42, 0.08);
        z-index: 1220;
    }
}

/* Body scroll lock - applied while the mobile nav panel is open so
   background content doesn't scroll under a tap. */
body.lmp-nav-scroll-locked {
    overflow: hidden;
}

/*  Page chrome - breadcrumb area inherits new top spacing  */

body .layout-main > .private-breadcrumb-slot {
    background: var(--ds-color-bg) !important;
    border-bottom: 1px solid var(--ds-color-border);
    box-sizing: border-box;
    padding: 12px 0 10px 0 !important;
    width: 100%;
}

body .layout-main > .private-breadcrumb-slot > .ui-toolbar {
    box-sizing: border-box;
    max-width: var(--ds-max-width-wide);
    margin: 0 auto !important;
    padding: 0 var(--ds-space-lg) !important;
    width: 100%;
}

body .layout-main > .layout-content {
    max-width: var(--ds-max-width-wide);
    margin: 0 auto;
    width: 100%;
    padding: 0 var(--ds-space-lg) var(--ds-space-lg) var(--ds-space-lg);
}

