/* fontul Sora (Google Fonts) se încarcă din App.razor numai pe paginile personalului: portalul pacientului nu cere nimic de la terți (§3.158) */

:root {
    --nx-ink: #16201f;
    /* tema deschisă (după modelul ales de proprietar, 2026-10-22): fundal gri-verzui foarte deschis, carduri și meniu albe,
       o singură culoare de acțiune teal; accesibilitate (docs/ACCESIBILITATE.md): #2b7d73 dă 4,9:1 cu textul alb al butoanelor */
    --nx-sea: #2b7d73;
    --nx-sea-deep: #23695f;
    --nx-sea-bright: #3a9188;
    --nx-sand: #e4ecea;
    --nx-paper: #f0f5f4;
    --nx-mist: #e9f0ef;
    --nx-line: #e1e9e7;
    --nx-text: #1f2a2e;
    --nx-muted: #5d6b6e;
    --nx-surface: #ffffff;
    --nx-top: #ffffff;
    --nx-danger: #b42318;
    --nx-warn: #b54708;
    /* chenarul câmpurilor de formular (WCAG 1.4.11: cel puțin 3:1 față de fundal) și conturul de focalizare (2.4.7) */
    --nx-line-control: #7f8c8a;
    --nx-focus: #1f6b62;
    --nx-font-ui: "Sora", "Segoe UI", sans-serif;
    --nx-font-display: var(--nx-font-ui);
    --bs-font-sans-serif: var(--nx-font-ui);
    --bs-body-font-family: var(--nx-font-ui);
    --bs-body-color: var(--nx-text);
    --bs-body-bg: transparent;
    --bs-primary: var(--nx-sea);
    --bs-primary-rgb: 43, 125, 115;
    --bs-link-color: var(--nx-sea-deep);
    --bs-link-hover-color: var(--nx-ink);
    --bs-border-radius: 0.55rem;
    --bs-border-color: var(--nx-line);
    /* nuanța culorii de acțiune pentru stări (selecție, hover), ca „r, g, b” pentru rgba() */
    --nx-accent-rgb: 43, 125, 115;
    --nx-accent-bright-rgb: 58, 145, 136;
    /* meniul din stânga și bannerul de pe prima pagină: deschise pe tema deschisă (valorile închise în html[data-theme="dark"]) */
    --nx-side-bg: #ffffff;
    --nx-side-line: #e6eceb;
    --nx-side-brand: #16201f;
    --nx-side-brand-hover: #2b7d73;
    --nx-side-sub: #5d6b6e;
    --nx-side-label: #5d6b6e;
    --nx-side-link: #1f2a2e;
    --nx-side-hover-bg: #f0f5f4;
    --nx-side-hover-text: #16201f;
    --nx-side-active-bg: #e2f1ee;
    --nx-side-active-text: #1f6b62;
    --nx-side-active-bar: #e2f1ee;
    --nx-side-focus: #1f6b62;
    --nx-side-field-line: #7f8c8a;
    --nx-side-field-bg: #ffffff;
    --nx-side-field-bg-focus: #ffffff;
    --nx-side-field-text: #1f2a2e;
    --nx-side-placeholder: #5d6b6e;
    --nx-side-key-line: #c9d6d3;
    --nx-side-key-text: #5d6b6e;
    --nx-side-empty-link: #23695f;
    --nx-side-mark-bg: #cfe8e3;
    --nx-side-mark-text: #16201f;
    --nx-side-first-ring: #2b7d73;
    --nx-side-toggler-bg: #ffffff;
    --nx-side-toggler-checked: #e2f1ee;
    --nx-side-burger: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2831,31,31,0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    --nx-hero-bg: #ffffff;
    --nx-hero-line: #e1e9e7;
    --nx-hero-text: #16201f;
    --nx-hero-kicker: #2b7d73;
    --nx-hero-lead: #3d4a4d;
    --nx-hero-cta-bg: #2b7d73;
    --nx-hero-cta-hover: #23695f;
    --nx-hero-cta-text: #ffffff;
    /* căsuțele iconițelor din meniu și capetele de tabel */
    --nx-side-ico-bg: #edf3f2;
    --nx-side-ico-fg: #2f3d40;
    --nx-side-ico-active-bg: #2b7d73;
    --nx-side-ico-active-fg: #ffffff;
    --nx-th-bg: #2b7d73;
    --nx-th-fg: #ffffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    height: 100%;
    /* controalele native (bifele, butoanele radio, calendarul în Firefox) iau culoarea de acțiune; fereastra calendarului din Chrome / Edge e desenată de browser și rămâne albastră */
    accent-color: var(--nx-sea);
}

body {
    margin: 0;
    min-height: 100%;
    font-family: var(--nx-font-ui);
    color: var(--nx-text);
    background-color: var(--nx-paper);
    background-image: none;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .nx-display {
    font-family: var(--nx-font-display);
    letter-spacing: -0.02em;
    color: var(--nx-ink);
}

h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 600;
    margin: 0 0 0.75rem;
}

h2 {
    font-size: 1.35rem;
    font-weight: 600;
}

a {
    color: var(--nx-sea-deep);
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--nx-ink);
}

.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--nx-sea);
    --bs-btn-border-color: var(--nx-sea);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--nx-sea-deep);
    --bs-btn-hover-border-color: var(--nx-sea-deep);
    --bs-btn-active-bg: #08574e;
    --bs-btn-active-border-color: #08574e;
    --bs-btn-disabled-bg: #7ab8af;
    --bs-btn-disabled-border-color: #7ab8af;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.55rem 1.15rem;
    border-radius: 0.5rem;
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.18rem rgba(var(--nx-accent-rgb), 0.25);
}

/* Focalizarea de la tastatură, vizibilă pe orice element interactiv, în ambele teme (WCAG 2.4.7; contur ≥ 3:1, 1.4.11).
   Cu mouse-ul (:focus fără :focus-visible) rămâne doar umbra discretă de mai sus. */
:focus-visible {
    outline: 3px solid var(--nx-focus);
    outline-offset: 2px;
}
.btn:focus-visible,
.nx-action:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.form-check-input:focus-visible,
summary:focus-visible,
a:focus-visible,
[contenteditable="true"]:focus-visible {
    outline: 3px solid var(--nx-focus);
    outline-offset: 2px;
    box-shadow: none;
}
h1:focus-visible[tabindex="-1"] { outline: none; }

/* Legătura „Sari la conținut”: ascunsă până primește focalizarea (primul Tab pe pagină). */
.nx-sari-continut {
    position: absolute;
    left: 0.5rem;
    top: -3rem;
    z-index: 2000;
    padding: 0.5rem 0.9rem;
    border-radius: 0.4rem;
    background: var(--nx-surface);
    color: var(--nx-sea-deep);
    font-weight: 600;
    border: 2px solid var(--nx-focus);
}
.nx-sari-continut:focus,
.nx-sari-continut:focus-visible { top: 0.5rem; }

/* Fereastra cu scurtăturile de tastatură (js/scurtaturi.js) */
.nx-scurtaturi { border: 1px solid var(--nx-line); border-radius: 0.6rem; padding: 1.2rem 1.4rem; max-width: 34rem; width: calc(100% - 2rem); background: var(--nx-surface); color: var(--nx-text); }
.nx-scurtaturi::backdrop { background: rgba(0, 0, 0, 0.45); }
.nx-scurtaturi h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.nx-scurtaturi table { width: 100%; border-collapse: collapse; margin-bottom: 0.75rem; }
.nx-scurtaturi th, .nx-scurtaturi td { text-align: left; padding: 0.3rem 0.4rem; border-bottom: 1px solid var(--nx-line); vertical-align: top; font-size: 0.9rem; }
.nx-scurtaturi kbd { font-family: inherit; font-size: 0.82rem; padding: 0.1rem 0.4rem; border: 1px solid var(--nx-line-control); border-radius: 0.3rem; background: var(--nx-mist); color: var(--nx-text); white-space: nowrap; }

/* Culorile de text Bootstrap (galbenul #ffc107 are 1,6:1 pe alb; roșul și verdele scad sub 4,5:1 pe fundalul închis): pe tokenii temei */
.text-warning { color: var(--nx-warn) !important; }
.text-danger { color: var(--nx-danger) !important; }
html[data-theme="dark"] .text-success { color: var(--nx-sea-deep) !important; }

.form-control,
.form-select {
    border-color: var(--nx-line-control);
}
.form-check-input {
    border-color: var(--nx-line-control);
}

.form-control {
    border-color: var(--nx-line-control);
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: var(--nx-surface);
}

.form-control:focus {
    border-color: var(--nx-sea);
    background: var(--nx-surface);
}

/* Listele au aceeași înălțime și aceleași colțuri ca căsuțele de text (cu Bootstrap erau mai scunde, așa că o listă de lângă o
   căsuță nu se termina la același nivel); în dreapta rămâne locul săgeții. */
.form-select {
    border-radius: 0.5rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    padding-left: 0.85rem;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--nx-muted);
    margin-bottom: 0.35rem;
}

.alert {
    border: none;
    border-radius: 0.55rem;
    font-size: 0.9rem;
}

.alert-warning {
    background: #fff4e5;
    color: #5c3b12;
}

.alert-danger {
    background: #fef3f2;
    color: var(--nx-danger);
}

.alert-success {
    background: #eef8f4;
    color: var(--nx-sea-deep);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(var(--nx-accent-rgb), 0.04);
    --bs-table-hover-bg: rgba(var(--nx-accent-rgb), 0.07);
    --bs-table-border-color: var(--nx-line);
}

/* capetele de tabel pline, în culoarea de acțiune (ca pe fișa pacientului din modelul ales); doar pe ecran: la tipar fundalul nu se tipărește și textul alb ar dispărea */
@media screen {
    .table > thead > tr > th {
        --bs-table-bg: var(--nx-th-bg);
        --bs-table-color: var(--nx-th-fg);
        color: var(--nx-th-fg);
        border-bottom-color: var(--nx-th-bg);
        font-weight: 600;
    }
    .table > thead > tr > th:first-child { border-top-left-radius: 0.5rem; }
    .table > thead > tr > th:last-child { border-top-right-radius: 0.5rem; }
}

.table-responsive,
.nx-scroll-x {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 640.98px) {
    .home-hero {
        margin: 0 0 1.25rem;
        padding: 1.35rem 1.15rem;
        border-radius: 0.85rem;
    }

    .home-paths {
        grid-template-columns: 1fr;
    }

    .table {
        font-size: 0.88rem;
    }

    .btn-primary {
        min-height: 2.75rem;
    }
}

.card {
    border: 1px solid var(--nx-line);
    border-radius: 0.75rem;
    background: var(--nx-surface);
    box-shadow: none;
}

/* Home */
.home-hero {
    position: relative;
    overflow: hidden;
    margin: -0.25rem 0 1.75rem;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border-radius: 1rem;
    background: var(--nx-hero-bg);
    border: 1px solid var(--nx-hero-line);
    color: var(--nx-hero-text);
    animation: nx-rise 0.5s ease backwards;
}

.home-hero::after {
    content: none;
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 36rem;
}

.home-kicker {
    margin: 0 0 0.5rem;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--nx-hero-kicker);
}

.home-brand {
    margin: 0;
    font-family: var(--nx-font-display);
    font-size: clamp(2.4rem, 6vw, 3.4rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 0.95;
    color: var(--nx-hero-text);
}

.home-lead {
    margin: 0.85rem 0 0;
    font-size: 1.05rem;
    line-height: 1.5;
    color: var(--nx-hero-lead);
}

.home-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.35rem;
}

.home-cta .btn-primary {
    background: var(--nx-hero-cta-bg);
    border-color: var(--nx-hero-cta-bg);
    color: var(--nx-hero-cta-text);
}

.home-cta .btn-primary:hover {
    background: var(--nx-hero-cta-hover);
    border-color: var(--nx-hero-cta-hover);
    color: var(--nx-hero-cta-text);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #eef6f3;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
}

.home-welcome {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
    color: var(--nx-muted);
    animation: nx-rise 0.5s ease 0.05s backwards;
}

.home-paths {
    display: grid;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
    animation: nx-rise 0.5s ease 0.1s backwards;
}

