/* NIDUS — "genesis" look, the AssetGenesis design language on NIDUS.
   A calm, warm-neutral admin UI: white sidebar with icon navigation, white top
   bar, off-white page, white cards on hairline borders, teal as the single
   accent, rounded status pills with a dot, Inter throughout.

   Loaded after nidus-modern.css, only when App\Support\UiTheme resolves to
   genesis (partials/ui-theme-head.blade.php). Genesis pages carry both
   .nm-theme-fillow and .nm-theme-genesis on <body>: Fillow's structure (full
   height sidebar, brand band, bell, dark toggle) stays as it is and this file
   only repaints it. Nothing here touches Fillow or classic, so switching back
   is NIDUS_UI_THEME=fillow, or "Fillow" on a user's own profile.

   Same two layers as nidus-classic.css: tokens on :root first, before the
   tenant palette (Branding::paletteCss) and the user's own menu / accent
   colours, so either of those still wins; then component rules, every one
   under body.nm-theme-genesis so they outrank both .nm-theme-fillow rules and
   the base ones. */

:root {
    --nm-navy-900: #1b1b19;
    --nm-teal-600: #0f766e;
    --nm-bg: #f6f6f3;
    --nm-surface: #ffffff;
    --nm-border: #e5e4de;
    --nm-text: #2f2f2b;
    --nm-muted: #62615b;
    --nm-red-600: #b42318;
    --nm-red-100: #fbe5e2;
    --nm-green-600: #137536;
    --nm-green-100: #e2f4e7;
    --nm-amber-600: #8a5206;
    --nm-amber-100: #fbf0d3;
    --nm-blue-600: #1d5fb4;
    --nm-blue-100: #e1ecfa;
    --nm-gold: #fbbf24;
    --nm-radius: 12px;
    --nm-radius-sm: 8px;
    --nm-radius-btn: 8px;
    --nm-shadow: 0 1px 2px rgba(20, 20, 15, 0.05);
    --nm-shadow-lg: 0 16px 40px -8px rgba(20, 20, 15, 0.18), 0 2px 6px rgba(20, 20, 15, 0.06);
    --nm-topbar-h: 60px;
    --nm-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

    /* AssetGenesis reads at 14px with 13px controls and 12px column heads. */
    --nm-fs-2xs: 0.6875rem;
    --nm-fs-xs: 0.75rem;
    --nm-fs-sm: 0.8125rem;
    --nm-fs-md: 0.8125rem;
    --nm-fs-base: 0.875rem;
    --nm-fs-lg: 1rem;
    --nm-fs-xl: 1.375rem;
    --nm-fs-2xl: 1.625rem;
    --nm-line: 1.5;

    /* AssetGenesis-only tokens the components below need. */
    --ng-surface-2: #f1f1ed;
    --ng-border-strong: #d3d1c9;
    --ng-heading: #1b1b19;
    --ng-subtle: #8a887f;
    --ng-neutral: #55544e;
    --ng-neutral-soft: #ebeae5;
    --ng-primary-hover: color-mix(in srgb, var(--nm-teal-600) 80%, black);
    --ng-primary-soft: color-mix(in srgb, var(--nm-teal-600) 12%, white);
    --ng-shadow-md: 0 4px 16px -4px rgba(20, 20, 15, 0.1), 0 1px 3px rgba(20, 20, 15, 0.06);
    --ng-sidebar-w: 248px;
    --ng-sidebar-collapsed: 72px;
}

/* The component-set tokens live on .nm-app-shell (body), so they're re-set at
   the same level. */
body.nm-theme-genesis {
    --nm-ui-primary: var(--nm-teal-600);
    --nm-ui-secondary: var(--ng-neutral);
    --nm-ui-success: var(--nm-green-600);
    --nm-ui-danger: var(--nm-red-600);
    --nm-ui-warning: #b46e0a;
    --nm-ui-info: var(--nm-blue-600);
    --nm-ui-dark: var(--ng-heading);
    --nm-ui-light: var(--ng-neutral-soft);
    --nm-ui-radius: 12px;
    --nm-ui-radius-pill: 999px;
    --nm-ui-shadow: var(--nm-shadow);
    --nm-ui-shadow-pop: var(--ng-shadow-md);
    --nm-sidebar-icon-muted-bg: var(--ng-neutral-soft);
    --nm-sidebar-icon-muted-fg: var(--nm-muted);
    font-family: var(--nm-font-family);
    font-size: var(--nm-fs-base);
    line-height: var(--nm-line);
    color: var(--nm-text);
    -webkit-font-smoothing: antialiased;
}

/* AssetGenesis's dark scheme. body.nm-dark (nidus-modern.css) sets its own
   tokens on body, so these sit one class higher. */
