/* Page chrome that used to sit at the bottom of base.css. Load immediately after base.css. */
/* Header */
.header-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    margin: 0;
    color: var(--nav-text);
    background: linear-gradient(135deg, var(--nav-bg-start), var(--nav-bg-end));
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--nav-shadow);
    backdrop-filter: blur(16px) saturate(140%);
}

.header-spacer {
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 10px var(--portal-layout-wide-inset-x, 24px);
    position: relative;
}
.nav-primary {
    min-width: 0;
    flex: 1 1 auto;
}

.brand {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex: 0 0 auto;
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    letter-spacing: -0.02em;
}

.brand .brand-nav-link {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: inherit;
    text-decoration: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.15s ease, box-shadow 0.15s ease;
}

.brand-nav-link:hover {
    opacity: 0.92;
}

.brand-nav-link:focus-visible {
    outline: 2px solid var(--color-gold, #e6be78);
    outline-offset: 3px;
}

.brand-logo {
    display: block;
    height: 34px !important;
    width: auto !important;
    max-width: 235px !important;
    max-height: 34px !important;
    object-fit: contain;
    flex: 0 0 auto;
}

/*
 * Header bar is always a dark gradient — wordmarks must read as light.
 * LOGO_NAVBAR_STATIC_PATH: supply a light/white logo and use brand-logo--light-asset (no filter).
 * Otherwise brightness(0) invert(1) for dark/colour logos on transparent PNG.
 */
.header-bar .brand-logo--on-dark-nav:not(.brand-logo--light-asset) {
    filter: brightness(0) invert(1);
    opacity: 0.98;
}
.header-bar .brand-logo--invert {
    filter: brightness(0) invert(1);
    opacity: 0.98;
}
.header-bar .brand-logo--light-asset {
    filter: none;
    opacity: 1;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-list a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    font-weight: var(--weight-medium);
    color: var(--nav-link-text);
    text-decoration: none;
    transition: color var(--nav-motion-fast) ease, background var(--nav-motion-fast) ease, box-shadow var(--nav-motion-fast) ease;
}
.nav-list a.is-active {
    color: var(--nav-text);
    background: var(--nav-active-bg);
    box-shadow: none;
}
.nav-list a.is-active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 6px;
    height: 2px;
    border-radius: 2px;
    background: var(--nav-active-indicator);
}

.nav-list a:hover,
.nav-list a:focus-visible {
    color: var(--nav-text);
    background: var(--nav-link-bg-hover);
    box-shadow: 0 4px 10px rgba(5, 16, 32, 0.16);
    outline: none;
}
.nav-list a:focus-visible {
    box-shadow: var(--nav-focus-ring);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: flex-end;
}

/* Account dropdown */
.account-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-control,
.nav-action-link,
.account-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: var(--nav-control-height);
    padding: 8px var(--nav-control-pad-x);
    border: 1px solid transparent;
    border-radius: var(--nav-control-radius);
    color: inherit;
    font-weight: var(--weight-semibold);
    line-height: 1;
    cursor: pointer;
    transition: border-color var(--nav-motion-fast) ease, background var(--nav-motion-fast) ease, box-shadow var(--nav-motion-fast) ease;
    text-decoration: none;
}
.nav-control--secondary,
.account-dropdown-toggle {
    border-color: var(--nav-control-border);
    background: var(--nav-control-bg);
}
.nav-control--primary,
.nav-action-link {
    border-color: var(--nav-primary-border);
    background: var(--nav-primary-bg);
    color: var(--nav-primary-text);
    font-weight: var(--weight-semibold);
}
.nav-control.is-active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28);
}

.nav-control--secondary:hover,
.nav-control--secondary:focus-visible,
.account-dropdown-toggle:hover,
.account-dropdown-toggle:focus-visible {
    border-color: var(--nav-control-border-hover);
    background: var(--nav-control-bg-hover);
    box-shadow: 0 4px 12px rgba(5, 16, 32, 0.18);
    outline: none;
}
.nav-control--primary:hover,
.nav-control--primary:focus-visible,
.nav-action-link:hover,
.nav-action-link:focus-visible {
    border-color: var(--nav-primary-border-hover);
    background: var(--nav-primary-bg-hover);
    box-shadow: 0 5px 14px rgba(155, 115, 52, 0.2);
    outline: none;
}
.nav-control:focus-visible,
.nav-action-link:focus-visible,
.account-dropdown-toggle:focus-visible {
    box-shadow: var(--nav-focus-ring);
}

