/* Module: Shared Loxal checklists, row menus and developer specimens in both themes. */
:root { --surface: var(--field-bg); --border: var(--border-strong); --text: var(--text-primary); --accent: var(--loxal-red); --accent-soft: var(--surface-tint); --shadow: var(--shadow-sm); }
html[data-theme="light"] { --link-readable: #c6161d; }
html[data-theme="dark"] { --link-readable: #ff9da2; }
/* Inline links keep their underline. Whole navigation tiles use their own card treatment. */
main a:not(.btn):not(.dropdown-item):not(.card-link-shell), .context-help-markdown a, .context-help-panel-footer a { color: var(--link-readable); text-decoration: underline; text-underline-offset: .15em; }
main a:not(.btn):not(.dropdown-item):not(.card-link-shell):hover, .context-help-markdown a:hover, .context-help-panel-footer a:hover { color: var(--text-primary); }
.context-help-markdown a:focus-visible, .context-help-panel-footer a:focus-visible { outline: 2px solid var(--link-readable); outline-offset: 3px; }
.btn-primary, .context-help-launcher { --bs-btn-disabled-bg: #cf171e; --bs-btn-disabled-border-color: #cf171e; --bs-btn-disabled-color: #ffffff; background-color: #cf171e; border-color: #cf171e; color: #ffffff; }
[data-theme="dark"] main .text-danger, [data-theme="dark"] .field-validation-error, [data-theme="dark"] .invalid-feedback, [data-theme="dark"] .validation-summary-errors, [data-theme="dark"] main .btn-outline-danger { color: #ff9da2; }
.form-control:disabled, .form-select:disabled { background-color: var(--surface-muted); color: var(--text-muted); opacity: 1; }
.modal-content { background-color: var(--page-bg); color: var(--text-primary); }
.portal-checklist { border: 1px solid var(--border); border-radius: .5rem; padding: .65rem; background: var(--surface); color: var(--text); }
.portal-checklist-heading { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; font-weight: 600; }
.portal-checklist-count { color: var(--text-muted); font-size: .8rem; font-weight: 400; white-space: nowrap; }
.portal-checklist-items { max-height: 190px; overflow-y: auto; overscroll-behavior: contain; margin-top: .5rem; border: 1px solid var(--border); border-radius: .35rem; }
.portal-checklist-row { display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem; margin: 0; border-bottom: 1px solid var(--border); cursor: pointer; color: var(--text); }
.portal-checklist-row:last-child { border-bottom: 0; }
.portal-checklist-row input { flex-shrink: 0; margin: 0; }
.portal-checklist .portal-checklist-row .form-check-input { float: none; margin: 0; }
.portal-checklist-row:hover, .portal-checklist-row.is-selected { background: var(--accent-soft); color: var(--text); }
.portal-checklist-row:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.portal-checklist-label { overflow-wrap: anywhere; }
.portal-checklist-row.is-disabled { color: var(--text-muted); cursor: not-allowed; }
.portal-checklist-empty { margin: .5rem 0 0; }
.portal-checklist-row[hidden], .portal-checklist-empty[hidden] { display: none !important; }
.portal-checklist-source { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; clip-path: inset(50%); }
.portal-row-action-trigger { min-width: 6.5rem; white-space: nowrap; }
.portal-row-menu { display: none; position: fixed !important; z-index: 1080; width: max-content; min-width: 14rem; max-width: min(26rem, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; padding: .5rem 0; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--page-bg); color: var(--text); box-shadow: var(--shadow); }
.portal-row-menu.show { display: block; }
.portal-row-dialog .modal-body { display: block; }
.portal-row-menu .dropdown-item { white-space: normal; padding: .55rem .85rem; color: var(--text); width: 100%; text-align: left; }
.portal-row-menu form { display: block !important; margin: 0; }
.portal-row-menu .dropdown-divider { border-top: 1px solid var(--border); margin: .4rem 0; opacity: 1; }
.portal-row-menu .dropdown-item:hover, .portal-row-menu .dropdown-item:focus, .dropdown-item:active { background: var(--accent-soft); color: var(--text); }
.portal-row-menu .text-danger { color: var(--bs-danger) !important; }
[data-theme="dark"] .portal-row-menu .text-danger { color: #ff9da2 !important; }
.portal-row-menu .dropdown-item:disabled { opacity: .65; }
.table { --bs-table-color: var(--text); --bs-table-bg: transparent; --bs-table-hover-color: var(--text); --bs-table-hover-bg: var(--accent-soft); --bs-table-striped-color: var(--text); --bs-table-active-color: var(--text); --bs-table-active-bg: var(--accent-soft); }
[data-theme="dark"] .dropdown-menu { --bs-dropdown-color: var(--text); --bs-dropdown-bg: var(--page-bg); --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-link-active-color: var(--text); --bs-dropdown-link-hover-bg: var(--accent-soft); --bs-dropdown-link-active-bg: var(--accent-soft); }
.role-checkbox-grid.portal-checklist { display: block; }
.style-guide-nav { display: flex; flex-wrap: wrap; gap: .6rem; padding: 1rem 0; }
.style-guide-section { scroll-margin-top: 5rem; margin-bottom: 1.5rem; }
.style-guide-section > h2 { border-bottom: 1px solid var(--border); padding-bottom: .6rem; }
.style-guide-specimens { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.style-guide-section code { color: var(--text); overflow-wrap: anywhere; }
.settings-password-policy { grid-column: 1 / -1; }
.style-guide-token { display: inline-block; padding: .5rem; border: 1px solid var(--border); border-radius: .35rem; }
[data-batch-fields][hidden] { display: none !important; }
.context-help-launcher { width: auto; min-width: 5rem; padding: .65rem 1rem; gap: .4rem; }
/* Customer logo specimens use one light preview surface in both themes so dark and transparent artwork stays legible. */
.customer-logo-shell { display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--bs-border-color); border-radius: 6px; padding: 4px 8px; flex: 0 1 144px; min-width: 0; }
.customer-logo-image { display: block; max-width: min(100%, 128px); max-height: 44px; object-fit: contain; }
.customer-logo-preview { display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--bs-border-color); border-radius: 6px; padding: 16px; width: min(100%, 288px); min-height: 112px; margin-bottom: 16px; }
.customer-logo-preview img { display: block; max-width: 256px; max-height: 160px; width: auto; height: auto; object-fit: contain; }
.customer-branding-panel { max-width: 960px; }
@media (max-width: 575.98px) {
    .customer-logo-shell { flex: 0 0 76px; padding: 3px 4px; }
    .customer-logo-image { max-width: min(100%, 68px); max-height: 32px; }
    /* Keep both identities visible without wrapping the fixed-height shell when a customer logo is present. */
    .top-shell-inner:has(.customer-logo-shell) { gap: .5rem; }
    .top-shell-inner:has(.customer-logo-shell) .brand-link { margin-right: 0; min-width: 0; }
    .top-shell-inner:has(.customer-logo-shell) .brand-product { font-size: .7rem; letter-spacing: .08em; }
    .top-shell-actions:has(.customer-logo-shell) { gap: .5rem; flex-shrink: 0; }
    .top-shell-actions:has(.customer-logo-shell) .shell-theme-toggle { width: 40px; height: 40px; padding: .5rem; }
    .top-shell-actions:has(.customer-logo-shell) [data-theme-toggle-label] { display: none; }
}