body.nm-dark.nm-theme-genesis {
    --nm-bg: #121311;
    --nm-surface: #1b1c19;
    --nm-border: #2e2f29;
    --nm-text: #cfcec6;
    --nm-muted: #9c9a90;
    --nm-navy-900: #ecebe6;
    --nm-navy-700: #d6d5ce;
    --nm-navy-500: #a9a79e;
    --nm-teal-600: #2fb3a6;
    --nm-teal-500: #5cc9bf;
    --nm-teal-100: #16302d;
    --nm-green-600: #4ccf7a;
    --nm-green-100: #15301f;
    --nm-amber-600: #e4a93c;
    --nm-amber-100: #342a12;
    --nm-red-600: #ef6f64;
    --nm-red-100: #3a1c19;
    --nm-blue-600: #6ea6ea;
    --nm-blue-100: #16263a;
    --nm-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --nm-shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
    --ng-surface-2: #23241f;
    --ng-border-strong: #3d3e36;
    --ng-heading: #ecebe6;
    --ng-subtle: #7d7b72;
    --ng-neutral: #bdbbb2;
    --ng-neutral-soft: #2a2b26;
    --ng-primary-hover: #5cc9bf;
    --ng-primary-soft: #16302d;
    --ng-shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
    --nm-ui-warning: #e4a93c;
    --nm-sidebar-icon-muted-bg: var(--ng-neutral-soft);
}

/* Thin scrollbars in the surface's own colours; without this the sidebar and
   content panes show a bright browser track in dark mode. */
body.nm-theme-genesis .nm-sidebar,
body.nm-theme-genesis .nm-main {
    scrollbar-width: thin;
    scrollbar-color: var(--ng-border-strong) transparent;
}

body.nm-theme-genesis :focus-visible {
    outline: 2px solid var(--nm-teal-600);
    outline-offset: 2px;
}

body.nm-theme-genesis h1,
body.nm-theme-genesis h2,
body.nm-theme-genesis h3,
body.nm-theme-genesis h4,
body.nm-theme-genesis h5 {
    color: var(--ng-heading);
    letter-spacing: -0.01em;
}

/* ---------- top bar: white, hairline underneath ---------- */

body.nm-theme-genesis .nm-topbar {
    background: var(--nm-surface);
    color: var(--nm-text);
    border-bottom: 1px solid var(--nm-border);
    padding: 0 1.25rem;
}

body.nm-theme-genesis .nm-topbar-meta {
    color: var(--nm-muted);
    font-size: var(--nm-fs-sm);
}

body.nm-theme-genesis .nm-topbar-icon-btn,
body.nm-theme-genesis .nm-help-link,
body.nm-theme-genesis .nm-mobile-nav-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ng-heading);
    opacity: 1;
}

body.nm-theme-genesis .nm-topbar-icon-btn:hover,
body.nm-theme-genesis .nm-help-link:hover,
body.nm-theme-genesis .nm-mobile-nav-toggle:hover {
    background: var(--ng-surface-2);
}

body.nm-theme-genesis .nm-help-link {
    font-weight: 600;
    font-size: var(--nm-fs-base);
}

/* A small red count tucked on the bell's shoulder, leaving the bell visible. */
body.nm-theme-genesis .nm-topbar-bell-badge {
    box-sizing: border-box;
    background: var(--nm-red-600);
    color: #fff;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    top: 2px;
    right: 1px;
    font-size: 0.5625rem;
    line-height: 1;
    border: 2px solid var(--nm-surface);
}

body.nm-theme-genesis .nm-profile-icon-btn {
    border: 0;
    background: var(--ng-primary-soft);
    color: var(--nm-teal-600);
    font-size: var(--nm-fs-xs);
    font-weight: 600;
}

body.nm-theme-genesis .nm-topbar-client-logo {
    border: 1px solid var(--nm-border);
}

body.nm-theme-genesis .nm-profile-dropdown,
body.nm-theme-genesis .nm-topbar-bell-menu {
    border-radius: 10px;
    box-shadow: var(--ng-shadow-md);
    padding: 0.3rem;
}

body.nm-theme-genesis .nm-profile-dropdown a {
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
    font-size: var(--nm-fs-sm);
    font-weight: 500;
}

body.nm-theme-genesis .nm-profile-dropdown a:hover {
    background: var(--ng-surface-2);
}

/* ---------- sidebar: white, icon + label rows, teal-tinted active row ---------- */

body.nm-theme-genesis .nm-sidebar {
    width: var(--ng-sidebar-collapsed);
    flex-basis: var(--ng-sidebar-collapsed);
    padding: 0.35rem 0.6rem 0.75rem;
    scrollbar-width: thin;
}

body.nm-theme-genesis .nm-app.nm-sidebar-expanded .nm-sidebar {
    width: var(--ng-sidebar-w);
    flex-basis: var(--ng-sidebar-w);
}

body.nm-theme-genesis .nm-sidebar-brand,
body.nm-theme-genesis .nm-app.nm-sidebar-expanded .nm-sidebar-brand,
body.nm-theme-genesis .nm-app:not(.nm-sidebar-expanded) .nm-sidebar-brand {
    background: var(--nm-surface);
    margin: -0.35rem -0.6rem 0.35rem;
    top: -0.35rem;
    gap: 0.6rem;
}

body.nm-theme-genesis .nm-app.nm-sidebar-expanded .nm-sidebar-brand {
    padding: 0 0.75rem 0 1rem;
}