.account-name {
    font-weight: var(--weight-medium);
    color: var(--nav-account-text);
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chevron {
    width: 1.1em;
    height: 1.1em;
    transition: transform 0.2s ease;
}

.account-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 14px);
    min-width: 220px;
    max-width: min(320px, calc(100vw - 32px));
    padding: 12px;
    border-radius: var(--radius-lg);
    background: var(--nav-dropdown-bg);
    border: 1px solid var(--nav-dropdown-border);
    box-shadow: var(--nav-dropdown-shadow);
    backdrop-filter: blur(18px) saturate(160%);
    z-index: 1000;
}

.account-dropdown-menu.show {
    display: block;
}
.account-dropdown-menu:focus,
.account-dropdown-menu:focus-visible {
    outline: none;
}

.account-dropdown-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--nav-dropdown-item-text);
    font-size: var(--text-base);
    text-decoration: none;
    font-weight: var(--weight-medium);
    transition: background var(--nav-motion-fast) ease, color var(--nav-motion-fast) ease;
}

.account-dropdown-menu .menu-action-form {
    margin: 0;
}

.account-dropdown-menu .menu-action-label {
    display: block;
    margin: 6px 0 6px;
    padding: 0 4px;
    color: var(--nav-dropdown-muted);
    font-size: var(--text-xs);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.account-dropdown-menu .menu-action-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--nav-dropdown-input-border);
    background: var(--nav-dropdown-input-bg);
    color: var(--nav-dropdown-input-text);
    font-size: var(--text-base);
    margin-bottom: 8px;
}

.account-dropdown-menu .menu-action-input::placeholder {
    color: var(--nav-dropdown-input-placeholder);
}

.account-dropdown-menu .menu-action-input:focus-visible {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: var(--nav-focus-ring);
}

.account-dropdown-menu .menu-action-button {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--nav-dropdown-item-text);
    font-size: var(--text-base);
    font-weight: var(--weight-medium);
    text-align: left;
    cursor: pointer;
    transition: background var(--nav-motion-fast) ease, color var(--nav-motion-fast) ease;
}

.account-dropdown-menu a:hover,
.account-dropdown-menu a:focus-visible {
    background: var(--nav-dropdown-item-hover-bg);
    color: var(--nav-dropdown-item-hover-text);
    outline: none;
}

.account-dropdown-menu .menu-action-button:hover,
.account-dropdown-menu .menu-action-button:focus-visible {
    background: var(--nav-dropdown-item-hover-bg);
    color: var(--nav-dropdown-item-hover-text);
    outline: none;
}
.account-dropdown-menu a:focus-visible,
.account-dropdown-menu .menu-action-button:focus-visible {
    box-shadow: var(--nav-focus-ring);
}

.menu-separator {
    height: 1px;
    margin: 10px 0;
    background: var(--nav-separator);
    border: none;
}

.account-dropdown-menu a.logout {
    color: var(--nav-logout-text);
}

.account-dropdown.is-open .chevron {
    transform: rotate(180deg);
}

