/* =========================================================================
   NexOne console

   Colour is a considered placeholder: cool slate neutrals, teal accent,
   dark chrome. There is no NexGen brand palette yet.

   Every colour goes through a token, and the dark set is defined even though
   nothing switches to it yet. That was the cheap half of the dark-mode
   question - retrofitting tokens after six screens exist is the expensive
   half, and techs live in this all day.
   ========================================================================= */

:root {
    /* Neutrals - cool slate */
    --nx-slate-50:  #f7f8fa;
    --nx-slate-100: #eef0f4;
    --nx-slate-200: #e0e4ea;
    --nx-slate-300: #c9cfd9;
    --nx-slate-400: #98a0ac;
    --nx-slate-500: #6b7480;
    --nx-slate-600: #4d555f;
    --nx-slate-700: #363d46;
    --nx-slate-800: #232931;
    --nx-slate-900: #171b21;

    /* Accent */
    --nx-accent:       #0f7b8a;
    --nx-accent-hover: #0c626e;
    --nx-accent-soft:  #e2f1f3;

    /* Status - the same four everywhere, so a colour means one thing */
    --nx-ok:      #12855c;
    --nx-warn:    #b5730b;
    --nx-danger:  #c2352b;
    --nx-neutral: #98a0ac;

    --nx-ok-soft:     #e3f3ec;
    --nx-warn-soft:   #fdf1de;
    --nx-danger-soft: #fbe9e7;

    /* Surfaces */
    --nx-bg:          var(--nx-slate-50);
    --nx-surface:     #ffffff;
    --nx-surface-alt: var(--nx-slate-100);
    --nx-border:      var(--nx-slate-200);
    --nx-border-firm: var(--nx-slate-300);

    /* Chrome - the dark rail and top bar, in both themes */
    --nx-chrome:        var(--nx-slate-900);
    --nx-chrome-alt:    var(--nx-slate-800);
    --nx-chrome-text:   var(--nx-slate-300);
    --nx-chrome-bright: #ffffff;

    /* Text */
    --nx-text:      var(--nx-slate-900);
    --nx-text-soft: var(--nx-slate-500);
    --nx-text-mute: var(--nx-slate-400);

    /* Type */
    --nx-font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --nx-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

    /* Density. Compact is the default - nine devices visible in a 900px window
       with the filter bar, bulk-action bar and pagination all still on screen. */
    --nx-row-height: 30px;
    --nx-row-pad-y: 4px;
    --nx-font-size: 13px;
}

[data-density="comfortable"] {
    --nx-row-height: 40px;
    --nx-row-pad-y: 9px;
    --nx-font-size: 14px;
}

[data-theme="dark"] {
    --nx-bg:          #12161b;
    --nx-surface:     var(--nx-slate-900);
    --nx-surface-alt: var(--nx-slate-800);
    --nx-border:      #2a313a;
    --nx-border-firm: #39414c;

    --nx-chrome:      #0d1116;
    --nx-chrome-alt:  var(--nx-slate-800);

    --nx-text:        var(--nx-slate-100);
    --nx-text-soft:   var(--nx-slate-400);
    --nx-text-mute:   var(--nx-slate-500);

    --nx-accent-soft: #10333a;
    --nx-ok-soft:     #10291f;
    --nx-warn-soft:   #2d2313;
    --nx-danger-soft: #2e1917;
}

/* ---------------------------------------------------------------- base --- */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--nx-font);
    font-size: var(--nx-font-size);
    color: var(--nx-text);
    background: var(--nx-bg);
}

* { box-sizing: border-box; }

code, .nx-mono, .nx-hostname {
    font-family: var(--nx-mono);
    font-variant-numeric: tabular-nums;
}

h1 { font-size: 19px; font-weight: 600; margin: 0; }

/* Blazor moves focus to the h1 on navigation so screen readers announce the new page.
   That is worth keeping, but the ring is not: the heading is not interactive, and Chrome
   treats the programmatic focus as :focus-visible, so a mouse user gets a box round the
   page title on every navigation. */
h1:focus, h1:focus-visible { outline: none; }
h2 { font-size: 15px; font-weight: 600; margin: 0; }

/* --------------------------------------------------------------- shell --- */

.nx-shell {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 48px 1fr;
    grid-template-areas: "brand topbar" "rail main";
    height: 100vh;
    overflow: hidden;
}

.nx-brand {
    grid-area: brand;
    background: var(--nx-chrome);
    color: var(--nx-chrome-bright);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    font-weight: 600;
    letter-spacing: 0.2px;
    border-right: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}

.nx-brand .nx-dot {
    width: 8px; height: 8px; border-radius: 2px;
    background: var(--nx-accent);
}

.nx-topbar {
    grid-area: topbar;
    background: var(--nx-chrome);
    color: var(--nx-chrome-text);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nx-topbar .nx-spacer { flex: 1; }

/* The "you're scoped to one client" reminder in the topbar - see MainLayout.razor's doc
   comment for why this exists (SelectedClientId is sticky and otherwise invisible outside
   CompanyOverview). Warm, not alarming - this is a normal working state, not an error. */
.nx-scope-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px 4px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--nx-accent, #6b5bd6) 18%, transparent);
    color: inherit;
    font-size: 12.5px;
    white-space: nowrap;
}

.nx-scope-pill b { font-weight: 600; }

.nx-scope-pill button {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 11.5px;
    cursor: pointer;
}

.nx-scope-pill button:hover { background: rgba(255, 255, 255, 0.22); }

.nx-user {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: right;
    padding-right: 4px;
}
.nx-user b { color: var(--nx-chrome-bright); font-weight: 500; font-size: 12px; }
.nx-user span { color: var(--nx-slate-500); font-size: 11px; }

/* The client switcher is the spine of the whole console: it sets the scope
   everything else inherits. Given the accent so it reads as state, not chrome. */
.nx-client-switcher { min-width: 250px; }

.nx-rail {
    grid-area: rail;
    background: var(--nx-chrome-alt);
    width: 200px;
    padding: 8px 0;
    overflow-y: auto;
    border-right: 1px solid rgba(255,255,255,0.05);
}

.nx-rail a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    color: var(--nx-chrome-text);
    text-decoration: none;
    font-size: 13px;
    border-left: 2px solid transparent;
}
.nx-rail a:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nx-rail a.active {
    background: rgba(15,123,138,0.18);
    color: #fff;
    border-left-color: var(--nx-accent);
    font-weight: 500;
}
.nx-rail a.disabled { opacity: 0.4; pointer-events: none; }

.nx-rail-group {
    padding: 12px 16px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--nx-slate-500);
}

/* An expandable rail section - "Ticketing" and "Favorites" in the real NinjaOne rail both
   disclose a sub-list rather than navigating anywhere themselves. Kept visually identical
   to an <a> so the rail reads as one consistent list, not two different controls. */
.nx-rail-expand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 7px 16px;
    background: none;
    border: none;
    border-left: 2px solid transparent;
    color: var(--nx-chrome-text);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
.nx-rail-expand:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nx-rail-expand i { font-style: normal; font-size: 10px; opacity: 0.6; }

.nx-rail a.nx-rail-sub { padding-left: 30px; font-size: 12.5px; }

/* Grouped rail: a collapsed section that holds the current page keeps the accent edge so
   you can still see where you are. */
.nx-rail-expand[aria-expanded="true"] { color: #fff; font-weight: 500; }
.nx-rail-expand.has-active { border-left-color: var(--nx-accent); color: #fff; }
.nx-rail-expand span { flex: 1; text-align: left; }
.nx-rail-badge {
    background: var(--nx-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    border-radius: 9px;
    padding: 1px 6px;
}

.nx-main {
    grid-area: main;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--nx-bg);
}

/* --------------------------------------------------------- saved views --- */

.nx-views {
    width: 208px;
    flex: none;
    background: var(--nx-surface);
    border-right: 1px solid var(--nx-border);
    overflow-y: auto;
    padding: 8px 0;
}

.nx-views-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 12px 6px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--nx-text-mute);
}

.nx-view {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 5px 12px;
    border: 0;
    border-left: 2px solid transparent;
    background: none;
    color: var(--nx-text);
    font: inherit;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
}
.nx-view:hover { background: var(--nx-surface-alt); }
.nx-view.active {
    background: var(--nx-accent-soft);
    border-left-color: var(--nx-accent);
    font-weight: 500;
}

.nx-view-count {
    font-family: var(--nx-mono);
    font-size: 11px;
    color: var(--nx-text-mute);
    flex: none;
}
.nx-view.active .nx-view-count { color: var(--nx-accent); }

/* ---------------------------------------------------------- work areas --- */

.nx-page { display: flex; flex: 1; min-height: 0; }

.nx-work {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* .nx-main/.nx-shell both clip overflow (grid-based app shell, scrolling handled inside
       each work area instead) - a page whose content can run taller than the viewport, like
       the ticket detail screen with a growing comment thread, needs its own scrollbar here
       or the extra content is simply cut off with no way to reach it. Pages whose content
       manages its own internal scroll (the board's .nx-grid-wrap + RadzenDataGrid) never
       grow past this box's height in the first place, so this is a no-op for them. */
    overflow-y: auto;
}

.nx-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--nx-surface);
    border-bottom: 1px solid var(--nx-border);
    flex-wrap: wrap;
}
.nx-toolbar .nx-spacer { flex: 1; }

/* A "Label + one control" pair inline in a toolbar - e.g. TicketView.razor's Status
   dropdown next to the ticket title, matching NinjaOne's own "Status: New" chip placement
   without needing a bespoke chip-styled dropdown. */
.nx-inline-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--nx-text-soft);
    white-space: nowrap;
}

.nx-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px 2px 9px;
    border-radius: 11px;
    background: var(--nx-accent-soft);
    color: var(--nx-accent);
    border: 1px solid transparent;
    font-size: 11.5px;
    white-space: nowrap;
}
.nx-chip button {
    border: 0; background: none; cursor: pointer; padding: 0 2px;
    color: inherit; font-size: 13px; line-height: 1; opacity: 0.7;
}
.nx-chip button:hover { opacity: 1; }

.nx-grid-wrap { flex: 1; min-height: 0; padding: 0 12px 12px; }

/* Bulk actions appear only with a selection, so the row is not permanently
   eating vertical space on a screen whose whole point is density. */
.nx-bulk {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--nx-accent-soft);
    border-bottom: 1px solid var(--nx-border);
    font-size: 12.5px;
}

/* ---------------------------------------------------------- status dot --- */

.nx-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.nx-status::before {
    content: ""; width: 7px; height: 7px; border-radius: 50%;
    background: var(--nx-neutral); flex: none;
}
.nx-status.online::before      { background: var(--nx-ok); }
.nx-status.offline::before     { background: var(--nx-neutral); }
.nx-status.pending::before     { background: var(--nx-warn); }
.nx-status.quarantined::before { background: var(--nx-danger); }
.nx-status.retired::before     { background: var(--nx-slate-300); }
.nx-status.retired             { color: var(--nx-text-mute); }

.nx-flag {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--nx-warn); font-size: 11.5px;
}

.nx-stale { color: var(--nx-warn); }
.nx-never { color: var(--nx-text-mute); font-style: italic; }

/* --------------------------------------------------------------- pods --- */

.nx-detail { flex: 1; overflow-y: auto; padding: 12px; }

.nx-detail-head {
    display: flex; align-items: center; gap: 12px;
    padding: 0 0 12px; flex-wrap: wrap;
    flex: none; /* so it keeps its height inside .nx-detail-fill's flex column */
}
.nx-detail-head h1 { font-family: var(--nx-mono); font-size: 18px; }

.nx-pods {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    align-items: start;
}

.nx-pod {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    overflow: hidden;
}
.nx-pod > header {
    padding: 7px 12px;
    background: var(--nx-surface-alt);
    border-bottom: 1px solid var(--nx-border);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--nx-text-soft);
    font-weight: 600;
}
.nx-pod.nx-pod-wide { grid-column: 1 / -1; }

/* C) the CPU/Memory/Disk strip at the top of DeviceView's Overview tab - the NinjaOne-shaped
   "tiles across the top" layout, kept separate from .nx-pods below it (the existing
   System/OS/NexAgent/etc pods, untouched) rather than folded into the same grid, since these
   are always meant to read as one row, not reflow with the rest. The screenshot used to live
   as a fourth narrow tile in this same row, capped at 160px tall - a technician squinting at
   a remote desktop needs to actually read what's on screen, so it now gets its own full-width
   pod below this row instead, sized close to a real screenshot's aspect ratio. */
.nx-live-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 12px;
    align-items: stretch;
    margin-bottom: 12px;
}
@media (max-width: 900px) {
    .nx-live-row { grid-template-columns: 1fr 1fr; }
}
.nx-live-tile { display: flex; flex-direction: column; }
.nx-live-tile > header { display: flex; justify-content: space-between; gap: 6px; }
.nx-live-figure { padding: 10px 12px 4px; font-size: 20px; font-weight: 600; }
.nx-spark { width: 100%; height: 40px; display: block; padding: 0 4px 8px; box-sizing: border-box; }

.nx-live-screenshot-wide { margin-bottom: 16px; }
.nx-live-screenshot-wide > header { display: flex; justify-content: space-between; gap: 6px; }
.nx-live-screenshot-img {
    width: 100%;
    max-height: 640px;
    object-fit: contain;
    background: #111;
    display: block;
}
.nx-live-screenshot-empty {
    padding: 48px 12px;
    font-size: 12px;
    color: var(--nx-text-mute);
    text-align: center;
}

.nx-facts { width: 100%; border-collapse: collapse; }
.nx-facts th, .nx-facts td {
    padding: 5px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--nx-border);
    font-size: 12.5px;
}
.nx-facts tr:last-child th, .nx-facts tr:last-child td { border-bottom: 0; }
.nx-facts th { color: var(--nx-text-soft); font-weight: 400; width: 42%; }
.nx-facts td { font-family: var(--nx-mono); word-break: break-word; }
.nx-facts td.nx-plain { font-family: var(--nx-font); }

/* ------------------------------------------------------ review banner --- */

.nx-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    margin-bottom: 12px;
    border: 1px solid;
}
.nx-banner.warn   { background: var(--nx-warn-soft);   border-color: var(--nx-warn);   }
.nx-banner.danger { background: var(--nx-danger-soft); border-color: var(--nx-danger); }
.nx-banner.ok     { background: var(--nx-ok-soft);      border-color: var(--nx-ok);     }
.nx-banner.info   { background: var(--nx-accent-soft);  border-color: var(--nx-accent); }

/* Feature #19: the console-wide "known issue" strip in MainLayout.razor - same review
   banner look, pinned near the top of the shell rather than inline in a page body. */
.nx-known-issue-banner { margin: 0 20px 0 20px; }

/* Feature #1: a plain native date input (AdminContractRenewals.razor) rather than an
   unverified Radzen date-picker component - styled to sit visually consistent with the
   RadzenTextBox/RadzenDropDown inputs beside it in the same form. */
.nx-date-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    background: var(--nx-surface);
    color: var(--nx-text);
    font: inherit;
}
.nx-banner p { margin: 2px 0 0; font-size: 12.5px; color: var(--nx-text-soft); }
.nx-banner .nx-banner-body { flex: 1; }
.nx-banner strong { font-size: 13px; }

/* -------------------------------------------------- identity weighting --- */

.nx-weight {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.nx-weight.strong { background: var(--nx-ok-soft);     color: var(--nx-ok); }
.nx-weight.medium { background: var(--nx-warn-soft);   color: var(--nx-warn); }
.nx-weight.weak   { background: var(--nx-surface-alt); color: var(--nx-text-mute); }

/* ------------------------------------------------------------- states --- */

.nx-splash, .nx-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 64px 16px; color: var(--nx-text-soft); text-align: center;
}
.nx-empty h1 { color: var(--nx-text); }

.nx-error {
    margin: 12px;
    padding: 10px 14px;
    border-radius: 4px;
    background: var(--nx-danger-soft);
    border: 1px solid var(--nx-danger);
    color: var(--nx-danger);
    font-size: 12.5px;
}

/* ------------------------------------------------- company overview --- */

/* The tab strip on CompanyOverview.razor - Overview/Devices are real, the rest are visible,
   disabled placeholders for a module not built yet (see that page's own class doc). */
.nx-company-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--nx-border);
    margin: 4px 0 12px;
    overflow-x: auto;
}
.nx-company-tab {
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--nx-text-mute);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
}
.nx-company-tab:hover { color: var(--nx-text); }
.nx-company-tab.active {
    color: var(--nx-text);
    font-weight: 600;
    border-bottom-color: var(--nx-accent);
}
.nx-company-tab.disabled { opacity: 0.4; pointer-events: none; }

/* A single number-over-label tile, for a panel reporting a module NexOne hasn't built yet
   (ticketing, documentation) - "—" rather than a lying "0". */