body.nm-theme-genesis .nm-sidebar-brand-mark,
body.nm-theme-genesis .nm-app.nm-sidebar-expanded .nm-sidebar-brand-mark {
    width: 30px;
    height: 30px;
}

body.nm-theme-genesis .nm-sidebar-brand-name {
    font-size: 1.15rem;
    color: var(--ng-heading);
}

body.nm-theme-genesis .nm-sidebar-brand-tagline {
    font-size: var(--nm-fs-2xs);
    color: var(--ng-subtle);
}

body.nm-theme-genesis .nm-sidebar-toggle {
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--nm-muted);
}

body.nm-theme-genesis .nm-sidebar-toggle:hover {
    background: var(--ng-surface-2);
    color: var(--ng-heading);
}

body.nm-theme-genesis .nm-sidebar-nav {
    gap: 2px;
}

body.nm-theme-genesis .nm-sidebar-link,
body.nm-theme-genesis .nm-app.nm-sidebar-expanded .nm-sidebar-link {
    gap: 0.6rem;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    color: var(--ng-heading);
    font-size: var(--nm-fs-sm);
    font-weight: 500;
    transition: background 0.12s;
}

body.nm-theme-genesis .nm-app:not(.nm-sidebar-expanded) .nm-sidebar-link {
    padding: 0.5rem 0;
}

body.nm-theme-genesis .nm-sidebar-link:hover {
    background: var(--ng-surface-2);
}

body.nm-theme-genesis .nm-sidebar-item-active > .nm-sidebar-link {
    background: var(--ng-primary-soft);
    color: var(--nm-teal-600);
    border-radius: 8px;
    font-weight: 500;
    box-shadow: none;
}

/* Icons are quiet glyphs, teal only on the active row. The letter tiles a
   module without a glyph keeps get the same treatment as a small neutral
   square. !important because nidus-modern.css forces its own muted colours
   on these with !important. */
body.nm-theme-genesis .nm-sidebar-item .nm-sidebar-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: var(--nm-fs-2xs);
    font-weight: 600;
    background: var(--ng-neutral-soft) !important;
    color: var(--nm-muted) !important;
}

body.nm-theme-genesis .nm-sidebar-item .nm-sidebar-glyph {
    background: transparent !important;
    font-size: 1rem;
    font-weight: 400;
}

body.nm-theme-genesis .nm-app:not(.nm-sidebar-expanded) .nm-sidebar-item .nm-sidebar-glyph {
    font-size: 1.15rem;
}

body.nm-theme-genesis .nm-sidebar-item-active .nm-sidebar-icon {
    background: var(--nm-teal-600) !important;
    color: #fff !important;
}

body.nm-theme-genesis .nm-sidebar-item-active .nm-sidebar-glyph,
body.nm-theme-genesis .nm-sidebar-link:hover .nm-sidebar-glyph {
    background: transparent !important;
    color: var(--nm-teal-600) !important;
}

body.nm-theme-genesis .nm-sidebar-link:hover .nm-sidebar-icon:not(.nm-sidebar-glyph) {
    background: var(--nm-teal-600) !important;
    color: #fff !important;
}

body.nm-theme-genesis .nm-sidebar-chevron {
    color: var(--ng-subtle);
    font-size: 0.7rem;
}

body.nm-theme-genesis .nm-sidebar-flyout {
    border-radius: 10px;
    box-shadow: var(--ng-shadow-md);
    padding: 0.3rem;
}

body.nm-theme-genesis .nm-sidebar-flyout-title {
    color: var(--ng-subtle);
    font-size: var(--nm-fs-2xs);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.01em;
}

body.nm-theme-genesis .nm-sidebar-sublink {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    color: var(--nm-muted);
    font-size: var(--nm-fs-sm);
    font-weight: 500;
}

body.nm-theme-genesis .nm-sidebar-sublink::before {
    content: none;
}

body.nm-theme-genesis .nm-app.nm-sidebar-expanded .nm-sidebar-sublink {
    padding-left: 2.35rem;
}

body.nm-theme-genesis .nm-sidebar-sublink:hover {
    background: var(--ng-surface-2);
    color: var(--ng-heading);
}

body.nm-theme-genesis .nm-sidebar-sublink.nm-sidebar-link-active {
    background: transparent;
    color: var(--nm-teal-600);
    font-weight: 600;
}

/* ---------- content ---------- */

body.nm-theme-genesis .nm-shell {
    max-width: 1440px;
    margin: 1.25rem auto 2rem;
    padding: 0 1.5rem;
}

/* Page titles sit on the page, not in a gradient band: 22px semibold,
   muted line under it. Covers the shared header partial and the
   .nm-page-header blocks screens render themselves. */
body.nm-theme-genesis .nm-hero-header,
body.nm-theme-genesis .nm-page-header {
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    color: var(--nm-text);
    align-items: flex-end;
    margin-bottom: 1.25rem;
}

body.nm-theme-genesis .nm-hero-header-title,
body.nm-theme-genesis .nm-page-title {
    color: var(--ng-heading);
    font-size: var(--nm-fs-xl);
    font-weight: 600;
    letter-spacing: -0.01em;
}