@media (max-width: 1024px) {
    .header-inner {
        gap: 12px;
        padding-top: 12px;
        padding-bottom: 12px;
    }
    .brand {
        font-size: var(--text-xl);
    }
    .nav-list {
        gap: 10px;
    }
    .nav-actions {
        gap: 10px;
    }
}
@media (max-width: 900px) {
    .account-name {
        display: none;
    }
    .account-dropdown-toggle {
        min-width: 44px;
        padding-left: 10px;
        padding-right: 10px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .nav-list {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
        overflow-x: visible;
    }
    .nav-actions {
        justify-content: flex-start;
        width: 100%;
    }
    .nav-actions .account-dropdown {
        margin-left: auto;
    }
    .account-dropdown-toggle {
        width: auto;
        min-width: 44px;
        justify-content: center;
    }
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 auto 24px;
    padding: 14px 20px;
    max-width: 1100px;
    background: rgba(230, 190, 120, 0.15);
    border: 1px solid var(--color-gold);
    border-radius: var(--radius-md);
    color: var(--color-midnight);
}
.impersonation-banner-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: var(--text-base);
}
.impersonation-banner-text strong {
    font-size: var(--text-md);
}
.impersonation-banner-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    background: var(--color-midnight);
    color: #fff;
    font-weight: var(--weight-semibold);
    transition: background 0.2s ease;
}
.impersonation-banner-action:hover,
.impersonation-banner-action:focus-visible {
    background: var(--color-forest);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Global content defaults (moved from inline) */
.container {
    max-width: var(--layout-wide);
    margin: var(--portal-content-offset-y, 16px) auto;
    background: #fff;
    padding: var(--portal-content-inset-x, 16px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
}

/*
 * Manage Portal: never the legacy white .container card shell.
 * Scoped to body.internal-layout so one rule beats .container everywhere in the shell.
 */
body.internal-layout .internal-main .container,
body.theme-dark.internal-layout .internal-main .container {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
h1 { color: #333; margin-bottom: 10px; }
body.theme-light h1,
body.theme-light h2,
body.theme-light h3,
body.theme-light h4,
body.theme-light h5,
body.theme-light h6 {
    color: var(--color-text);
}
.subheading { color: #666; margin: 0 0 20px 0; }
.widget {
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 20px 0;
    background: var(--nav-dropdown-bg, #fffefb);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-2);
    color: var(--color-text);
}

body.theme-light .widget {
    background: var(--nav-dropdown-bg, #fffefb);
    border-color: var(--color-border);
    box-shadow: var(--shadow-2);
    color: var(--color-text);
}

body.theme-light .widget h1,
body.theme-light .widget h2,
body.theme-light .widget h3,
body.theme-light .widget h4,
body.theme-light .widget h5,
body.theme-light .widget h6 {
    color: var(--color-text);
}

/* Deal landing: inner layout inside .widget (one surface; title row + body — no second full-width white frame) */
.deal-widget-shell {
    position: relative;
}
.deal-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}
.deal-widget-header--nowrap {
    flex-wrap: nowrap;
}
.deal-widget-header__title {
    margin: 0;
}

/* Dense widgets (documents tree, property editor): one inner work surface on top of .widget */
.deal-widget-work-surface {
    background: var(--nav-dropdown-bg, #fffefb);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-1);
    padding: 14px 16px;
}
.deal-widget-work-surface > .deal-widget-header {
    margin-bottom: 0;
}

body.theme-dark .deal-widget-work-surface {
    background: var(--color-bg);
    border-color: var(--color-border);
    box-shadow: var(--shadow-2);
}

body.theme-dark .deal-widget-work-surface .border-bottom {
    border-color: var(--color-border) !important;
}
body.theme-dark .deal-widget-work-surface .border-top {
    border-color: var(--color-border) !important;
}

body.theme-light .container {
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--color-text);
}

body.theme-dark .container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-3);
    border-radius: var(--radius-lg);
    color: var(--color-text);
}

.container-shell {
    box-sizing: border-box;
    width: 100%;
    max-width: var(--layout-wide);
    margin: var(--portal-content-offset-y, 16px) auto;
    padding: 0;
}

body.theme-dark .widget {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-2);
    color: var(--color-text);
}

body.theme-dark .widget h1,
body.theme-dark .widget h2,
body.theme-dark .widget h3,
body.theme-dark .widget h4,
body.theme-dark .widget h5,
body.theme-dark .widget h6 {
    color: var(--color-text);
}

body.theme-dark .widget a {
    color: var(--color-gold);
}

body.theme-dark .widget a:hover,
body.theme-dark .widget a:focus-visible {
    color: var(--color-sand);
}

/* Theme switcher */
.theme-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 10px;
    border: 1px solid var(--nav-theme-switch-border);
    border-radius: var(--radius-md);
    background: var(--nav-theme-switch-bg);
}
.theme-switch__label {
    font-weight: var(--weight-semibold);
    font-size: var(--text-sm);
    color: inherit;
}
.theme-switch__buttons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--nav-theme-switch-bg);
    border: 1px solid var(--nav-theme-switch-border);
    border-radius: var(--radius-pill);
    padding: 4px;
}
.theme-switch__btn {
    border: 1px solid var(--nav-theme-switch-btn-border);
    background: var(--nav-theme-switch-btn-bg);
    color: inherit;
    border-radius: var(--radius-pill);
    padding: 6px 10px;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.theme-switch__btn.is-active {
    border-color: var(--color-gold);
    background: rgba(230, 190, 120, 0.3);
    color: #fff;
}
.theme-switch__btn:hover,
.theme-switch__btn:focus-visible {
    background: var(--nav-theme-switch-btn-hover-bg);
    border-color: var(--nav-theme-switch-btn-hover-border);
    outline: none;
}
.theme-switch__btn:focus-visible {
    box-shadow: var(--nav-focus-ring);
}
.theme-light .theme-switch {
    border-color: var(--nav-theme-switch-border);
    background: var(--nav-theme-switch-bg);
}
.theme-light .theme-switch__buttons {
    background: var(--nav-theme-switch-bg);
    border-color: var(--nav-theme-switch-border);
}
.theme-light .theme-switch__btn {
    border-color: var(--nav-theme-switch-btn-border);
    background: var(--nav-theme-switch-btn-bg);
    color: inherit;
}
.theme-light .theme-switch__btn.is-active {
    background: rgba(230, 190, 120, 0.3);
    border-color: var(--color-gold);
    color: #fff;
}
.theme-light .theme-switch__btn:hover,
.theme-light .theme-switch__btn:focus-visible {
    background: var(--nav-theme-switch-btn-hover-bg);
    border-color: var(--nav-theme-switch-btn-hover-border);
}

@media (prefers-reduced-motion: reduce) {
    .nav-list a,
    .nav-control,
    .nav-action-link,
    .account-dropdown-toggle,
    .account-dropdown-menu a,
    .account-dropdown-menu .menu-action-button,
    .theme-switch__btn,
    .chevron {
        transition: none !important;
    }
}

/* Keyboard shortcuts help modal */
.shortcut-help-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
}
.shortcut-help-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 10, 24, 0.45);
}
.shortcut-help-modal__dialog {
    position: relative;
    width: min(540px, calc(100vw - 32px));
    margin: 10vh auto 0;
    border-radius: var(--radius-md);
    border: 1px solid rgba(20, 40, 60, 0.14);
    background: #fff;
    color: var(--color-midnight);
    box-shadow: 0 20px 50px rgba(10, 18, 32, 0.3);
    padding: 16px 18px;
}
.shortcut-help-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.shortcut-help-modal__header h2 {
    margin: 0;
    font-size: var(--text-md);
}
.shortcut-help-modal__close {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(20, 40, 60, 0.18);
    background: rgba(20, 40, 60, 0.05);
    color: var(--color-midnight);
    font-size: var(--text-md);
    line-height: 1;
    cursor: pointer;
}
.shortcut-help-modal__close:focus-visible {
    outline: none;
    box-shadow: var(--nav-focus-ring);
}
.shortcut-help-modal__body {
    display: grid;
    gap: 8px;
}
.shortcut-help-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}
.shortcut-help-row kbd {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(20, 40, 60, 0.2);
    background: rgba(20, 40, 60, 0.08);
    color: var(--color-midnight);
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    text-align: center;
}
.theme-dark .shortcut-help-modal__dialog {
    background: rgba(8, 12, 24, 0.94);
    color: #e6edf6;
    border-color: rgba(255, 255, 255, 0.16);
}
.theme-dark .shortcut-help-modal__close {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #e6edf6;
}
.theme-dark .shortcut-help-row kbd {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
}