.nx-stat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 6px;
    border-right: 1px solid var(--nx-border);
}
.nx-stat-tile:last-child { border-right: 0; }
.nx-stat-tile b { font-size: 18px; }
.nx-stat-tile span { font-size: 11px; color: var(--nx-text-mute); }

.nx-stat-row { display: flex; }
.nx-stat-row .nx-stat-tile { flex: 1; }

/* --------------------------------------------------- fleet overview --- */

.nx-dash {
    display: grid;
    grid-template-columns: 300px minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

@media (max-width: 1280px) {
    .nx-dash { grid-template-columns: 280px minmax(0, 1fr); }
    .nx-dash-side { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
}
@media (max-width: 900px) {
    .nx-dash { grid-template-columns: 1fr; }
    .nx-dash-side { grid-template-columns: 1fr; }
}

.nx-dash-main, .nx-dash-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.nx-pod-search { padding: 8px 10px; border-bottom: 1px solid var(--nx-border); }

.nx-client-list { max-height: 520px; overflow-y: auto; }

.nx-client-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 7px 12px 7px 0;
    border: 0;
    border-bottom: 1px solid var(--nx-border);
    background: none;
    color: var(--nx-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.nx-client-row:hover { background: var(--nx-surface-alt); }
.nx-client-row.active { background: var(--nx-accent-soft); }
.nx-client-row:last-child { border-bottom: 0; }

/* The status stripe, as in the reference: colour on the left edge carries the
   client's worst state without spending a column on it. */
.nx-client-bar { width: 3px; align-self: stretch; flex: none; background: var(--nx-slate-300); }
.nx-client-bar.ok      { background: var(--nx-ok); }
.nx-client-bar.warn    { background: var(--nx-warn); }
.nx-client-bar.danger  { background: var(--nx-danger); }
.nx-client-bar.empty   { background: var(--nx-slate-300); }

.nx-client-name { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.3; }
.nx-client-name small { display: block; color: var(--nx-text-mute); font-size: 11px; }

.nx-client-badges { display: flex; gap: 4px; flex: none; }

.nx-badge {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 17px; padding: 0 5px;
    border-radius: 9px; font-size: 10.5px; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.nx-badge.danger { background: var(--nx-danger-soft); color: var(--nx-danger); }
.nx-badge.warn   { background: var(--nx-warn-soft);   color: var(--nx-warn); }
.nx-badge.ok     { background: var(--nx-ok-soft);     color: var(--nx-ok); }

/* Device tags (DeviceView's header row, Devices grid's Tags column). A dedicated class
   rather than bare .nx-badge, since plain .nx-badge has no background of its own - every
   existing caller applies .danger/.warn/.ok or relies on a container for one - and a tag
   chip needs to read as a chip in both places it appears, including the grid column,
   which isn't wrapped in anything else new. */
.nx-tag-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
    padding: 8px 0 2px;
}
.nx-tag-chip {
    display: inline-flex; align-items: center;
    background: var(--nx-accent-soft); color: var(--nx-accent);
    border-radius: 9px; padding: 3px 7px; font-size: 11px; font-weight: 600;
}
.nx-tag-chip a { color: inherit; text-decoration: none; font-weight: 700; margin-left: 5px; opacity: 0.7; }

/* Favorites star (DeviceView/CompanyOverview headers). Unstyled <button> so it sits inline
   with the h1/status pill without dragging in RadzenButton's own padding/border chrome. */
.nx-star-toggle {
    background: none; border: none; cursor: pointer; padding: 0 2px;
    font-size: 18px; line-height: 1; color: var(--nx-text-mute);
}
.nx-star-toggle.active { color: var(--nx-warn); }
.nx-star-toggle:hover { color: var(--nx-warn); }

/* Command palette (Ctrl/Cmd+K) - a centered overlay over the existing .nx-modal-backdrop,
   same dismiss-by-backdrop-click convention as every other modal in the console. */
.nx-command-palette {
    position: fixed; top: 14vh; left: 50%; transform: translateX(-50%);
    width: min(560px, calc(100vw - 32px)); max-height: 60vh;
    background: var(--nx-surface); border: 1px solid var(--nx-border-firm);
    border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,0.28);
    z-index: 1201; /* above .nx-modal-backdrop's 1200 */ display: flex; flex-direction: column; overflow: hidden;
}
.nx-command-palette-input {
    border: none; border-bottom: 1px solid var(--nx-border);
    padding: 14px 16px; font-size: 15px; background: transparent; color: var(--nx-text);
    outline: none;
}
.nx-command-palette-results { overflow-y: auto; padding: 6px; }
.nx-command-palette-empty {
    padding: 18px 14px; color: var(--nx-text-mute); font-size: 12.5px; text-align: center;
}
.nx-command-palette-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 6px; text-decoration: none; color: var(--nx-text);
    font-size: 13px;
}
.nx-command-palette-item:hover, .nx-command-palette-item.active { background: var(--nx-accent-soft); }
.nx-command-palette-kind {
    flex: none; width: 52px; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
    color: var(--nx-text-mute); letter-spacing: 0.03em;
}

/* Native remote control, R1 (RemoteView.razor) - the canvas the agent's captured frames are
   drawn to, and the "waiting / disconnected" overlay shown over it until a frame arrives. */
/* The remote page is the one console screen that must not scroll. .nx-detail's default
   overflow-y:auto is what forced a scrollbar and pushed the bottom of the remote screen off
   the window; this variant turns the page into a fixed-height flex column instead, so the
   stage gets exactly the leftover height and the canvas is scaled to fit inside it.
   min-height:0 on the growing child is the part that is easy to miss - without it a flex
   item refuses to shrink below its content's intrinsic size, which for a 4K canvas is how
   the scrollbar comes back. */
.nx-detail-fill {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.nx-remote-body {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 10px;
}

.nx-remote-stage {
    position: relative; background: #1b1e24; border-radius: 8px;
    flex: 1; min-width: 0; min-height: 0;
    display: flex; align-items: center; justify-content: center;
}

/* Fit: never larger than the stage, aspect ratio preserved, no scrollbars anywhere.
   1:1: the canvas keeps its own pixel size and the stage scrolls, for when a technician
   needs to read something at native resolution. */
.nx-remote-stage.is-fit { overflow: hidden; }
.nx-remote-stage.is-actual { overflow: auto; align-items: flex-start; justify-content: flex-start; }

.nx-remote-canvas { display: block; }
.is-fit .nx-remote-canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.is-actual .nx-remote-canvas { max-width: none; max-height: none; flex: none; }

.nx-remote-stage:fullscreen { border-radius: 0; }
.nx-remote-stage:fullscreen .nx-remote-canvas { max-width: 100vw; max-height: 100vh; }

.nx-remote-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    color: #cfd3da; font-size: 14px; background: rgba(27, 30, 36, 0.55);
    /* Belt and braces: the overlay is only shown while the session is not connected, but it
       covers the whole canvas, so even a momentary stale one would swallow every mouse and
       key event. It never needs to be a hit target itself. */
    pointer-events: none;
}
/* Hidden with a class rather than removed from the tree - see RemoteView.razor's header for
   why the stage's children must stay structurally constant across renders. */
.nx-remote-overlay.is-hidden { display: none; }

/* --- command bar --- */

.nx-remote-bar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
    padding: 6px 8px; margin-bottom: 8px;
    background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 4px;
    flex: none;
}

.nx-remote-group { display: flex; align-items: center; gap: 4px; }

.nx-remote-label { font-size: 11.5px; color: var(--nx-text-soft); text-transform: uppercase; letter-spacing: .04em; }

.nx-rbtn {
    font: inherit; font-size: 12px; line-height: 1;
    padding: 6px 9px; border-radius: 3px;
    border: 1px solid var(--nx-border); background: var(--nx-bg); color: var(--nx-text);
    cursor: pointer; white-space: nowrap;
}
.nx-rbtn:hover:not(:disabled) { border-color: var(--nx-accent); color: var(--nx-accent); }
.nx-rbtn:disabled { opacity: .45; cursor: default; }
.nx-rbtn.is-on { border-color: var(--nx-accent); color: var(--nx-accent); background: var(--nx-surface); }
.nx-rbtn.is-rec { border-color: #b4443a; color: #d8776c; }

.nx-rselect, .nx-rinput {
    font: inherit; font-size: 12px; padding: 5px 6px; border-radius: 3px;
    border: 1px solid var(--nx-border); background: var(--nx-bg); color: var(--nx-text);
}
.nx-rinput { flex: 1; min-width: 0; font-family: var(--nx-mono); }

.nx-remote-fps {
    font-family: var(--nx-mono); font-size: 11.5px; color: var(--nx-text-soft);
    min-width: 52px;
}

.nx-remote-stats {
    font-family: var(--nx-mono); font-size: 11px; color: var(--nx-text-soft); opacity: .8;
}

.nx-remote-toast {
    flex: none; margin-bottom: 8px; padding: 7px 10px; border-radius: 3px;
    font-size: 12.5px;
    background: var(--nx-surface); border: 1px solid var(--nx-border); color: var(--nx-text);
}
.nx-remote-toast.is-error { border-color: #b4443a; color: #d8776c; }

/* --- side panels (file browser, settings) --- */

.nx-remote-side {
    display: none;
    width: 300px; flex: none;
    background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 4px;
    flex-direction: column; min-height: 0;
}
.nx-remote-side.is-open { display: flex; }

.nx-remote-side-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; border-bottom: 1px solid var(--nx-border); flex: none;
}

.nx-remote-side-body { padding: 10px; overflow-y: auto; min-height: 0; }

.nx-remote-path { display: flex; gap: 6px; }

.nx-remote-hint { font-size: 11.5px; color: var(--nx-text-soft); margin: 8px 0 0; line-height: 1.45; }

.nx-remote-dirpath {
    font-family: var(--nx-mono); font-size: 11px; color: var(--nx-text-soft);
    margin: 10px 0 4px; word-break: break-all;
}

.nx-remote-files { list-style: none; margin: 0; padding: 0; }
.nx-remote-files li { border-bottom: 1px solid var(--nx-border); }

.nx-rlink {
    display: flex; align-items: center; gap: 6px; width: 100%;
    font: inherit; font-size: 12px; text-align: left;
    padding: 6px 2px; background: none; border: 0; color: var(--nx-text); cursor: pointer;
}
.nx-rlink:hover { color: var(--nx-accent); }

.nx-remote-size { margin-left: auto; font-family: var(--nx-mono); font-size: 11px; color: var(--nx-text-soft); }

.nx-rchat { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.nx-rchat li { padding: 5px 0; border-bottom: 1px solid var(--nx-border); }
.nx-rchat li.is-mine { color: var(--nx-text-soft); }
.nx-rchat b { margin-right: 6px; }
.nx-rchat-entry { padding: 8px 10px; border-top: 1px solid var(--nx-border); flex: none; }

.nx-remote-stage.is-dropping { outline: 2px dashed var(--nx-accent); outline-offset: -6px; }

.nx-remote-progress {
    display: flex; align-items: center; gap: 10px; flex: none;
    padding: 6px 10px; margin-bottom: 8px; font-size: 11.5px;
    background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 3px;
}
.nx-remote-progress progress { flex: 1; height: 6px; }

.nx-rsecret { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12px; }
.nx-rsecret > span { flex: 1; }

.nx-rnotes {
    width: 100%; min-height: 120px; margin-top: 4px;
    font-family: inherit; resize: vertical;
}

/* --- Quick Connect --- */

.nx-qc-code {
    display: flex; align-items: baseline; gap: 12px;
    margin: 12px 0 8px; padding: 12px;
    background: var(--nx-bg); border: 1px solid var(--nx-accent); border-radius: 4px;
}
.nx-qc-value {
    font-family: var(--nx-mono); font-size: 34px; font-weight: 600;
    letter-spacing: .08em; color: var(--nx-accent);
}
.nx-qc-expiry { font-size: 11.5px; color: var(--nx-text-soft); }
.nx-qc-small { font-family: var(--nx-mono); letter-spacing: .06em; }

.nx-qc-url {
    font-family: var(--nx-mono); font-size: 15px; padding: 8px 10px; margin: 4px 0 8px;
    background: var(--nx-bg); border: 1px solid var(--nx-border); border-radius: 3px;
    word-break: break-all;
}

/* --- /join, seen by the person being helped --- */

.nx-join {
    max-width: 440px; margin: 8vh auto; padding: 0 16px;
    font-size: 15px; line-height: 1.5;
}
.nx-join h1 { font-size: 24px; margin-bottom: 8px; }

.nx-join-code {
    display: block; width: 100%; margin: 20px 0 12px;
    font-family: var(--nx-mono); font-size: 32px; text-align: center;
    letter-spacing: .12em; text-transform: uppercase;
    padding: 12px; border-radius: 4px;
    border: 1px solid var(--nx-border); background: var(--nx-surface); color: var(--nx-text);
}

.nx-join-go {
    display: block; width: 100%; padding: 14px;
    font: inherit; font-size: 16px; font-weight: 600;
    border: 0; border-radius: 4px; cursor: pointer;
    background: var(--nx-accent); color: #fff;
}
.nx-join-go:disabled { opacity: .4; cursor: default; }

.nx-join-steps { margin: 20px 0; padding-left: 20px; }
.nx-join-steps li { margin-bottom: 6px; }

.nx-join-note { font-size: 13px; color: var(--nx-text-soft); }

/* --- monitor thumbnails --- */

.nx-remote-thumbs {
    display: flex; gap: 8px; flex-wrap: wrap; flex: none;
    padding: 8px; margin-bottom: 8px;
    background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 4px;
}

.nx-rthumb {
    display: flex; flex-direction: column; gap: 4px; align-items: center;
    padding: 6px; border: 1px solid var(--nx-border); border-radius: 3px;
    background: var(--nx-bg); color: var(--nx-text-soft); cursor: pointer;
    font: inherit; font-size: 10.5px; font-family: var(--nx-mono);
}
.nx-rthumb.is-on { border-color: var(--nx-accent); color: var(--nx-accent); }
.nx-rthumb img { display: block; width: 180px; height: auto; border-radius: 2px; }
.nx-rthumb-all {
    display: flex; align-items: center; justify-content: center;
    width: 180px; height: 101px; background: #1b1e24; color: #cfd3da; border-radius: 2px;
    font-size: 12px;
}

.nx-rvalue { font-family: var(--nx-mono); word-break: break-all; max-width: 200px; }

.nx-remote-regedit {
    margin-top: 10px; padding: 8px;
    background: var(--nx-bg); border: 1px solid var(--nx-border); border-radius: 3px;
}
.nx-remote-regedit > label { display: block; font-size: 11.5px; font-weight: 600; margin-bottom: 6px; }

.nx-rlink.is-on { color: var(--nx-accent); font-weight: 600; }

/* --- background tools panel --- */

.nx-remote-side.is-wide { width: 460px; }

.nx-remote-tabs { display: flex; gap: 2px; padding: 6px 8px 0; flex: none; }

.nx-rtab {
    font: inherit; font-size: 12px; padding: 5px 10px;
    border: 1px solid var(--nx-border); border-bottom: 0;
    border-radius: 3px 3px 0 0;
    background: var(--nx-bg); color: var(--nx-text-soft); cursor: pointer;
}
.nx-rtab.is-on { background: var(--nx-surface); color: var(--nx-text); font-weight: 600; }

.nx-rtable { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 8px; }
.nx-rtable th {
    text-align: left; font-weight: 600; font-size: 10.5px; text-transform: uppercase;
    letter-spacing: .04em; color: var(--nx-text-soft);
    padding: 4px 6px 4px 0; border-bottom: 1px solid var(--nx-border);
}
.nx-rtable td { padding: 3px 6px 3px 0; border-bottom: 1px solid var(--nx-border); }
.nx-rtable td:nth-child(2), .nx-rtable td:nth-child(3), .nx-rtable td:nth-child(4) {
    font-family: var(--nx-mono);
}

.nx-rowactions { display: flex; gap: 8px; white-space: nowrap; }
.nx-rlink.nx-danger:hover { color: #d8776c; }

.nx-remote-events { list-style: none; margin: 8px 0 0; padding: 0; font-size: 11.5px; }
.nx-remote-events li {
    padding: 6px 0 6px 8px; border-bottom: 1px solid var(--nx-border);
    border-left: 3px solid transparent;
}
.nx-remote-events li.is-warn  { border-left-color: var(--nx-warn); }
.nx-remote-events li.is-error { border-left-color: #b4443a; }
.nx-revent-head { font-family: var(--nx-mono); font-size: 10.5px; color: var(--nx-text-soft); }
.nx-revent-body { margin-top: 2px; white-space: pre-wrap; word-break: break-word; }

.nx-rterm {
    background: #12161b; color: #cfd3da; font-family: var(--nx-mono); font-size: 11.5px;
    padding: 8px; border-radius: 3px; margin: 8px 0;
    height: 300px; overflow: auto; white-space: pre-wrap; word-break: break-word;
}

.nx-remote-setting { margin-bottom: 16px; }
.nx-remote-setting > label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.nx-remote-placeholder { opacity: .75; }

/* --- health bar --- */

.nx-health { padding: 12px 14px 14px; }
.nx-health-figure { font-size: 12.5px; color: var(--nx-text-soft); margin-bottom: 8px; }
.nx-health-figure b { font-size: 20px; color: var(--nx-text); font-weight: 600; margin-right: 4px; }

.nx-health-bar {
    display: flex;
    height: 12px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--nx-slate-200);
}
[data-theme="dark"] .nx-health-bar { background: var(--nx-slate-700); }

.nx-health-bar .seg { display: block; height: 100%; }
.nx-health-bar .seg.ok      { background: var(--nx-ok); }
.nx-health-bar .seg.warn    { background: var(--nx-warn); }
.nx-health-bar .seg.danger  { background: var(--nx-danger); }
.nx-health-bar .seg.unknown { background: var(--nx-slate-400); }

.nx-health-legend {
    display: flex; flex-wrap: wrap; gap: 4px 16px;
    margin-top: 10px; font-size: 11.5px; color: var(--nx-text-soft);
}
.nx-health-legend span { display: inline-flex; align-items: center; gap: 6px; }
.nx-health-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.nx-health-legend i.ok      { background: var(--nx-ok); }
.nx-health-legend i.warn    { background: var(--nx-warn); }
.nx-health-legend i.danger  { background: var(--nx-danger); }
.nx-health-legend i.unknown { background: var(--nx-slate-400); }

/* --- condition rows: one per condition, never one per device --- */

.nx-condition-group { padding: 4px 0 6px; }
.nx-condition-group h3 {
    margin: 0; padding: 8px 14px 4px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--nx-text-soft); font-weight: 600;
}

.nx-condition {
    display: flex; align-items: center; gap: 12px;
    width: 100%; padding: 7px 14px;
    border: 0; border-left: 3px solid transparent;
    background: none; color: var(--nx-text);
    font: inherit; text-align: left; cursor: pointer;
}
.nx-condition:hover { background: var(--nx-surface-alt); }
.nx-condition.danger { border-left-color: var(--nx-danger); }
.nx-condition.warn   { border-left-color: var(--nx-warn); }

.nx-condition-label { flex: 1; min-width: 0; line-height: 1.35; }
.nx-condition-label b { font-size: 12.5px; font-weight: 500; display: block; }
.nx-condition-label small { color: var(--nx-text-mute); font-size: 11px; }

.nx-condition-count {
    flex: none; font-family: var(--nx-mono); font-variant-numeric: tabular-nums;
    font-size: 14px; font-weight: 500;
}
.nx-condition.danger .nx-condition-count { color: var(--nx-danger); }
.nx-condition.warn   .nx-condition-count { color: var(--nx-warn); }

.nx-all-clear {
    display: flex; flex-direction: column; gap: 3px;
    padding: 18px 14px; color: var(--nx-text-soft); font-size: 12.5px;
}
.nx-all-clear b { color: var(--nx-ok); font-size: 13.5px; }

/* --- activity --- */

.nx-activity { list-style: none; margin: 0; padding: 0; }
.nx-activity li {
    display: flex; gap: 10px; align-items: baseline;
    padding: 6px 12px; border-bottom: 1px solid var(--nx-border); font-size: 12.5px;
}
.nx-activity li:last-child { border-bottom: 0; }
.nx-activity li.denied { background: var(--nx-danger-soft); }

.nx-activity-when { flex: none; width: 34px; color: var(--nx-text-mute); font-size: 11px; }
.nx-activity-what { flex: 1; min-width: 0; line-height: 1.35; }
.nx-activity-what b { font-weight: 500; }
.nx-activity-what small { display: block; color: var(--nx-text-mute); font-size: 11px; }

/* ------------------------------------------------------ the + menu --- */

.nx-add { position: relative; flex: none; }

.nx-add-trigger {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    color: var(--nx-chrome-bright);
    font-size: 17px; line-height: 1; cursor: pointer;
}
.nx-add-trigger:hover { background: rgba(255,255,255,0.14); }

.nx-add-menu {
    position: absolute; top: 34px; left: 0; z-index: 1300;
    width: 290px; padding: 4px 0;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border-firm);
    border-radius: 6px;
    box-shadow: 0 10px 32px rgba(23,27,33,0.24);
    color: var(--nx-text);
}

.nx-add-title {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 12px 6px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--nx-text-mute); font-weight: 600;
}
.nx-add-back {
    border: 0; background: none; cursor: pointer; padding: 0 2px;
    color: var(--nx-accent); font-size: 14px; line-height: 1;
}