body.nm-theme-genesis .nm-hero-header-subtitle,
body.nm-theme-genesis .nm-page-subtitle {
    color: var(--nm-muted);
    opacity: 1;
    font-size: var(--nm-fs-sm);
    margin-top: 4px;
}

body.nm-theme-genesis .nm-hero-stat-chip,
body.nm-theme-genesis .nm-list-hero-stat {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
    padding: 0.3rem 0.75rem;
    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: 999px;
    box-shadow: var(--nm-shadow);
}

body.nm-theme-genesis .nm-hero-stat-value,
body.nm-theme-genesis .nm-list-hero-stat-value {
    font-size: var(--nm-fs-base);
    font-weight: 600;
    color: var(--ng-heading);
    font-variant-numeric: tabular-nums;
}

body.nm-theme-genesis .nm-hero-stat-label,
body.nm-theme-genesis .nm-list-hero-stat-label {
    font-size: var(--nm-fs-xs);
    text-transform: none;
    letter-spacing: 0;
    color: var(--nm-muted);
    opacity: 1;
    margin: 0;
}

body.nm-theme-genesis .nm-page-header .nm-btn-secondary {
    background: var(--nm-surface);
    border-color: var(--ng-border-strong);
    color: var(--ng-heading);
}

body.nm-theme-genesis .nm-page-header .nm-btn-secondary:hover {
    background: var(--ng-surface-2);
}

body.nm-theme-genesis .nm-list-hero {
    border-top: 0;
    border: 1px solid var(--nm-border);
    box-shadow: var(--nm-shadow);
    padding: 1rem 1.15rem;
}

body.nm-theme-genesis .nm-list-hero-title {
    font-size: var(--nm-fs-lg);
    font-weight: 600;
    color: var(--ng-heading);
}

body.nm-theme-genesis .nm-list-hero-subtitle {
    font-size: var(--nm-fs-sm);
}

/* ---------- cards: white, hairline border, barely-there shadow ---------- */

body.nm-theme-genesis .nm-card,
body.nm-theme-genesis .nm-detail-card,
body.nm-theme-genesis .nm-table-wrap,
body.nm-theme-genesis .nm-section {
    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

body.nm-theme-genesis .nm-detail-card {
    border-top: 1px solid var(--nm-border);
    padding: 1.15rem;
}

body.nm-theme-genesis .nm-detail-card-title,
body.nm-theme-genesis .nm-section-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ng-heading);
    text-transform: none;
    letter-spacing: 0;
}

body.nm-theme-genesis .nm-section {
    border-left: 1px solid var(--nm-border);
    padding: 1rem 1.15rem;
}

body.nm-theme-genesis .nm-section-title::before {
    content: none;
}

/* A section inside a card is a region of it, not a second card. */
body.nm-theme-genesis .nm-card .nm-section,
body.nm-theme-genesis .nm-detail-card .nm-section,
body.nm-theme-genesis .nm-section .nm-section {
    box-shadow: none;
    background: transparent;
}

body.nm-theme-genesis a.nm-card:hover {
    border-color: var(--ng-border-strong);
    box-shadow: var(--ng-shadow-md);
}

body.nm-theme-genesis .nm-label {
    font-size: var(--nm-fs-sm);
    font-weight: 500;
    color: var(--ng-heading);
    text-transform: none;
    letter-spacing: 0;
}

/* ---------- tables ---------- */

body.nm-theme-genesis .nm-table {
    font-size: var(--nm-fs-base);
}

body.nm-theme-genesis .nm-table thead th {
    background: transparent;
    color: var(--nm-muted);
    font-size: var(--nm-fs-xs);
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.8rem 1rem;
}

body.nm-theme-genesis .nm-table td {
    padding: 0.8rem 1rem;
}

body.nm-theme-genesis .nm-table tbody tr:hover {
    background: var(--ng-surface-2);
}

body.nm-theme-genesis .nm-mono {
    color: var(--ng-heading);
    font-weight: 500;
}

/* ---------- status pills: soft fill, dot in the text colour ---------- */

body.nm-theme-genesis .nm-badge {
    padding: 0.25em 0.65em;
    font-size: var(--nm-fs-xs);
    font-weight: 500;
    background: var(--ng-neutral-soft);
    color: var(--ng-neutral);
    white-space: nowrap;
}

body.nm-theme-genesis .nm-badge-request,
body.nm-theme-genesis .nm-badge-primary { background: var(--ng-primary-soft); color: var(--nm-teal-600); }
body.nm-theme-genesis .nm-badge-approved,
body.nm-theme-genesis .nm-badge-info { background: var(--nm-blue-100); color: var(--nm-blue-600); }
body.nm-theme-genesis .nm-badge-complete,
body.nm-theme-genesis .nm-badge-released,
body.nm-theme-genesis .nm-badge-success { background: var(--nm-green-100); color: var(--nm-green-600); }
body.nm-theme-genesis .nm-badge-reject,
body.nm-theme-genesis .nm-badge-danger { background: var(--nm-red-100); color: var(--nm-red-600); }
body.nm-theme-genesis .nm-badge-warning { background: var(--nm-amber-100); color: var(--nm-amber-600); }