/* Task widget theming */
.theme-light .task-card {
    background: #ffffff !important;
    border: 1px solid rgba(6, 42, 96, 0.12) !important;
    box-shadow: var(--shadow-3) !important;
    border-radius: var(--radius-md) !important;
}
.theme-light .task-card summary { color: var(--color-midnight) !important; }
.theme-light .task-subtasks {
    background: #ffffff !important;
    border-style: solid !important;
    border-color: var(--color-border) !important;
    border-width: 1px 0 0 0 !important; /* top only */
    border-radius: 0 !important;
    padding: 8px !important;
}
.theme-light .task-subtasks li {
    background: #ffffff !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-sm);
    padding: 8px 10px !important;
    color: var(--color-midnight) !important;
}
.theme-dark .task-card {
    background: linear-gradient(145deg, rgba(10, 14, 30, 0.45), rgba(8, 12, 24, 0.55)) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    box-shadow: var(--shadow-3) !important;
    color: #e6edf6 !important;
}
.theme-dark .task-subtasks {
    background: rgba(8, 12, 24, 0.4) !important;
    border-style: solid !important;
    border-color: rgba(255,255,255,0.08) !important;
    border-width: 1px 0 0 0 !important; /* top only */
    border-radius: 0 !important;
}
.theme-dark .task-subtasks li {
    background: linear-gradient(145deg, rgba(10, 14, 30, 0.55), rgba(6, 10, 22, 0.65)) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: #e6edf6 !important;
}