.nx-add-item {
    display: flex; align-items: flex-start; gap: 10px;
    width: 100%; padding: 6px 12px;
    border: 0; background: none; color: var(--nx-text);
    font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
}
.nx-add-item:hover:not(.unbuilt):not(.disabled) { background: var(--nx-surface-alt); }
.nx-add-item.unbuilt, .nx-add-item.disabled { opacity: 0.45; cursor: default; }

.nx-add-icon { flex: none; width: 18px; text-align: center; font-size: 13px; }
.nx-add-label { flex: 1; min-width: 0; line-height: 1.35; }
.nx-add-label small { display: block; color: var(--nx-text-mute); font-size: 11px; }
.nx-add-more { flex: none; color: var(--nx-text-mute); }

.nx-add-sep { height: 1px; margin: 4px 0; background: var(--nx-border); }

/* ------------------------------------------------------- admin area --- */

.nx-admin { flex: 1; overflow-y: auto; padding: 12px 16px 24px; }

.nx-crumb {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--nx-text-mute); margin-bottom: 6px;
}
.nx-crumb a { color: var(--nx-accent); text-decoration: none; }
.nx-crumb a:hover { text-decoration: underline; }
.nx-crumb b { color: var(--nx-text); font-weight: 500; }

.nx-admin > h1 { margin-bottom: 14px; }

.nx-admin-body {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) { .nx-admin-body { grid-template-columns: 1fr; } }

.nx-admin-nav {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    overflow: hidden;
}

.nx-admin-cat + .nx-admin-cat { border-top: 1px solid var(--nx-border); }

.nx-admin-cat-head {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 10px 12px;
    border: 0; background: none; color: var(--nx-text);
    font: inherit; font-size: 13.5px; font-weight: 500;
    text-align: left; cursor: pointer;
}
.nx-admin-cat-head:hover { background: var(--nx-surface-alt); }
.nx-chevron { color: var(--nx-text-mute); font-size: 12px; }

.nx-admin-pages { padding-bottom: 6px; }
.nx-admin-pages a, .nx-admin-pages span.disabled {
    display: block; padding: 5px 12px 5px 22px;
    font-size: 12.5px; text-decoration: none; color: var(--nx-text);
    border-left: 2px solid transparent;
}
.nx-admin-pages a:hover { background: var(--nx-surface-alt); }
.nx-admin-pages a.active {
    background: var(--nx-accent-soft);
    border-left-color: var(--nx-accent);
    color: var(--nx-accent); font-weight: 500;
}
.nx-admin-pages span.disabled { color: var(--nx-text-mute); cursor: default; }
.nx-admin-pages span.disabled small { display: block; font-size: 10.5px; opacity: 0.8; }

.nx-admin-page { min-width: 0; }

.nx-settings-head { margin-bottom: 14px; }
.nx-settings-head p { margin: 4px 0 0; color: var(--nx-text-soft); font-size: 12.5px; }

/* Getting started (Phase 1 item 2, 2026-09-17) - a simple responsive card grid, no new
   layout primitive needed beyond what nx-settings-head already establishes above. */
.nx-getting-started-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.nx-gs-card {
    border: 1px solid var(--nx-border);
    border-radius: 6px;
    padding: 12px 14px;
    background: var(--nx-surface);
}

.nx-gs-card h3 { font-size: 13.5px; font-weight: 600; margin: 0 0 4px; }

.nx-gs-card p {
    color: var(--nx-text-soft);
    font-size: 12.5px;
    margin: 0 0 8px;
}

.nx-gs-card a { color: var(--nx-accent); text-decoration: none; font-size: 12.5px; font-weight: 500; }
.nx-gs-card a:hover { text-decoration: underline; }

/* --- setting cards --- */

.nx-setting {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.nx-setting-body { flex: 1; min-width: 0; }
.nx-setting-body h3 { margin: 0 0 3px; font-size: 14px; font-weight: 600; }
.nx-setting-body > p { margin: 0 0 10px; font-size: 12.5px; color: var(--nx-text-soft); }

.nx-setting-edit-link {
    flex: none; border: 0; background: none; cursor: pointer;
    color: var(--nx-accent); font: inherit; font-size: 12.5px; padding: 0;
}
.nx-setting-edit-link:hover { text-decoration: underline; }

.nx-setting-values {
    display: grid; grid-template-columns: 190px minmax(0, 1fr);
    gap: 4px 12px; margin: 0; font-size: 12.5px;
}
.nx-setting-values dt { color: var(--nx-text-soft); }
.nx-setting-values dd { margin: 0; }

.nx-setting-edit label { display: block; margin-bottom: 10px; font-size: 12.5px; color: var(--nx-text-soft); }
.nx-setting-edit label > *:not(small) { margin-top: 4px; }
.nx-setting-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Branding admin page (nexgen-platform-feature-spec.md, section 8/14) - a small live
   preview next to a hex-text-box, since this codebase has no colour-picker component
   with a confirmed API to reuse. Inline-styled background colour comes from the page
   itself; this rule only sets the swatch's shape. */
.nx-color-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid var(--nx-border);
    vertical-align: middle;
    margin-left: 6px;
}

.nx-saved {
    margin-bottom: 12px; padding: 8px 12px;
    background: var(--nx-ok-soft); border: 1px solid var(--nx-ok);
    border-radius: 4px; color: var(--nx-ok); font-size: 12.5px;
}

/* --- admin landing cards --- */

.nx-admin-group { margin-bottom: 20px; }
.nx-admin-group h3 {
    margin: 0 0 8px; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.6px; color: var(--nx-text-soft); font-weight: 600;
}
.nx-admin-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px;
}
.nx-admin-card {
    display: block; padding: 11px 13px;
    background: var(--nx-surface); border: 1px solid var(--nx-border);
    border-radius: 4px; text-decoration: none; color: var(--nx-text);
}
.nx-admin-card:hover { border-color: var(--nx-accent); }
.nx-admin-card b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.nx-admin-card span { font-size: 12px; color: var(--nx-text-soft); line-height: 1.4; }
.nx-admin-card.unbuilt { opacity: 0.6; }
.nx-admin-card.unbuilt:hover { border-color: var(--nx-border); }

/* --- forms in dialogs --- */

.nx-form label { display: block; margin-bottom: 12px; font-size: 12.5px; color: var(--nx-text-soft); }
.nx-form label > *:not(small) { margin-top: 4px; }
.nx-form label small { display: block; margin-top: 3px; color: var(--nx-text-mute); font-size: 11px; }
.nx-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.nx-checkline { display: flex !important; align-items: center; gap: 8px; }
.nx-checkline label { margin-bottom: 0 !important; }

/* Accessibility pass (feature #27, nexgen-platform-feature-spec.md §13). */

/* A visually-hidden label - present for assistive tech, invisible to sighted users, and
   NOT display:none/visibility:hidden, both of which most screen readers also skip. Same
   "off-screen, not gone" technique every accessibility guide gives, applied here rather
   than invented, since this is the one part of an a11y pass that has one universally
   correct answer, not a judgment call. */
.nx-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Off-screen until it receives keyboard focus (Tab from the very top of the page), then
   pinned to the top-left corner above everything else - the standard skip-link pattern.
   Never visible to a mouse user, since a mouse user reaches content directly. */
.nx-skip-link {
  position: absolute; top: -100px; left: 8px; z-index: 10000;
  background: var(--nx-accent, #2f6fed); color: #fff;
  padding: 8px 14px; border-radius: 4px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: top 0.1s ease-out;
}
.nx-skip-link:focus { top: 8px; }
.nx-required { color: var(--nx-danger); }

.nx-os-picker { display: flex; gap: 8px; margin: 12px 0 16px; }
.nx-os {
    flex: 1; padding: 10px; border: 1px solid var(--nx-border-firm);
    border-radius: 4px; background: var(--nx-surface); color: var(--nx-text);
    font: inherit; font-size: 12.5px; cursor: pointer;
}
.nx-os.active { border-color: var(--nx-accent); background: var(--nx-accent-soft); color: var(--nx-accent); font-weight: 500; }
.nx-os.unbuilt { opacity: 0.45; cursor: default; }
.nx-os small { display: block; font-size: 10px; color: var(--nx-text-mute); }

.nx-copybox {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 8px 7px 10px; margin-top: 4px;
    background: var(--nx-surface-alt);
    border: 1px solid var(--nx-border-firm);
    border-radius: 4px;
}
.nx-copybox code {
    flex: 1; min-width: 0; font-size: 11.5px; word-break: break-all;
    color: var(--nx-text); user-select: all;
}

/* The prepopulated installer. Given prominence over the command line beside it, because
   downloading it is the path a technician should take and the command line is the fallback
   for GPO and Intune. */
.nx-download {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px; margin-top: 4px;
    background: var(--nx-accent-soft);
    border: 1px solid var(--nx-accent);
    border-radius: 4px;
}
.nx-download-button {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    background: var(--nx-accent); color: #fff;
    border-radius: 4px; text-decoration: none;
    font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.nx-download-button:hover { filter: brightness(1.08); text-decoration: none; }
.nx-download > span { flex: 1; min-width: 180px; font-size: 12px; line-height: 1.45; }

/* Sits in a row of Radzen text buttons and has to look like one, but must stay an anchor
   so the browser performs the download itself. */
.nx-inline-link {
    display: inline-block; padding: 2px 8px; margin-right: 2px;
    font-size: 11px; font-weight: 500;
    color: var(--nx-accent); text-decoration: none;
}
.nx-inline-link:hover { text-decoration: underline; }

.nx-modal-wide { width: min(620px, calc(100vw - 32px)); }

/* ---------------------------------------------- admin: scopes, perms --- */

.nx-scope-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.nx-perm-preview {
    display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
}
.nx-perm-preview b { width: 100%; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.nx-perm-preview span {
    padding: 2px 6px; border-radius: 3px;
    background: var(--nx-surface-alt); color: var(--nx-text-soft);
    font-size: 11px;
}
.nx-perm-preview span.nx-perm-danger {
    background: var(--nx-danger-soft); color: var(--nx-danger); font-weight: 500;
}

.nx-setting h3 .nx-badge { margin-left: 6px; vertical-align: middle; }

/* --- audit --- */

.nx-audit { display: flex; gap: 12px; align-items: stretch; height: 640px; }
.nx-audit .nx-views { width: 200px; flex: none; }
.nx-audit .nx-work {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    overflow: hidden;
}
.nx-audit .nx-toolbar { border-bottom: 1px solid var(--nx-border); }
.nx-audit .nx-grid-wrap { padding: 0 8px 8px; }

/* ------------------------------------------------------------ modals --- */

.nx-modal-backdrop {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(23, 27, 33, 0.45);
}

.nx-modal {
    position: fixed; z-index: 1201;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(460px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border-firm);
    border-radius: 6px;
    box-shadow: 0 12px 40px rgba(23, 27, 33, 0.28);
    padding: 16px 18px;
}

.nx-modal h2 { margin-bottom: 12px; }
.nx-modal label { display: block; margin-bottom: 12px; font-size: 12.5px; color: var(--nx-text-soft); }
.nx-modal label > * { margin-top: 4px; }

.nx-modal-actions {
    display: flex; align-items: center; justify-content: flex-end; gap: 8px;
    margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--nx-border);
}

/* The device page's Actions dropdown (New ticket / Run script) - a plain toggled panel
   rather than a component library dropdown, so it has no dependency beyond what every
   modal on this page already uses. */
.nx-action-dropdown { position: relative; display: inline-block; }
.nx-action-menu {
    position: absolute; top: calc(100% + 4px); right: 0; z-index: 20;
    background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 6px;
    box-shadow: 0 8px 24px rgba(23, 27, 33, 0.22);
    min-width: 160px; padding: 4px;
}
.nx-action-menu a {
    display: block; padding: 7px 10px; border-radius: 4px; font-size: 13px;
    color: var(--nx-text); text-decoration: none; cursor: pointer;
}
.nx-action-menu a:hover { background: var(--nx-surface-alt); }

.nx-check {
    display: flex !important; align-items: flex-start; gap: 8px;
    color: var(--nx-text) !important; margin-bottom: 6px !important;
}
.nx-check small { display: block; color: var(--nx-text-mute); font-size: 11.5px; }

.nx-column-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px;
    max-height: 320px; overflow-y: auto;
}

.nx-hint { font-size: 12px; color: var(--nx-text-soft); margin: 0 0 8px; }
.nx-hint code {
    background: var(--nx-surface-alt); padding: 1px 4px; border-radius: 3px; font-size: 11.5px;
}

.nx-text-soft { color: var(--nx-text-soft); }

/* --------------------------------------------------- Radzen overrides ---
   Radzen's DataGrid is chosen for density and filtering. Its default row
   height is far taller than a working screen wants, so the density tokens
   are pushed into it here rather than fought with per-grid attributes. */

.nx-grid .rz-data-grid-data,
.nx-grid .rz-grid-table { font-size: var(--nx-font-size); }

.nx-grid .rz-grid-table > tbody > tr > td {
    padding: var(--nx-row-pad-y) 8px;
    height: var(--nx-row-height);
    border-bottom: 1px solid var(--nx-border);
}

.nx-grid .rz-grid-table > thead > tr > th {
    padding: 5px 8px;
    background: var(--nx-surface-alt);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--nx-text-soft);
    white-space: nowrap;
}