/* Dot and label stay on one line, centred on each other, however tight the row the pill sits in. */
body.nm-theme-genesis .nm-badge:is(.nm-badge-request, .nm-badge-approved, .nm-badge-complete, .nm-badge-released, .nm-badge-reject,
    .nm-badge-primary, .nm-badge-info, .nm-badge-success, .nm-badge-danger, .nm-badge-warning):not(.nm-badge-solid, .nm-badge-outline, .nm-badge-circle) {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

body.nm-theme-genesis .nm-badge:is(.nm-badge-request, .nm-badge-approved, .nm-badge-complete, .nm-badge-released, .nm-badge-reject,
    .nm-badge-primary, .nm-badge-info, .nm-badge-success, .nm-badge-danger, .nm-badge-warning):not(.nm-badge-solid, .nm-badge-outline, .nm-badge-circle)::before {
    content: "";
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 0.4em;
}

/* ---------- filter chips and tabs ---------- */

body.nm-theme-genesis .nm-chip {
    padding: 0.3rem 0.75rem;
    background: var(--nm-surface);
    border: 1px solid var(--ng-border-strong);
    color: var(--ng-heading);
    font-size: var(--nm-fs-sm);
    font-weight: 500;
    box-shadow: var(--nm-shadow);
}

body.nm-theme-genesis .nm-chip:hover {
    background: var(--ng-surface-2);
    border-color: var(--ng-border-strong);
    color: var(--ng-heading);
}

body.nm-theme-genesis .nm-chip-active,
body.nm-theme-genesis .nm-chip-active:hover {
    background: var(--ng-primary-soft);
    border-color: transparent;
    color: var(--nm-teal-600);
    box-shadow: none;
}

body.nm-theme-genesis .nm-chip-count {
    background: var(--ng-neutral-soft);
    color: var(--ng-neutral);
}

body.nm-theme-genesis .nm-chip-active .nm-chip-count {
    background: var(--nm-surface);
    color: var(--nm-teal-600);
}

body.nm-theme-genesis .nm-tabs {
    display: flex;
    gap: 0.15rem;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border-bottom: 1px solid var(--nm-border);
}

body.nm-theme-genesis .nm-tab {
    padding: 0.55rem 0.75rem;
    margin-bottom: -1px;
    border-radius: 0;
    border-bottom: 2px solid transparent;
    color: var(--nm-muted);
    font-size: var(--nm-fs-sm);
    font-weight: 500;
}

body.nm-theme-genesis .nm-tab:hover:not(:disabled) {
    color: var(--ng-heading);
}

body.nm-theme-genesis .nm-tab-active,
body.nm-theme-genesis .nm-tab-active:hover:not(:disabled) {
    background: transparent;
    color: var(--ng-heading);
    border-bottom-color: var(--nm-teal-600);
    font-weight: 600;
}

/* ---------- buttons and fields ---------- */

/* The variant classes carry the whole button too: plenty of screens use
   nm-btn-secondary on its own, which otherwise falls back to the browser's
   outset border. */
body.nm-theme-genesis .nm-btn,
body.nm-theme-genesis .nm-btn-outline,
body.nm-theme-genesis .nm-btn-primary,
body.nm-theme-genesis .nm-btn-secondary,
body.nm-theme-genesis .nm-btn-danger {
    font-family: inherit;
    padding: 0.45rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: var(--nm-fs-sm);
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.12s, color 0.12s, border-color 0.12s, box-shadow 0.12s;
}

body.nm-theme-genesis :is(.nm-btn, .nm-btn-primary, .nm-btn-secondary, .nm-btn-danger):disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

body.nm-theme-genesis .nm-btn-primary {
    background: var(--nm-teal-600);
    border-color: var(--nm-teal-600);
    color: #fff;
    box-shadow: var(--nm-shadow);
}

body.nm-theme-genesis .nm-btn-primary:hover {
    background: var(--ng-primary-hover);
    border-color: var(--ng-primary-hover);
}

body.nm-theme-genesis .nm-btn-secondary {
    background: var(--nm-surface);
    border-color: var(--ng-border-strong);
    color: var(--ng-heading);
    box-shadow: var(--nm-shadow);
}

body.nm-theme-genesis .nm-btn-secondary:hover {
    background: var(--ng-surface-2);
    color: var(--ng-heading);
}

body.nm-theme-genesis .nm-btn-danger {
    background: var(--nm-red-100);
    border-color: transparent;
    color: var(--nm-red-600);
}

body.nm-theme-genesis .nm-btn-danger:hover {
    background: var(--nm-red-600);
    color: #fff;
}

body.nm-theme-genesis .nm-btn-link {
    font-size: var(--nm-fs-sm);
    font-weight: 500;
}

body.nm-theme-genesis .nm-btn-link:hover {
    color: var(--ng-primary-hover);
}

body.nm-theme-genesis .nm-input,
body.nm-theme-genesis .nm-select,
body.nm-theme-genesis .nm-search-input {
    border-color: var(--ng-border-strong);
    border-radius: 8px;
    font-size: var(--nm-fs-sm);
    box-shadow: var(--nm-shadow);
}

body.nm-theme-genesis .nm-input,
body.nm-theme-genesis .nm-select {
    padding: 0.45rem 0.7rem;
}

body.nm-theme-genesis .nm-search-input {
    padding: 0.45rem 0.75rem 0.45rem 2.2rem;
}

body.nm-theme-genesis .nm-input:hover,
body.nm-theme-genesis .nm-select:hover {
    border-color: var(--ng-border-strong);
}

body.nm-theme-genesis .nm-input:focus,
body.nm-theme-genesis .nm-select:focus,
body.nm-theme-genesis .nm-search-input:focus {
    border-color: var(--nm-teal-600);
    box-shadow: 0 0 0 3px var(--ng-primary-soft);
}

body.nm-theme-genesis .nm-select:disabled,
body.nm-theme-genesis .nm-input:disabled,
body.nm-theme-genesis .nm-input[readonly] {
    background: var(--ng-surface-2);
    box-shadow: none;
}

body.nm-theme-genesis .nm-page-link {
    border-radius: 8px;
    font-size: var(--nm-fs-sm);
}

body.nm-theme-genesis .nm-alert {
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    font-size: var(--nm-fs-sm);
}

/* ---------- KPI and overview tiles become white widgets ---------- */

/* The colour moves from the tile's fill to its number, so a page of tiles
   reads as one calm surface with the statuses still told apart. */
body.nm-theme-genesis .nm-kpi-tile {
    background: var(--nm-surface);
    color: var(--ng-heading);
    border: 1px solid var(--nm-border);
    border-radius: var(--nm-radius);
    box-shadow: var(--nm-shadow);
}

body.nm-theme-genesis .nm-kpi-tile .nm-kpi-value {
    color: var(--nm-tile-bg, var(--ng-heading));
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

body.nm-theme-genesis .nm-kpi-label {
    color: var(--nm-muted);
    opacity: 1;
    font-size: var(--nm-fs-xs);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

body.nm-theme-genesis .nm-overview-tile {
    background: var(--nm-surface);
    color: var(--ng-heading);
    border: 1px solid var(--nm-border);
    box-shadow: var(--nm-shadow);
}

body.nm-theme-genesis .nm-overview-tile-teal { --ng-tone: var(--nm-teal-600); }
body.nm-theme-genesis .nm-overview-tile-indigo { --ng-tone: var(--nm-blue-600); }
body.nm-theme-genesis .nm-overview-tile-amber { --ng-tone: var(--nm-amber-600); }
body.nm-theme-genesis .nm-overview-tile-rose { --ng-tone: var(--nm-red-600); }

body.nm-theme-genesis .nm-overview-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--ng-surface-2);
    color: var(--ng-tone, var(--nm-teal-600));
}

body.nm-theme-genesis a.nm-overview-tile:hover,
body.nm-theme-genesis a.nm-kpi-tile:hover {
    border-color: var(--ng-border-strong);
    box-shadow: var(--ng-shadow-md);
}

/* ---------- floating actions ---------- */

body.nm-theme-genesis .nm-fab {
    width: 46px;
    height: 46px;
    font-size: 1.25rem;
    box-shadow: var(--ng-shadow-md);
}

body.nm-theme-genesis .nm-fab-dashboard {
    background: var(--nm-surface);
    color: var(--ng-heading);
    border: 1px solid var(--ng-border-strong);
}

body.nm-dark.nm-theme-genesis .nm-fab-dashboard {
    background: var(--nm-surface);
}

body.nm-theme-genesis .nm-fab-create {
    background: var(--nm-teal-600);
}

body.nm-theme-genesis .nmw-launcher {
    background: var(--nm-teal-600);
    box-shadow: var(--ng-shadow-md);
}

body.nm-theme-genesis .nmw-launcher:hover {
    background: var(--ng-primary-hover);
    box-shadow: var(--nm-shadow-lg);
}

body.nm-theme-genesis .nmw-icon-chat path:last-child {
    fill: var(--nm-teal-600);
}

/* ---------- phone ---------- */

@media (max-width: 900px) {
    body.nm-theme-genesis .nm-shell {
        margin-top: 1rem;
        padding: 0 1rem;
    }

    body.nm-theme-genesis .nm-sidebar,
    body.nm-theme-genesis .nm-app.nm-sidebar-expanded .nm-sidebar {
        width: var(--ng-sidebar-w);
        flex-basis: var(--ng-sidebar-w);
    }

    /* The drawer always shows labels, whatever the desktop rail was left at. */
    body.nm-theme-genesis .nm-app:not(.nm-sidebar-expanded) .nm-sidebar-link {
        padding: 0.4rem 0.6rem;
    }

    body.nm-theme-genesis .nm-app:not(.nm-sidebar-expanded) .nm-sidebar-item .nm-sidebar-glyph {
        font-size: 1rem;
    }

    body.nm-theme-genesis .nm-sidebar-sublink {
        padding-left: 2.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.nm-theme-genesis *,
    body.nm-theme-genesis *::before,
    body.nm-theme-genesis *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* ---------- sign-in page (admin/login-genesis.blade.php): the AssetGenesis auth card ---------- */

body.ng-auth-body {
    margin: 0;
    background: var(--nm-bg);
}

.ng-auth-bg {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    box-sizing: border-box;
}

.ng-auth-card {
    width: 100%;
    /* Compact on a laptop; on a wide screen just wide enough to keep covering the tagline lettered across the
       middle of the default backdrop (images/big/gmmco.jpg), whose edges would otherwise show either side. */
    max-width: min(1180px, max(820px, 46vw));
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--nm-shadow-lg);
}

.ng-auth-form {
    padding: 1.9rem 2.25rem;
}

.ng-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.15rem;
}

.ng-auth-mark {
    width: 28px;
    height: 28px;
}

.ng-auth-wordmark {
    font-size: 1.3rem;
    color: var(--ng-heading);
    line-height: 1;
}

.ng-auth-client-logo {
    margin-left: auto;
    height: 26px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
}

.ng-auth-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--ng-heading);
    letter-spacing: -0.01em;
    margin: 0 0 0.2rem;
}