.home-paths a {
    display: block;
    padding: 1rem 1.15rem;
    border-radius: 0.75rem;
    border: 1px solid var(--nx-line);
    background: var(--nx-surface);
    text-decoration: none;
    color: var(--nx-ink);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.home-paths a:hover {
    border-color: var(--nx-sea);
    background: var(--nx-surface);
    transform: translateY(-2px);
    color: var(--nx-ink);
}

.home-paths strong {
    display: block;
    font-family: var(--nx-font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.home-paths span {
    font-size: 0.88rem;
    color: var(--nx-muted);
}

@media (min-width: 720px) {
    .home-paths {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Login */
.login-title {
    margin: 0 0 0.35rem;
    font-family: var(--nx-font-display);
    font-size: 1.85rem;
    font-weight: 600;
}

.login-sub {
    margin: 0 0 1.5rem;
    color: var(--nx-muted);
    font-size: 0.95rem;
}

.login-form .mb-3 {
    margin-bottom: 1rem !important;
}

.login-form .btn-primary {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.7rem 1rem;
}

.login-panouri {
    margin: 1.6rem 0 0;
    font-size: 0.82rem;
}

.login-panouri a {
    color: var(--nx-muted);
    text-decoration: none;
}

.login-panouri a:hover { text-decoration: underline; }

.auth-panel-inner:has(.nx-panouri) { max-width: 46rem; }
/* câmpul parolei cu ochiul „arată cât ține apăsat” (Login) */
.nx-parola { position: relative; }
.nx-parola input { padding-right: 2.8rem; }
/* butonul propriu al browserului (Edge: ochiul care apare la tastare) dublează ochiul nostru: ascuns */
.nx-parola input::-ms-reveal, .nx-parola input::-ms-clear { display: none; }
.nx-parola-ochi { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); width: 2.2rem; height: 2.2rem; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: .35rem; background: transparent; color: var(--nx-muted); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.nx-parola-ochi:hover, .nx-parola-ochi[aria-pressed="true"] { color: var(--nx-text); background: rgba(var(--nx-accent-rgb), .1); }
.nx-parola-ochi:focus-visible { outline: 3px solid var(--nx-focus); outline-offset: 1px; }
.nx-parola-ochi svg { width: 1.25rem; height: 1.25rem; }

.nx-panou-grup {
    margin: 1.1rem 0 0.15rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nx-muted);
}

.nx-panou-rand {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.75rem 0;
    border-top: 1px solid var(--nx-line);
}

.nx-panou-rand-titlu { display: block; }
.nx-panou-varianta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
}
.nx-panou-varianta-sus {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.nx-panou-varianta-nume {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nx-muted);
}
.nx-panou-varianta .nx-muted { font-size: 0.82rem; overflow-wrap: anywhere; }
.nx-panou-rand-act { display: flex; gap: 0.4rem; flex: 0 0 auto; }

/* Motion */
/* nx-rise se folosește numai cu „backwards”, niciodată „both” / „forwards”: o animație de transform rămasă aplicată după sfârșit
   (oricare ar fi valoarea finală) face din element blocul conținător al copiilor position: fixed — turul ghidat din .content apărea
   deplasat cu lățimea meniului și cu derularea paginii */
@keyframes nx-rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes nx-drift {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(-12px, 18px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--nx-sea);
}

.invalid {
    outline: 1px solid var(--nx-danger);
}

.validation-message {
    color: var(--nx-danger);
}

.blazor-error-boundary {
    background: var(--nx-danger);
    padding: 1rem 1.25rem;
    color: white;
    border-radius: 0.5rem;
}

.blazor-error-boundary::after {
    content: "A apărut o eroare.";
}

/* —— Shared clinical pages —— */
.nx-page-head {
    margin-bottom: 1.25rem;
    animation: nx-rise 0.4s ease backwards;
}

.nx-page-kicker {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--nx-muted);
}

.nx-page-title {
    margin: 0;
    font-family: var(--nx-font-display);
    font-size: clamp(1.65rem, 3vw, 2.1rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--nx-ink);
}

.nx-page-lead {
    margin: 0.4rem 0 0;
    color: var(--nx-muted);
    font-size: 0.95rem;
    max-width: 36rem;
}

.nx-loading {
    color: var(--nx-muted);
}

/* filele: cea aleasă e plină în culoarea de acțiune, cu text alb; celelalte, text închis pe fundal transparent.
   Aceleași reguli pentru .nx-tabs și pentru filele Bootstrap (.nav-tabs). */
.nx-tabs {
    display: flex;
    flex-wrap: wrap; /* multe file (Nomenclatoare, Administrare acces): trec pe rândul următor, nu lățesc pagina */
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.nx-tab {
    appearance: none;
    border: none;
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--nx-ink);
    padding: 0.55rem 0.95rem;
    border-radius: 0.55rem;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease, background 0.2s ease;
}

.nx-tab:hover {
    color: var(--nx-ink);
    background: var(--nx-mist);
}

.nx-tab.is-active,
.nx-tab.is-active:hover {
    color: #fff;
    background: var(--nx-sea);
}

.nav-tabs {
    --bs-nav-tabs-border-width: 0;
    gap: 0.35rem;
    border-bottom: none;
}

.nav-tabs .nav-link {
    color: var(--nx-ink);
    background: transparent;
    border: none;
    border-radius: 0.55rem;
    font-weight: 600;
    padding: 0.55rem 0.95rem;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link:focus-visible {
    color: var(--nx-ink);
    background: var(--nx-mist);
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-link.active:hover {
    color: #fff;
    background: var(--nx-sea);
}

.btn-outline-nx {
    --bs-btn-color: var(--nx-ink);
    --bs-btn-bg: var(--nx-surface);
    --bs-btn-border-color: var(--nx-line);
    --bs-btn-hover-color: var(--nx-ink);
    --bs-btn-hover-bg: var(--nx-mist);
    --bs-btn-hover-border-color: var(--nx-sea);
    --bs-btn-active-bg: var(--nx-mist);
    --bs-btn-active-border-color: var(--nx-sea);
    --bs-btn-disabled-color: var(--nx-muted);
    --bs-btn-disabled-bg: var(--nx-surface);
    --bs-btn-disabled-border-color: var(--nx-line);
    background: var(--nx-surface);
    color: var(--nx-ink);
    border-color: var(--nx-line);
    font-weight: 600;
}

.btn-danger-nx {
    color: #fff;
    background: var(--nx-danger);
    border: 1px solid var(--nx-danger);
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    border-radius: 0.5rem;
}

.btn-danger-nx:hover {
    background: #912018;
    border-color: #912018;
    color: #fff;
}

.nx-panel {
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: 1rem;
    padding: 1.15rem 1.2rem 1.35rem;
}

.nx-panel-title {
    margin: 0 0 0.85rem;
    font-family: var(--nx-font-display);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--nx-ink);
}

.nx-panel-sub {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--nx-muted);
}

.nx-panel-sheet {
    border-left: 3px solid var(--nx-sea);
}

.nx-panel-warn {
    border-left: 3px solid var(--nx-warn);
    background: color-mix(in srgb, var(--nx-warn) 14%, var(--nx-surface));
}

.nx-panel-danger {
    border-left: 3px solid var(--nx-danger);
    background: color-mix(in srgb, var(--nx-danger) 14%, var(--nx-surface));
}

.nx-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Bandă de siguranță la prescriere (alergii, grupă, medicație curentă, atenționări) */
.nx-safety {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: stretch;
    border-left: 4px solid var(--nx-sea);
    padding: 0.85rem 1rem;
}

.nx-safety.nx-safety-alert {
    border-left-color: var(--nx-danger);
    background: color-mix(in srgb, var(--nx-danger) 8%, var(--nx-surface));
}

.nx-safety-item {
    min-width: 9rem;
    flex: 1 1 9rem;
}

.nx-safety-item + .nx-safety-item {
    border-left: 1px solid var(--nx-line);
    padding-left: 1.25rem;
}

.nx-safety-val {
    font-weight: 600;
    color: var(--nx-ink);
}

.nx-safety-val.nx-safety-strong {
    color: var(--nx-danger);
}

.nx-divider {
    height: 1px;
    background: var(--nx-line);
    margin: 1.15rem 0;
}

.nx-search-row {
    display: flex;
    gap: 0.4rem;
}

.nx-search-row .form-control {
    flex: 1;
    min-width: 0;
}

.nx-suggest {
    list-style: none;
    margin: 0 0 0.75rem;
    padding: 0;
    border: 1px solid var(--nx-line);
    border-radius: 0.55rem;
    overflow: hidden;
    background: var(--nx-surface);
}

.nx-suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    appearance: none;
    border: none;
    border-bottom: 1px solid var(--nx-line);
    background: transparent;
    font: inherit;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
    color: var(--nx-ink);
}

.nx-suggest li:last-child .nx-suggest-item {
    border-bottom: none;
}

.nx-suggest-item:hover {
    background: var(--nx-mist);
}

/* —— Garda board —— */
.nx-garda-layout {
    display: grid;
    /* o singură coloană cât ecranul: fără ea, coloana implicită „auto” crește cât cel mai lat select / tabel și pagina
       derulează orizontal pe telefon (formularul din stânga al Gărzii, Nomenclatoarelor, Organizării) */
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
    animation: nx-rise 0.45s ease backwards;
}

.nx-garda-layout > * { min-width: 0; }

@media (min-width: 992px) {
    .nx-garda-layout.has-intake {
        grid-template-columns: minmax(16rem, 20rem) minmax(0, 1fr);
        align-items: start;
    }
}

/* Lista / tabelul e primul copil: nu îl înghesui în coloana de 20rem. Panoul se deschide deasupra, pe toată lățimea. */
.nx-garda-layout.has-intake:has(> .nx-board:first-child) {
    grid-template-columns: minmax(0, 1fr);
}

.nx-garda-layout.has-intake:has(> .nx-board:first-child) > .nx-intake {
    order: -1;
}

.nx-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 0.85rem;
    align-items: flex-end;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: 0.75rem;
}

.nx-field {
    min-width: 7.5rem;
}

.nx-field .form-label {
    margin-bottom: 0.2rem;
}

/* un câmp de fișier fără .form-control are lățimea lui intrinsecă: pe telefon nu iese din pagină */
.nx-field input[type="file"] { max-width: 100%; }

/* în bara de filtre, selectul mic are aceeași înălțime ca câmpurile alăturate (.form-control își pune padding-ul lui și peste
   -sm) și o lățime minimă, ca să nu stea mai jos și mai îngust decât ele */
.nx-toolbar .nx-field .form-select-sm {
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    border-radius: 0.5rem;
    min-width: 10rem;
}

.nx-toolbar-action {
    margin-bottom: 0.05rem;
}

.nx-board-head {
    display: flex;
    flex-wrap: wrap; /* titlul, numărul, alarmele și butoanele trec pe rândul următor pe telefon */
    align-items: baseline;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.nx-board-head .nx-panel-title {
    margin: 0;
}

.nx-count {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--nx-sea-deep);
    background: rgba(var(--nx-accent-rgb), 0.1);
    padding: 0.15rem 0.55rem;
    border-radius: 0.35rem;
}

.nx-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 0.85rem;
}

.nx-pager .nx-muted {
    font-size: 0.85rem;
}

.nx-table-wrap {
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: 0.85rem;
}

.nx-table {
    margin: 0;
    font-size: 0.9rem;
}

.nx-table thead th {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--nx-th-fg);
    border-bottom-color: var(--nx-th-bg);
    background: var(--nx-th-bg);
    white-space: nowrap;
    padding: 0.7rem 0.75rem;
}

.nx-table tbody td {
    padding: 0.7rem 0.75rem;
    border-color: var(--nx-line);
    vertical-align: middle;
}

.nx-table tbody tr {
    box-shadow: inset 3px 0 0 transparent;
    transition: background 0.15s ease;
}

.nx-table tbody tr:hover {
    background: rgba(var(--nx-accent-rgb), 0.04);
}