/* Dark-mode fix (2026-09-17): Radzen renders the header label and sort icon as
   separate elements *inside* the <th>, each carrying its own colour straight from
   Radzen's own light-only theme tokens. A colour declared directly on a descendant
   always wins over an inherited value from an ancestor rule, no matter how specific
   that ancestor's selector is - so overriding `th` above was never enough in dark
   mode, it just never showed until now. This forces every header descendant to the
   same token. Unverified against a real dark-mode build - flag if headers are still
   wrong after this.
*/
.nx-grid .rz-grid-table > thead > tr > th,
.nx-grid .rz-grid-table > thead > tr > th * {
    color: var(--nx-text-soft) !important;
}

/* Dark-mode fix (2026-09-17): Radzen's dropdown/select popups (RadzenDropDown,
   RadzenDropDownDataGrid, autocomplete lists, etc.) render detached from any .nx-*
   wrapper and were never themed at all - they always used Radzen's own light
   background/text colours, which is why the New Ticket "Organization" popup looked
   fine in light mode but had faded, low-contrast rows once the surrounding page
   went dark. Same caveat as above: unverified against a real dark-mode build. */
.rz-dropdown-panel,
.rz-popup,
.rz-listbox {
    background: var(--nx-surface) !important;
    border: 1px solid var(--nx-border) !important;
    color: var(--nx-text) !important;
}

.rz-dropdown-panel .rz-dropdown-item,
.rz-dropdown-panel li,
.rz-listbox .rz-listbox-item,
.rz-popup li,
.rz-popup .rz-listitem {
    color: var(--nx-text) !important;
    background: transparent !important;
}

.rz-dropdown-panel .rz-dropdown-item:hover,
.rz-dropdown-panel li:hover,
.rz-listbox .rz-listbox-item:hover,
.rz-popup li:hover {
    background: var(--nx-surface-alt) !important;
}

.rz-dropdown-panel .rz-state-highlight,
.rz-listbox .rz-state-highlight,
.rz-popup .rz-state-highlight {
    background: var(--nx-accent-soft) !important;
    color: var(--nx-text) !important;
}

.nx-grid .rz-datatable-even { background: var(--nx-surface); }
.nx-grid .rz-datatable-odd  { background: var(--nx-surface); }
.nx-grid .rz-grid-table > tbody > tr:hover { background: var(--nx-surface-alt); }
.nx-grid .rz-grid-table > tbody > tr.rz-state-highlight { background: var(--nx-accent-soft); }

.nx-grid a { color: var(--nx-accent); text-decoration: none; }
.nx-grid a:hover { text-decoration: underline; }

/* Ticket ID/Subject links (Tickets.razor) - block-level and full-height so the *whole* cell
   opens the ticket, not just the few pixels of underlined text, matching the "click the
   ticket to open it" expectation a ticketing grid should meet. */
.nx-grid a.nx-cell-link {
    display: block;
    width: 100%;
    height: 100%;
    padding: 8px 0;
    margin: -8px 0;
}

/* ============================================================================
   Authentication: sign-in screen, no-access screen, account menu.
   ============================================================================ */

.nx-empty-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nx-bg);
    padding: 24px;
}

.nx-signin { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--nx-bg); padding: 24px; }

.nx-signin-card {
    width: min(380px, 100%);
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 8px;
    padding: 32px 28px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.nx-signin-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.2px;
    color: var(--nx-text);
    margin-bottom: 4px;
}

.nx-signin-brand .nx-dot {
    width: 9px; height: 9px; border-radius: 2px;
    background: var(--nx-accent);
}

.nx-signin-tag { color: var(--nx-text-soft); font-size: 13px; margin: 0 0 20px; }

.nx-signin-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 4px;
    border: 1px solid var(--nx-border-firm);
    background: var(--nx-surface);
    color: var(--nx-text);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.nx-signin-button:hover { background: var(--nx-surface-alt); }

.nx-signin-hint {
    color: var(--nx-text-mute);
    font-size: 11.5px;
    line-height: 1.5;
    text-align: left;
    margin: 16px 0 0;
}

/* ------------------------------------------------------- account menu --- */

.nx-account { position: relative; }

.nx-account-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    color: inherit;
}
.nx-account-trigger:hover { background: rgba(255,255,255,0.06); }

.nx-account-avatar {
    display: flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--nx-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}
.nx-account-avatar.lg { width: 36px; height: 36px; font-size: 13px; }

.nx-account-label {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    text-align: left;
}
.nx-account-label b { color: var(--nx-chrome-bright); font-weight: 500; font-size: 12px; }
.nx-account-label span { color: var(--nx-slate-500); font-size: 11px; }

.nx-account-backdrop { background: transparent; }

.nx-account-menu {
    position: absolute;
    z-index: 1201;
    top: calc(100% + 6px);
    right: 0;
    width: 260px;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
    padding: 12px;
    color: var(--nx-text);
}

.nx-account-menu-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--nx-border);
}
.nx-account-menu-head b { display: block; font-size: 13px; }
.nx-account-menu-head span { display: block; color: var(--nx-text-soft); font-size: 11.5px; }

.nx-account-menu-scope {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--nx-border);
}
.nx-account-menu-scope small { color: var(--nx-text-mute); font-size: 11px; }

.nx-account-menu-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 8px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--nx-text);
    font-size: 12.5px;
    text-decoration: none;
    cursor: pointer;
}
.nx-account-menu-item:hover { background: var(--nx-surface-alt); }
.nx-account-menu-item.danger { color: var(--nx-danger); }

.nx-account-menu-signout { margin: 0; }

/* --------------------------------------------------- access denied --- */

.nx-access-denied code { background: var(--nx-surface-alt); padding: 1px 5px; border-radius: 3px; }

/* ============================================================================
   NexDesk - ticket board (M9 board slice). Reuses .nx-page/.nx-views/.nx-work/
   .nx-toolbar/.nx-chip/.nx-grid-wrap/.nx-bulk verbatim - only what the board
   needs beyond the shapes those already give Devices is added below.
   ============================================================================ */

.nx-board-tabs { display: flex; gap: 2px; margin-left: 4px; }

.nx-board-tab {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 10px 9px; font-size: 12.5px; color: var(--nx-text-soft);
    border-bottom: 2px solid transparent; background: none; border-top: none;
    border-left: none; border-right: none; cursor: pointer;
}
.nx-board-tab:hover { color: var(--nx-text); }
.nx-board-tab.active { color: var(--nx-text); font-weight: 600; border-bottom-color: var(--nx-accent); }

.nx-board-tab-count {
    background: var(--nx-surface-alt); color: var(--nx-text-soft);
    font-size: 10.5px; padding: 1px 6px; border-radius: 20px;
    font-family: var(--nx-mono);
}
.nx-board-tab.active .nx-board-tab-count { background: var(--nx-accent-soft); color: var(--nx-accent); }

/* Attention strip - one card per condition, not per ticket (see TicketBoardService's
   class doc). Visually related to .nx-condition (Overview's fleet attention panel) but
   laid out as a row of cards rather than a vertical list, since a ticket board reads
   left-to-right above a grid rather than beside one. */
.nx-attn-row { display: flex; gap: 8px; padding: 10px 12px; flex-wrap: wrap; }

.nx-attn-card {
    flex: 1 1 220px; display: flex; gap: 9px; align-items: flex-start;
    padding: 9px 11px; border-radius: 6px; border: 1px solid var(--nx-border);
    background: var(--nx-surface-alt);
}
.nx-attn-card .stripe { width: 3px; align-self: stretch; border-radius: 3px; flex: none; background: var(--nx-slate-300); }
.nx-attn-card.danger  .stripe { background: var(--nx-danger); }
.nx-attn-card.warning .stripe { background: var(--nx-warn); }
.nx-attn-card.neutral .stripe { background: var(--nx-neutral); }

.nx-attn-num { font-family: var(--nx-mono); font-weight: 600; font-size: 16px; line-height: 1; }
.nx-attn-card.danger  .nx-attn-num { color: var(--nx-danger); }
.nx-attn-card.warning .nx-attn-num { color: var(--nx-warn); }
.nx-attn-card.neutral .nx-attn-num { color: var(--nx-text-soft); }
.nx-attn-text { font-size: 11.5px; color: var(--nx-text-soft); margin-top: 3px; line-height: 1.35; }

/* Priority chip - mapped onto the console's existing four-colour vocabulary rather than
   a fifth palette (Critical=danger, High=warn, Medium=accent, Low=neutral) - see
   Ticket.Priority's class doc. */
.nx-pri { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 11.5px; white-space: nowrap; }
.nx-pri i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.nx-pri.emergency i { background: var(--nx-danger); }  .nx-pri.emergency { color: var(--nx-danger); }
.nx-pri.critical  i { background: var(--nx-warn); }    .nx-pri.critical  { color: var(--nx-warn); }
.nx-pri.normal    i { background: var(--nx-accent); }  .nx-pri.normal    { color: var(--nx-accent); }
.nx-pri.longterm  i { background: var(--nx-neutral); } .nx-pri.longterm  { color: var(--nx-text-soft); }
.nx-pri.superlow  i { background: var(--nx-surface-alt); border: 1px solid var(--nx-border); }
.nx-pri.superlow  { color: var(--nx-text-mute); }

/* Status pill - a ticket's lifecycle state, distinct from the dot-based .nx-status a
   device uses, since a ticket status is a short phrase ("Waiting on Customer") rather
   than a single word next to a dot. */
.nx-tstatus {
    display: inline-flex; align-items: center; height: 19px; padding: 0 8px;
    border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.nx-tstatus.new       { background: var(--nx-accent-soft); color: var(--nx-accent); }
.nx-tstatus.progress  { background: var(--nx-warn-soft);   color: var(--nx-warn); }
.nx-tstatus.waiting   { background: var(--nx-surface);     color: var(--nx-text-soft); border: 1px solid var(--nx-border-firm); }
.nx-tstatus.resolved  { background: var(--nx-ok-soft);     color: var(--nx-ok); }
.nx-tstatus.closed    { background: var(--nx-surface-alt); color: var(--nx-text-mute); }

/* SLA countdown - colour carries urgency the same way .nx-stale/.nx-never already do for
   a device's last-seen column. */
.nx-sla { font-family: var(--nx-mono); font-weight: 600; }
.nx-sla.ok     { color: var(--nx-ok); }
.nx-sla.warn   { color: var(--nx-warn); }
.nx-sla.bad    { color: var(--nx-danger); }
.nx-sla.paused { color: var(--nx-text-mute); font-weight: 500; font-family: var(--nx-font); font-style: italic; }
.nx-sla.none   { color: var(--nx-text-mute); font-weight: 500; font-family: var(--nx-font); }

/* Agreement tag - nexgen-console-ux.md's billing rule: a ticket inherits its client's
   one agreement (Client.AgreementType) rather than a tech deciding billability by hand. */
.nx-agreement { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 4px; white-space: nowrap; }
.nx-agreement.managed  { background: var(--nx-ok-soft);     color: var(--nx-ok); }
.nx-agreement.breakfix { background: var(--nx-surface-alt); color: var(--nx-text-soft); }
.nx-agreement.project  { background: var(--nx-accent-soft); color: var(--nx-accent); }
.nx-agreement.internal { background: var(--nx-surface-alt); color: var(--nx-text-mute); }

.nx-ticket-company { display: flex; flex-direction: column; gap: 1px; line-height: 1.3; }
.nx-ticket-company b { font-weight: 600; }
.nx-ticket-company span { font-size: 10.5px; color: var(--nx-text-mute); }

.nx-unassigned { color: var(--nx-text-mute); font-style: italic; }

/* New-ticket page (M9 creation slice) - a three-column layout modeled on NinjaOne's own
   ticket-creation screen: narrow "what/who this is about" info on the left, the wide
   subject/description in the middle (the actual content of the ticket), a narrow
   "has this come up before" recap on the right. Reuses .nx-pod (DeviceView's boxed
   sections) for the two side columns rather than inventing a second card style. */
.nx-ticket-create {
    margin: 12px;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 280px;
    gap: 12px;
    align-items: start;
}
@media (max-width: 1100px) {
    .nx-ticket-create { grid-template-columns: 1fr; }
}

.nx-ticket-create-left,
.nx-ticket-create-right { display: flex; flex-direction: column; gap: 12px; }

.nx-ticket-create .nx-pod > .nx-pod-body { padding: 12px; }
.nx-ticket-create .nx-pod label {
    display: block; margin-bottom: 12px; font-size: 12.5px; color: var(--nx-text-soft);
}
.nx-ticket-create .nx-pod label:last-child { margin-bottom: 0; }
.nx-ticket-create .nx-pod label > * { margin-top: 4px; }

/* The middle column: subject reads like a title (this IS the ticket), description is a
   plain, generously-sized textarea - no rich-text toolbar, because there's no rich-text
   storage behind it (Ticket.Description is plain text, see its class doc). */
.nx-ticket-create-main {
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    padding: 14px 16px;
}
.nx-ticket-subject input {
    font-size: 15px; font-weight: 500;
}
.nx-ticket-create-main label {
    display: block; font-size: 12.5px; color: var(--nx-text-soft); margin-bottom: 14px;
}
.nx-ticket-create-main label > * { margin-top: 4px; }
.nx-ticket-description textarea {
    width: 100%; min-height: 220px; resize: vertical;
    font-family: var(--nx-font); font-size: 13px; line-height: 1.5;
    padding: 8px 10px;
    background: var(--nx-surface); color: var(--nx-text);
    border: 1px solid var(--nx-border-firm); border-radius: 4px;
}

.nx-recent-ticket {
    display: flex; flex-direction: column; gap: 2px;
    padding: 8px 0; border-bottom: 1px solid var(--nx-border);
}
.nx-recent-ticket:last-child { border-bottom: none; padding-bottom: 0; }
.nx-recent-ticket .nx-recent-top {
    display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
}
.nx-recent-ticket .nx-recent-num { font-family: var(--nx-mono); color: var(--nx-text-mute); font-size: 11px; }
.nx-recent-ticket .nx-recent-subject { font-size: 12.5px; }
.nx-recent-ticket .nx-recent-meta { font-size: 11px; color: var(--nx-text-mute); }

/* Ticket detail - the comment/update thread, living in the middle column below the
   Description box (like an email chain under a message) rather than as its own pod - the
   thread is part of the ticket's own text, not a side fact about it. Newest update first,
   same as any mail client thread or NinjaOne's own activity feed: the reply box sits right
   above the most recent entry, so what to read first and where to add the next update are
   both at the top of the list, not buried below everything already read. */
.nx-ticket-comments {
    margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--nx-border);
}
.nx-ticket-comments > header {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--nx-text-soft); font-weight: 600; margin-bottom: 10px;
}
.nx-comment-form { margin-bottom: 14px; }
.nx-comment-list {
    display: flex; flex-direction: column; gap: 12px;
}
.nx-comment {
    padding: 10px 12px;
    background: var(--nx-surface-alt); border: 1px solid var(--nx-border); border-radius: 6px;
}
.nx-comment-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    margin-bottom: 4px; font-size: 12.5px;
}
.nx-comment-head span { font-size: 11px; }
/* Marks a comment that arrived by email (or, once built, the client portal) rather than
   from a signed-in technician - a quick visual cue for "this is the customer's own words,
   not staff's" without needing a whole separate layout for external comments. */