.ng-auth-lead {
    color: var(--nm-muted);
    font-size: var(--nm-fs-sm);
    margin: 0 0 1rem;
}

.ng-auth-label {
    display: block;
    font-size: var(--nm-fs-sm);
    font-weight: 500;
    color: var(--ng-heading);
    margin-bottom: 0.3rem;
}

.ng-auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 0.75rem;
}

body.nm-theme-genesis .ng-auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.7rem;
    font-size: var(--nm-fs-base);
}

body.nm-theme-genesis .ng-auth-submit {
    width: 100%;
    margin-top: 1.1rem;
    padding: 0.5rem 0.8rem;
    font-size: var(--nm-fs-base);
}

.ng-auth-link {
    color: var(--nm-teal-600);
    font-size: var(--nm-fs-sm);
    font-weight: 500;
    text-decoration: none;
}

.ng-auth-link:hover {
    text-decoration: underline;
}

.ng-auth-or {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.9rem 0 0.75rem;
    color: var(--ng-subtle);
    font-size: var(--nm-fs-xs);
}

.ng-auth-or::before,
.ng-auth-or::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--nm-border);
}

body.nm-theme-genesis .ng-auth-sso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.ng-auth-sso-toggle {
    display: block;
    text-align: center;
    margin-top: 0.6rem;
}