.impersonate-container {
max-width: var(--layout-wide);
}
.impersonate-container .d-flex {
flex-wrap: nowrap;
}
.impersonate-container .d-flex > div:first-child {
min-width: 0;
flex: 1;
}
.impersonate-container .d-flex > div:last-child {
flex-shrink: 0;
align-self: flex-start;
}
.impersonate-container .d-flex > div:last-child .btn.btn-secondary.btn-sm {
white-space: nowrap;
}
@media (max-width: 576px) {
.impersonate-container .d-flex {
flex-wrap: wrap;
}
}
.impersonate-search {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
}
.impersonate-search input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    font-size: var(--text-md);
    line-height: 1.5;
}
.impersonate-search .btn.btn-sm {
    height: 100%;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    font-size: var(--text-md);
    line-height: 1.5;
    white-space: nowrap;
}
.impersonate-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.impersonate-user-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 18px;
    background: #fff;
    box-shadow: var(--shadow-1);
    gap: 16px;
}
.impersonate-user-details h2 {
    margin: 0;
}
.impersonate-user-details dl {
    margin: 12px 0 0;
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 12px;
    row-gap: 4px;
    font-size: var(--text-base);
}
.impersonate-user-details dt {
    font-weight: var(--weight-semibold);
    color: var(--color-midnight);
}
.impersonate-user-details dd {
    margin: 0;
}
/* Form uses .mt-auto for spacing - no custom styling needed */
.impersonate-active {
    margin-top: 36px;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: rgba(20, 40, 60, 0.08);
}
/* Use Bootstrap .text-muted utility instead */

/* Edit Modal System ---------------------------------------------------- */
.lp-edit-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: #f1f3f5;
    border: none;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    font-size: 0.95em;
    cursor: pointer;
    transition: background 0.2s ease;
}
.lp-edit-btn:hover {
    background: #e1e4e7;
}
.lp-modal {
    display: none;
    opacity: 0;
    transition: opacity 0.5s;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.25);
    pointer-events: none;
}
.lp-modal.lp-open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}
.lp-modal .lp-modal-content {
    background: #fff;
    max-width: 520px;
    margin: 10vh auto;
    padding: 30px 24px 18px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
    position: relative;
    transform: translateY(30px);
    transition: transform 0.5s;
}
.lp-modal.lp-open .lp-modal-content {
    transform: translateY(0);
}
.lp-modal .lp-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.3em;
    color: #888;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}
.lp-modal .lp-close:hover {
    color: #333;
}
body.modal-open {
    overflow: hidden;
}

/* Toast: static/css/lp_toast.css (portal_core_styles.html) */

/* Internal layout: main content lines up with sidebar (no top gap) */
.internal-main__content > * {
    padding-top: 0 !important;
}