.nx-comment-source {
    margin-left: 6px; padding: 1px 6px; border-radius: 8px;
    background: var(--nx-accent-soft); color: var(--nx-accent);
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px;
}
.nx-comment-body { margin: 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.nx-comment-form textarea {
    width: 100%; min-height: 64px; resize: vertical; box-sizing: border-box;
    font-family: var(--nx-font); font-size: 13px; line-height: 1.5;
    padding: 8px 10px;
    background: var(--nx-surface); color: var(--nx-text);
    border: 1px solid var(--nx-border-firm); border-radius: 4px;
}

/* ------------------------------------------------------- notification bell --- */
/* Same trigger/backdrop/dropdown shape as .nx-account-* - a second bespoke popover
   pattern would be a second thing to keep visually consistent for no reason. */

.nx-notif { position: relative; }

.nx-notif-trigger {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px;
    background: transparent; border: none; border-radius: 4px;
    color: inherit; cursor: pointer; font-size: 16px;
}
.nx-notif-trigger:hover { background: rgba(255,255,255,0.06); }

.nx-notif-badge {
    position: absolute; top: 1px; right: 1px;
    min-width: 15px; height: 15px; padding: 0 3px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: var(--nx-danger); color: #fff;
    font-size: 10px; font-weight: 600; line-height: 1;
}

.nx-notif-backdrop { background: transparent; }

.nx-notif-menu {
    position: absolute;
    z-index: 1201;
    top: calc(100% + 6px);
    right: 0;
    width: 340px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
    color: var(--nx-text);
}

.nx-notif-menu-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid var(--nx-border);
    font-size: 12px; font-weight: 600;
}
.nx-notif-menu-head button {
    background: none; border: none; color: var(--nx-accent);
    font-size: 11.5px; font-weight: 500; cursor: pointer; padding: 0;
}

.nx-notif-item {
    display: block; width: 100%; text-align: left;
    padding: 10px 12px; border: none; border-bottom: 1px solid var(--nx-border);
    background: transparent; color: var(--nx-text); cursor: pointer;
}
.nx-notif-item:last-child { border-bottom: none; }
.nx-notif-item:hover { background: var(--nx-surface-alt); }
.nx-notif-item.unread { background: var(--nx-accent-soft); }
.nx-notif-item-title { display: block; font-size: 12.5px; font-weight: 600; }
.nx-notif-item-body { display: block; font-size: 12px; color: var(--nx-text-soft); margin-top: 2px; }
.nx-notif-item-time { display: block; font-size: 10.5px; color: var(--nx-text-mute); margin-top: 4px; }

.nx-notif-empty { padding: 24px 12px; text-align: center; color: var(--nx-text-soft); font-size: 12.5px; }

/* ---------------------------------------------------- comment delete + pages --- */

.nx-comment-del {
    background: none; border: none; color: var(--nx-text-mute);
    cursor: pointer; font-size: 11px; padding: 0 0 0 8px;
}
.nx-comment-del:hover { color: var(--nx-danger); }

.nx-comment-confirm {
    display: flex; align-items: center; gap: 6px; font-size: 11px;
}
.nx-comment-confirm button { background: none; border: none; cursor: pointer; padding: 0; font-size: 11px; }
.nx-comment-confirm .danger { color: var(--nx-danger); font-weight: 600; }

.nx-comment-pager {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    margin-top: 10px; font-size: 11.5px; color: var(--nx-text-soft);
}
.nx-comment-pager button {
    background: none; border: 1px solid var(--nx-border-firm); border-radius: 4px;
    padding: 3px 10px; cursor: pointer; color: var(--nx-text); font-size: 11.5px;
}
.nx-comment-pager button:disabled { opacity: 0.4; cursor: default; }

.nx-notif-enable {
    display: flex; flex-direction: column; gap: 6px;
    padding: 10px 12px; border-bottom: 1px solid var(--nx-border);
    background: var(--nx-surface-alt); font-size: 11.5px; color: var(--nx-text-soft);
}
.nx-notif-enable button {
    align-self: flex-start;
    background: var(--nx-accent); color: #fff; border: none;
    border-radius: 4px; padding: 5px 10px; font-size: 11.5px; cursor: pointer;
}
.nx-notif-enable.muted { background: transparent; }

/* ---------------------------------------------- documentation (per-client) --- */

/* The IT Glue-shaped redesign: a categorized left rail (templates grouped by their
   Icon tag) beside the dashboard/grid, on ClientDocumentation.razor and
   ClientDocumentationPasswords.razor. Deliberately its own two-column grid rather than
   reusing .nx-dash (that one is a dashboard-of-pods layout with no persistent nav rail -
   this is closer to .nx-audit's fixed-sidebar-plus-work-area shape, just wider). */
.nx-doc-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
@media (max-width: 900px) {
    .nx-doc-shell { grid-template-columns: 1fr; }
}

.nx-doc-sidebar {
    display: flex; flex-direction: column; gap: 2px;
    background: var(--nx-surface);
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    padding: 6px;
    position: sticky; top: 0;
}
.nx-doc-sidebar h4 {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--nx-text-mute); padding: 8px 8px 4px;
}
.nx-doc-cat {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 6px 8px; border-radius: 4px;
    font-size: 12.5px; color: var(--nx-text); text-decoration: none;
    background: none; border: none; text-align: left; cursor: pointer; width: 100%;
}
.nx-doc-cat:hover { background: var(--nx-surface-alt); }
.nx-doc-cat.active { background: var(--nx-accent-soft); color: var(--nx-accent); font-weight: 600; }
.nx-doc-cat span.count {
    font-size: 10.5px; color: var(--nx-text-mute); font-variant-numeric: tabular-nums;
}
.nx-doc-cat.active span.count { color: var(--nx-accent); }
.nx-doc-sidebar hr { border: none; border-top: 1px solid var(--nx-border); margin: 6px 4px; }

.nx-doc-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.nx-doc-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

/* A dedicated password row (ClientDocumentationPasswords.razor) - name/username on the
   left, masked value + reveal/copy icon buttons on the right, the same left-content /
   right-icon-buttons shape IT Glue's own Passwords screen uses instead of a bare text
   "Reveal" link, which is what the original flat Documentation.razor still uses inline in
   its edit form (unchanged - see that page's own doc comment for why it stays simpler). */
.nx-pw-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-bottom: 1px solid var(--nx-border);
}
.nx-pw-row:last-child { border-bottom: 0; }
.nx-pw-row .nx-pw-main { flex: 1; min-width: 0; }
.nx-pw-row .nx-pw-main b { display: block; font-size: 12.5px; }
.nx-pw-row .nx-pw-main small { display: block; color: var(--nx-text-mute); font-size: 11px; }
.nx-pw-value {
    font-family: var(--nx-mono); font-size: 12px; color: var(--nx-text-soft);
    min-width: 90px; text-align: right; user-select: all;
}
.nx-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 4px;
    border: 1px solid var(--nx-border-firm); background: var(--nx-surface);
    color: var(--nx-text-soft); cursor: pointer; font-size: 13px; line-height: 1;
}
.nx-icon-btn:hover { background: var(--nx-surface-alt); color: var(--nx-text); }
.nx-icon-btn.copied { color: var(--nx-ok); border-color: var(--nx-ok); }

/* Documents folder browser (ClientDocumentationFiles.razor) - a breadcrumb trail above a
   flat list of folder/document rows, the same left-content / right-icon-buttons row shape
   .nx-pw-row already established, reused here rather than invented fresh. */
.nx-doc-breadcrumb {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    font-size: 12.5px; color: var(--nx-text-mute); margin-bottom: 10px;
}
.nx-doc-breadcrumb a { color: var(--nx-text-soft); }
.nx-doc-breadcrumb a:hover { color: var(--nx-accent); }
.nx-doc-breadcrumb .sep { color: var(--nx-text-mute); }
.nx-file-list { display: flex; flex-direction: column; }
.nx-file-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-bottom: 1px solid var(--nx-border);
}
.nx-file-row:last-child { border-bottom: 0; }
.nx-file-icon { font-size: 16px; width: 22px; text-align: center; flex-shrink: 0; }
.nx-file-main { flex: 1; min-width: 0; }
.nx-file-main a { font-size: 12.5px; }
.nx-file-main small { display: block; color: var(--nx-text-mute); font-size: 11px; }
.nx-file-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* Record detail page (ClientDocumentationRecord.razor) - the field values on the left,
   the Related Items / Revisions / Attachments side panels on the right, the same
   two-column "main content, narrower side column of pods" shape .nx-dash already uses for
   CompanyOverview, at a narrower side column since these panels are lists, not charts. */
.nx-detail-panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 12px;
    align-items: start;
}
@media (max-width: 900px) {
    .nx-detail-panels { grid-template-columns: 1fr; }
}
.nx-field-list dt {
    font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px;
    color: var(--nx-text-mute); margin-top: 12px;
}
.nx-field-list dt:first-child { margin-top: 0; }
.nx-field-list dd { margin: 3px 0 0; font-size: 13px; word-break: break-word; }

/* ---------------------------------------------------------------------------
   Outline pages (NexMDM, Email migration)

   A module that is planned but not built gets a real page describing its shape
   rather than a dead rail link - see Mdm.razor / EmailMigration.razor. These
   pages are almost entirely prose lists inside the existing .nx-pod, so the only
   thing they need is a list that reads well at the console's 12.5px body size.
   --------------------------------------------------------------------------- */
.nx-outline-list { margin: 0; padding-left: 18px; }
.nx-outline-list li {
    font-size: 12.5px;
    color: var(--nx-text-soft);
    margin-bottom: 6px;
    line-height: 1.5;
}
.nx-outline-list li:last-child { margin-bottom: 0; }
.nx-outline-list b { color: var(--nx-text); }

/* ---------------------------------------------------------------------------
   NexPDF (2026-09-19)

   The viewer is the first screen in this console that is mostly a canvas, so it
   needs a handful of classes of its own. Everything that could be reused was -
   .nx-toolbar, .nx-banner, .nx-bulk, .nx-grid-wrap and .nx-pod all come through
   unchanged; what is below is only the parts that genuinely have no precedent
   here (a thumbnail strip, a page stage, and a markup overlay that has to sit
   pixel-exactly on top of the page canvas).
   --------------------------------------------------------------------------- */

/* Small shared bits NexPDF needed that the rest of the console had been doing
   with inline styles. Defined once here rather than repeated per page. */
.nx-danger-text { color: var(--nx-danger); }

.nx-inline-input {
    font: inherit;
    font-size: 12px;
    padding: 1px 4px;
    width: 160px;
    border: 1px solid var(--nx-border);
    border-radius: 3px;
    background: var(--nx-surface);
    color: var(--nx-text);
}

/* A file picker that looks like the console's other buttons. <InputFile> renders a
   bare <input type=file>, which cannot be styled - so it is hidden inside a label
   and the label is what gets drawn. */
.nx-upload-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 10px;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    background: var(--nx-surface);
}
.nx-upload-button:hover { border-color: var(--nx-accent); }
.nx-upload-button input[type="file"] {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    overflow: hidden;
}

.nx-pdf-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 0 12px 10px;
    align-items: center;
}
.nx-pdf-toolgroup {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    background: var(--nx-surface);
}
.nx-pdf-toollabel {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--nx-text-soft);
    margin-right: 2px;
}
.nx-pdf-color {
    width: 28px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--nx-border);
    border-radius: 3px;
    background: none;
    cursor: pointer;
}

.nx-pdf-body {
    display: flex;
    gap: 12px;
    padding: 0 12px 12px;
    min-height: 0;
    flex: 1;
}

.nx-pdf-thumbs {
    width: 148px;
    flex: 0 0 148px;
    overflow-y: auto;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    background: var(--nx-surface);
    padding: 6px;
}
.nx-pdf-thumb { margin-bottom: 8px; }
.nx-pdf-thumb.active canvas { outline: 2px solid var(--nx-accent); }
.nx-pdf-thumb label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--nx-text-soft);
    margin-bottom: 2px;
}
.nx-pdf-thumb canvas {
    display: block;
    width: 110px;
    border: 1px solid var(--nx-border);
    background: #fff;
    cursor: pointer;
}

.nx-pdf-stage {
    flex: 1;
    min-width: 0;
    overflow: auto;
    background: #4a4a4a;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    padding: 16px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* The two canvases must line up exactly - the overlay is positioned over the page
   and every mark's coordinates are read as a fraction of this element's own
   bounding rect. Any padding, border, or margin between them would offset every
   annotation by that amount. */
.nx-pdf-canvas-wrap { position: relative; line-height: 0; }
.nx-pdf-canvas-wrap canvas { display: block; }
#nx-pdf-canvas { background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.35); }
#nx-pdf-overlay {
    position: absolute;
    inset: 0;
    cursor: crosshair;
}

/* ---------------------------------------------------------------------------
   Client portal (2026-09-19)

   A separate visual register from the console on purpose. The console is a dense
   technician tool - 12px type, 30px grid rows, a dark module rail. The portal is
   read twice a month by someone who does not work here, so it is wider, larger,
   and has four links instead of thirty. It still uses the same CSS variables, so
   it reads as the same product and follows the same light/dark theme.
   --------------------------------------------------------------------------- */
.nx-portal {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--nx-bg);
    color: var(--nx-text);
}

.nx-portal-top {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 22px;
    height: 56px;
    border-bottom: 1px solid var(--nx-border);
    background: var(--nx-surface);
}
.nx-portal-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    color: var(--nx-text);
}
.nx-portal-nav { display: flex; gap: 4px; }
.nx-portal-nav a {
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13.5px;
    text-decoration: none;
    color: var(--nx-text-soft);
}
.nx-portal-nav a:hover { background: var(--nx-surface-alt); color: var(--nx-text); }
.nx-portal-nav a.active { background: var(--nx-accent-soft); color: var(--nx-accent); }

.nx-portal-who { text-align: right; line-height: 1.25; }
.nx-portal-who b { display: block; font-size: 13px; }
.nx-portal-who span { font-size: 11.5px; color: var(--nx-text-soft); }

.nx-portal-signout {
    font-size: 12.5px;
    color: var(--nx-text-soft);
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
}
.nx-portal-signout:hover { border-color: var(--nx-accent); color: var(--nx-accent); }

.nx-portal-main {
    flex: 1;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 22px 40px;
}

.nx-portal-foot {
    border-top: 1px solid var(--nx-border);
    padding: 14px 22px;
    font-size: 12px;
    color: var(--nx-text-soft);
    text-align: center;
}

.nx-portal-head { margin-bottom: 18px; }
.nx-portal-head h1 { font-size: 22px; margin: 4px 0 2px; font-weight: 600; }
.nx-portal-head p { margin: 0; color: var(--nx-text-soft); font-size: 13px; }

.nx-portal-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.nx-portal-tile {
    display: block;
    padding: 16px 18px;
    border: 1px solid var(--nx-border);
    border-radius: 6px;
    background: var(--nx-surface);
    text-decoration: none;
    color: var(--nx-text);
}
.nx-portal-tile:hover { border-color: var(--nx-accent); }
.nx-portal-tile-value { display: block; font-size: 26px; font-weight: 600; line-height: 1.1; }
.nx-portal-tile-label { display: block; font-size: 12px; color: var(--nx-text-soft); margin-top: 3px; }

.nx-portal-filter {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    font-size: 13px;
}
.nx-portal-filter label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.nx-portal-list { list-style: none; margin: 0; padding: 0; }
.nx-portal-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--nx-border);
    font-size: 13px;
}
.nx-portal-list li:last-child { border-bottom: none; }
.nx-portal-list li > a { flex: 1; display: flex; gap: 10px; text-decoration: none; color: var(--nx-text); }
.nx-portal-list li > a:hover { color: var(--nx-accent); }

.nx-portal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.nx-portal-table th {
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--nx-text-soft);
    padding: 6px 8px;
    border-bottom: 1px solid var(--nx-border);
}
.nx-portal-table td { padding: 9px 8px; border-bottom: 1px solid var(--nx-border); }
.nx-portal-table tr:last-child td { border-bottom: none; }
.nx-portal-table .nx-num { text-align: right; font-variant-numeric: tabular-nums; }

/* white-space: pre-wrap, because a ticket description and a comment are plain
   text that people typed with line breaks in - rendering them collapsed is the
   single most common way a support thread becomes unreadable. */
.nx-portal-body-text { white-space: pre-wrap; font-size: 13px; line-height: 1.55; }

.nx-portal-thread { list-style: none; margin: 14px 0 0; padding: 0; }
.nx-portal-thread li {
    padding: 12px 0;
    border-top: 1px solid var(--nx-border);
}
.nx-portal-thread-head {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    margin-bottom: 4px;
}

.nx-portal-reply { margin-bottom: 8px; }
.nx-portal-reply textarea {
    width: 100%;
    font: inherit;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    background: var(--nx-surface);
    color: var(--nx-text);
    resize: vertical;
}
.nx-portal-reply > div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

/* The sign-in and reset forms. They share .nx-signin/.nx-signin-card with the
   technician sign-in screen deliberately - one branded card, two audiences. */
.nx-portal-form { text-align: left; margin-top: 14px; }
.nx-portal-form label {
    display: block;
    font-size: 12px;
    color: var(--nx-text-soft);
    margin: 10px 0 4px;
}
.nx-portal-form input {
    width: 100%;
    font: inherit;
    font-size: 14px;
    padding: 9px 11px;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    background: var(--nx-surface);
    color: var(--nx-text);
    box-sizing: border-box;
}
.nx-portal-form button { margin-top: 14px; }
.nx-portal-form-inline {
    border-top: 1px solid var(--nx-border);
    margin-top: 20px;
    padding-top: 6px;
}
.nx-portal-form-inline > div { display: flex; gap: 8px; }
.nx-portal-form-inline input { flex: 1; font-size: 13px; padding: 7px 9px; }
.nx-portal-form-inline button {
    margin-top: 0;
    white-space: nowrap;
    font-size: 12.5px;
    padding: 7px 12px;
    border: 1px solid var(--nx-border);
    border-radius: 4px;
    background: var(--nx-surface);
    color: var(--nx-text);
    cursor: pointer;
}
.nx-portal-form-inline button:hover { border-color: var(--nx-accent); color: var(--nx-accent); }