.ng-auth-sso-panel {
    margin-top: 0.75rem;
}

.ng-auth-sso-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

body.nm-theme-genesis .ng-auth-sso-row .nm-btn {
    flex: 1;
}

.ng-auth-portals {
    text-align: center;
    margin: 0.9rem 0 0;
    font-size: var(--nm-fs-xs);
    color: var(--nm-muted);
}

.ng-auth-portals .ng-auth-link {
    font-size: inherit;
}

.ng-auth-alert {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    font-size: var(--nm-fs-sm);
    margin-bottom: 1rem;
}

.ng-auth-alert-danger { background: var(--nm-red-100); color: var(--nm-red-600); }
.ng-auth-alert-info { background: var(--ng-primary-soft); color: var(--nm-teal-600); }

/* The teal side panel: what NIDUS does, one line per area. */
.ng-auth-side {
    background: var(--nm-teal-600);
    color: rgba(255, 255, 255, 0.82);
    padding: 1.9rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.ng-auth-side::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.ng-auth-side > * {
    position: relative;
}

.ng-auth-side h2 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0 0 1rem;
}

.ng-auth-phase {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
    margin-bottom: 0.6rem;
    font-size: var(--nm-fs-xs);
    line-height: 1.45;
}

.ng-auth-phase b {
    color: #fff;
    font-weight: 600;
}

.ng-auth-n {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: 0.8rem;
}

.ng-auth-foot {
    font-size: var(--nm-fs-xs);
    opacity: 0.75;
    margin-top: 1rem;
}

.ng-auth-foot a {
    color: inherit;
}

@media (max-width: 767.98px) {
    .ng-auth-card { grid-template-columns: 1fr; }
    .ng-auth-side { display: none; }
    .ng-auth-form { padding: 2rem 1.5rem; }
}

/* ---------- the other sign-in pages (MFA, "already signed in", audit and vendor portal sign-in) ----------
   They share the .nm-login-* markup: an optional .nm-login-pitch beside a .nm-login-card. In the genesis look the
   whole .nm-login-wrap becomes the AssetGenesis auth card - the form on the left, the pitch as the teal panel on the
   right - and a page without a pitch is a single centred card. Opt-in per page with body.ng-login-skin
   (partials/login-skin-head.blade.php), so Fillow and classic keep their page untouched. */

body.ng-login-skin {
    margin: 0;
    background: var(--nm-bg);
}

body.ng-login-skin .nm-login-page {
    background: var(--nm-bg);
    font-family: var(--nm-font-family);
    padding: 1.5rem;
}