.nx-row-triaj-0 { box-shadow: inset 3px 0 0 #9aa8b0 !important; }
.nx-row-triaj-1 { box-shadow: inset 3px 0 0 #c62828 !important; background: rgba(198, 40, 40, 0.04); }
.nx-row-triaj-2 { box-shadow: inset 3px 0 0 #ef6c00 !important; background: rgba(239, 108, 0, 0.05); }
.nx-row-triaj-3 { box-shadow: inset 3px 0 0 #f9a825 !important; background: rgba(249, 168, 37, 0.07); }
.nx-row-triaj-4 { box-shadow: inset 3px 0 0 #2e7d32 !important; background: rgba(46, 125, 50, 0.05); }
.nx-row-triaj-5 { box-shadow: inset 3px 0 0 #1565c0 !important; background: rgba(21, 101, 192, 0.05); }
.nx-row-anulat {
    opacity: 0.72;
    background: rgba(0, 0, 0, 0.03);
    box-shadow: inset 3px 0 0 #8a9499 !important;
}

.nx-triaj {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.nx-triaj-0 { color: #5c6b73; }
.nx-triaj-1 { color: #b71c1c; }
.nx-triaj-2 { color: #e65100; }
.nx-triaj-3 { color: #f57f17; }
.nx-triaj-4 { color: #1b5e20; }
.nx-triaj-5 { color: #0d47a1; }

.nx-patient {
    font-weight: 600;
    color: var(--nx-ink);
}

.nx-muted {
    font-size: 0.82rem;
    color: var(--nx-muted);
}

.nx-danger-text {
    font-size: 0.82rem;
    color: var(--nx-danger);
    margin-top: 0.15rem;
}

/* schimbare favorabilă (raportul comparativ al indicatorilor) */
.nx-ok-text {
    font-size: 0.82rem;
    color: var(--nx-success, #1e7e34);
}

.nx-wait,
.nx-vitals {
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    color: var(--nx-text);
    white-space: nowrap;
}

.nx-status {
    font-size: 0.82rem;
    color: var(--nx-ink);
}

.nx-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    max-width: 18rem;
}

.nx-action {
    appearance: none;
    display: inline-flex;
    align-items: center;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.28rem 0.5rem;
    border-radius: 0.35rem;
    border: 1px solid var(--nx-line);
    background: var(--nx-surface);
    color: var(--nx-ink);
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.nx-action:hover {
    border-color: var(--nx-sea);
    background: var(--nx-mist);
    color: var(--nx-ink);
}

.nx-action-accent {
    border-color: rgba(var(--nx-accent-rgb), 0.45);
    color: var(--nx-sea-deep);
}

.nx-action-danger {
    border-color: rgba(180, 35, 24, 0.35);
    color: var(--nx-danger);
}

.nx-form-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
}

.nx-form-grid > div:nth-child(-n+3) {
    grid-column: span 1;
}

.nx-form-grid > div.c-span {
    grid-column: 1 / -1;
}

.nx-form-grid > div.c-span2 {
    grid-column: span 2;
}

@media (min-width: 768px) {
    .nx-form-grid > div:nth-child(-n+3) {
        grid-column: span 2;
    }

    /* „pe tot rândul” rămâne pe tot rândul și printre primele trei câmpuri (altfel regula de mai sus îl strângea la două coloane) */
    .nx-form-grid > div.c-span:nth-child(-n+3) {
        grid-column: 1 / -1;
    }
}

/* Formulare clinice: fiecare câmp pe rândul lui, pe toată lățimea, cu aer între ele. */
.nx-form-grid.nx-form-stack {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
}

/* Etichetă, apoi acțiunile câmpului (Dictează, Ciornă), apoi caseta. Nu pe rândul de deasupra. */
.nx-camp {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
}

.nx-camp > .form-label { margin-bottom: 0; }

.nx-camp-actiuni {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    align-items: center;
    justify-content: flex-start;
}

.nx-ciorna-ai {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
}

.nx-ciorna-istoric {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin: 0;
    font-size: 0.82rem;
    color: var(--nx-muted);
    cursor: pointer;
    user-select: none;
}

.nx-ciorna-istoric input { margin: 0; }

/* Textul dictat / ciorna care nu a încăput în limita câmpului: pe un rând propriu sub butoane, la vedere până e preluat */
.nx-text-peste-limita {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--nx-warn);
    border-radius: 0.375rem;
    color: var(--nx-text);
    font-size: 0.85rem;
}

.nx-text-peste-limita-actiuni { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* Contorul de caractere al editorului (câmpurile cu limită, ex. anamneza): textul vizibil, fără formatare */
.nx-editor-contor { display: block; text-align: right; font-size: 0.78rem; color: var(--nx-muted); margin-top: 0.15rem; }
.nx-editor-contor.peste { color: var(--nx-danger); font-weight: 600; }

.nx-table tbody tr.nx-istoric-acum td { box-shadow: inset 3px 0 0 var(--nx-sea); }

.nx-rezumat-ai {
    white-space: pre-wrap;
    margin: 0;
}

.nx-dosar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 1rem;
}

label.nx-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: var(--nx-muted);
}

.nx-form-grid > .c-span2 {
    grid-column: span 2;
}

.nx-anormal {
    color: #9f1239;
    font-weight: 600;
}

html[data-theme="dark"] .nx-anormal {
    color: #fda4af;
}

.nx-grafic {
    width: 100%;
    max-width: 52rem;
    height: auto;
    color: var(--nx-ink);
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: 0.75rem;
}

.nx-grafic line {
    stroke: currentColor;
    stroke-opacity: 0.35;
}

.nx-grafic polyline {
    fill: none;
    stroke: var(--nx-sea-deep);
    stroke-width: 2;
}

.nx-grafic text {
    fill: currentColor;
    font-size: 12px;
}

.nx-grafic-punct {
    fill: var(--nx-sea-deep);
}

.nx-grafic-anormal {
    fill: #b42318;
}

html[data-theme="dark"] .nx-grafic-anormal {
    fill: #fda4af;
}

.nx-form-grid.nx-form-stack > div,
.nx-form-grid.nx-form-stack > div.c-span2,
.nx-form-grid.nx-form-stack > div:nth-child(-n+3) {
    grid-column: 1 / -1;
}

.nx-journal {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.82rem;
    color: var(--nx-muted);
}

/* Fișă episod */
.nx-fisa-meta {
    margin: 0.35rem 0 0;
    color: var(--nx-muted);
    font-size: 0.92rem;
}

.nx-note,
.nx-lab-card {
    border: 1px solid var(--nx-line);
    border-radius: 0.55rem;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.55rem;
    background: var(--nx-surface);
}
/* rezultatele lungi (culturi, antibiograme: „Tip analiza: …; Germeni: …; Rezistent: …”) se rup pe rânduri, nu ies din card */
.nx-lab-card .nx-vitals { white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 640.98px) {
    .nx-actions {
        max-width: none;
    }

    .nx-intake {
        order: -1;
    }
}

/* ---------- Tipărituri (FO, bilet externare, scrisoare medicală) ---------- */
/* ===================== Asistentul din colț (AsistentPanou, docs/ASISTENT-AI.md) ===================== */
.nx-asistent-bulina {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040;
    width: 3.4rem; height: 3.4rem; border-radius: 50%; border: 0;
    background: var(--nx-sea); color: #fff; display: grid; place-items: center; cursor: pointer;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}
.nx-asistent-bulina:hover { background: var(--nx-sea-deep); }
.nx-asistent-bulina:focus-visible { outline: 3px solid var(--nx-focus); outline-offset: 3px; }
.nx-asistent-fereastra {
    position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1040;
    width: min(26rem, calc(100vw - 2rem)); height: min(36rem, calc(100vh - 6rem));
    display: flex; flex-direction: column;
    background: var(--nx-surface); color: var(--nx-text);
    border: 1px solid var(--nx-line); border-radius: 1rem; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25); overflow: hidden;
}
.nx-asistent-cap { display: flex; justify-content: space-between; align-items: center; padding: .55rem .8rem; background: var(--nx-sea); color: #fff; }
.nx-asistent-cap .btn-link { color: #fff; text-decoration: none; }
.nx-asistent-cap-act { display: flex; gap: .25rem; align-items: center; }
.nx-asistent-mesaje { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .55rem; }
.nx-asistent-mesaj { max-width: 92%; padding: .45rem .65rem; border-radius: .75rem; line-height: 1.4; white-space: pre-wrap; }
.nx-asistent-mesaj.eu { align-self: flex-end; background: var(--nx-sea); color: #fff; border-bottom-right-radius: .2rem; }
.nx-asistent-mesaj.el { align-self: flex-start; background: var(--nx-mist); border-bottom-left-radius: .2rem; }
.nx-asistent-mesaj.eroare { border: 1px solid var(--nx-danger); }
.nx-asistent-carduri { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; white-space: normal; }
.nx-asistent-card { background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: .5rem; padding: .3rem .5rem; display: flex; flex-direction: column; font-size: .9rem; }
.nx-asistent-card a { font-weight: 600; }
.nx-asistent-card .nx-muted { font-size: .82rem; }
.nx-asistent-ghid { margin-top: .4rem; font-size: .86rem; white-space: normal; }
.nx-asistent-ghid summary { cursor: pointer; color: var(--nx-muted); }
.nx-asistent-ghid p { margin: .3rem 0; padding: .35rem .5rem; background: var(--nx-surface); border-left: 3px solid var(--nx-line); border-radius: .25rem; }
.nx-asistent-actiune { margin-top: .45rem; background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: .5rem; padding: .4rem .55rem; white-space: normal; }
.nx-asistent-actiune table { width: 100%; font-size: .88rem; border-collapse: collapse; }
.nx-asistent-actiune th { font-weight: 500; color: var(--nx-muted); padding: .1rem .5rem .1rem 0; vertical-align: top; width: 42%; }
.nx-asistent-actiune td { font-weight: 600; padding: .1rem 0; }
.nx-asistent-actiune-butoane { display: flex; gap: .4rem; margin-top: .45rem; }
.nx-asistent-actiune[data-stare="salvat"] { border-color: var(--nx-sea); }
.nx-asistent-durata { display: block; margin-top: .2rem; font-size: .72rem; color: var(--nx-muted); }
.nx-asistent-exemple { display: flex; flex-direction: column; gap: .3rem; align-items: flex-start; }
.nx-asistent-exemplu { border: 1px solid var(--nx-line); background: var(--nx-surface); color: var(--nx-sea-deep); border-radius: 1rem; padding: .2rem .7rem; font-size: .9rem; cursor: pointer; text-align: left; }
.nx-asistent-exemplu:hover { border-color: var(--nx-sea); }
.nx-asistent-nota { font-size: .8rem; margin-top: .6rem; }
.nx-asistent-intrare { display: flex; gap: .4rem; padding: .55rem .75rem .3rem; border-top: 1px solid var(--nx-line); }
.nx-asistent-dictare { padding: 0 .75rem .55rem; }
/* Etapa 7: tabelul unei întrebări din catalog, rezumatul lung, variantele, părerea, pacientul din discuție */
.nx-asistent-tabel { margin-top: .4rem; overflow-x: auto; max-width: 100%; }
.nx-asistent-tabel table { border-collapse: collapse; font-size: .82rem; width: 100%; }
.nx-asistent-tabel th, .nx-asistent-tabel td { padding: .2rem .4rem; border-bottom: 1px solid var(--nx-line); text-align: left; vertical-align: top; }
.nx-asistent-tabel th { font-weight: 600; white-space: nowrap; }
.nx-asistent-tabel tr.atentie td { background: color-mix(in srgb, var(--nx-warn) 18%, transparent); }
.nx-asistent-textlung { margin-top: .4rem; white-space: pre-wrap; font-size: .85rem; border-left: 3px solid var(--nx-line); padding-left: .5rem; }
.nx-asistent-alege { margin-left: .4rem; padding: 0 .4rem; }
.nx-asistent-subsol { display: flex; gap: .5rem; align-items: center; justify-content: space-between; }
.nx-asistent-parere { display: inline-flex; gap: .15rem; align-items: center; margin-left: auto; }
.nx-asistent-parere .btn { padding: 0 .2rem; text-decoration: none; line-height: 1.2; }
.nx-asistent-subsol .nx-asistent-durata { margin-top: 0; }
.nx-asistent-context { padding: .25rem .75rem; font-size: .78rem; border-top: 1px solid var(--nx-line); }
.nx-asistent-dictare:empty { display: none; }
/* Pe telefon (/m): bulina deasupra barei de navigare de jos, fereastra pe tot ecranul, microfonul mare (lucrul la patul pacientului) */
.nx-asistent-bulina.mobil { bottom: calc(4.6rem + env(safe-area-inset-bottom, 0px)); right: .9rem; }
.nx-asistent-fereastra.mobil { inset: 0; width: 100vw; height: 100dvh; border-radius: 0; z-index: 1060; }
.nx-asistent-fereastra.mobil .nx-asistent-dictare .btn { width: 100%; padding: .7rem; font-size: 1.05rem; }
.nx-asistent-fereastra.mobil .nx-asistent-intrare input { font-size: 1rem; }
@media print { .nx-asistent-bulina, .nx-asistent-fereastra { display: none !important; } }

.print-shell {
    max-width: 210mm;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.print-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.print-page {
    background: #fff;
    color: #111;
    font-family: var(--nx-font-ui);
    font-size: 10.5pt;
    line-height: 1.35;
    padding: 14mm 14mm 12mm;
    border: 1px solid var(--nx-line);
    border-radius: 0.5rem;
    box-shadow: 0 8px 30px rgba(18, 33, 43, 0.08);
}

.print-antet {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 2px solid #111;
    padding-bottom: 0.5rem;
    margin-bottom: 0.9rem;
}

.print-unitate-nume { font-weight: 700; font-size: 12.5pt; text-transform: uppercase; }
.print-unitate-linie { font-size: 9pt; color: #333; }
.print-antet-dreapta { text-align: right; font-size: 9.5pt; white-space: nowrap; }

.print-title {
    font-family: var(--nx-font-ui);
    font-size: 14pt;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    margin: 0.4rem 0 0.9rem;
    color: #111;
}

.print-h2 {
    font-family: var(--nx-font-ui);
    font-size: 10pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #111;
    border-bottom: 1px solid #999;
    margin: 0.9rem 0 0.4rem;
    padding-bottom: 0.15rem;
}

.print-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid #999;
    border-right: none;
    border-bottom: none;
}

.print-cell {
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
    padding: 0.2rem 0.4rem;
    min-height: 2.2rem;
    display: flex;
    flex-direction: column;
}

.print-cell span { font-size: 7.5pt; color: #555; text-transform: uppercase; letter-spacing: 0.03em; }
.print-cell strong { font-weight: 600; min-height: 1em; }
.print-cell.c1 { grid-column: span 1; }
.print-cell.c2 { grid-column: span 2; }
.print-cell.c3 { grid-column: span 3; }
.print-cell.c4 { grid-column: span 4; }

.print-table { width: 100%; border-collapse: collapse; font-size: 10pt; }
.print-table th, .print-table td { border: 1px solid #999; padding: 0.2rem 0.4rem; vertical-align: top; text-align: left; }
.print-table th { background: #f0f0f0; font-size: 8pt; text-transform: uppercase; letter-spacing: 0.03em; }

.print-text { white-space: pre-wrap; min-height: 2.5rem; margin: 0; }
.print-qr { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 0.8rem; }
.print-qr figure { margin: 0; flex: none; width: 3.6cm; text-align: center; }
.print-qr svg { display: block; width: 3.6cm; height: 3.6cm; }
.print-qr figcaption { font-size: 0.75em; margin-top: 0.15rem; }
.print-qr .print-text { min-height: 0; }
.print-qr-alte { margin-bottom: 0.6rem; }
.print-qr-atentie { margin-bottom: 1rem; }
.print-nota { margin: 0 0 0.25rem; white-space: pre-wrap; }
/* subtitlurile unei secțiuni de tipăritură (FO: anamneza, examenul clinic, investigațiile) */
.print-h3 { font-family: var(--nx-font-ui); font-size: 9pt; font-weight: 700; color: #111; margin: 0.6rem 0 0.25rem; }
.print-nota-mica { font-size: 8pt; color: #444; margin: 0.15rem 0 0.4rem; }
.print-lista { margin: 0 0 0.3rem; padding-left: 1.2rem; font-size: 9pt; }
.print-cell strong.print-normal { font-weight: 400; }
.mono { font-family: Consolas, "Courier New", monospace; }
.muted { color: #777; }

.print-semnaturi {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.6rem;
}

.print-semnaturi div { display: flex; flex-direction: column; min-width: 12rem; border-top: 1px solid #999; padding-top: 0.3rem; }
.print-semnaturi span { font-size: 7.5pt; text-transform: uppercase; color: #555; }
.print-semnaturi em { font-size: 8.5pt; color: #777; font-style: normal; }

.print-subsol { margin-top: 1.2rem; font-size: 8pt; color: #777; text-align: center; }

@media print {
    @page { size: A4; margin: 10mm; }
    body { background: #fff !important; }
    .no-print { display: none !important; }
    .print-shell { max-width: none; padding: 0; }
    .print-page { border: none; box-shadow: none; padding: 0; border-radius: 0; }
    .print-h2, .print-h3 { break-after: avoid; }
    .print-table, .print-grid { break-inside: auto; }
    tr { break-inside: avoid; }
}

/* ===================== Mobil (PWA) ===================== */

html:has(.m-shell),
body:has(.m-shell) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}
.m-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--nx-paper);
    font-size: 20px;
}
.m-top {
    flex: 0 0 auto;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 3.6rem;
    padding: calc(env(safe-area-inset-top) + 0.35rem) max(0.9rem, env(safe-area-inset-right)) 0.35rem max(0.9rem, env(safe-area-inset-left));
    background: var(--nx-top);
    border-bottom: 1px solid var(--nx-line);
}
.m-brand { font-family: var(--nx-font-display); font-weight: 700; font-size: 26px; color: var(--nx-ink); text-decoration: none; flex: 0 0 auto; }
.m-top-title { flex: 1; min-width: 0; font-size: 22px; font-weight: 700; color: var(--nx-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-top-link { flex: 0 0 auto; font-size: 18px; font-weight: 700; color: var(--nx-ink); text-decoration: none; padding: 0.45rem; }
/* indicatorul de rețea / coada offline (îl scrie js/offline-mobil.js); online fără coadă: doar punctul */
.m-retea { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid currentColor; font-size: 15px; font-weight: 700; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.m-retea-dot { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.m-retea-text { overflow: hidden; text-overflow: ellipsis; }
.m-retea[data-stare="online"] { color: #067647; }
.m-retea[data-stare="online"][data-coada="0"] { border-color: transparent; padding: 0.45rem; }
.m-retea[data-stare="online"][data-coada="0"] .m-retea-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.m-retea[data-stare="offline"] { color: var(--nx-danger); }
.m-retea[data-stare="reconectare"] { color: var(--nx-warn); }
html[data-theme="dark"] .m-retea[data-stare="online"] { color: #6ce9a6; }
html[data-theme="dark"] .m-retea[data-stare="offline"] { color: #ff8a80; }
html[data-theme="dark"] .m-retea[data-stare="reconectare"] { color: #ffb35c; }
.m-offline-stare { display: inline-block; margin-top: 0.3rem; padding: 0.15rem 0.55rem; border-radius: 0.6rem; background: var(--nx-mist); color: var(--nx-sea-deep); font-size: 16px; font-weight: 600; }
/* telefon îngust: titlul mai mic și pe cel mult două rânduri („Gardă pe zone”, „Programe naționale” nu se mai taie) */
@media (max-width: 430px) {
    .m-brand { font-size: 22px; }
    .m-top-title { font-size: 18px; line-height: 1.15; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .m-top-link { padding: 0.35rem; }
}
.m-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    width: 100%;
    padding: 0.85rem max(0.85rem, env(safe-area-inset-right)) 1.1rem max(0.85rem, env(safe-area-inset-left));
}
.m-nav {
    flex: 0 0 auto;
    z-index: 2;
    display: flex;
    width: 100%;
    background: var(--nx-surface);
    border-top: 1px solid var(--nx-line);
    padding: 0.2rem 0.15rem calc(0.2rem + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 18px rgba(18, 33, 43, 0.06);
}
.acces-refuzat { max-width: 28rem; margin: 2.5rem auto; padding: 1.25rem 1.1rem; background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: 0.85rem; }
.acces-refuzat h1 { font-size: 1.35rem; margin: 0 0 0.35rem; }
.acces-refuzat p { margin: 0; color: var(--nx-muted); }
.m-nav .m-nav-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 112px; padding: 8px 0 10px; text-decoration: none; color: var(--nx-ink); opacity: 1; -webkit-tap-highlight-color: transparent; }
.m-nav-ico { display: block; font-size: 56px; line-height: 1; }
.m-nav-item.active .m-nav-ico { background: rgba(var(--nx-accent-rgb), 0.16); border-radius: 999px; padding: 0.1rem 0.4rem; }
.m-nav a.nav-link { padding: 8px 0 10px; }
.m-nav .m-nav-label { display: block; max-width: 100%; font-size: 22px; font-weight: 800; line-height: 1.2; letter-spacing: 0; color: var(--nx-ink); text-align: center; white-space: normal; }
.m-nav-item.active .m-nav-label { color: var(--nx-sea-deep); }
.m-loading, .m-empty { font-size: 20px; color: var(--nx-muted); text-align: center; padding: 2rem 0; }
.m-hero { padding: 1rem 1.05rem; border-radius: 0.9rem; background: var(--nx-surface); border: 1px solid var(--nx-line); margin-bottom: 0.9rem; }
.m-kicker { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--nx-sea-deep); }
.m-h1 { font-size: 32px; margin: 0.2rem 0 0.35rem; }
.m-h2 { font-size: 26px; margin: 1.1rem 0 0.55rem; }
.m-muted { font-size: 20px; line-height: 1.35; color: var(--nx-muted); margin: 0; }
.m-cnp { display: block; margin-top: 0.2rem; font-size: 22px; font-weight: 800; line-height: 1.25; letter-spacing: 0.04em; color: var(--nx-ink); font-variant-numeric: tabular-nums; }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.m-tile { display: flex; flex-direction: column; justify-content: center; min-height: 6.2rem; padding: 1rem 1.05rem; border-radius: 0.9rem; background: var(--nx-surface); border: 1px solid var(--nx-line); text-decoration: none; color: var(--nx-text); }
.m-tile-n { font-family: var(--nx-font-display); font-size: 40px; font-weight: 600; color: var(--nx-ink); line-height: 1; }
.m-tile-l { font-size: 17px; color: var(--nx-muted); margin-top: 0.4rem; }
.m-list { display: flex; flex-direction: column; gap: 0.5rem; }
.m-group { font-size: 15px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--nx-muted); margin: 0.5rem 0 0; }
.m-card { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.55rem; padding: 0.95rem 1rem; border-radius: 0.85rem; background: var(--nx-surface); border: 1px solid var(--nx-line); color: var(--nx-text); text-decoration: none; }
button.m-card { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.m-card:active { background: var(--nx-mist); }
.m-card-static { cursor: pointer; }
.m-card-warn { border-color: #f9a825; }
.m-card-main { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.m-card-main strong { font-size: 24px; line-height: 1.25; color: var(--nx-ink); }
.m-card-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; text-align: right; }
.m-badge { font-size: 16px; font-weight: 800; padding: 0.2rem 0.55rem; border-radius: 0.4rem; background: rgba(var(--nx-accent-rgb), 0.12); color: var(--nx-sea-deep); }
.m-status { font-size: 18px; color: var(--nx-ink); }
.m-link { font-size: 18px; font-weight: 800; }
.m-table { width: 100%; font-size: 18px; margin-top: 0.5rem; border-top: 1px solid var(--nx-line); }
.m-table td { padding: 0.45rem 0.25rem; border-bottom: 1px solid var(--nx-mist); vertical-align: top; }
.m-table tr.is-warn td { background: rgba(249, 168, 37, 0.12); }
.m-chips { display: flex; gap: 0.4rem; overflow-x: auto; padding-bottom: 0.5rem; margin-bottom: 0.4rem; -webkit-overflow-scrolling: touch; }
.m-chip { flex: 0 0 auto; border: 1px solid var(--nx-line); background: var(--nx-surface); border-radius: 999px; padding: 0.7rem 1.1rem; min-height: 3.2rem; font-size: 18px; font-weight: 700; color: var(--nx-ink); }
.m-chip b { color: var(--nx-sea-deep); margin-left: 0.2rem; }
.m-chip.is-on { background: var(--nx-sea); border-color: var(--nx-sea); color: #fff; }
.m-chip.is-on b { color: #fff; }
.m-toolbar { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.7rem; }
.m-search { display: flex; gap: 0.4rem; margin-bottom: 0.6rem; }
.m-search .form-control { flex: 1; min-width: 0; }
.m-fab { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: calc(4.5rem + env(safe-area-inset-bottom)); width: 3rem; height: 3rem; border-radius: 50%; border: 0; background: var(--nx-sea); color: #fff; font-size: 1.3rem; box-shadow: 0 6px 18px rgba(var(--nx-accent-rgb), 0.35); z-index: 3; }
.m-section { background: var(--nx-surface); border: 1px solid var(--nx-line); border-radius: 0.75rem; padding: 0.6rem 0.85rem; margin-bottom: 0.7rem; }
.m-section > summary { font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; }
.m-section > summary::-webkit-details-marker { display: none; }
.m-section > summary::before { content: "▸"; color: var(--nx-muted); }
.m-section[open] > summary::before { content: "▾"; }
.m-section[open] > summary { margin-bottom: 0.5rem; }
.m-ul { padding-left: 1.1rem; margin: 0.25rem 0; font-size: 20px; }
.m-ul li { margin-bottom: 0.2rem; }
.m-sub { padding: 0.4rem 0; border-top: 1px solid var(--nx-mist); }
.m-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.m-grid2 label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 16px; color: var(--nx-text); }
.m-grid2 label.c2 { grid-column: span 2; }
.m-inline { display: flex; gap: 0.3rem; }
.m-row-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.m-suggest { display: flex; flex-direction: column; border: 1px solid var(--nx-line); border-radius: 0.5rem; margin-top: 0.3rem; overflow: hidden; }
.m-suggest button { text-align: left; border: 0; background: var(--nx-surface); color: var(--nx-text); padding: 0.7rem 0.85rem; font-size: 18px; border-bottom: 1px solid var(--nx-mist); }
.m-section > summary { font-size: 20px; }
.m-content .form-label { font-size: 18px; font-weight: 700; color: var(--nx-text); }
.m-content .form-control, .m-content .form-select, .m-content .btn { font-size: 20px; }
.m-content .btn, .m-content .btn-sm { min-height: 3.4rem; font-size: 20px; padding: 0.6rem 1rem; }
.m-content h1 { font-size: 32px; }
.m-fab { bottom: calc(140px + env(safe-area-inset-bottom)); }

/* ===================== Ghid / ajutor ===================== */

.nx-icon-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 2.35rem; height: 2.35rem; padding: 0; border: none; border-radius: 0.55rem; background: transparent; color: var(--nx-text); font-family: inherit; font-size: 1.05rem; font-weight: 600; line-height: 1; cursor: pointer; text-decoration: none; }
.nx-icon-btn svg { width: 1.2rem; height: 1.2rem; display: block; }
.nx-icon-btn i { font-size: 1.05rem; }
.nx-icon-btn:hover { background: var(--nx-mist); color: var(--nx-ink); }
.nx-help-btn { font-size: 1.05rem; }
.nx-help-backdrop { position: fixed; inset: 0; background: rgba(18, 33, 43, 0.25); z-index: 1040; }
.nx-help-drawer { position: fixed; top: 0; right: 0; bottom: 0; height: 100vh; height: 100dvh; width: min(34rem, 100vw); background: var(--nx-surface); color: var(--nx-text); z-index: 1050; display: flex; flex-direction: column; box-shadow: -12px 0 32px rgba(18, 33, 43, 0.18); animation: nx-slide-in 0.2s ease; }
@keyframes nx-slide-in { from { transform: translateX(2rem); opacity: 0; } to { transform: none; opacity: 1; } }
.nx-help-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 1rem 1.25rem 0.75rem; border-bottom: 1px solid var(--nx-line); }
.nx-help-body { flex: 1; overflow: auto; padding: 1rem 1.25rem; }
.nx-help-foot { padding: 0.65rem 1.25rem; border-top: 1px solid var(--nx-line); font-size: 0.85rem; }
.nx-help-foot:has(button) { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; }
.nx-ghid h1 { font-size: 1.35rem; margin-bottom: 0.5rem; }
.nx-ghid h2 { font-size: 1.05rem; margin: 1.1rem 0 0.4rem; color: var(--nx-sea-deep); }
.nx-ghid h3 { font-size: 0.95rem; margin: 0.9rem 0 0.3rem; }
.nx-ghid p, .nx-ghid li { font-size: 0.92rem; line-height: 1.5; }
.nx-ghid ol, .nx-ghid ul { padding-left: 1.2rem; }
.nx-ghid li { margin-bottom: 0.25rem; }
.nx-ghid code { background: var(--nx-mist); padding: 0.05rem 0.35rem; border-radius: 0.3rem; font-size: 0.85em; }
.nx-ghid table { width: 100%; font-size: 0.88rem; border-collapse: collapse; margin: 0.5rem 0 1rem; }
.nx-ghid th, .nx-ghid td { border-bottom: 1px solid var(--nx-line); padding: 0.35rem 0.5rem; text-align: left; vertical-align: top; }
.nx-ghid blockquote { border-left: 3px solid var(--nx-sea); margin: 0.6rem 0; padding: 0.3rem 0.8rem; background: var(--nx-mist); border-radius: 0 0.4rem 0.4rem 0; }
/* Căutarea în ghid (GhidCautareCamp): rezultate sub câmp; pe pagină un panou suprapus, în fereastra „?” o listă în flux */
.nx-ghid-cautare-pagina { margin: 0 0 1rem; max-width: 46rem; }
.nx-ghid-cautare { position: relative; }
.nx-ghid-sugestii { position: absolute; left: 0; right: 0; top: calc(100% + 0.25rem); z-index: 30; max-height: min(70vh, 32rem); overflow: auto; padding: 0.5rem; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-line); border-radius: 0.6rem; box-shadow: 0 12px 28px rgba(18, 33, 43, 0.16); }
.nx-ghid-cautare:not(.is-compact):not(:focus-within) .nx-ghid-sugestii { display: none; }
.nx-ghid-sugestii:focus { outline: none; }
.nx-ghid-cautare.is-compact .nx-ghid-sugestii { position: static; margin-top: 0.4rem; max-height: 45vh; box-shadow: none; }
.nx-ghid-rezultate { list-style: none; margin: 0; padding: 0; }
.nx-ghid-rezultate > li { border-bottom: 1px solid var(--nx-line); }
.nx-ghid-rezultate > li:last-child { border-bottom: none; }
.nx-ghid-rez-buton { display: block; width: 100%; text-align: left; border: 0; background: transparent; font: inherit; padding: 0.45rem 0.5rem; border-radius: 0.4rem; color: var(--nx-text); cursor: pointer; }
.nx-ghid-rez-buton:hover, .nx-ghid-rez-buton:focus-visible { background: var(--nx-mist); }
.nx-ghid-rezultate a { display: block; padding: 0.45rem 0.5rem; border-radius: 0.4rem; color: var(--nx-text); text-decoration: none; }
.nx-ghid-rezultate a:hover, .nx-ghid-rezultate a:focus-visible { background: var(--nx-mist); }
.nx-ghid-rez-titlu { display: block; font-weight: 600; color: var(--nx-sea-deep); }
.nx-ghid-rez-sectiune { display: block; font-size: 0.85rem; color: var(--nx-ink); }
.nx-ghid-rez-fragment { display: block; font-size: 0.82rem; color: var(--nx-muted); line-height: 1.4; }
.nx-ghid-rez-grup { display: inline-block; margin: 0 0.5rem; font-size: 0.75rem; color: var(--nx-muted); }
.nx-ghid-rezultate.is-pagina > li { padding: 0.5rem 0; }
.nx-ghid-rezultate.is-pagina a { display: inline-block; padding: 0.1rem 0.3rem; }
.nx-ghid-rezultate.is-pagina .nx-ghid-rez-fragment { margin: 0.15rem 0.3rem 0; }
.nx-ghid-rezultate mark, .nx-ghid-cautare mark { padding: 0 0.05rem; background: #fff1a8; color: inherit; border-radius: 0.15rem; }
html[data-theme="dark"] .nx-ghid-rezultate mark, html[data-theme="dark"] .nx-ghid-cautare mark { background: #5c4d00; color: #fff; }
.nx-ghid-toate { display: inline-block; margin: 0.4rem 0.5rem 0.2rem; font-size: 0.85rem; }
.nx-help-cautare { padding: 0.6rem 1.25rem; border-bottom: 1px solid var(--nx-line); }
.nx-ghid [id] { scroll-margin-top: 4.5rem; }
.nx-ghid-cuprins { list-style: none; padding: 0; margin: 0 0 0.5rem; font-size: 0.9rem; }
.nx-ghid-cuprins li { padding: 0.15rem 0.4rem; border-radius: 0.35rem; }
.nx-ghid-cuprins li.is-active { background: rgba(var(--nx-accent-rgb), 0.12); }
.nx-ghid-cuprins a { text-decoration: none; }

/* ---- indicatori / transfuzii / pns ---- */
.nx-kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .75rem; }
.nx-kpi { border: 1px solid var(--nx-border, #e3e6ea); border-radius: .5rem; padding: .6rem .8rem; background: var(--nx-surface); color: var(--nx-text); }
.nx-kpi-value { font-size: 1.5rem; font-weight: 600; line-height: 1.2; }
.nx-kpi-unit { font-size: .8rem; font-weight: 400; color: var(--nx-muted); }
.nx-kpi-label { font-size: .9rem; margin-top: .15rem; }
.nx-kpi-formula { font-size: .72rem; color: var(--nx-muted); margin-top: .2rem; }
.nx-row-urgent td { background: color-mix(in srgb, var(--nx-danger) 16%, var(--nx-surface)); }
.nx-row-warn td { background: color-mix(in srgb, var(--nx-warn) 10%, var(--nx-surface)); }
.nx-detail-cell { background: var(--nx-mist); }
.nx-nowrap { white-space: nowrap; }
.nx-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.nx-grid-2 > * { min-width: 0; }
@media (max-width: 900px) { .nx-grid-2 { grid-template-columns: minmax(0, 1fr); } }
/* identificatori lungi fără spații (numele metodelor SIUI, URL-uri): se rup oriunde, nu împing pagina la 390 px */
.nx-rupe { overflow-wrap: anywhere; }

/* bannerul Blazor de eroare — global (folosit si de MainLayout, si de MobileLayout); ascuns pana cand circuitul cade */
#blazor-error-ui { background: color-mix(in srgb, var(--nx-warn) 16%, var(--nx-surface)); color: var(--nx-ink); border-top: 1px solid color-mix(in srgb, var(--nx-warn) 45%, var(--nx-surface)); bottom: 0; box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.08); box-sizing: border-box; display: none; left: 0; padding: 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.85rem; top: 0.55rem; }

/* ---- pagina Acasă: contoare + grupuri de module ---- */
.home-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; animation: nx-rise 0.5s ease 0.08s backwards; }
.home-stat { display: flex; flex-direction: column; padding: 0.85rem 1rem; border-radius: 0.75rem; border: 1px solid var(--nx-line); background: var(--nx-surface); text-decoration: none; color: var(--nx-ink); transition: border-color 0.2s ease, transform 0.2s ease; }
.home-stat:hover { border-color: var(--nx-sea); transform: translateY(-2px); color: var(--nx-ink); }
.home-stat-n { font-family: var(--nx-font-display); font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.home-stat-l { font-size: 0.82rem; color: var(--nx-muted); }
/* pagina de start pe rol: cardurile zilei (GET api/acasa), schelet cât se încarcă, cardul cu atenție / căzut */
.home-panou { margin: 0 0 1.25rem; }
.home-panou-cap { display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap; }
.home-panou-ora { font-size: 0.8rem; color: var(--nx-muted); }
.home-panou-reincarca { margin-left: auto; }
.home-panou-eroare { padding: 0.75rem 1rem; border: 1px dashed var(--nx-line); border-radius: 0.75rem; color: var(--nx-muted); }
.home-stat.is-atentie { border-color: var(--nx-danger); }
.home-stat.is-atentie .home-stat-n { color: var(--nx-danger); }
.home-stat.is-eroare .home-stat-n { color: var(--nx-muted); }
.home-stat-d { font-size: 0.75rem; color: var(--nx-muted); margin-top: 0.15rem; }
.home-stat-schelet { pointer-events: none; gap: 0.45rem; }
.home-schelet-n, .home-schelet-l { display: block; border-radius: 0.35rem; background: var(--nx-line); animation: nx-schelet 1.2s ease-in-out infinite alternate; }
.home-schelet-n { width: 2.5rem; height: 1.7rem; }
.home-schelet-l { width: 75%; height: 0.8rem; }
@keyframes nx-schelet { from { opacity: 0.45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .home-schelet-n, .home-schelet-l { animation: none; } }

/* turul ghidat (Components/Shared/TurGhidat.razor): stratul, conturul țintei (umbra mare întunecă restul) și fereastra */
.nx-tur-strat { position: fixed; inset: 0; z-index: 1090; }
.nx-tur-tinta { position: fixed; z-index: 1091; border-radius: 0.6rem; box-shadow: 0 0 0 3px var(--nx-sea), 0 0 0 9999px rgba(8, 20, 28, 0.55); pointer-events: none; transition: top 0.2s ease, left 0.2s ease, width 0.2s ease, height 0.2s ease; }
.nx-tur-fereastra { position: fixed; z-index: 1092; overflow: auto; padding: 1rem 1.1rem 0.85rem; border-radius: 0.75rem; border: 1px solid var(--nx-line); background: var(--nx-surface); color: var(--nx-ink); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25); }
.nx-tur-pas { margin: 0 0 0.2rem; font-size: 0.75rem; color: var(--nx-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.nx-tur-titlu { margin: 0 0 0.4rem; font-size: 1.05rem; font-weight: 600; }
.nx-tur-text { margin: 0 0 0.75rem; font-size: 0.9rem; }
.nx-tur-butoane { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.nx-tur-sari { margin-right: auto; padding-left: 0; }
/* până la prima poziționare din js/nexus-app.js (nexusTur), conturul și fereastra nu se arată în colțul ecranului */
.nx-tur-tinta:not([style]), .nx-tur-fereastra:not([style]) { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .nx-tur-tinta { transition: none; } }
@media print { .nx-tur-strat, .nx-tur-tinta, .nx-tur-fereastra { display: none !important; } }
.home-group-title { font-family: var(--nx-font-display); font-size: 0.95rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--nx-muted); margin: 1.25rem 0 0.6rem; }
.home-paths-grid { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.home-foot { margin-top: 1.5rem; color: var(--nx-muted); font-size: 0.9rem; }

/* ---- notificări în bara de sus ---- */
.nx-notif { position: relative; display: inline-flex; }
.nx-notif-btn { position: relative; border: none; background: transparent; color: var(--nx-text); }
.nx-msg-btn { position: relative; }
.nx-notif-count { position: absolute; top: 0.05rem; right: -0.05rem; min-width: 1.05rem; height: 1.05rem; padding: 0 0.28rem; border-radius: 999px; background: var(--nx-mist); color: var(--nx-text); border: 1px solid var(--nx-line); font-size: 0.62rem; font-weight: 600; text-align: center; line-height: 1.05rem; pointer-events: none; }
.nx-notif-panel { position: absolute; right: 0; top: 2.4rem; width: 22rem; max-width: 90vw; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-line, #e3e6ea); border-radius: 0.6rem; box-shadow: 0 10px 30px rgba(0,0,0,0.12); padding: 0.75rem 0.9rem; z-index: 1100; }
.nx-notif-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.nx-notif-list { list-style: none; margin: 0; padding: 0; }
.nx-notif-list li { padding: 0.35rem 0; border-top: 1px solid #f0f2f4; }
.nx-notif-list li a { text-decoration: none; color: var(--nx-ink, #1b1f23); }
.nx-notif-list li.is-urgent a { color: #b42318; font-weight: 600; }
.nx-notif-foot { margin-top: 0.5rem; font-size: 0.78rem; }

/* ---- tipărituri: registre late / dense ---- */
.print-table-mic { font-size: 8.5pt; }
.print-table-mic th, .print-table-mic td { padding: 2px 4px; }
/* tabele late (10+ coloane): lățimea foii e fixă, celulele rup textul în loc să lățească tabelul; fontul scade cu numărul de coloane.
   Chromium micșorează la tipărire un tabel prea lat, PeachPDF (PDF-ul de pe server) îl taie la marginea foii. */
.print-table-lat { table-layout: fixed; width: 100%; }
.print-table-lat th, .print-table-lat td { word-break: break-word; overflow-wrap: anywhere; white-space: normal; hyphens: auto; }
.print-table-lat th { letter-spacing: 0; text-transform: none; } /* majusculele lățesc antetul cu ~20% și se rup urât pe coloane înguste */
.print-table-lat.print-dens-1, .print-table-lat.print-dens-1 th { font-size: 7.5pt; }
.print-table-lat.print-dens-1 th, .print-table-lat.print-dens-1 td { padding: 1px 3px; }
.print-table-lat.print-dens-2, .print-table-lat.print-dens-2 th { font-size: 6.5pt; }
.print-table-lat.print-dens-2 th, .print-table-lat.print-dens-2 td { padding: 1px 2px; }
.print-table-lat.print-dens-3, .print-table-lat.print-dens-3 th { font-size: 5.8pt; }
.print-table-lat.print-dens-3 th, .print-table-lat.print-dens-3 td { padding: 1px 1.5px; }
/* matricea drepturilor pe blocuri de grupe: fiecare bloc începe pe o pagină nouă, antetele grupelor se rup după „_” */
.print-subtitle { font-size: 10pt; font-weight: 600; margin: .45rem 0 .2rem; }
.print-bloc-nou { break-before: page; page-break-before: always; }
.print-matrice { table-layout: auto; width: 100%; }
.print-matrice th { vertical-align: bottom; }
.print-matrice td:first-child { width: 38%; }
@media print { .print-landscape { size: A4 landscape; } @page landscape { size: A4 landscape; } }

/* Etichete pentru tuburile de laborator (cod de bare Code 128): 50 × 25 mm, se tipăresc și pe imprimante de etichete */
.print-etichete { display: flex; flex-wrap: wrap; gap: 4mm; padding: 4mm; }
.print-eticheta { width: 50mm; height: 25mm; border: 1px dashed #bbb; padding: 1mm 2mm; box-sizing: border-box; overflow: hidden; background: #fff; color: #000; font-family: Consolas, monospace; page-break-inside: avoid; }
.print-eticheta-cod svg { width: 100%; height: 12mm; display: block; }
.print-eticheta-nume { font-size: 9pt; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.print-eticheta-rand { font-size: 7.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media print { .print-etichete { gap: 0; padding: 0; } .print-eticheta { border: none; } }
.print-landscape { page: landscape; }
/* pe ecran, foaia întinsă are lățimea A4 landscape (297 mm), nu 210 mm: tabelul lat nu mai iese din foaie în previzualizare */
@media screen { .print-shell:has(> .print-page.print-landscape) { max-width: calc(297mm + 2rem); } }

/* ---- meniu derulant simplu (details) pentru formulare ---- */
.nx-dropdown { position: relative; display: inline-block; }
.nx-dropdown > summary { list-style: none; cursor: pointer; }
.nx-dropdown > summary::-webkit-details-marker { display: none; }
.nx-dropdown-menu { position: absolute; right: 0; top: 2.5rem; z-index: 1050; min-width: 16rem; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-line, #e3e6ea); border-radius: .5rem; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: .35rem 0; display: flex; flex-direction: column; }
.nx-dropdown-menu a { padding: .45rem .9rem; text-decoration: none; color: var(--nx-ink, #1b1f23); white-space: nowrap; }
.nx-dropdown-menu a:hover { background: var(--nx-mist); }

/* panouri de afișaj (TV / sală de așteptare): tot ecranul, nu coloana A4 a tipăriturilor */
body:has(.nx-panou) { background: #0b1220; }
body:has(.nx-panou-light) { background: #f4f7fb; }
.print-shell:has(.nx-panou) { max-width: none; width: 100%; margin: 0; padding: 0; }

.nx-panou {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: #0b1220;
    color: #f1f5f9;
    padding: clamp(1.25rem, 2.4vh, 2.75rem) clamp(1.5rem, 3vw, 4.5rem) clamp(1rem, 2vh, 2rem);
    font-size: clamp(1.15rem, 1.55vw, 2.05rem);
}

.nx-panou-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: clamp(1rem, 3vw, 3rem);
    border-bottom: 3px solid #334155;
    padding-bottom: clamp(0.6rem, 1.4vh, 1.25rem);
    margin-bottom: clamp(0.8rem, 2vh, 1.75rem);
}

.nx-panou-titlu {
    margin: 0;
    flex: 1 1 16rem;
    min-width: 0;
    color: #f8fafc;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.1vw, 3.8rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
}

.nx-panou-ceas { flex: 0 0 auto; text-align: right; }
.nx-panou-ora { font-weight: 700; font-variant-numeric: tabular-nums; font-size: clamp(2.2rem, 4.2vw, 5rem); line-height: 0.9; }
.nx-panou-data { margin-top: 0.35rem; font-size: clamp(0.95rem, 1.2vw, 1.45rem); color: #94a3b8; text-transform: capitalize; }
.nx-panou-mic { font-size: .72em; color: #94a3b8; }
.nx-panou-corp { flex: 1 1 auto; min-height: 0; }
.nx-panou-tabel { width: 100%; border-collapse: collapse; table-layout: fixed; }
.nx-panou-tabel th { text-align: left; font-weight: 600; color: #94a3b8; font-size: .62em; text-transform: uppercase; letter-spacing: .06em; padding: .7em .45em .55em; border-bottom: 2px solid #334155; }
.nx-panou-tabel td { padding: .72em .45em; border-bottom: 1px solid #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.nx-panou-tabel tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }
.nx-panou-numar { font-weight: 700; font-size: 1.25em; }
.nx-panou-activ td { background: #16324f !important; }
.nx-panou-badge { display: inline-block; max-width: 100%; padding: .12em .7em; border-radius: .45em; font-weight: 700; font-size: .82em; color: #0f172a; background: #cbd5e1; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.nx-panou-badge-1 { background: #ef4444; color: #fff; } .nx-panou-badge-2 { background: #f97316; color: #fff; } .nx-panou-badge-3 { background: #facc15; } .nx-panou-badge-4 { background: #22c55e; } .nx-panou-badge-5 { background: #3b82f6; color: #fff; }
.nx-panou-stare { background: #1e293b; color: #e2e8f0; }
.nx-panou-stare-activ { background: #38bdf8; color: #082f49; }
.nx-panou-triaj-1 td { background: rgba(239,68,68,.22) !important; } .nx-panou-triaj-2 td { background: rgba(249,115,22,.18) !important; }
.nx-panou-nota { margin: 1.25rem 0 0; }
.nx-panou-subsol { margin-top: auto; padding-top: 1.25rem; font-size: .55em; color: #64748b; }
/* bonurile de ordine chemate (ambulator): ultimul număr mare, clipește 2 minute după chemare */
.nx-panou-chemari { margin: 0 0 1.1rem; }
.nx-panou-chemare { display: flex; align-items: baseline; gap: .6em; padding: .25em .6em; border-radius: .5em; background: #16324f; }
.nx-panou-chemare-nr { font-weight: 800; font-size: 2.6em; font-variant-numeric: tabular-nums; color: #fde047; }
.nx-panou-chemare-sageata { font-size: 1.6em; color: #94a3b8; }
.nx-panou-chemare-cab { font-weight: 700; font-size: 1.6em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-panou-chemare-noua { animation: nx-panou-clipeste 1s ease-in-out 0s 6 alternate; }
@keyframes nx-panou-clipeste { from { background: #16324f; } to { background: #b45309; } }
@media (prefers-reduced-motion: reduce) { .nx-panou-chemare-noua { animation: none; outline: 4px solid #fde047; } }
.nx-panou-chemari-anterioare { display: flex; flex-wrap: wrap; gap: .4em; margin: .5em 0 .3em; font-size: .8em; }

.nx-panou-light { background: #f4f7fb; color: #12212b; }
.nx-panou-light .nx-panou-head { border-bottom-color: #c5d0dc; }
.nx-panou-light .nx-panou-titlu { color: #12212b; }
.nx-panou-light .nx-panou-data,
.nx-panou-light .nx-panou-mic { color: #5c6b7a; }
.nx-panou-light .nx-panou-tabel th { color: #5c6b7a; border-bottom-color: #c5d0dc; }
.nx-panou-light .nx-panou-tabel td { border-bottom-color: #e4ebf2; }
.nx-panou-light .nx-panou-tabel tbody tr:nth-child(even) td { background: rgba(18, 33, 43, 0.04); }
.nx-panou-light .nx-panou-activ td { background: #d7ebf8 !important; }
.nx-panou-light .nx-panou-stare { background: #e8eef4; color: #12212b; }
.nx-panou-light .nx-panou-triaj-1 td { background: rgba(239, 68, 68, 0.16) !important; }
.nx-panou-light .nx-panou-triaj-2 td { background: rgba(249, 115, 22, 0.16) !important; }
.nx-panou-light .nx-panou-subsol { color: #6b7785; }
.nx-panou-light .nx-panou-chemare { background: #d7ebf8; }
.nx-panou-light .nx-panou-chemare-nr { color: #92400e; }
@keyframes nx-panou-clipeste-l { from { background: #d7ebf8; } to { background: #fcd34d; } }
.nx-panou-light .nx-panou-chemare-noua { animation-name: nx-panou-clipeste-l; }
/* ecranul de check-in de la recepție (§3.160): codul QR cât mai mare, pe alb (se citește și cu camere slabe), textul alături sau dedesubt */
.nx-checkin-corp { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2rem; }
.nx-checkin-qr svg { display: block; width: min(68vh, 86vw); height: auto; background: #fff; padding: 1rem; border-radius: .5rem; }
.nx-checkin-text { flex: 1 1 18rem; max-width: 34rem; font-size: .8em; }

@media (max-width: 800px) {
    .nx-panou-head { align-items: flex-start; }
    .nx-panou-ceas { text-align: left; }
    .nx-panou-titlu { font-size: 1.7rem; }
    .nx-panou-ora { font-size: 2.4rem; }
    .nx-panou { font-size: 1.05rem; }
}

/* ---------- Editor de text clinic cu formatare (EditorText) + câmpuri care cresc la focalizare ---------- */
.nx-editor-wrap { position: relative; }
.nx-editor-bara { display: flex; gap: .15rem; align-items: center; flex-wrap: wrap; padding: .2rem .3rem; border: 1px solid var(--bs-border-color, #dee2e6); border-bottom: none; border-radius: .375rem .375rem 0 0; background: rgba(0,0,0,.025); }
.nx-editor-bara button { border: none; background: transparent; padding: .1rem .45rem; border-radius: .25rem; font-size: .85rem; line-height: 1.4; color: var(--nx-text); cursor: pointer; }
.nx-editor-bara button:hover { background: rgba(13,143,127,.12); }
/* formatarea activă la cursor (editor.js, actualizeazaBara): B / I / U, exponent, liste, aliniere */
.nx-editor-bara button[aria-pressed="true"] { background: rgba(13,143,127,.18); box-shadow: inset 0 0 0 1px rgba(13,143,127,.45); }
.nx-editor-bara button svg { width: 1rem; height: 1rem; display: block; }
.nx-editor-bara .nx-ed-select { font-size: .8rem; padding: .1rem .3rem; border: 1px solid var(--bs-border-color, #dee2e6); border-radius: .25rem; background: var(--nx-surface); color: var(--nx-text); height: 1.65rem; }
.nx-editor-bara .nx-ed-size { width: 4.6rem; }
.nx-editor-bara .nx-ed-a sup { font-size: .55em; }
.nx-editor font[size="1"], .nx-html font[size="1"], .print-text font[size="1"] { font-size: .7em; }
.nx-editor font[size="2"], .nx-html font[size="2"], .print-text font[size="2"] { font-size: .85em; }
.nx-editor font[size="3"], .nx-html font[size="3"], .print-text font[size="3"] { font-size: 1em; }
.nx-editor font[size="4"], .nx-html font[size="4"], .print-text font[size="4"] { font-size: 1.15em; }
.nx-editor font[size="5"], .nx-html font[size="5"], .print-text font[size="5"] { font-size: 1.4em; }
.nx-editor font[size="6"], .nx-html font[size="6"], .print-text font[size="6"] { font-size: 1.8em; }
.nx-editor font[size="7"], .nx-html font[size="7"], .print-text font[size="7"] { font-size: 2.4em; }
.nx-editor-bara .sep { width: 1px; height: 1.1rem; background: var(--bs-border-color, #dee2e6); margin: 0 .2rem; }
.nx-editor { min-height: calc(var(--nx-editor-rows, 3) * 1.5rem + .75rem); height: auto; overflow: auto; border-radius: 0 0 .375rem .375rem; white-space: pre-wrap; transition: min-height .12s ease, width .12s ease, margin-left .12s ease, margin-right .12s ease; }
.nx-editor-wrap.is-disabled .nx-editor { border-radius: .375rem; background: var(--nx-mist); color: var(--nx-muted); }
/* Cu mouse: crește doar cât pointerul e pe câmp (focusul poate rămâne). Lățimea o decide js/campuri.js: spre spațiul liber, sau deloc dacă rândul e deja lat. */
@media (hover: hover) and (pointer: fine) {
    .nx-editor-wrap:hover:focus-within { position: relative; z-index: 30; }
    .nx-editor-wrap:hover:focus-within .nx-editor-bara,
    .nx-editor-wrap:hover:focus-within .nx-editor,
    textarea.form-control:hover:focus {
        box-sizing: border-box;
        width: var(--nx-grow-w, 100%);
        margin-left: var(--nx-grow-ml, 0px);
        margin-right: var(--nx-grow-mr, 0px);
        position: relative;
        z-index: 6;
        box-shadow: 0 10px 28px rgba(18, 33, 43, 0.16);
    }
    .nx-editor-wrap:hover:focus-within .nx-editor { min-height: 20rem; }
    textarea.form-control:hover:focus { min-height: 16rem; }
}
@media (hover: none) {
    .nx-editor-wrap:focus-within .nx-editor { min-height: 16rem; }
    textarea.form-control:focus { min-height: 14rem; }
}
/* exponent / indice: Bootstrap (reboot) le afișează cu vertical-align: baseline + position, iar Chrome decide după stilul calculat dacă textul
   e deja exponent; cu baseline, al doilea clic pe x² nu-l mai scotea. În editor (și la afișare / tipărire, ca să arate la fel) folosim
   vertical-align-ul nativ. */
.nx-editor sup, .nx-html sup, .print-text sup { position: static; top: auto; vertical-align: super; line-height: 0; }
.nx-editor sub, .nx-html sub, .print-text sub { position: static; bottom: auto; vertical-align: sub; line-height: 0; }
.nx-editor big, .nx-html big, .print-text big { font-size: 1.25em; }
.nx-editor small, .nx-html small, .print-text small { font-size: .85em; }
.nx-editor hr, .nx-html hr, .print-text hr { margin: .4rem 0; border: 0; border-top: 1px solid #999; }
.nx-editor blockquote, .nx-html blockquote, .print-text blockquote { margin: 0 0 .35rem 1.5rem; padding: 0; border: 0; }
.nx-editor h3, .nx-html h3, .print-text h3 { font-size: 1.1em; }
.nx-editor:empty::before { content: attr(data-placeholder); color: #9aa; pointer-events: none; }
.nx-editor p { margin: 0 0 .35rem; }
.nx-editor ul, .nx-editor ol { margin: 0 0 .35rem 1.2rem; padding: 0; }
.nx-editor h4, .nx-editor h3, .nx-editor h5 { font-size: 1rem; font-weight: 700; margin: .3rem 0 .2rem; }
/* textarea-urile obișnuite cresc la focalizare, ca să nu se scrie în fante */
textarea.form-control { transition: min-height .12s ease, width .12s ease, margin-left .12s ease, margin-right .12s ease; }
/* text formatat afișat (panouri, tipărituri) */
.nx-html p, .print-text p { margin: 0 0 .35rem; }
.nx-html ul, .nx-html ol, .print-text ul, .print-text ol { margin: 0 0 .35rem 1.2rem; padding-left: .2rem; }
.nx-html h4, .print-text h4, .nx-html h3, .print-text h3 { font-size: 1em; font-weight: 700; margin: .3rem 0 .15rem; }
/* tabele inserate în editor / afișate / tipărite */
/* white-space: editorul și .print-text păstrează spațiile (pre-wrap); în structura tabelului nu, ca spațiile dintre rânduri / celule să nu devină celule anonime */
.nx-editor table, .nx-html table, .print-text table { border-collapse: collapse; margin: 0 0 .45rem; width: auto; max-width: 100%; white-space: normal; }
.nx-editor th, .nx-editor td, .nx-html th, .nx-html td, .print-text th, .print-text td { border: 1px solid #b9c6c0; padding: .2rem .4rem; vertical-align: top; text-align: left; }
.nx-editor th, .nx-editor td, .nx-html th, .nx-html td, .print-text th, .print-text td { white-space: pre-wrap; } /* .nx-html: celula arată ca în editor și la tipărire */
/* Enter / Shift+Enter într-o celulă: editor.js pune clasa cât ține comanda, ca Chrome să scrie <br>, nu un „\n” literal */
.nx-editor.nx-ed-br th, .nx-editor.nx-ed-br td { white-space: normal; }
.nx-editor td, .nx-editor th { min-width: 2.5rem; }
.nx-editor th, .nx-html th, .print-text th { font-weight: 700; background: rgba(0,0,0,.035); text-transform: none; letter-spacing: normal; font-size: inherit; }
.nx-editor caption, .nx-html caption, .print-text caption { caption-side: top; font-weight: 700; padding: 0 0 .15rem; text-align: left; color: inherit; }
.nx-editor ul ul, .nx-editor ol ol, .nx-editor ul ol, .nx-editor ol ul { margin-bottom: 0; }
html[data-theme="dark"] .nx-editor th, html[data-theme="dark"] .nx-editor td, html[data-theme="dark"] .nx-html th, html[data-theme="dark"] .nx-html td { border-color: #3c4d55; }
@media print {
    .print-text th, .print-text td, .nx-html th, .nx-html td { border: 1px solid #000; }
    .print-text th, .nx-html th { background: transparent; }
    .print-text table, .nx-html table { break-inside: auto; }
}
/* meniul de tabel al editorului (bara „Tabel ▾” și clic dreapta pe o celulă); îl creează editor.js în body */
.nx-editor-bara .nx-ed-tabel { font-size: .8rem; }
.nx-editor-bara button:disabled { opacity: .4; cursor: default; background: transparent; }
.nx-ed-meniu { position: fixed; z-index: 2000; min-width: 15rem; padding: .25rem 0; background: var(--nx-surface, #fff); color: var(--nx-text, #1c2a32); border: 1px solid var(--nx-line, #d0dbd5); border-radius: .4rem; box-shadow: 0 10px 28px rgba(18, 33, 43, .2); font-size: .875rem; }
.nx-ed-meniu button { display: flex; align-items: center; width: 100%; border: 0; background: transparent; color: inherit; text-align: left; padding: .3rem .8rem .3rem .4rem; cursor: pointer; line-height: 1.3; }
.nx-ed-meniu button:hover, .nx-ed-meniu button.activ { background: rgba(var(--nx-accent-rgb), 0.12); }
.nx-ed-meniu button.pericol { color: #b42318; }
html[data-theme="dark"] .nx-ed-meniu button.pericol { color: #ff8a80; }
.nx-ed-meniu .bifa { display: inline-block; width: 1.3rem; text-align: center; font-weight: 700; }
.nx-ed-meniu .sep { height: 1px; margin: .25rem 0; background: var(--nx-line, #d0dbd5); }
/* panoul tabelelor (butonul de tabel din bară): tabel nou, tabelele predefinite, salvarea tabelului curent (EditorText.razor) */
.nx-editor-bara .nx-ed-tabele-btn { display: inline-flex; align-items: center; gap: .1rem; }
.nx-editor-bara .nx-ed-sageata { font-size: .65rem; }
.nx-ed-tabele-fundal { position: fixed; inset: 0; z-index: 1990; }
.nx-ed-tabele { position: absolute; top: 2.1rem; left: .3rem; z-index: 1995; width: min(22rem, calc(100vw - 2rem)); max-height: 24rem; overflow: auto; padding: .3rem 0; background: var(--nx-surface, #fff); color: var(--nx-text, #1c2a32); border: 1px solid var(--nx-line, #d0dbd5); border-radius: .4rem; box-shadow: 0 10px 28px rgba(18, 33, 43, .2); font-size: .875rem; }
.nx-ed-tabele .sep { height: 1px; margin: .3rem 0; background: var(--nx-line, #d0dbd5); }
.nx-ed-tabele-item { display: block; width: 100%; border: 0; background: transparent; color: inherit; text-align: left; padding: .3rem .8rem; cursor: pointer; line-height: 1.3; }
.nx-ed-tabele-item:hover:not(:disabled) { background: rgba(var(--nx-accent-rgb), 0.12); }
.nx-ed-tabele-item:disabled { opacity: .5; cursor: default; }
.nx-ed-tabele-titlu { padding: .35rem .8rem .1rem; font-weight: 700; font-size: .8rem; color: var(--nx-muted); text-transform: uppercase; letter-spacing: .02em; }
.nx-ed-tabele-grup { padding: .25rem .8rem 0; font-size: .78rem; color: var(--nx-muted); }
.nx-ed-tabele-nota { padding: .25rem .8rem; font-size: .8rem; color: var(--nx-muted); }
.nx-ed-tabele-rand { display: flex; align-items: center; gap: .25rem; padding-right: .4rem; }
.nx-ed-tabele-rand .nume { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-left: 1.2rem; }
.nx-ed-tabele-rand input { flex: 1 1 auto; margin-left: .8rem; }
.nx-ed-tabele-mic { border: 0; background: transparent; color: inherit; padding: .1rem .35rem; border-radius: .25rem; cursor: pointer; }
.nx-ed-tabele-mic:hover { background: rgba(var(--nx-accent-rgb), 0.12); }
.nx-ed-tabele-mic.pericol:hover { background: rgba(180, 35, 24, .12); }
.nx-ed-tabele-salvare { padding: .2rem .8rem .4rem; }
.nx-ed-tabele-eroare { margin: .3rem .8rem 0; color: #b42318; font-size: .8rem; }
html[data-theme="dark"] .nx-ed-tabele-eroare { color: #ff8a80; }
.nx-ed-tabele-item:focus-visible, .nx-ed-tabele-mic:focus-visible { outline: 3px solid var(--nx-focus); outline-offset: -3px; }
/* „＋ rând” lângă ultimul rând al tabelului cu cursorul (editor.js) */
.nx-ed-plus { position: absolute; z-index: 7; padding: .05rem .45rem; font-size: .75rem; line-height: 1.4; border: 1px solid var(--nx-line, #d0dbd5); border-radius: .3rem; background: var(--nx-surface, #fff); color: var(--nx-text); box-shadow: 0 2px 6px rgba(18, 33, 43, .12); cursor: pointer; }
.nx-ed-plus:hover { background: rgba(var(--nx-accent-rgb), 0.12); }
.nx-ed-plus[hidden] { display: none; }

/* profilul unității (Administrare → Module): opțiunile ca niște carduri alese cu radio */
.nx-profil-optiuni { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .6rem; margin: .5rem 0 .8rem; }
.nx-profil-optiune { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .85rem; border: 1px solid var(--nx-line-control, #c9d3d0); border-radius: .5rem; cursor: pointer; background: var(--nx-surface); }
.nx-profil-optiune input { position: absolute; opacity: 0; pointer-events: none; }
.nx-profil-optiune span { font-size: .85rem; color: var(--nx-muted); }
.nx-profil-optiune.ales { border-color: var(--nx-sea, #0d8f7f); box-shadow: inset 0 0 0 1px var(--nx-sea, #0d8f7f); background: rgba(var(--nx-accent-rgb), .06); }
.nx-profil-optiune:focus-within { outline: 3px solid var(--nx-focus); outline-offset: 1px; }
.nx-profil-optiune.curent strong { color: var(--nx-sea, #0d8f7f); }
/* 16 profiluri pe grupuri: carduri mai înguste, descrierea completă a celui ales sub grilă */
.nx-profil-grup { border: 0; padding: 0; margin: 0 0 .4rem; min-width: 0; }
.nx-profil-grup legend { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--nx-muted); margin-bottom: .1rem; float: none; width: auto; }
.nx-profil-grup .nx-profil-optiuni { grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr)); gap: .45rem; margin: .25rem 0 .5rem; }
.nx-profil-grup .nx-profil-optiune { padding: .5rem .7rem; }
.nx-profil-grup .nx-profil-optiune span { font-size: .78rem; }
.nx-profil-detaliu { padding: .55rem .8rem; border-left: 3px solid var(--nx-sea, #0d8f7f); background: rgba(var(--nx-accent-rgb), .05); border-radius: .3rem; margin: .2rem 0 .7rem; font-size: .9rem; }
/* licența Nexus (Module, §3.181): etichetele pe stânga, valorile alături; pe telefon una sub alta */
.nx-licenta { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; margin: 0 0 .6rem; }
.nx-licenta dt { font-weight: 600; }
.nx-licenta dd { margin: 0; }
@media (max-width: 576px) { .nx-licenta { grid-template-columns: 1fr; } .nx-licenta dd { margin-bottom: .3rem; } }

/* ---------- Temă întunecată (cookie nx-theme, altfel preferința sistemului) ---------- */
html[data-theme="dark"] {
    color-scheme: dark;
    /* tema închisă „bleumarin de noapte”: fundal albastru-închis calm, aceeași acțiune teal ca tema deschisă (butoane #2b7d73, legături #7fd1c4); textul ~9:1, nu alb pur (mai puțin obositor) */
    --nx-ink: #cfd6e2;
    --nx-sea: #2b7d73;
    --nx-sea-deep: #7fd1c4;
    --nx-sea-bright: #3fb3a3;
    --nx-sand: #1f2533;
    --nx-paper: #151a24;
    --nx-mist: #252c3b;
    --nx-line: #2a3344;
    --nx-text: #b1b9c6;
    --nx-muted: #939dae;
    --nx-surface: #1c2230;
    --nx-top: #181e2a;
    /* accesibilitate: textul roșu / portocaliu pe fundal închis (vechile valori din tema deschisă aveau 2,5:1 și 3,0:1) */
    --nx-danger: #f97066;
    --nx-warn: #fdb022;
    --nx-line-control: #6e7a8f;
    --nx-focus: #7fd1c4;
    --bs-body-color: #b1b9c6;
    --bs-body-bg: #151a24;
    --bs-emphasis-color: #cfd6e2;
    --bs-nav-tabs-link-active-color: #cfd6e2;
    --bs-nav-tabs-link-active-bg: #1c2230;
    --bs-border-color: #2a3344;
    --bs-secondary-color: #939dae;
    --bs-tertiary-bg: #202736;
    --bs-secondary-bg: #202736;
    --bs-list-group-bg: #1c2230;
    --bs-list-group-color: #b1b9c6;
    --bs-list-group-border-color: #2a3344;
    --bs-list-group-action-hover-bg: #252c3b;
    --bs-list-group-action-hover-color: #cfd6e2;
    --bs-list-group-action-active-bg: #252c3b;
    --bs-list-group-action-active-color: #cfd6e2;
    --nx-accent-rgb: 43, 125, 115;
    --nx-accent-bright-rgb: 127, 209, 196;
    --nx-side-bg: #181e2a;
    --nx-side-line: #283041;
    --nx-side-brand: #cfd6e2;
    --nx-side-brand-hover: #7fd1c4;
    --nx-side-sub: #939dae;
    --nx-side-label: #939dae;
    --nx-side-link: #a8b1c0;
    --nx-side-hover-bg: #222a39;
    --nx-side-hover-text: #dfe5ee;
    --nx-side-active-bg: #2b7d73;
    --nx-side-active-text: #ffffff;
    --nx-side-active-bar: #2b7d73;
    --nx-side-focus: #7fd1c4;
    --nx-side-field-line: #6e7a8f;
    --nx-side-field-bg: #1f2634;
    --nx-side-field-bg-focus: #232b3a;
    --nx-side-field-text: #b1b9c6;
    --nx-side-placeholder: #939dae;
    --nx-side-key-line: #3a4458;
    --nx-side-key-text: #939dae;
    --nx-side-empty-link: #7fd1c4;
    --nx-side-mark-bg: rgba(43, 125, 115, 0.35);
    --nx-side-mark-text: #dfe5ee;
    --nx-side-first-ring: #7fd1c4;
    --nx-side-toggler-bg: #1f2634;
    --nx-side-toggler-checked: #222a39;
    --nx-side-burger: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    --nx-hero-bg: #1c2230;
    --nx-hero-line: #2a3344;
    --nx-hero-text: #cfd6e2;
    --nx-hero-kicker: #7fd1c4;
    --nx-hero-lead: #a9b2c0;
    --nx-hero-cta-bg: #2b7d73;
    --nx-hero-cta-hover: #23695f;
    --nx-hero-cta-text: #ffffff;
    --nx-side-ico-bg: #222a39;
    --nx-side-ico-fg: #a8b1c0;
    --nx-side-ico-active-bg: rgba(255, 255, 255, 0.18);
    --nx-side-ico-active-fg: #ffffff;
    --nx-th-bg: #1e4a46;
    --nx-th-fg: #d6ece8;
}
html[data-theme="dark"] .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #2b7d73;
    --bs-btn-border-color: #2b7d73;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #23695f;
    --bs-btn-hover-border-color: #23695f;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #1f5c54;
    --bs-btn-active-border-color: #1f5c54;
    --bs-btn-disabled-color: #b9cfcb;
    --bs-btn-disabled-bg: #24433f;
    --bs-btn-disabled-border-color: #24433f;
}
html[data-theme="dark"] .m-chip.is-on,
html[data-theme="dark"] .m-chip.is-on b,
html[data-theme="dark"] .m-fab {
    background: #2b7d73;
    border-color: #2b7d73;
    color: #fff;
}
html[data-theme="dark"] body { background: var(--nx-paper); color: var(--nx-text); }
html[data-theme="dark"] .top-row { background: var(--nx-top); color: var(--nx-text); }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .nx-help-drawer,
html[data-theme="dark"] .nx-notif-panel,
html[data-theme="dark"] .nx-dropdown-menu,
html[data-theme="dark"] .btn-logout,
html[data-theme="dark"] .nx-editor,
html[data-theme="dark"] .nx-editor-bara,
html[data-theme="dark"] .nx-editor-bara .nx-ed-select,
html[data-theme="dark"] .nx-kpi,
html[data-theme="dark"] .list-group-item {
    background: var(--nx-surface);
    color: var(--nx-text);
    border-color: var(--nx-line);
}
html[data-theme="dark"] .nx-editor-bara button { color: var(--nx-text); }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-check-input { border-color: var(--nx-line-control); }
/* fundalurile roșii păstrează nuanța închisă, cu textul alb (6,6:1); --nx-danger din tema închisă e pentru text */
html[data-theme="dark"] .btn-danger-nx,
html[data-theme="dark"] .blazor-error-boundary { background: #b42318; border-color: #b42318; color: #fff; }
html[data-theme="dark"] .table {
    --bs-table-color: var(--nx-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--nx-line);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
}
html[data-theme="dark"] .nx-dropdown-menu a:hover,
html[data-theme="dark"] .nx-icon-btn:hover { background: var(--nx-mist); }
html[data-theme="dark"] .alert-warning { background: #3a2e1c; color: #f3d7a1; }
html[data-theme="dark"] .alert-danger { background: #3a2220; color: #f3b4ae; }
html[data-theme="dark"] .alert-success { background: #1a3330; color: #b7ebe3; }
html[data-theme="dark"] .nx-notif-list li { border-top-color: var(--nx-line); }
html[data-theme="dark"] .nx-notif-list li.is-urgent a { color: #f3b4ae; }
html[data-theme="dark"] .nx-triaj-0 { color: var(--nx-muted); }
html[data-theme="dark"] .nx-triaj-4 { color: #8fd18f; }
html[data-theme="dark"] .nx-triaj-5 { color: #9ec0f5; }

/* Sistem → setări: secțiuni pe grupe, cel mult două coloane (una pe ecrane înguste), etichete care se rup pe rânduri. */
.nx-setari {
    container-type: inline-size;
}

.nx-setari-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.45rem;
    margin: 0 0 1.1rem;
}

.nx-setari-nav a,
.nx-setari-nav-link {
    display: inline-block;
    font: inherit;
    line-height: 1.4;
    cursor: pointer;
    padding: 0.2rem 0.65rem;
    border: 1px solid var(--nx-line);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--nx-sea-deep);
    text-decoration: none;
    background: var(--nx-mist);
}

.nx-setari-nav a:hover,
.nx-setari-nav a:focus-visible,
.nx-setari-nav-link:hover,
.nx-setari-nav-link:focus-visible {
    border-color: var(--nx-sea);
    color: var(--nx-ink);
}

.nx-setari-grupa {
    scroll-margin-top: 5rem;
}

.nx-setari-grupa + .nx-setari-grupa {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--nx-line);
}

.nx-setari-grupa-titlu {
    margin: 0 0 0.15rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--nx-ink);
}

.nx-setari-grupa-ajutor {
    margin: 0 0 0.8rem;
    font-size: 0.85rem;
}

.nx-setari-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.95rem 1.4rem;
    align-items: start;
}

@container (min-width: 38rem) {
    .nx-setari-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.nx-setare {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.nx-setare.nx-setare-lat {
    grid-column: 1 / -1;
}

.nx-setare > .form-label {
    margin: 0;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
}

.nx-setare .form-control,
.nx-setare .form-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.nx-setare .form-text,
.nx-setare .invalid-feedback {
    margin: 0;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

/* Setare pe care o scrie aplicația (blocată până la „Modifică manual”) și setare încă nefolosită de Nexus. */
.nx-setare .form-text.nx-warning-text {
    color: var(--nx-warn);
}

.nx-setare-fara-efect {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0 0.45rem;
    border: 1px solid var(--nx-line);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--nx-muted);
    background: var(--nx-mist);
    white-space: nowrap;
    vertical-align: 0.08em;
}

html[data-theme="dark"] .nx-setare .form-text.nx-warning-text {
    color: #f5b971;
}

.nx-setare .form-control[readonly] {
    background: var(--nx-mist);
    color: var(--nx-muted);
}

.nx-setari-stare,
.nx-setari-alte {
    align-self: center;
    font-size: 0.88rem;
}

/* Sistem: categoriile în bara laterală (una singură vizibilă) și căutarea setărilor; pe ecrane înguste bara devine o listă de alegere. */
.nx-sistem {
    display: grid;
    grid-template-columns: 15.5rem minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.nx-sistem-bara {
    position: sticky;
    top: 4.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
}

.nx-sistem-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.nx-sistem-nav-link {
    appearance: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    border: none;
    border-left: 3px solid transparent;
    border-radius: 0.45rem;
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--nx-muted);
    text-align: left;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.nx-sistem-nav-link:hover {
    color: var(--nx-ink);
    background: rgba(var(--nx-accent-rgb), 0.06);
}

.nx-sistem-nav-link.is-active {
    color: var(--nx-sea-deep);
    background: var(--nx-mist);
    border-left-color: var(--nx-sea);
}

.nx-sistem-nesalvat {
    color: var(--nx-warn);
    font-size: 1.25rem;
    line-height: 1;
}

.nx-sistem-select {
    display: none;
}

.nx-sistem-continut {
    min-width: 0;
}

.nx-sistem-categorie-cap {
    margin-bottom: 1rem;
}

.nx-sistem-categorie-titlu {
    margin: 0 0 0.2rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--nx-ink);
}

.nx-sistem-rezultate-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.nx-sistem-rezultat {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.6rem;
    width: 100%;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--nx-line);
    border-radius: 0.45rem;
    background: var(--nx-surface);
    color: var(--nx-text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.nx-sistem-rezultat:hover,
.nx-sistem-rezultat:focus-visible {
    border-color: var(--nx-sea);
    color: var(--nx-text);
}

.nx-sistem-rezultat-titlu {
    font-weight: 600;
    color: var(--nx-ink);
}

.nx-sistem-rezultat-cheie {
    margin-left: auto;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
}

.nx-sistem-legaturi {
    padding-left: 1.1rem;
}

.nx-sistem-legaturi li + li {
    margin-top: 0.3rem;
}

/* Setarea / panoul deschis din căutare: evidențiat scurt. */
.nx-evidentiat {
    border-radius: 0.45rem;
    animation: nx-evidentiat 2.6s ease-out;
}

@keyframes nx-evidentiat {
    0%, 40% { box-shadow: 0 0 0 3px var(--nx-sea-bright); background-color: rgba(var(--nx-accent-bright-rgb), 0.12); }
    100% { box-shadow: 0 0 0 3px transparent; background-color: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    .nx-evidentiat {
        animation: none;
        outline: 3px solid var(--nx-sea-bright);
        outline-offset: 2px;
    }
}

@media (max-width: 900px) {
    .nx-sistem {
        grid-template-columns: minmax(0, 1fr);
        gap: 1rem;
    }

    .nx-sistem-bara {
        position: static;
    }

    .nx-sistem-nav {
        display: none;
    }

    .nx-sistem-select {
        display: block;
    }
}

/* ===================== Camera de gardă: vitale în serie, alarme, zone și boxuri ===================== */
.nx-alarma-chip {
    display: inline-block;
    margin: 0.1rem 0.25rem 0.1rem 0;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #9f1239;
    background: rgba(190, 18, 60, 0.09);
    border: 1px solid rgba(190, 18, 60, 0.25);
}

html[data-theme="dark"] .nx-alarma-chip { color: #fda4af; background: rgba(253, 164, 175, 0.12); border-color: rgba(253, 164, 175, 0.35); }

.nx-alarma-vitale {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(190, 18, 60, 0.35);
    background: rgba(190, 18, 60, 0.06);
    color: var(--nx-text);
}

.nx-vg {
    display: grid;
    gap: 0.6rem;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    margin: 0.5rem 0;
}

.nx-vg-compact { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }

.nx-vg-panel {
    margin: 0;
    padding: 0.4rem 0.5rem 0.2rem;
    border: 1px solid var(--nx-line);
    border-radius: 0.6rem;
    background: var(--nx-surface);
    color: var(--nx-ink);
    break-inside: avoid;
}

.nx-vg-panel.is-alarma { border-color: rgba(190, 18, 60, 0.55); }

.nx-vg-panel figcaption {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: var(--nx-muted);
}

.nx-vg-panel figcaption strong { color: var(--nx-text); }
.nx-vg-panel.is-alarma figcaption strong { color: #9f1239; }
html[data-theme="dark"] .nx-vg-panel.is-alarma figcaption strong { color: #fda4af; }

.nx-vg-svg { width: 100%; height: auto; display: block; }
.nx-vg-svg text { fill: var(--nx-muted); font-size: 9px; }
.nx-vg-ax { stroke: currentColor; stroke-opacity: 0.3; }
.nx-vg-banda { fill: var(--nx-sea); fill-opacity: 0.1; }
.nx-vg-linie { fill: none; stroke-width: 1.8; }
.nx-vg-linie.s1 { stroke: var(--nx-sea-deep); }
.nx-vg-linie.s2 { stroke: var(--nx-muted); stroke-dasharray: 4 3; }
.nx-vg-punct.s1 { fill: var(--nx-sea-deep); }
.nx-vg-punct.s2 { fill: var(--nx-muted); }
.nx-vg-alarma { fill: #be123c; stroke: var(--nx-surface); stroke-width: 1; }
html[data-theme="dark"] .nx-vg-alarma { fill: #fda4af; }

.nx-vitale-tabel tr.has-alarma td:first-child { box-shadow: inset 3px 0 0 #be123c; }
.nx-vitale-form { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); }
.nx-vitale-form .nx-vf { display: flex; flex-direction: column; gap: 0.15rem; margin: 0; }
.nx-vitale-form .nx-vf .form-label { margin: 0; font-size: 0.82rem; }
.nx-vitale-form .c-span2 { grid-column: span 2; }
.nx-praguri { font-size: 0.8rem; }

.nx-zone-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
    align-items: start;
}

.nx-zona-card {
    border: 1px solid var(--nx-line);
    border-top: 4px solid var(--nx-sea);
    border-radius: 0.75rem;
    background: var(--nx-surface);
    padding: 0.7rem 0.8rem;
    min-width: 0;
}

.nx-zona-tip-1 { border-top-color: #f59e0b; }
.nx-zona-tip-2 { border-top-color: #c62828; }
.nx-zona-tip-3 { border-top-color: var(--nx-sea); }
.nx-zona-tip-4 { border-top-color: #1565c0; }
.nx-zona-tip-5 { border-top-color: #6d28d9; }
.nx-zona-tip-6, .nx-zona-tip-9, .nx-zona-nerepartizati { border-top-color: #9aa8b0; }
.nx-zona-card.is-plina { box-shadow: 0 0 0 2px rgba(190, 18, 60, 0.35); }

.nx-zona-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.4rem; }
.nx-zona-titlu { font-size: 1.02rem; font-weight: 700; margin: 0; color: var(--nx-ink); }
.nx-zona-ocupare { font-weight: 700; font-size: 1rem; padding: 0.1rem 0.55rem; border-radius: 0.45rem; background: var(--nx-mist); color: var(--nx-ink); white-space: nowrap; }
.nx-zona-card.is-plina .nx-zona-ocupare { background: rgba(190, 18, 60, 0.12); color: #9f1239; }
html[data-theme="dark"] .nx-zona-card.is-plina .nx-zona-ocupare { color: #fda4af; }
.nx-zona-plina { margin: 0 0 0.4rem; font-size: 0.82rem; font-weight: 600; color: #9f1239; }
html[data-theme="dark"] .nx-zona-plina { color: #fda4af; }

.nx-boxuri { display: grid; gap: 0.45rem; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); margin-bottom: 0.4rem; }
.nx-box { border: 1px dashed var(--nx-line); border-radius: 0.55rem; padding: 0.35rem 0.45rem; min-width: 0; font-size: 0.88rem; }
.nx-box.is-ocupat { border-style: solid; background: var(--nx-mist); }
.nx-box-cod { display: block; font-weight: 700; font-family: Consolas, monospace; color: var(--nx-ink); }
.nx-box-chip { display: inline-block; margin: 0.1rem 0.1rem 0.1rem 0; padding: 0 0.4rem; border-radius: 0.35rem; background: var(--nx-mist); font-family: Consolas, monospace; font-size: 0.85rem; }
.nx-box-chip.is-inactiv { opacity: 0.5; text-decoration: line-through; }

.nx-zona-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.nx-zona-lista > li { border: 1px solid var(--nx-line); border-radius: 0.55rem; padding: 0.35rem 0.5rem; }
.nx-zona-pacient { min-width: 0; }
.nx-zona-pacient-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; }
.nx-zona-pacient .nx-patient { font-weight: 600; overflow-wrap: anywhere; }
.nx-zona-pacient .nx-actions { margin-top: 0.25rem; }
.nx-zona-pacient.has-alarma .nx-vitals { color: #9f1239; }
/* vitalele din cardul unui box îngust („TA 150/95 · P 112 · 38,9° · SpO₂ 91 · FR 26”) se rup pe rânduri, nu ies din card */
.nx-zona-pacient .nx-vitals { white-space: normal; overflow-wrap: anywhere; }
html[data-theme="dark"] .nx-zona-pacient.has-alarma .nx-vitals { color: #fda4af; }
.nx-loc { white-space: nowrap; }

@media print {
    .nx-vg { grid-template-columns: repeat(3, 1fr); gap: 0.25rem; }
    .nx-vg-panel { padding: 0.15rem 0.3rem; border-radius: 0.25rem; }
    .nx-vg-banda { fill: #0d8f7f; fill-opacity: 0.12; }
    .nx-vg-linie.s1 { stroke: #0a6b5f; }
    .nx-vg-alarma { fill: #be123c; }
}

/* mobil: tabloul pe zone */
.m-zona { border-top: 4px solid var(--nx-sea); }
.m-zona.is-plina summary .m-badge { background: rgba(190, 18, 60, 0.15); color: #9f1239; }
.m-alarma { color: #9f1239; font-weight: 700; }
html[data-theme="dark"] .m-alarma { color: #fda4af; }
.print-mic { font-size: 8.5pt; color: #444; }
.print-vitale { font-size: 9pt; }
.print-page .nx-vg-panel { background: #fff; color: #12212b; }
.nx-vitale-garda.is-mobil .m-grid2 > label { min-width: 0; }
.nx-vitale-garda.is-mobil .m-grid2 input { width: 100%; min-width: 0; }
.nx-muta-zona select { max-width: 100%; }

/* ---------- CNAS online: stările operațiilor și XML-ul cererilor ---------- */
.nx-ok-text { color: var(--nx-sea-deep); font-weight: 600; }
.nx-warn-text { color: var(--nx-warn); }
.nx-cod-xml {
    max-height: 22rem;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.78rem;
    background: var(--nx-mist);
    border: 1px solid var(--nx-line);
    border-radius: 0.4rem;
    padding: 0.5rem;
}

/* DRG: rândurile registrului deschid vederea pe caz */
.nx-row-click { cursor: pointer; }
.nx-row-click:hover td { background: var(--nx-hover, rgba(0,0,0,.035)); }

/* ---------- Semnături electronice: circuitul de semnare, verificarea (validă / nedeterminată / invalidă), PDF ---------- */
.nx-semn { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid currentColor; white-space: nowrap; line-height: 1.5; }
.nx-semn-valida { color: var(--nx-sea-deep); background: color-mix(in srgb, var(--nx-sea-deep) 10%, var(--nx-surface)); }
.nx-semn-nedeterminata { color: var(--nx-warn); background: color-mix(in srgb, var(--nx-warn) 12%, var(--nx-surface)); }
.nx-semn-invalida { color: var(--nx-danger); background: color-mix(in srgb, var(--nx-danger) 12%, var(--nx-surface)); }
.nx-semn-anulata { color: var(--nx-muted); background: transparent; }
.nx-semnaturi { border: 1px solid var(--nx-line); border-radius: .5rem; padding: .75rem; margin: .25rem 0 .6rem; background: var(--nx-surface); }
.nx-semnaturi h3 { font-size: 1rem; }
.nx-semn-detalii { font-size: .82rem; color: var(--nx-muted); overflow-wrap: anywhere; }
.nx-semn-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: .5rem; align-items: end; }
.nx-semn-mono { font-family: Consolas, "Courier New", monospace; font-size: .78rem; overflow-wrap: anywhere; }
.nx-semn-semnatar { border-left: 3px solid var(--nx-line); padding: .25rem 0 .25rem .6rem; margin: .4rem 0; }
.nx-semn-mesaje { margin: .2rem 0 .2rem 1.1rem; padding: 0; font-size: .82rem; }
.nx-verificare-titlu { font-size: .95rem; font-weight: 600; margin: .8rem 0 .2rem; }
.nx-row-semnaturi > td { background: transparent; }
.print-page .nx-semn-detalii, .print-page .nx-semn-mesaje { color: #333; font-size: 8.5pt; }
.print-page .nx-semn { border-color: #999; color: #111; background: transparent; }

/* ---------- Val. 4, clinic: pașii unui asistent (cereri în bloc), liste de definiții, insigne ---------- */
.nx-pasi { display: flex; flex-wrap: wrap; gap: .35rem .9rem; list-style: none; padding: 0; margin: 0; counter-reset: none; }
.nx-pasi li { font-size: .88rem; color: var(--nx-muted); }
.nx-pasi li.is-active button { color: var(--nx-sea-deep); font-weight: 700; }
.nx-pasi li.is-done button { color: var(--nx-text); }
.nx-dl { display: grid; grid-template-columns: minmax(7rem, max-content) 1fr; gap: .2rem .8rem; margin: .3rem 0 .6rem; }
.nx-dl dt { font-weight: 600; color: var(--nx-muted); font-size: .85rem; }
.nx-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .nx-dl { grid-template-columns: 1fr; } .nx-dl dd { margin-bottom: .3rem; } }
.nx-badge { display: inline-block; padding: .05rem .45rem; border-radius: .35rem; font-size: .78rem; font-weight: 600; background: var(--nx-mist); color: var(--nx-text); border: 1px solid var(--nx-line); white-space: nowrap; }
.nx-badge-warn { color: var(--nx-warn); border-color: currentColor; background: color-mix(in srgb, var(--nx-warn) 10%, var(--nx-surface)); }
.nx-badge-danger { color: var(--nx-danger); border-color: currentColor; background: color-mix(in srgb, var(--nx-danger) 10%, var(--nx-surface)); }
/* prezență confirmată în agenda Programări (§3.145); textul spune și el „confirmată”, culoarea nu e singurul semn */
.nx-badge-ok { color: var(--nx-focus); border-color: currentColor; background: color-mix(in srgb, var(--nx-sea) 10%, var(--nx-surface)); }
.nx-avertizari { border-left: 3px solid var(--nx-warn); padding: .3rem 0 .3rem .6rem; margin: .4rem 0; font-size: .88rem; }
.nx-avertizari li { margin-bottom: .15rem; }

/* Mesajul de la pornirea eșuată a circuitului (js/pornire-blazor.js) */
.nx-eroare-pornire {
    padding: 1.5rem;
    font-family: sans-serif;
}

.nx-eroare-pornire pre {
    white-space: pre-wrap;
}

/* Fereastra „Alegeți un PIN” a lucrului fără rețea (js/offline-mobil.js) */
dialog.nx-pin {
    max-width: 22rem;
    border: 1px solid var(--nx-line, #d8dee4);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

dialog.nx-pin form {
    display: grid;
    gap: 0.4rem;
}

dialog.nx-pin input {
    font-size: 1.3rem;
    letter-spacing: 0.3rem;
    padding: 0.35rem 0.5rem;
}

dialog.nx-pin .nx-pin-eroare {
    color: #c0392b;
    min-height: 1.2rem;
    margin: 0;
}

dialog.nx-pin .nx-pin-butoane {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Siguranța pacientului (val. 5): alerte de medicație, valori critice, brățara, scanarea ---------- */
.nx-alerte-siguranta { border-left: 3px solid var(--nx-warn); padding: .3rem 0 .3rem .6rem; margin: .4rem 0; font-size: .88rem; }
.nx-alerte-siguranta.is-blocant { border-left-color: var(--nx-danger); background: color-mix(in srgb, var(--nx-danger) 6%, transparent); }
.nx-alerte-siguranta li { margin-bottom: .15rem; }
.nx-alerta-blocanta { color: var(--nx-danger); }
.nx-bratara { display: flex; align-items: center; gap: 4mm; background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; box-sizing: border-box; overflow: hidden; border: 1px dashed #bbb; padding: 1.5mm 4mm 1.5mm 30mm; }
.nx-bratara-adult { width: 280mm; height: 25mm; }
.nx-bratara-copil { width: 180mm; height: 25mm; padding-left: 20mm; }
.nx-bratara-eticheta { width: 50mm; height: 25mm; flex-direction: column; align-items: stretch; gap: 0; padding: 1mm 2mm; }
.nx-bratara-text { flex: 1 1 auto; min-width: 0; }
.nx-bratara-nume { font-size: 11pt; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-bratara-rand { font-size: 7.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-bratara-alergii { font-size: 8pt; font-weight: 700; border: 1px solid #000; padding: 0 1mm; display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-bratara-cod svg { height: 20mm; width: auto; display: block; }
.nx-bratara-eticheta .nx-bratara-cod svg { width: 100%; height: 12mm; }
.nx-bratara-eticheta .nx-bratara-nume { font-size: 8.5pt; }
@media print { .nx-bratara { border: none; } }
.m-scan-video { width: 100%; max-height: 45vh; background: #000; border-radius: .5rem; object-fit: cover; }
.m-scan-pas { border: 1px solid var(--nx-line); border-radius: .6rem; padding: .6rem; margin-bottom: .6rem; }
.m-scan-pas.is-ok { border-color: var(--nx-ok, #2e7d32); }
.m-scan-pas.is-err { border-color: var(--nx-danger); background: color-mix(in srgb, var(--nx-danger) 8%, transparent); }
.m-scan-mare { font-size: 1.05rem; font-weight: 700; }

/* ---- Val. 5: ecranul de blocare la inactivitate, codul QR și codurile de recuperare (2FA) ---- */
.nx-blocare {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(18, 38, 47, 0.92);
    backdrop-filter: blur(6px);
}
.nx-blocare-card {
    width: 100%;
    max-width: 26rem;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: var(--nx-surface, #fff);
    color: var(--nx-ink, #12262f);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}
.nx-blocare-titlu { font-size: 1.35rem; margin: 0 0 0.75rem; }
.nx-blocare-actiuni { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.nx-qr { background: #fff; padding: 0.5rem; border-radius: 0.5rem; max-width: 100%; height: auto; }
.nx-coduri-recuperare {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.25rem 1rem;
    padding-left: 1.25rem;
    font-size: 1.05rem;
}
@media print { .nx-blocare { display: none; } }

/* Tabloul veniturilor / DRG (/venituri): bara relativă a venitului estimat pe lună (decorativă; valoarea e în coloana alăturată) */
.nx-bara-venit { height: .6rem; min-width: 1px; border-radius: 2px; background: var(--nx-sea); }

/* Asistentul de codificare de la externare: lista constatărilor de completitudine */
.nx-completitudine { border: 1px solid var(--nx-line); border-radius: .5rem; padding: .6rem .8rem; margin: .5rem 0 1rem; }
.nx-completitudine ul { margin: .3rem 0 0; padding-left: 1.1rem; }
.nx-completitudine .nx-zona { font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--nx-muted); margin-right: .35rem; }

/* Sistem → Platformă → Copia de urgență */
.nx-copie-urgenta-stare { display: grid; grid-template-columns: max-content 1fr; gap: .2rem 1rem; }
.nx-copie-urgenta-stare dt { font-weight: 600; }
.nx-copie-urgenta-stare dd { margin: 0; }

/* Selectorul de dată (js/calendar.js): fereastra proprie, în culorile temei, în locul calendarului nativ din Chrome / Edge / Firefox.
   html.nx-cal-activ e pus de script (lipsește pe ecranele tactile, unde rămâne selectorul sistemului). Iconița e fundal: în DOM-ul
   randat de Blazor nu se adaugă nimic. Firefox își păstrează iconița lui (nu poate fi ascunsă), deci nu o desenăm și pe a noastră. */
html.nx-cal-activ input[type="date"]::-webkit-calendar-picker-indicator,
html.nx-cal-activ input[type="datetime-local"]::-webkit-calendar-picker-indicator { display: none; }
html.nx-cal-activ input[type="date"]:not(:disabled):not([readonly]),
html.nx-cal-activ input[type="datetime-local"]:not(:disabled):not([readonly]) {
    padding-right: 2.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%235c6b73'%3E%3Cpath d='M4 .5a.5.5 0 0 1 1 0V1h6V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1zM2 5v9a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5zm2 2h2v2H4zm3 0h2v2H7zm3 0h2v2h-2zm-6 3h2v2H4zm3 0h2v2H7z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1rem;
    cursor: text;
}
html.nx-cal-activ[data-theme="dark"] input[type="date"]:not(:disabled):not([readonly]),
html.nx-cal-activ[data-theme="dark"] input[type="datetime-local"]:not(:disabled):not([readonly]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2393a6b0'%3E%3Cpath d='M4 .5a.5.5 0 0 1 1 0V1h6V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1zM2 5v9a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V5zm2 2h2v2H4zm3 0h2v2H7zm3 0h2v2h-2zm-6 3h2v2H4zm3 0h2v2H7z'/%3E%3C/svg%3E");
}
@supports (-moz-appearance: none) {
    html.nx-cal-activ input[type="date"]:not(:disabled):not([readonly]),
    html.nx-cal-activ input[type="datetime-local"]:not(:disabled):not([readonly]) { background-image: none !important; padding-right: 0.85rem; }
}
.nx-cal { position: fixed; z-index: 2100; width: 18.5rem; padding: .6rem; background: var(--nx-surface); color: var(--nx-text); border: 1px solid var(--nx-line-control); border-radius: .6rem; box-shadow: 0 10px 28px rgba(18, 33, 43, .22); font-size: .875rem; }
.nx-cal[hidden] { display: none; }
.nx-cal-cap { display: flex; gap: .3rem; align-items: center; margin-bottom: .4rem; }
.nx-cal-cap select { flex: 1 1 auto; min-width: 0; padding: .2rem .3rem; border: 1px solid var(--nx-line-control); border-radius: .4rem; background: var(--nx-surface); color: var(--nx-text); font: inherit; }
.nx-cal-cap .nx-cal-an { flex: 0 0 5rem; }
.nx-cal-nav { flex: 0 0 2rem; height: 2rem; border: 1px solid var(--nx-line-control); border-radius: .4rem; background: var(--nx-surface); color: var(--nx-text); font-size: 1.1rem; line-height: 1; }
.nx-cal-nav:hover { background: var(--nx-mist); }
.nx-cal-grila { width: 100%; border-collapse: collapse; table-layout: fixed; }
.nx-cal-grila th { text-align: center; font-size: .75rem; font-weight: 600; color: var(--nx-muted); padding: .2rem 0; }
.nx-cal-grila td { padding: 1px; text-align: center; }
.nx-cal-zi { width: 100%; height: 2.1rem; border: 1px solid transparent; border-radius: .4rem; background: transparent; color: var(--nx-text); font: inherit; }
.nx-cal-zi:hover:not(:disabled) { background: var(--nx-mist); }
.nx-cal-zi.nx-cal-alta { color: var(--nx-muted); }
.nx-cal-zi[aria-current="date"] { border-color: var(--nx-sea); font-weight: 600; }
.nx-cal-zi.nx-cal-ales, .nx-cal-zi.nx-cal-ales:hover { background: var(--nx-sea); border-color: var(--nx-sea); color: #fff; font-weight: 600; }
.nx-cal-zi:disabled { opacity: .35; cursor: not-allowed; }
.nx-cal-zi:focus-visible, .nx-cal-nav:focus-visible, .nx-cal-cap select:focus-visible { outline: 3px solid var(--nx-focus); outline-offset: 1px; }
.nx-cal-jos { display: flex; gap: .35rem; align-items: center; justify-content: flex-end; margin-top: .5rem; flex-wrap: wrap; }
.nx-cal-jos .btn { padding: .2rem .55rem; font-size: .8rem; transform: none; }
.nx-cal-btn { padding: .2rem .55rem; font-size: .8rem; border: 1px solid var(--nx-line-control); border-radius: .4rem; background: var(--nx-surface); color: var(--nx-text); }
.nx-cal-btn:hover { background: var(--nx-mist); }
.nx-cal-btn:focus-visible { outline: 3px solid var(--nx-focus); outline-offset: 1px; }
.nx-cal-jos .nx-cal-ora { width: 6.5rem; margin-right: auto; padding: .2rem .4rem; }
.nx-cal-jos .nx-cal-ora[hidden] { display: none; }

/* panoul directorului pe telefon (/m/director): valoarea, luna trecută și tendința (verde = bine, roșu = rău, gri = neutru) */
.m-dir-val { font-family: var(--nx-font-display); font-size: 30px; font-weight: 600; color: var(--nx-ink); line-height: 1.1; }
.m-dir-u { font-size: 15px; color: var(--nx-muted); margin-left: 0.25rem; }
.m-dir-trend { font-size: 15px; font-weight: 600; }
.m-dir-trend.is-bine { color: #2e7d32; }
.m-dir-trend.is-rau { color: var(--nx-danger); }
.m-dir-trend.is-neutru { color: var(--nx-muted); }
:root[data-theme="dark"] .m-dir-trend.is-bine { color: #81c784; }
/* tabla paturilor (Internări → Tabla paturilor): o casetă pe pat, colorată după stare */
.nx-tabla-totaluri { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 1rem; }
.nx-tabla-total { padding: .3rem .7rem; border-radius: .5rem; }
.nx-tabla-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; align-items: start; }
@media (max-width: 1100px) { .nx-tabla-layout { grid-template-columns: minmax(0, 1fr); } }
.nx-tabla-salon { margin-bottom: .75rem; }
.nx-tabla-pat { min-width: 10rem; max-width: 15rem; padding: .35rem .55rem; border-radius: .45rem; border: 1px solid var(--nx-line); border-left-width: 6px; background: var(--nx-surface); }
.nx-tabla-pat.is-selected { outline: 3px solid var(--nx-focus); outline-offset: 1px; }
.nx-tabla-pat-liber { border-left-color: #2e9d5b; background: rgba(46, 157, 91, .10); }
.nx-tabla-pat-ocupat { border-left-color: #2f6fb3; background: rgba(47, 111, 179, .10); }
.nx-tabla-pat-rezervat { border-left-color: #c58a00; background: rgba(197, 138, 0, .13); }
.nx-tabla-pat-blocat { border-left-color: #6b7280; background: repeating-linear-gradient(135deg, rgba(107, 114, 128, .16) 0 6px, rgba(107, 114, 128, .05) 6px 12px); }