/* Chip colour variants and a two-column label/field form grid. Both were being
   done ad hoc with inline styles before the End users and NexPDF screens needed
   them in several places at once; defined once here instead. */
.nx-chip.ok     { background: var(--nx-ok-soft);     color: var(--nx-ok);     }
.nx-chip.warn   { background: var(--nx-warn-soft);   color: var(--nx-warn);   }
.nx-chip.danger { background: var(--nx-danger-soft); color: var(--nx-danger); }

.nx-form-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 10px 14px;
    align-items: center;
}
.nx-form-grid > label { font-size: 12.5px; color: var(--nx-text-soft); margin: 0; }

/* ---------------------------------------------------------------------------
   The external signing page (2026-09-20)

   A third visual register, after the console and the client portal, and the
   most different of the three. The person reading this has no NexOne account,
   often arrives on a phone, and is about to do something legally binding. So:
   large type, one column, generous targets, and field boxes that are impossible
   to miss. Deliberately light-only - a contract that renders dark because the
   signer's phone is in dark mode is not what anyone expects a document to do.
   --------------------------------------------------------------------------- */
.nx-sign-shell {
    min-height: 100vh;
    background: #eceff3;
    color: #1a1d21;
    font-family: var(--nx-font);
    padding: 24px 16px 40px;
}

.nx-sign-head {
    max-width: 900px;
    margin: 0 auto 16px;
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.nx-sign-from { font-size: 12.5px; color: #5a6470; }
.nx-sign-head h1 { font-size: 22px; margin: 2px 0 2px; font-weight: 600; }
.nx-sign-who { margin: 0; font-size: 13px; color: #5a6470; }
.nx-sign-head-actions { margin-left: auto; text-align: right; }
.nx-sign-remaining { display: block; font-size: 12.5px; color: #5a6470; margin-bottom: 6px; }

.nx-sign-message,
.nx-sign-banner,
.nx-sign-submit,
.nx-sign-decline {
    max-width: 900px;
    margin: 0 auto 14px;
    background: #fff;
    border: 1px solid #d7dce3;
    border-radius: 6px;
    padding: 14px 18px;
}
.nx-sign-message p { margin: 6px 0 0; font-size: 13.5px; white-space: pre-wrap; }

.nx-sign-banner { display: none; font-size: 13.5px; }
.nx-sign-banner.show { display: block; }
.nx-sign-banner.danger {
    display: block;
    background: #fbe9e7;
    border-color: #e4b4ae;
    color: #8c241c;
}
.nx-sign-banner.danger:empty { display: none; }

.nx-sign-splash {
    max-width: 620px;
    margin: 60px auto;
    background: #fff;
    border: 1px solid #d7dce3;
    border-radius: 8px;
    padding: 32px 30px;
    text-align: center;
}
.nx-sign-splash h1 { font-size: 20px; margin: 0 0 10px; font-weight: 600; }
.nx-sign-splash p { font-size: 14px; color: #5a6470; margin: 0 0 8px; line-height: 1.55; }

.nx-sign-pages { max-width: 900px; margin: 0 auto 18px; }

/* Each page is a positioning context for its own field boxes - the field's
   normalised coordinates are multiplied by exactly this element's size, so any
   padding or border between the canvas and the box would offset every field. */
.nx-sign-page {
    position: relative;
    margin: 0 auto 16px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,.14);
}
.nx-sign-page canvas { display: block; }

.nx-sign-field {
    position: absolute;
    border: 2px dashed #0f7b8a;
    background: rgba(15, 123, 138, .09);
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.nx-sign-field:hover { background: rgba(15, 123, 138, .18); }
.nx-sign-field.filled { border-style: solid; border-color: #12855c; background: rgba(18,133,92,.06); }
.nx-sign-field img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* A brief pulse when "go to next field" lands on one - enough to find it on a
   dense page, gone before it becomes annoying. */
.nx-sign-field.flash { animation: nx-sign-flash 1.2s ease-out; }
@keyframes nx-sign-flash {
    0%, 100% { box-shadow: 0 0 0 0 rgba(15,123,138,0); }
    30%      { box-shadow: 0 0 0 7px rgba(15,123,138,.35); }
}

.nx-sign-field-label {
    font-size: 11px;
    color: #0f7b8a;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    pointer-events: none;
}
.nx-sign-field-date { font-size: 12px; color: #1a1d21; }
.nx-sign-field-input {
    width: 100%; height: 100%;
    border: 0; background: transparent;
    font: inherit; font-size: 13px;
    padding: 0 6px;
    color: #1a1d21;
}
.nx-sign-field-input:focus { outline: none; }

.nx-sign-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 14px;
}
.nx-sign-consent input { margin-top: 3px; width: 17px; height: 17px; }

.nx-sign-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.nx-sign-primary {
    background: #0f7b8a; color: #fff;
    border: 0; border-radius: 5px;
    padding: 11px 22px;
    font: inherit; font-size: 14px; font-weight: 600;
    cursor: pointer;
}
.nx-sign-primary:hover { background: #0c626e; }

.nx-sign-secondary {
    background: #fff; color: #1a1d21;
    border: 1px solid #c8cfd8; border-radius: 5px;
    padding: 7px 14px;
    font: inherit; font-size: 12.5px;
    cursor: pointer;
}
.nx-sign-secondary:disabled { opacity: .45; cursor: default; }

.nx-sign-link {
    background: none; border: 0;
    color: #5a6470; font: inherit; font-size: 13px;
    text-decoration: underline; cursor: pointer;
    padding: 6px 2px;
}
.nx-sign-danger {
    background: #c2352b; color: #fff;
    border: 0; border-radius: 5px;
    padding: 9px 18px;
    font: inherit; font-size: 13.5px; cursor: pointer;
}

.nx-sign-decline { display: none; }
.nx-sign-decline.open { display: block; }
.nx-sign-decline label { display: block; font-size: 13px; color: #5a6470; margin-bottom: 10px; }
.nx-sign-decline textarea {
    width: 100%; margin-top: 6px;
    font: inherit; font-size: 13.5px;
    padding: 8px 10px;
    border: 1px solid #d7dce3; border-radius: 4px;
    box-sizing: border-box;
    resize: vertical;
}

.nx-sign-pad {
    display: none;
    position: fixed; inset: 0;
    background: rgba(12, 16, 22, .55);
    z-index: 50;
    align-items: center; justify-content: center;
    padding: 16px;
}
.nx-sign-pad.open { display: flex; }
.nx-sign-pad-card {
    background: #fff;
    border-radius: 8px;
    padding: 22px 24px;
    width: min(540px, 100%);
}
.nx-sign-pad-card h2 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
.nx-sign-pad-hint { font-size: 13px; color: #5a6470; margin: 0 0 12px; }

/* touch-action: none so drawing with a finger does not scroll the page out from
   under the signature - the single most common way a mobile signature pad fails. */
#nx-sign-pad-canvas {
    width: 100%; height: 170px;
    border: 1px solid #d7dce3;
    border-radius: 5px;
    background: #fbfcfd;
    cursor: crosshair;
    touch-action: none;
    display: block;
}

.nx-sign-pad-type { display: flex; gap: 8px; margin-top: 12px; }
.nx-sign-pad-type input {
    flex: 1; font: inherit; font-size: 14px;
    padding: 8px 10px;
    border: 1px solid #d7dce3; border-radius: 4px;
}
.nx-sign-pad-type button {
    background: #fff; border: 1px solid #c8cfd8; border-radius: 4px;
    padding: 8px 14px; font: inherit; font-size: 13px; cursor: pointer;
    white-space: nowrap;
}

.nx-sign-pad-actions {
    display: flex; gap: 12px; align-items: center;
    justify-content: flex-end;
    margin-top: 16px;
}

.nx-sign-foot {
    max-width: 900px;
    margin: 26px auto 0;
    font-size: 12px;
    color: #6b747f;
    text-align: center;
    line-height: 1.5;
}

/* The <a download> in the header uses the same chip as the buttons beside it. */
a.nx-sign-secondary { display: inline-block; text-decoration: none; margin-left: 6px; }
a.nx-sign-secondary:hover { background: #f3f5f8; }

/* Server-rendered placeholder, replaced the moment sign.js has a page to paint. It is
   deliberately visible rather than an empty div: a signing page showing nothing where
   the document should be is indistinguishable from a signing page that works. */
.nx-sign-loading {
    padding: 40px 0;
    text-align: center;
    color: #6b747f;
    font-size: 14px;
}

.nx-sign-error {
    color: #8c241c;
    font-size: 14px;
    padding: 28px 20px;
    text-align: center;
    line-height: 1.6;
}
.nx-sign-error a { color: #8c241c; }

/* The console side of e-signature: the request builder and the status board. */
.nx-sign-build {
    width: 320px;
    flex: 0 0 320px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nx-sign-signers { list-style: none; margin: 0 0 10px; padding: 0; }
.nx-sign-signers li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12.5px;
}
.nx-sign-signers li:hover { background: var(--nx-surface-alt); }
/* The selected signer is what a placed field gets assigned to, so "which one is
   selected" has to be unmissable - a field placed against the wrong person is
   not obvious until the wrong person is asked to sign. */
.nx-sign-signers li.active {
    background: var(--nx-accent-soft);
    outline: 1px solid var(--nx-accent);
}
.nx-sign-signers li > div { flex: 1; min-width: 0; }
.nx-sign-signers li b { display: block; }
.nx-sign-signers li span.nx-text-soft { font-size: 11.5px; }

.nx-sign-swatch {
    width: 12px; height: 12px;
    border-radius: 3px;
    flex: 0 0 12px;
}

.nx-sign-addsigner { display: flex; flex-direction: column; gap: 6px; }

.nx-sign-fieldlist { list-style: none; margin: 10px 0 0; padding: 0; }
.nx-sign-fieldlist li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    padding: 4px 0;
    border-top: 1px solid var(--nx-border);
}
.nx-sign-fieldlist li a { margin-left: auto; }

.nx-sign-pagebar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 12px 12px;
}

.nx-sign-row-summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12.5px;
}
.nx-sign-row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 10px;
    font-size: 12.5px;
}

/* The request just sent, so the board opens on the thing the technician was
   doing rather than making them find it. */
.nx-pod-highlight { outline: 2px solid var(--nx-accent); }

/* ------------------------------------------------------- NexDesk expansion (#1-#25) --- */

/* Board: search, filter panel, custom views, column chooser */
.nx-ticket-search {
    width: 260px; font: inherit; font-size: 12.5px; padding: 4px 8px; margin: 0 6px;
    background: var(--nx-surface); color: var(--nx-text);
    border: 1px solid var(--nx-border-firm); border-radius: 4px;
}
.nx-ticket-filters {
    display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-start;
    padding: 10px 12px; margin: 0 12px 8px;
    background: var(--nx-surface-alt); border: 1px solid var(--nx-border); border-radius: 4px;
}
.nx-ticket-filters > label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--nx-text-soft); }
.nx-ticket-filters > label.nx-check { flex-direction: row; align-items: center; gap: 5px; color: var(--nx-text); }
.nx-custom-view { padding: 0 4px 0 0; }
.nx-custom-view-name {
    flex: 1; min-width: 0; text-align: left; background: none; border: 0; color: inherit;
    font: inherit; font-size: 12.5px; padding: 5px 0 5px 12px; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nx-custom-view-del {
    background: none; border: 0; color: var(--nx-text-mute); cursor: pointer; font-size: 11px;
    visibility: hidden; padding: 2px 4px;
}
.nx-custom-view:hover .nx-custom-view-del { visibility: visible; }
.nx-custom-view-del:hover { color: var(--nx-danger); }
.nx-col-move {
    background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 3px;
    color: var(--nx-text); cursor: pointer; font-size: 11px; width: 22px; height: 20px; padding: 0;
}
.nx-col-move:disabled { opacity: .35; cursor: default; }

/* Shared admin tables/forms (previously styled inline on one page only) */
.nx-sla-table { width: 100%; border-collapse: collapse; }
.nx-sla-table th { text-align: left; font-size: 11.5px; color: var(--nx-text-mute);
    text-transform: uppercase; letter-spacing: .03em; padding: 4px 8px 6px 0; }
.nx-sla-table td { padding: 6px 8px 6px 0; vertical-align: middle; }
.nx-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
.nx-form-grid > label, .nx-pod-body > label { display: flex; flex-direction: column; gap: 3px; }
.nx-canned-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--nx-border); }
.nx-canned-row:last-child { border-bottom: 0; }

/* Ticket detail: pods */
.nx-pod > header { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.nx-pod-action {
    text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 11.5px;
    color: var(--nx-accent); cursor: pointer;
}
.nx-linked-device { padding: 5px 0; border-bottom: 1px solid var(--nx-border); font-size: 12.5px; }
.nx-linked-device:last-of-type { border-bottom: 0; }
.nx-linked-device .nx-status { font-size: 9px; margin-right: 4px; padding: 0; background: none; }
.nx-linked-device-actions { display: flex; gap: 10px; margin-top: 2px; font-size: 11.5px; }
.nx-watcher { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; padding: 2px 0; }
.nx-watcher span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-file-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 0; }
.nx-file-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-activity { max-height: 360px; overflow-y: auto; }
.nx-activity-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--nx-border); }
.nx-activity-detail { flex-basis: 100%; color: var(--nx-text-mute); font-size: 11px; overflow-wrap: anywhere; }
a.nx-recent-ticket { display: block; color: inherit; text-decoration: none; }
a.nx-recent-ticket:hover { background: var(--nx-surface-alt); }

/* Ticket detail: compose box, internal notes, time, attachments */
.nx-comment-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.nx-seg {
    font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer;
    background: var(--nx-surface); color: var(--nx-text-soft);
    border: 1px solid var(--nx-border-firm); border-radius: 4px;
}
.nx-seg.on { background: var(--nx-accent-soft); color: var(--nx-accent); border-color: var(--nx-accent); font-weight: 600; }
.nx-comment-form.internal textarea { background: var(--nx-warn-soft); border-color: var(--nx-warn); }
.nx-comment-form.internal .nx-seg.on { background: var(--nx-warn-soft); color: var(--nx-warn); border-color: var(--nx-warn); }
.nx-comment.internal { background: var(--nx-warn-soft); border-color: var(--nx-warn); }
.nx-comment.system { border-style: dashed; }
.nx-comment-badge {
    margin-left: 6px; padding: 1px 6px; border-radius: 8px; font-size: 10px;
    background: var(--nx-surface); border: 1px solid var(--nx-border); color: var(--nx-text-soft);
}
.nx-comment-badge.internal { background: var(--nx-warn); color: #fff; border-color: var(--nx-warn); text-transform: uppercase; letter-spacing: .4px; }
.nx-comment-edit {
    width: 100%; min-height: 64px; box-sizing: border-box; font: inherit; font-size: 13px; padding: 6px 8px;
    background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-border-firm); border-radius: 4px;
}
.nx-attach-btn { cursor: pointer; font-size: 12px; color: var(--nx-accent); }
.nx-attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nx-attach-chip {
    display: inline-flex; align-items: center; gap: 5px; max-width: 260px;
    padding: 3px 8px; font-size: 11.5px; border-radius: 12px;
    background: var(--nx-surface); border: 1px solid var(--nx-border); color: var(--nx-text);
    text-decoration: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.nx-attach-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 3px; }
.nx-attach-chip button { background: none; border: 0; color: var(--nx-text-mute); cursor: pointer; font-size: 10px; }

/* NexDesk automation pass: related tickets, workflow admin, reporting, finance */
.nx-related-row { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 0; }
.nx-related-row a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-rel-badge {
    margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 10px; font-weight: 500;
    background: var(--nx-surface-alt); border: 1px solid var(--nx-border); color: var(--nx-text-soft);
}
.nx-wf-h { margin: 14px 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--nx-text-soft); }
.nx-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.nx-kpi { background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 4px; padding: 10px 12px; }
.nx-kpi b { display: block; font-size: 22px; font-weight: 600; color: var(--nx-text); }
.nx-kpi span { font-size: 11px; color: var(--nx-text-soft); text-transform: uppercase; letter-spacing: .4px; }
.nx-report-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 12px; }
.nx-report-filters label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--nx-text-soft); }
.nx-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; margin-bottom: 12px; }
.nx-num { text-align: right; font-variant-numeric: tabular-nums; }
.nx-bars { display: flex; align-items: flex-end; gap: 2px; height: 140px; padding: 6px 0; }
.nx-bars .nx-bar-pair { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; min-width: 3px; }
.nx-bars .c { background: var(--nx-accent); flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.nx-bars .d { background: var(--nx-slate-400); flex: 1; min-height: 1px; border-radius: 2px 2px 0 0; }
.nx-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--nx-text-soft); }
.nx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }
.nx-bill-client { border: 1px solid var(--nx-border); border-radius: 4px; margin-bottom: 12px; background: var(--nx-surface); }
.nx-bill-client > header { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--nx-surface-alt); border-bottom: 1px solid var(--nx-border); }
.nx-bill-client table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.nx-bill-client td, .nx-bill-client th { padding: 5px 12px; border-bottom: 1px solid var(--nx-border); text-align: left; }