body.ng-login-skin .nm-login-page::before {
    content: none;
}

body.ng-login-skin .nm-login-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    max-width: 460px;
    background: var(--nm-surface);
    border: 1px solid var(--nm-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--nm-shadow-lg);
}

body.ng-login-skin .nm-login-wrap:has(.nm-login-pitch) {
    grid-template-columns: 1fr 1fr;
    max-width: 940px;
}

body.ng-login-skin .nm-login-wrap > * {
    align-self: stretch;
}

body.ng-login-skin button.nm-btn-link {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: var(--nm-fs-sm);
    font-weight: 500;
    color: var(--nm-teal-600);
}

body.ng-login-skin button.nm-btn-link:hover {
    text-decoration: underline;
}

body.ng-login-skin .nm-login-card-col {
    order: 1;
    display: flex;
    flex-direction: column;
}

body.ng-login-skin .nm-login-card {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    padding: 2.5rem 2.75rem 1.5rem;
    flex: 1;
}

body.ng-login-skin .nm-login-card-accent {
    display: none;
}

body.ng-login-skin .nm-login-brand {
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}

body.ng-login-skin .nm-login-brand-mark {
    width: 34px;
    height: 34px;
}

body.ng-login-skin .nm-login-brand-name {
    font-family: "Baloo 2", var(--nm-font-family);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 0;
    color: var(--ng-heading);
    line-height: 1;
}

body.ng-login-skin .nm-login-title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--ng-heading);
    letter-spacing: -0.01em;
    margin: 0 0 0.3rem;
}

body.ng-login-skin .nm-login-subtitle {
    font-size: var(--nm-fs-sm);
    margin-bottom: 1.5rem;
}

body.ng-login-skin .nm-login-form .nm-field {
    margin-bottom: 1rem;
}

body.ng-login-skin .nm-login-form .nm-input,
body.ng-login-skin .nm-login-card .nm-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: var(--nm-fs-base);
}

body.ng-login-skin .nm-login-card .nm-btn {
    padding: 0.6rem 0.8rem;
    font-size: var(--nm-fs-base);
}

body.ng-login-skin .nm-login-page-footer {
    color: var(--ng-subtle);
    font-size: var(--nm-fs-xs);
    margin: 0;
    padding: 0 2.75rem 1.5rem;
    text-align: left;
}

body.ng-login-skin .nm-login-page-footer a {
    color: var(--nm-muted);
}

body.ng-login-skin .nm-login-pitch {
    order: 2;
    background: var(--nm-teal-600);
    color: rgba(255, 255, 255, 0.82);
    padding: 2.6rem;
    position: relative;
    overflow: hidden;
}

body.ng-login-skin .nm-login-pitch::after {
    content: "";
    position: absolute;
    right: -80px;
    bottom: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

body.ng-login-skin .nm-login-pitch-mark {
    display: none;
}

body.ng-login-skin .nm-login-pitch h2 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    margin: 0 0 1rem;
}

body.ng-login-skin .nm-login-pitch-accent {
    color: inherit;
}

body.ng-login-skin .nm-login-pitch p {
    color: rgba(255, 255, 255, 0.82);
    font-size: var(--nm-fs-sm);
    line-height: 1.6;
    max-width: none;
}

body.ng-login-skin .nm-alert {
    border-radius: 10px;
}

body.ng-login-skin .nm-session-list {
    border-radius: 10px;
}

@media (max-width: 767.98px) {
    body.ng-login-skin .nm-login-wrap:has(.nm-login-pitch) {
        grid-template-columns: 1fr;
        max-width: 460px;
    }

    body.ng-login-skin .nm-login-pitch {
        display: none;
    }

    body.ng-login-skin .nm-login-card {
        padding: 2rem 1.5rem 1.25rem;
    }

    body.ng-login-skin .nm-login-page-footer {
        padding: 0 1.5rem 1.25rem;
    }
}

/* the single-column auth card (password reset) */
.ng-auth-card-single {
    grid-template-columns: 1fr;
    max-width: 460px;
}

.ng-auth-section {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--nm-border);
}

.ng-auth-label-gap {
    margin-top: 1rem;
}

.ng-auth-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ng-primary-soft);
    color: var(--nm-teal-600);
    font-size: 0.6875rem;
    font-weight: 600;
    margin-right: 0.35rem;
}

body.nm-theme-genesis .ng-auth-otp {
    letter-spacing: 0.5em;
    font-size: 1.25rem;
    text-align: center;
}

.ng-auth-portals-sub {
    margin-top: 0.4rem;
    font-size: var(--nm-fs-xs);
}

/* the registration page's three-step tracker, kept on one line inside the auth card */
body.ng-login-skin .nm-progress-tracker {
    flex-wrap: nowrap;
    gap: 0.35rem;
}

body.ng-login-skin .nm-progress-tracker .nm-progress-step-label {
    font-size: var(--nm-fs-xs);
    white-space: nowrap;
}

body.ng-login-skin .nm-progress-tracker .nm-progress-connector {
    min-width: 0.75rem;
    flex: 1 1 0.75rem;
}