/* ===================================================================== NexDesk batch 3 */
.nx-banner.info { background: var(--nx-accent-soft); border-color: var(--nx-accent); }
.nx-field-input { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--nx-border-firm);
    border-radius: 4px; background: var(--nx-surface); color: var(--nx-text); box-sizing: border-box; }
.nx-field-input:focus { outline: 2px solid var(--nx-accent-soft); border-color: var(--nx-accent); }
kbd { font-family: var(--nx-mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--nx-border-firm);
    border-bottom-width: 2px; border-radius: 3px; background: var(--nx-surface); }
.nx-kbd-hint { border: 1px solid var(--nx-border-firm); background: var(--nx-surface); border-radius: 50%; width: 22px; height: 22px;
    cursor: pointer; color: var(--nx-text-soft); font-weight: 600; }

/* Markdown-lite (#15) */
.nx-md p { margin: 0 0 6px; }
.nx-md p:last-child { margin-bottom: 0; }
.nx-md ul, .nx-md ol { margin: 2px 0 6px; padding-left: 20px; }
.nx-md code { font-family: var(--nx-mono); font-size: 12px; background: var(--nx-surface-alt); padding: 1px 4px; border-radius: 3px; }
.nx-md .nx-md-pre, .nx-md pre { font-family: var(--nx-mono); font-size: 12px; background: var(--nx-surface-alt); padding: 8px;
    border-radius: 4px; white-space: pre-wrap; margin: 4px 0; }
.nx-md .nx-md-quote, .nx-md blockquote { border-left: 3px solid var(--nx-border-firm); margin: 4px 0; padding-left: 10px; color: var(--nx-text-soft); }
.nx-md h4, .nx-md h5, .nx-md h6 { margin: 6px 0 4px; font-size: 13.5px; }
.nx-md img { max-width: 100%; border-radius: 4px; }
.nx-comment-body.nx-md { white-space: normal; }
.nx-md-tools { display: flex; gap: 2px; align-items: center; margin-bottom: 4px; }
.nx-md-tools button { border: 1px solid transparent; background: none; border-radius: 3px; padding: 1px 7px; cursor: pointer;
    color: var(--nx-text-soft); font-size: 12px; }
.nx-md-tools button:hover { border-color: var(--nx-border); background: var(--nx-surface-alt); color: var(--nx-text); }

/* Checklist (#6) */
.nx-checklist { border: 1px solid var(--nx-border); border-radius: 6px; padding: 8px 10px; margin: 10px 0; background: var(--nx-surface); }
.nx-checklist > header { display: flex; gap: 10px; align-items: center; font-weight: 600; margin-bottom: 6px; }
.nx-checklist-bar { flex: 1; max-width: 160px; height: 5px; border-radius: 3px; background: var(--nx-surface-alt); overflow: hidden; }
.nx-checklist-bar > div { height: 100%; background: var(--nx-ok); }
.nx-checklist-item { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.nx-checklist-item label { display: flex; gap: 6px; align-items: center; flex: 1; cursor: pointer; }
.nx-checklist-item.done span:not(.nx-text-soft) { text-decoration: line-through; color: var(--nx-text-soft); }

/* Kanban (#1) */
.nx-kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; padding: 8px 12px 16px; overflow-x: auto; align-items: start; }
.nx-kanban-col { background: var(--nx-surface-alt); border-radius: 6px; padding: 8px; min-height: 180px; border: 2px dashed transparent; }
.nx-kanban-col.over { border-color: var(--nx-accent); }
.nx-kanban-col > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.nx-kanban-card { background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 5px; padding: 7px 9px; margin-bottom: 6px;
    cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.nx-kanban-card.cursor { outline: 2px solid var(--nx-accent); }
.nx-kanban-card.selected { background: var(--nx-accent-soft); }
.nx-kanban-top { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; }
.nx-kanban-subject { font-weight: 500; margin: 4px 0; line-height: 1.3; }
.nx-kanban-meta { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--nx-text-soft); flex-wrap: wrap; }
.nx-row-cursor td { background: var(--nx-accent-soft) !important; }

/* Approvals (#14), AI (#25) */
.nx-approval-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 3px 0; }
.nx-approval { font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 8px; background: var(--nx-surface-alt); }
.nx-approval.pending { background: var(--nx-warn-soft); color: var(--nx-warn); }
.nx-approval.approved { background: var(--nx-ok-soft); color: var(--nx-ok); }
.nx-approval.denied { background: var(--nx-danger-soft); color: var(--nx-danger); }
.nx-ai-out { margin-top: 8px; padding: 8px; border-radius: 5px; background: var(--nx-accent-soft); font-size: 12.5px; }

/* Portal form (#17) */
.nx-portal-form { display: flex; flex-direction: column; gap: 10px; }
.nx-portal-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 500; }
.nx-portal-form .nx-attach-btn { flex-direction: row; cursor: pointer; color: var(--nx-accent); font-weight: 400; }
.nx-pod-body .nx-hint { overflow-wrap: anywhere; }

/* --- NexRMM batch (2026-09-25) ------------------------------------------------ */
.nx-badge.info { background: var(--nx-accent-soft); color: var(--nx-accent); }
.nx-pod-pad { padding: 8px 12px 10px; margin: 0; }
.nx-rmm-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 12.5px; margin: 4px 0 10px; }
.nx-rmm-strip > a { color: var(--nx-accent); text-decoration: none; }
.nx-rmm-strip > a:hover { text-decoration: underline; }
.nx-tools-layout { display: grid; grid-template-columns: 240px 1fr; gap: 14px; align-items: start; }
.nx-tools-list { border: 1px solid var(--nx-border); border-radius: 4px; background: var(--nx-surface); padding: 6px 0; position: sticky; top: 8px; }
.nx-tools-list h4 { margin: 8px 12px 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--nx-text-soft); }
.nx-tools-list a { display: block; padding: 5px 12px; font-size: 13px; color: var(--nx-text); text-decoration: none; }
.nx-tools-list a:hover { background: var(--nx-surface-alt); }
.nx-tools-list a.active { background: var(--nx-accent-soft); color: var(--nx-accent); font-weight: 600; }
.nx-tools-main { min-width: 0; }
.nx-code-input { width: 100%; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; padding: 6px 8px;
    border: 1px solid var(--nx-border-firm); border-radius: 4px; background: var(--nx-surface); color: var(--nx-text); }
.nx-terminal-out { background: #10151b; color: #d6dde6; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px;
    padding: 8px 10px; border-radius: 4px; max-height: 480px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 6px 0; }
.nx-tool-table th { position: sticky; top: 0; background: var(--nx-surface-alt); }
.nx-tool-table td { font-size: 12px; }
.nx-subtabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--nx-border); margin-bottom: 12px; }
.nx-subtabs a { padding: 7px 12px; font-size: 13px; color: var(--nx-text-soft); text-decoration: none; border-bottom: 2px solid transparent; }
.nx-subtabs a.active { color: var(--nx-accent); border-bottom-color: var(--nx-accent); font-weight: 600; }
.nx-report-table { background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 4px; width: 100%; }
.nx-timeline { list-style: none; margin: 0; padding: 0; }
.nx-timeline-day { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--nx-text-soft); margin: 14px 0 4px; }
.nx-timeline-item { display: grid; grid-template-columns: 52px 110px 1fr; gap: 10px; padding: 6px 10px; border-left: 3px solid var(--nx-border);
    background: var(--nx-surface); margin-bottom: 2px; font-size: 13px; }
.nx-timeline-item.ok { border-left-color: var(--nx-ok); }
.nx-timeline-item.warn { border-left-color: var(--nx-warn); }
.nx-timeline-item.danger { border-left-color: var(--nx-danger); }
.nx-timeline-item.info { border-left-color: var(--nx-accent); }
.nx-timeline-time { font-family: ui-monospace, Consolas, monospace; color: var(--nx-text-soft); }
.nx-timeline-kind { font-size: 11.5px; color: var(--nx-text-soft); text-transform: uppercase; letter-spacing: .03em; }
.nx-day-chart { width: 100%; height: 140px; background: var(--nx-surface-alt); border-radius: 4px; }
.nx-proc-chip { display: inline-block; margin: 1px 6px 1px 0; padding: 1px 6px; border-radius: 10px; background: var(--nx-surface-alt); font-size: 11.5px; }
.nx-facts tr.nx-diff td { background: var(--nx-warn-soft); }
.nx-compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 12px; }
.nx-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; padding: 8px 12px 12px; }
.nx-photo-grid figure { margin: 0; }
.nx-photo-grid img { width: 100%; height: 140px; object-fit: cover; border-radius: 4px; border: 1px solid var(--nx-border); }
.nx-photo-grid figcaption { font-size: 12px; color: var(--nx-text-soft); display: flex; justify-content: space-between; }
@media (max-width: 900px) { .nx-tools-layout { grid-template-columns: 1fr; } .nx-tools-list { position: static; } }
.nx-report-table .nx-badge, .nx-facts .nx-badge { white-space: nowrap; }
.nx-settings-head a, .nx-report-table a, .nx-tools-main a, .nx-timeline a { color: var(--nx-accent); text-decoration: none; }
.nx-settings-head a:hover, .nx-report-table a:hover, .nx-tools-main a:hover, .nx-timeline a:hover { text-decoration: underline; }
/* NexRMM pages stack pods inside .nx-work, a flex column that scrolls: without this the
   pods shrink to fit and .nx-pod's overflow:hidden clips their rows. */
.nx-work > .nx-pod, .nx-work > .nx-report-table, .nx-work > .nx-timeline, .nx-work > .nx-tools-layout,
.nx-work > .nx-compare-grid, .nx-work > .nx-kpi-row, .nx-work > .nx-subtabs, .nx-work > .nx-report-filters,
.nx-work > .nx-settings-head, .nx-work > .nx-toolbar, .nx-work > p { flex-shrink: 0; }

/* NexDesk next (54-68) */
.nx-contact-notes { margin-top: 6px; padding: 6px 8px; background: var(--nx-warn-soft); border-radius: 6px; font-size: 12px; white-space: pre-wrap; }
.nx-scheduled-list { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 2px; }
.nx-scheduled { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 4px 8px; border: 1px dashed var(--nx-border); border-radius: 6px; }
.nx-scheduled > span:first-child { flex: 1; }
.nx-mini-badge { font-size: 10px; padding: 0 5px; margin-left: 4px; vertical-align: middle; }
.nx-quickview { position: fixed; z-index: 2000; width: 360px; max-height: 70vh; overflow: auto; background: var(--nx-surface, #fff); border: 1px solid var(--nx-border); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.nx-qv-head { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nx-qv-subject { font-weight: 600; font-size: 13.5px; }
.nx-qv-body { white-space: pre-wrap; color: var(--nx-text-soft, #555); }
.nx-qv-last { border-left: 3px solid var(--nx-accent); padding-left: 8px; white-space: pre-wrap; }
.nx-qv-last.internal { border-left-color: var(--nx-warn); }
.nx-dispatch { display: grid; grid-template-columns: 150px repeat(7, 1fr); border: 1px solid var(--nx-border); border-radius: 8px; overflow: hidden; font-size: 12px; }
.nx-dispatch > div { border-right: 1px solid var(--nx-border); border-bottom: 1px solid var(--nx-border); padding: 4px; min-height: 64px; }
.nx-dispatch .hd { background: var(--nx-surface-2, #f4f6f9); font-weight: 600; min-height: 0; }
.nx-dispatch .hd.today { color: var(--nx-accent); }
.nx-dispatch .tech { font-weight: 600; background: var(--nx-surface-2, #f4f6f9); }
.nx-dispatch .cell.drop { background: var(--nx-accent-soft, #e8f1fb); }
.nx-appt { display: block; margin-bottom: 3px; padding: 3px 5px; border-radius: 5px; background: var(--nx-accent-soft, #e8f1fb); border-left: 3px solid var(--nx-accent); cursor: grab; color: inherit; text-decoration: none; }
.nx-appt.onsite { border-left-color: #e67e22; background: #fdf0e3; }
.nx-appt.err { outline: 1px dashed var(--nx-danger); }
.nx-pod-body > label.nx-check, .nx-form-grid ~ label.nx-check { flex-direction: row; align-items: center; gap: 6px; display: flex; }
.nx-quickview { left: min(var(--qv-x), calc(100vw - 380px)) !important; top: min(var(--qv-y), calc(100vh - 320px)) !important; }

/* NexInsight (81-90) */
.nx-grade { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 5px; font-weight: 700; font-size: 12px; color: #fff; background: #888; margin-right: 6px; }
.nx-grade-big { min-width: 72px; height: 72px; font-size: 40px; border-radius: 10px; }
.nx-grade.gA, .nx-bar .gA { background: #1e8e3e; } .nx-grade.gB, .nx-bar .gB { background: #5b9b2f; }
.nx-grade.gC, .nx-bar .gC { background: #d48a00; } .nx-grade.gD, .nx-bar .gD { background: #e0621b; }
.nx-grade.gF, .nx-bar .gF { background: #c0392b; }
.nx-grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.nx-bar-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.nx-bar-row > span:first-child:not(.nx-grade):not(.nx-badge) { width: 130px; flex-shrink: 0; }
.nx-grade-card .nx-pod-body { padding: 8px 12px; }
.nx-grade-card header { display: flex; align-items: center; gap: 6px; }
.nx-bar { flex: 1; height: 8px; background: var(--nx-surface-2, #eef0f3); border-radius: 4px; overflow: hidden; }
.nx-bar > div { height: 100%; border-radius: 4px; }
.nx-heatmap { display: flex; flex-direction: column; gap: 2px; font-size: 11px; overflow-x: auto; }
.nx-heat-row { display: grid; grid-template-columns: 38px repeat(24, minmax(18px, 1fr)) 44px; gap: 2px; align-items: center; }
.nx-heat-head span { color: var(--nx-text-soft); text-align: left; }
.nx-heat-cell { height: 24px; border-radius: 3px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #0b2a57; }
.nx-heat-day { font-weight: 600; } .nx-heat-total { text-align: right; color: var(--nx-text-soft); }
.nx-quarter-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 8px; }
.nx-mini-num { width: 80px; }
.nx-digest h2 { font-size: 16px; }
.nx-dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nx-dash-widget { min-width: 0; }
.nx-dash-widget.drop { outline: 2px dashed var(--nx-accent); }
.nx-dash-widget[draggable="true"] { cursor: grab; }
.nx-drag-handle { color: var(--nx-text-soft); margin-right: 6px; letter-spacing: -2px; }
.nx-widget-edit { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nx-kpi-compact .nx-kpi { min-width: 90px; padding: 8px 10px; }
.nx-kpi-compact .nx-kpi b { font-size: 18px; }
.nx-mini-chart { width: 100%; height: 110px; }
.nx-portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
@media (max-width: 900px) { .nx-dash-grid { grid-template-columns: 1fr; } .nx-dash-widget { grid-column: auto !important; } }

/* NexPortal next (101-109) */
.nx-portal-bell { position: relative; margin-right: 10px; }
.nx-portal-bell-btn { background: none; border: 0; font-size: 18px; cursor: pointer; position: relative; padding: 4px 6px; }
.nx-portal-bell-count { position: absolute; top: -2px; right: -4px; background: #c0392b; color: #fff; border-radius: 9px; font-size: 10px; padding: 1px 5px; font-weight: 700; }
.nx-portal-bell-menu { position: absolute; right: 0; top: 36px; width: 340px; max-height: 70vh; overflow: auto; background: var(--nx-surface, #fff); color: var(--nx-text, #222); border: 1px solid var(--nx-border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); z-index: 1000; }
.nx-portal-bell-head { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--nx-border); font-size: 12.5px; }
.nx-portal-bell-foot { padding: 8px 12px; border-top: 1px solid var(--nx-border); font-size: 12.5px; }
.nx-portal-note { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--nx-border); color: inherit; text-decoration: none; font-size: 13px; }
.nx-portal-note.unread { background: var(--nx-accent-soft, #e8f1fb); }
.nx-portal-note small { color: var(--nx-text-soft); font-size: 11px; }
.nx-portal-banner { display: flex; gap: 10px; align-items: center; padding: 10px 18px; font-size: 13.5px; }
.nx-portal-banner span { flex: 1; }
.nx-portal-banner button { background: none; border: 0; cursor: pointer; font-size: 14px; color: inherit; }
.nx-portal-banner.warning { background: #fff4d6; color: #6b4c00; }
.nx-portal-banner.outage { background: #fde2df; color: #8a1f14; }
.nx-portal-news { background: var(--nx-surface, #fff); border-left: 4px solid var(--nx-accent); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.nx-portal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.nx-portal-actions a { background: var(--nx-surface, #fff); border: 1px solid var(--nx-border); border-radius: 8px; padding: 8px 12px; text-decoration: none; font-size: 13px; }
.nx-portal-tile.attention { border-color: #d48a00; }
.nx-status-word.s-operational { color: #1e8e3e; } .nx-status-word.s-degraded, .nx-status-word.s-maintenance { color: #d48a00; } .nx-status-word.s-outage { color: #c0392b; }
.nx-status-banner { color: #fff; border-radius: 10px; padding: 14px 18px; font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.nx-status-banner.s-operational { background: #1e8e3e; } .nx-status-banner.s-degraded { background: #d48a00; } .nx-status-banner.s-maintenance { background: #1f6feb; } .nx-status-banner.s-outage { background: #c0392b; }
.nx-status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: #999; }
.nx-status-dot.s-operational { background: #1e8e3e; } .nx-status-dot.s-degraded { background: #d48a00; } .nx-status-dot.s-maintenance { background: #1f6feb; } .nx-status-dot.s-outage { background: #c0392b; }
.nx-kb-search { width: 100%; max-width: 560px; font-size: 15px; padding: 10px 12px; margin-bottom: 12px; }
.nx-kb-cat { font-size: 14px; margin: 16px 0 6px; color: var(--nx-text-soft); text-transform: uppercase; letter-spacing: .04em; }
.nx-kb-body { font-size: 14.5px; line-height: 1.6; }
.nx-kb-vote { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.nx-kb-suggest { background: var(--nx-accent-soft, #e8f1fb); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; margin: -4px 0 8px; }
.nx-kb-row { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: inherit; font-size: 13px; }
.nx-kb-row.active, .nx-kb-row:hover { background: var(--nx-accent-soft, #e8f1fb); }
.nx-kb-row span { font-size: 11.5px; }
.nx-kb-preview { border: 1px solid var(--nx-border); border-radius: 8px; padding: 10px 14px; overflow: auto; max-height: 520px; }
.nx-quote-pad { width: 100%; max-width: 520px; height: 140px; border: 1px dashed var(--nx-border); border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; }
.nx-quote-table td:nth-child(n+2), .nx-quote-table th:nth-child(n+2) { text-align: right; }
.nx-portal-pay { display: inline-block; background: #1e8e3e; color: #fff !important; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.nx-portal-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.nx-portal-grid2 .span2 { grid-column: 1 / -1; }
@media (max-width: 700px) { .nx-portal-grid2 { grid-template-columns: 1fr; } .nx-portal-nav { overflow-x: auto; } }
.nx-health-list { list-style: none; margin: 0; padding: 4px 0; }
.nx-health-list li { display: grid; grid-template-columns: 18px 140px 1fr; gap: 8px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--nx-border); font-size: 13.5px; }
.nx-health-list li:first-child { border-top: 0; }
.nx-health-dot { width: 10px; height: 10px; border-radius: 50%; background: #999; }
.nx-health-dot.ok { background: #1e8e3e; } .nx-health-dot.warn { background: #d48a00; } .nx-health-dot.bad { background: #c0392b; }
.nx-health-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; color: #fff; font-weight: 600; font-size: 12.5px; margin-right: 6px; }
.nx-health-badge.h-excellent, .nx-health-badge.h-good { background: #1e8e3e; } .nx-health-badge.h-fair { background: #d48a00; } .nx-health-badge.h-needsattention { background: #c0392b; }
.nx-incident { padding: 8px 14px; border-top: 1px solid var(--nx-border); }
.nx-chip.warn { background: #fff4d6; color: #6b4c00; }

/* NexLink #125 uptime history bars */
.nx-uptime-bars { display: flex; gap: 1px; align-items: flex-end; height: 16px; }
.nx-uptime-bars span { width: 4px; height: 16px; border-radius: 1px; background: #22a06b; }
.nx-uptime-bars span.down { background: #d9534f; }

/* NexAgent next (110-116) */
.nx-remote-participants { font-size: 12px; color: var(--nx-accent); margin-right: 10px; }
.nx-remote-printcard { position: fixed; right: 20px; bottom: 20px; z-index: 2000; background: var(--nx-surface); border: 1px solid var(--nx-border);
    border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 12px 14px; max-width: 380px; font-size: 13px; }
.nx-remote-printcard > div:first-child { margin-bottom: 8px; font-weight: 600; }
.nx-remote-printcard > div:last-child { display: flex; gap: 6px; flex-wrap: wrap; }

.nx-chat-layout { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 12px; margin-top: 10px; height: calc(100vh - 190px); min-height: 360px; }
.nx-chat-list { overflow-y: auto; }
.nx-chat-convo { display: block; padding: 8px 10px; border-bottom: 1px solid var(--nx-border); color: inherit; text-decoration: none; }
.nx-chat-convo:hover, .nx-chat-convo.is-on { background: var(--nx-accent-soft); }
.nx-chat-snippet { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-chat-thread { display: flex; flex-direction: column; min-height: 0; }
.nx-chat-lines { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.nx-chat-line { max-width: 75%; }
.nx-chat-line.me { align-self: flex-end; text-align: right; }
.nx-chat-bubble { display: inline-block; padding: 7px 10px; border-radius: 12px; background: var(--nx-surface-alt); white-space: pre-wrap; text-align: left; }
.nx-chat-line.me .nx-chat-bubble { background: var(--nx-accent); color: #fff; }
.nx-chat-compose { display: flex; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--nx-border); align-items: flex-end; }
.nx-chat-compose textarea { flex: 1; }
@media (max-width: 800px) { .nx-chat-layout { grid-template-columns: 1fr; height: auto; } }

.nx-noc { padding: 10px 14px; min-height: 100vh; }
.nx-noc.is-dark { background: #0d1117; color: #e6edf3; }
.nx-noc.is-dark .nx-noc-tile { background: #161b22; border-color: #30363d; }
.nx-noc-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.nx-noc-grid { display: grid; gap: 10px; }
.nx-noc-tile { border: 1px solid var(--nx-border); border-radius: 6px; overflow: hidden; background: var(--nx-surface); }
.nx-noc-tile.is-off { opacity: .55; }
.nx-noc-shot { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; background: #000; }
.nx-noc-shot img { width: 100%; height: 100%; object-fit: contain; }
.nx-noc-meta { display: flex; gap: 6px; align-items: center; padding: 5px 8px; font-size: 12px; white-space: nowrap; overflow: hidden; }

/* NexPatch next (43-53) */
.nx-patch-nav { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--nx-border); }
.nx-patch-nav a { padding: 6px 12px; font-size: 13px; color: var(--nx-text-soft, #555); text-decoration: none; border-bottom: 2px solid transparent; }
.nx-patch-nav a.is-on { color: var(--nx-accent); border-bottom-color: var(--nx-accent); font-weight: 600; }

/* NexAutomate #146: the workflow canvas, a vertical flowchart of step cards. */
.nx-flow { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.nx-flow-card { background: var(--nx-surface); border: 1px solid var(--nx-border); border-left: 3px solid var(--nx-accent); border-radius: 4px; padding: 8px 10px; }
.nx-flow-card.off { opacity: 0.55; }
.nx-flow-card.if { border-left-color: var(--nx-warn); }
.nx-flow-card.dragging { outline: 2px dashed var(--nx-accent); }
.nx-flow-card header { display: flex; align-items: center; gap: 8px; cursor: grab; }
.nx-flow-card header strong { font-size: 13px; }
.nx-flow-card header .nx-spacer { flex: 1; }
.nx-flow-card header button { background: none; border: none; color: var(--nx-text-soft); cursor: pointer; padding: 0 3px; }
.nx-flow-params { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin-top: 6px; }
.nx-flow-params label { display: flex; flex-direction: column; font-size: 12px; color: var(--nx-text-soft); }
.nx-flow-params label.wide { grid-column: 1 / -1; }
.nx-flow-link { display: flex; justify-content: center; align-items: center; height: 26px; position: relative; }
.nx-flow-link::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 2px solid var(--nx-border); }
.nx-flow-link.drop { background: var(--nx-accent-soft); }
.nx-flow-link select { position: relative; z-index: 1; font-size: 11px; padding: 1px 4px; }
.nx-flow-branch { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.nx-flow-branch > div { border: 1px dashed var(--nx-border); border-radius: 4px; padding: 6px; }
.nx-flow-branch > div > span { font-size: 11px; text-transform: uppercase; color: var(--nx-text-soft); }
.nx-flow-cond { display: flex; gap: 4px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.nx-flow-cond input, .nx-flow-cond select { font-size: 12px; }
.nx-diff { font-family: var(--nx-mono-font, monospace); font-size: 12px; white-space: pre-wrap; margin: 0; }
.nx-diff .add { background: var(--nx-ok-soft); }
.nx-diff .del { background: var(--nx-danger-soft); }

/* ============================================================================
   Documentation (/help): the user guide, opened in its own tab from the account menu.
   ============================================================================ */

.nx-help { min-height: 100vh; background: var(--nx-bg); color: var(--nx-text); font-family: var(--nx-font); font-size: 14px; }
.nx-help-top {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
    height: 56px; padding: 0 20px; background: var(--nx-chrome); color: var(--nx-chrome-text);
    border-bottom: 1px solid var(--nx-border);
}
.nx-help-brand { color: var(--nx-chrome-bright); text-decoration: none; font-size: 15px; white-space: nowrap; }
.nx-help-brand b { color: var(--nx-chrome-bright); margin-right: 4px; }
.nx-help-search { flex: 1; max-width: 520px; margin-left: 24px; }
.nx-help-search input {
    width: 100%; height: 34px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--nx-chrome-alt);
    background: var(--nx-chrome-alt); color: var(--nx-chrome-bright); font: inherit; outline: none;
}
.nx-help-search input::placeholder { color: var(--nx-chrome-text); opacity: .8; }
.nx-help-search input:focus { border-color: var(--nx-accent); }
.nx-help-toplink {
    margin-left: auto; color: var(--nx-chrome-text); text-decoration: none; background: none; border: 0;
    font: inherit; cursor: pointer; white-space: nowrap; padding: 6px 4px;
}
.nx-help-toplink + .nx-help-toplink { margin-left: 0; }
.nx-help-toplink:hover { color: var(--nx-chrome-bright); }
.nx-help-menu { display: none; background: none; border: 0; color: var(--nx-chrome-bright); font-size: 20px; cursor: pointer; }

.nx-help-body { display: flex; align-items: flex-start; max-width: 1280px; margin: 0 auto; }
.nx-help-nav {
    position: sticky; top: 56px; width: 270px; flex: none; max-height: calc(100vh - 56px); overflow-y: auto;
    padding: 18px 12px 40px 20px; border-right: 1px solid var(--nx-border);
}
.nx-help-chapter { margin-bottom: 6px; }
.nx-help-chapter-head {
    display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0;
    padding: 6px 8px; font: inherit; font-weight: 600; color: var(--nx-text); cursor: pointer; border-radius: 5px; text-align: left;
}
.nx-help-chapter-head:hover { background: var(--nx-surface-alt); }
.nx-help-chapter-head i { font-style: normal; color: var(--nx-text-soft); font-size: 11px; }
.nx-help-nav a {
    display: block; padding: 5px 8px 5px 18px; color: var(--nx-text-soft); text-decoration: none; border-radius: 5px; font-size: 13.5px;
}
.nx-help-nav a:hover { color: var(--nx-text); background: var(--nx-surface-alt); }
.nx-help-nav a.active { color: var(--nx-accent); background: var(--nx-accent-soft); font-weight: 600; }

.nx-help-main { flex: 1; min-width: 0; padding: 28px 48px 80px; max-width: 900px; }
.nx-help-main h1 { font-size: 28px; margin: 4px 0 18px; line-height: 1.25; }
.nx-help-crumb { color: var(--nx-accent); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.nx-help-soft { color: var(--nx-text-soft); }

.nx-help-article { line-height: 1.65; }
.nx-help-article h3 { font-size: 19px; margin: 32px 0 10px; padding-top: 6px; border-top: 1px solid var(--nx-border); }
.nx-help-article h4 { font-size: 15.5px; margin: 22px 0 8px; }
.nx-help-article p { margin: 0 0 12px; }
.nx-help-article ul, .nx-help-article ol { margin: 0 0 14px; padding-left: 24px; }
.nx-help-article li { margin: 4px 0; }
.nx-help-article li > ul, .nx-help-article li > ol { margin: 4px 0; }
.nx-help-article a, .nx-help-main p a { color: var(--nx-accent); }
.nx-help-article code {
    font-family: var(--nx-mono); font-size: 12.5px; background: var(--nx-surface-alt); border: 1px solid var(--nx-border);
    padding: 1px 5px; border-radius: 4px; word-break: break-word;
}
.nx-help-article pre {
    background: var(--nx-chrome); color: var(--nx-chrome-bright); padding: 14px 16px; border-radius: 6px; overflow-x: auto; margin: 0 0 14px;
}
.nx-help-article pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 12.5px; }
.nx-help-table { overflow-x: auto; margin: 0 0 16px; }
.nx-help-table table { border-collapse: collapse; width: 100%; background: var(--nx-surface); font-size: 13.5px; }
.nx-help-table th, .nx-help-table td { border: 1px solid var(--nx-border); padding: 7px 10px; text-align: left; vertical-align: top; }
.nx-help-table th { background: var(--nx-surface-alt); font-weight: 600; }
.nx-help-callout {
    margin: 0 0 16px; padding: 10px 14px; border-radius: 6px; border-left: 4px solid var(--nx-accent); background: var(--nx-accent-soft);
}
.nx-help-callout.warn { border-left-color: var(--nx-warn); background: var(--nx-warn-soft); }
[data-theme="dark"] .nx-help-callout, [data-theme="dark"] .nx-help-nav a.active { background: var(--nx-surface-alt); }

.nx-help-toc {
    display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0 0 22px; padding: 10px 12px;
    background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 6px;
}
.nx-help-toc b { margin-right: 6px; font-size: 12px; color: var(--nx-text-soft); text-transform: uppercase; letter-spacing: .04em; }
.nx-help-toc button {
    background: var(--nx-surface-alt); border: 1px solid var(--nx-border); border-radius: 12px; padding: 2px 10px;
    font: inherit; font-size: 12.5px; color: var(--nx-text); cursor: pointer;
}
.nx-help-toc button:hover { border-color: var(--nx-accent); color: var(--nx-accent); }

.nx-help-index-head { font-size: 20px; margin: 34px 0 12px; }
.nx-help-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.nx-help-card { background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 8px; padding: 14px 16px; }
.nx-help-card b { display: block; margin-bottom: 6px; }
.nx-help-card a { display: block; padding: 2px 0; color: var(--nx-accent); text-decoration: none; font-size: 13.5px; }
.nx-help-card a:hover { text-decoration: underline; }

.nx-help-results { display: flex; flex-direction: column; gap: 10px; }
.nx-help-results a {
    display: block; padding: 12px 14px; background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 6px;
    text-decoration: none; color: var(--nx-text);
}
.nx-help-results a:hover { border-color: var(--nx-accent); }
.nx-help-results b { color: var(--nx-accent); }
.nx-help-results small { margin-left: 8px; color: var(--nx-text-soft); }
.nx-help-results span { display: block; margin-top: 4px; color: var(--nx-text-soft); font-size: 13px; }

.nx-help-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--nx-border); }
.nx-help-pager a {
    display: flex; flex-direction: column; max-width: 48%; padding: 10px 14px; border: 1px solid var(--nx-border); border-radius: 6px;
    background: var(--nx-surface); color: var(--nx-accent); text-decoration: none;
}
.nx-help-pager a.next { text-align: right; margin-left: auto; }
.nx-help-pager a:hover { border-color: var(--nx-accent); }
.nx-help-pager small { color: var(--nx-text-soft); font-size: 11.5px; }

@media (max-width: 900px) {
    .nx-help-menu { display: block; }
    .nx-help-toplink { display: none; }
    .nx-help-search { margin-left: 8px; }
    .nx-help-nav { display: none; position: fixed; left: 0; top: 56px; bottom: 0; z-index: 15; background: var(--nx-surface); max-height: none; width: 300px; }
    .nx-help-nav.open { display: block; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
    .nx-help-main { padding: 22px 18px 60px; }
}

@media print {
    .nx-help-top, .nx-help-nav, .nx-help-toc, .nx-help-pager { display: none !important; }
    .nx-help-main { padding: 0; max-width: none; }
    .nx-help { background: #fff; color: #000; }
}
