/* ============================================================================
   cloudly.gg - panel "nx"
   Warstwa wizualna nowego panelu. Nic tu nie zależy od bootstrapa, jQuery ani
   od /assets-v2 - to jest osobny, zamknięty system. Stary panel zostaje nietknięty.

   Spis:
     1. Tokeny (kolory, typografia, spacing, cienie)
     2. Reset i podstawy
     3. Szkielet (sidebar / topbar / content)
     4. Nawigacja
     5. Komponenty (card, button, badge, stat, table, form, alert, empty)
     6. Karty usług
     7. Toasty
     8. Narzędzia i responsywność
   ========================================================================== */

/* ---------------------------------------------------------------- 1. TOKENY */

:root {
    /* Marka */
    --nx-brand:         #216FED;   /* wypełnienie */
    --nx-brand-hi:      #3B8CFF;   /* akcent tekstowy na tincie */
    --nx-brand-lo:      #1058CB;   /* hover */
    --nx-brand-press:   #0E4CAF;   /* wciśnięcie */
    --nx-brand-ink:     #FFFFFF;

    /* Semantyka statusów */
    --nx-ok:            #22C55E;
    --nx-warn:          #F59E0B;
    --nx-danger:        #F04438;
    --nx-danger-lo:     #D92D20;
    --nx-danger-press:  #B42318;
    --nx-info:          #38BDF8;

    /* Typografia */
    --nx-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --nx-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

    /* Skala odstępów (4px) */
    --nx-1: 4px;   --nx-2: 8px;   --nx-3: 12px;  --nx-4: 16px;
    --nx-5: 20px;  --nx-6: 24px;  --nx-8: 32px;  --nx-10: 40px;
    --nx-12: 48px; --nx-16: 64px;

    /* Zaokrąglenia */
    --nx-r-btn: 6px;   /* kontrolki: przyciski, pola, ikony - celowo ostrzejsze niż karty */
    --nx-r-sm: 8px;
    --nx-r:    12px;
    --nx-r-lg: 16px;
    --nx-r-xl: 20px;
    --nx-r-full: 999px;

    /* Szkielet */
    --nx-side-w: 264px;
    --nx-top-h:  64px;

    --nx-ease: cubic-bezier(.4, 0, .2, 1);
}

/* Motyw ciemny - domyślny */
:root,
[data-nx-theme="dark"] {
    --nx-bg:            #0A0D14;
    --nx-bg-soft:       #0E121B;
    --nx-surface:       #131824;
    --nx-surface-2:     #19202F;
    --nx-surface-3:     #1F2839;

    --nx-line:          rgba(255, 255, 255, .07);
    --nx-line-hi:       rgba(255, 255, 255, .13);

    --nx-text:          #E9EDF6;
    --nx-text-dim:      #9AA4B8;
    --nx-text-mute:     #6B7688;

    --nx-shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
    --nx-shadow:    0 8px 24px -8px rgba(0, 0, 0, .55);
    --nx-shadow-lg: 0 24px 56px -20px rgba(0, 0, 0, .70);
    --nx-glow:      0 0 0 1px rgba(33, 111, 237, .35), 0 8px 28px -10px rgba(33, 111, 237, .55);

    --nx-tint:      rgba(33, 111, 237, .12);
    --nx-tint-hi:   rgba(33, 111, 237, .20);

    color-scheme: dark;
}

/* Motyw jasny - te same komponenty, inne tokeny.
   Marka idzie o dwa stopnie ciemniej: ten sam #216FED na jasnym tle wygląda jak
   neon i gryzie się z resztą, a akcenty tekstowe na jasnym tincie muszą mieć kontrast. */
[data-nx-theme="light"] {
    --nx-brand:         #1D5FD1;
    --nx-brand-hi:      #1B51B4;
    --nx-brand-lo:      #174CA8;
    --nx-brand-press:   #133C86;

    --nx-danger:        #D92D20;
    --nx-danger-lo:     #B42318;
    --nx-danger-press:  #912018;

    --nx-bg:            #F4F6FB;
    --nx-bg-soft:       #FFFFFF;
    --nx-surface:       #FFFFFF;
    --nx-surface-2:     #F3F6FC;
    --nx-surface-3:     #E9EEF8;

    --nx-line:          rgba(16, 24, 40, .09);
    --nx-line-hi:       rgba(16, 24, 40, .16);

    --nx-text:          #0F1729;
    --nx-text-dim:      #566076;
    --nx-text-mute:     #7D879C;

    --nx-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --nx-shadow:    0 8px 24px -12px rgba(16, 24, 40, .18);
    --nx-shadow-lg: 0 24px 56px -24px rgba(16, 24, 40, .24);
    --nx-glow:      0 0 0 1px rgba(33, 111, 237, .25), 0 8px 28px -14px rgba(33, 111, 237, .45);

    --nx-tint:      rgba(33, 111, 237, .08);
    --nx-tint-hi:   rgba(33, 111, 237, .14);

    color-scheme: light;
}

/* ------------------------------------------------------- 2. RESET I PODSTAWY */

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

html.nx-html { -webkit-text-size-adjust: 100%; }

body.nx {
    margin: 0;
    min-height: 100vh;
    background: var(--nx-bg);
    color: var(--nx-text);
    font-family: var(--nx-font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Delikatna poświata w tle - daje głębię bez obrazków */
body.nx::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(900px 500px at 78% -10%, rgba(33, 111, 237, .10), transparent 65%),
        radial-gradient(700px 420px at 0% 100%, rgba(59, 140, 255, .06), transparent 60%);
}

.nx h1, .nx h2, .nx h3, .nx h4, .nx h5 { margin: 0; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
.nx h1 { font-size: 26px; }
.nx h2 { font-size: 20px; }
.nx h3 { font-size: 17px; }
.nx h4 { font-size: 15px; }
.nx p  { margin: 0; }

.nx a { color: inherit; text-decoration: none; }
.nx img { max-width: 100%; display: block; }
.nx svg { flex: none; }

.nx ::-webkit-scrollbar { width: 10px; height: 10px; }
.nx ::-webkit-scrollbar-track { background: transparent; }
.nx ::-webkit-scrollbar-thumb { background: var(--nx-line-hi); border-radius: var(--nx-r-full); border: 3px solid transparent; background-clip: content-box; }
.nx ::-webkit-scrollbar-thumb:hover { background: var(--nx-text-mute); background-clip: content-box; }

.nx :focus-visible { outline: 2px solid var(--nx-brand-hi); outline-offset: 2px; border-radius: var(--nx-r-sm); }

.nx summary { list-style: none; }
.nx summary::-webkit-details-marker { display: none; }

/* Atrybut hidden musi wygrywać z display z komponentów (flex/grid), inaczej nic nie chowa */
.nx [hidden] { display: none !important; }

/* ------------------------------------------------------------ 3. SZKIELET */

.nx-shell { position: relative; z-index: 1; min-height: 100vh; }

/* --- Sidebar --- */
.nx-side {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--nx-side-w);
    display: flex;
    flex-direction: column;
    background: var(--nx-bg-soft);
    border-right: 1px solid var(--nx-line);
    z-index: 60;
    transition: transform .28s var(--nx-ease);
}

.nx-side__head {
    height: var(--nx-top-h);
    display: flex;
    align-items: center;
    gap: var(--nx-3);
    padding: 0 var(--nx-5);
    border-bottom: 1px solid var(--nx-line);
    flex: none;
}

.nx-logo img { height: 26px; width: auto; }

.nx-side__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--nx-5) var(--nx-3) var(--nx-4);
}

.nx-side__foot {
    flex: none;
    padding: var(--nx-4) var(--nx-5);
    border-top: 1px solid var(--nx-line);
    color: var(--nx-text-mute);
    font-size: 11px;
    line-height: 1.6;
}
/* „Powered by" - mniejsze i bledsze od nazwy panelu, żeby nie konkurowało z marką */
.nx-side__powered { margin-top: 2px; font-size: 10.5px; opacity: .75; }
.nx-side__powered a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }
.nx-side__powered a:hover { color: var(--nx-text-dim); }

/* Saldo jako chip przy pozycji "Portfel" w menu */
.nx-nav__chip {
    flex: none;
    padding: 2px 9px;
    border-radius: var(--nx-r-full);
    background: var(--nx-tint);
    color: var(--nx-brand-hi);
    font-size: 11.5px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.nx-nav__link:hover .nx-nav__chip { background: var(--nx-tint-hi); }

/* --- Topbar --- */
.nx-top {
    position: sticky; top: 0;
    height: var(--nx-top-h);
    display: flex; align-items: center; gap: var(--nx-3);
    padding: 0 var(--nx-6);
    /* Nieprzezroczyste tło zamiast rozmycia: efekt prawie ten sam, a przeglądarka
       nie przelicza rozmycia treści przy każdym odmalowaniu konsoli pod paskiem. */
    background: var(--nx-bg);
    border-bottom: 1px solid var(--nx-line);
    z-index: 50;
}
.nx-top__title { font-size: 15px; font-weight: 600; }
.nx-top__spacer { flex: 1; }

/* --- Content --- */
.nx-main { margin-left: var(--nx-side-w); min-height: 100vh; display: flex; flex-direction: column; }
.nx-content { flex: 1; padding: var(--nx-6) var(--nx-5) var(--nx-10); }
.nx-wrap { width: 100%; max-width: 1760px; margin: 0 auto; }

/* --- Wejście treści po wczytaniu strony ---
   Panel to zwykłe przeładowania, więc bez tego każda zakładka "wskakuje" twardo.
   Elementy najwyższego poziomu pojawiają się kaskadowo, ale krótko - to ma być
   wrażenie miękkiego wejścia, nie pokaz slajdów. */
@keyframes nx-enter {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}
.nx-wrap > * {
    animation: nx-enter .34s var(--nx-ease) both;
}
/* Okna modalne żyją własnym cyklem (opacity + visibility) - animacja wejścia
   zostawiłaby im opacity:1 na stałe i zepsuła zamykanie. */
.nx-wrap > .nx-modal { animation: none; }
.nx-wrap > :nth-child(2) { animation-delay: .05s; }
.nx-wrap > :nth-child(3) { animation-delay: .10s; }
.nx-wrap > :nth-child(4) { animation-delay: .15s; }
.nx-wrap > :nth-child(5) { animation-delay: .19s; }
.nx-wrap > :nth-child(n+6) { animation-delay: .22s; }

/* --- Pasek postępu przy przechodzeniu między zakładkami --- */
.nx-load {
    position: fixed; top: 0; left: 0;
    height: 2px; width: 0;
    z-index: 400;
    background: linear-gradient(90deg, var(--nx-brand), var(--nx-brand-hi));
    box-shadow: 0 0 10px rgba(59, 140, 255, .7);
    opacity: 0;
    transition: width .35s var(--nx-ease), opacity .2s var(--nx-ease);
    pointer-events: none;
}
.nx-load.is-active { opacity: 1; }

/* Backdrop dla sidebara na mobile */
.nx-backdrop {
    position: fixed; inset: 0;
    background: rgba(5, 8, 14, .68);
    opacity: 0; visibility: hidden;
    transition: opacity .25s var(--nx-ease), visibility .25s;
    z-index: 55;
}
body.nx-side-open .nx-backdrop { opacity: 1; visibility: visible; }

/* ----------------------------------------------------------- 4. NAWIGACJA */

.nx-nav { list-style: none; margin: 0; padding: 0; }
.nx-nav + .nx-nav { margin-top: var(--nx-5); }

.nx-nav__title {
    padding: 0 var(--nx-3) var(--nx-2);
    color: var(--nx-text-mute);
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em;
}

.nx-nav__link {
    position: relative;
    display: flex; align-items: center; gap: var(--nx-3);
    padding: 9px var(--nx-3);
    margin-bottom: 2px;
    border-radius: var(--nx-r-sm);
    /* pelny kolor tekstu - przygaszony wygladal jak pozycja nieaktywna */
    color: var(--nx-text);
    font-size: 13.5px; font-weight: 550;
    cursor: pointer;
    transition: background .16s var(--nx-ease), color .16s var(--nx-ease);
}
.nx-nav__link:hover { background: var(--nx-surface-2); color: var(--nx-text); }
.nx-nav__link svg { width: 18px; height: 18px; opacity: 1; }
.nx-nav__link.is-active {
    background: var(--nx-tint);
    color: var(--nx-text);
    font-weight: 600;
}
.nx-nav__link.is-active::before {
    content: "";
    position: absolute; left: 0; top: 50%;
    transform: translate(-11px, -50%);
    width: 3px; height: 18px;
    border-radius: 0 3px 3px 0;
    background: var(--nx-brand-hi);
    box-shadow: 0 0 12px rgba(59, 140, 255, .8);
}
.nx-nav__link.is-active svg { color: var(--nx-brand-hi); opacity: 1; }

.nx-nav__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nx-nav__count {
    flex: none;
    min-width: 20px; height: 20px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--nx-r-full);
    background: var(--nx-surface-3);
    color: var(--nx-text-dim);
    font-size: 11px; font-weight: 700;
}

/* Rozwijane grupy - natywne <details>; rozwijanie animuje JS w szkielecie,
   bo przeglądarka chowa zawartość <details> skokowo i nie da się jej złapać CSS-em. */
.nx-nav details > summary { list-style: none; }
.nx-nav details > summary::-webkit-details-marker { display: none; }
.nx-nav__caret { transition: transform .22s var(--nx-ease); opacity: .85; width: 14px; height: 14px; }
.nx-nav details[open] > summary .nx-nav__caret,
.nx-nav details.is-opening > summary .nx-nav__caret { transform: rotate(90deg); }
/* Strzałka wraca od razu przy kliknięciu, a nie dopiero po zwinięciu listy */
.nx-nav details.is-closing > summary .nx-nav__caret { transform: none; }

.nx-nav__sub { list-style: none; margin: 2px 0 var(--nx-2); padding: 0 0 0 var(--nx-4); }
.nx-nav__sub-link {
    position: relative;
    display: flex; align-items: center; gap: var(--nx-3);
    padding: 7px var(--nx-3);
    border-radius: var(--nx-r-sm);
    color: var(--nx-text);
    font-size: 13px;
    transition: background .16s var(--nx-ease), color .16s var(--nx-ease);
}
.nx-nav__sub-link::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 1px; background: var(--nx-line);
    transform: translateX(-8px);
}
.nx-nav__sub-link:hover { background: var(--nx-surface-2); color: var(--nx-text); }
.nx-nav__sub-link.is-active { color: var(--nx-text); background: var(--nx-tint); }
.nx-nav__sub-link img { width: 20px; height: 20px; border-radius: 5px; object-fit: contain; }
.nx-nav__sub-link .nx-dot { margin-left: auto; }

/* Flaga lokalizacji przy produkcie - obramowanie, bo biały pas polskiej flagi
   zlewałby się z jasnym motywem, a granat unijnej z ciemnym */
.nx-nav__sub-link .nx-nav__flag {
    margin-left: auto;
    width: auto; height: 13px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px var(--nx-line-hi);
}

/* Kropka statusu */
.nx-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--nx-text-mute); }
.nx-dot--ok     { background: var(--nx-ok);     box-shadow: 0 0 0 3px rgba(34, 197, 94, .15); }
.nx-dot--warn   { background: var(--nx-warn);   box-shadow: 0 0 0 3px rgba(245, 158, 11, .15); }
.nx-dot--danger { background: var(--nx-danger); box-shadow: 0 0 0 3px rgba(240, 68, 56, .15); }

/* --------------------------------------------------------- 5. KOMPONENTY */

/* --- Ikonowy przycisk (topbar, karty) --- */
.nx-icon-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r-btn);
    background: transparent;
    color: var(--nx-text-dim);
    cursor: pointer;
    transition: background .14s var(--nx-ease), color .14s var(--nx-ease), border-color .14s var(--nx-ease);
}
.nx-icon-btn:hover { color: var(--nx-text); background: var(--nx-surface-2); }
.nx-icon-btn:active { background: var(--nx-surface-3); }
.nx-icon-btn svg { width: 17px; height: 17px; }

/* --- Przyciski ---
   Styl płaski: jeden kolor tła, cienki obrys, bez gradientu, poświaty i podskoku.
   Cała reakcja na hover/active dzieje się na kolorze tła - nic się nie rusza. */
.nx-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--nx-2);
    padding: 8px var(--nx-4);
    border: 1px solid transparent;
    border-radius: var(--nx-r-btn);
    font-family: inherit; font-size: 13.5px; font-weight: 550;
    line-height: 1.25;
    letter-spacing: -.005em;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none;
    transition: background-color .14s var(--nx-ease), border-color .14s var(--nx-ease), color .14s var(--nx-ease);
}
.nx-btn svg { width: 16px; height: 16px; }
.nx-btn:disabled, .nx-btn.is-disabled { opacity: .45; pointer-events: none; }

.nx-btn--primary {
    background-color: var(--nx-brand);
    border-color: transparent;   /* pełny kolor, bez jaśniejszej obwódki */
    color: var(--nx-brand-ink);
}
.nx-btn--primary:hover  { background-color: var(--nx-brand-lo); }
.nx-btn--primary:active { background-color: var(--nx-brand-press); }

.nx-btn--ghost {
    background-color: transparent;
    border-color: var(--nx-line-hi);
    color: var(--nx-text);
}
.nx-btn--ghost:hover  { background-color: var(--nx-surface-2); }
.nx-btn--ghost:active { background-color: var(--nx-surface-3); }

.nx-btn--soft {
    background-color: var(--nx-tint);
    border-color: transparent;
    color: var(--nx-brand-hi);
}
.nx-btn--soft:hover { background-color: var(--nx-tint-hi); }

/* Zielony guzik - dla akcji, która wyprowadza z problemu (przejście na płatny plan),
   a nie tylko go odsuwa. Kolory z palety stanów, nie z marki. */
.nx-btn--ok {
    background-color: var(--nx-ok); border-color: transparent; color: #04140A; font-weight: 700;
}
.nx-btn--ok:hover { background-color: #16A34A; color: #04140A; }
.nx-btn--ok:active { background-color: #15803D; }

.nx-btn--danger {
    background-color: var(--nx-danger);
    border-color: transparent;
    color: #fff;
}
.nx-btn--danger:hover  { background-color: var(--nx-danger-lo); }
.nx-btn--danger:active { background-color: var(--nx-danger-press); }

.nx-btn--sm { padding: 5px var(--nx-3); font-size: 12.5px; }
.nx-btn--lg { padding: 11px var(--nx-6); font-size: 14.5px; }
.nx-btn--block { width: 100%; }

/* --- Karty --- */
.nx-card {
    position: relative;
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    box-shadow: var(--nx-shadow-sm);
}
.nx-card__head {
    display: flex; align-items: center; gap: var(--nx-3);
    padding: var(--nx-4) var(--nx-5);
    border-bottom: 1px solid var(--nx-line);
}
.nx-card__title { font-size: 14.5px; font-weight: 650; }
.nx-card__icon {
    width: 30px; height: 30px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-tint);
    color: var(--nx-brand-hi);
}
.nx-card__icon svg { width: 15px; height: 15px; }
.nx-card__body { padding: var(--nx-5); }
.nx-card__foot { padding: var(--nx-4) var(--nx-5); border-top: 1px solid var(--nx-line); }

/* --- Hero / nagłówek strony --- */
.nx-page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: var(--nx-4);
    margin-bottom: var(--nx-6);
}
.nx-page-head__sub { color: var(--nx-text-dim); margin-top: 6px; font-size: 13.5px; }
.nx-page-head__actions { display: flex; gap: var(--nx-2); flex-wrap: wrap; }

/* --- Statystyki --- */
.nx-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--nx-4);
    margin-bottom: var(--nx-6);
}
.nx-stat {
    padding: var(--nx-5);
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    display: flex; align-items: center; gap: var(--nx-4);
}
.nx-stat__icon {
    width: 42px; height: 42px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r);
    background: var(--nx-tint);
    color: var(--nx-brand-hi);
}
.nx-stat__icon svg { width: 20px; height: 20px; }
.nx-stat__icon--ok     { background: rgba(34, 197, 94, .12);  color: var(--nx-ok); }
.nx-stat__icon--warn   { background: rgba(245, 158, 11, .12); color: var(--nx-warn); }
.nx-stat__icon--danger { background: rgba(240, 68, 56, .12);  color: var(--nx-danger); }
.nx-stat__label { color: var(--nx-text-dim); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.nx-stat__value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.nx-stat__value small { font-size: 13px; color: var(--nx-text-dim); font-weight: 600; }

/* --- Odznaki --- */
.nx-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px;
    border-radius: var(--nx-r-full);
    font-size: 11.5px; font-weight: 650;
    background: var(--nx-surface-3);
    color: var(--nx-text-dim);
    white-space: nowrap;
}
.nx-badge--ok     { background: rgba(34, 197, 94, .13);  color: #4ADE80; }
.nx-badge--warn   { background: rgba(245, 158, 11, .13); color: #FBBF24; }
.nx-badge--danger { background: rgba(240, 68, 56, .13);  color: #FF7A70; }
.nx-badge--brand  { background: var(--nx-tint);          color: var(--nx-brand-hi); }
[data-nx-theme="light"] .nx-badge--ok     { color: #15803D; }
[data-nx-theme="light"] .nx-badge--warn   { color: #B45309; }
[data-nx-theme="light"] .nx-badge--danger { color: #B42318; }

/* --- Pasek postępu --- */
.nx-progress { height: 5px; border-radius: var(--nx-r-full); background: var(--nx-surface-3); overflow: hidden; }
.nx-progress__bar { height: 100%; border-radius: inherit; background: var(--nx-brand-hi); transition: width .4s var(--nx-ease); }
.nx-progress__bar--ok     { background: var(--nx-ok); }
.nx-progress__bar--warn   { background: var(--nx-warn); }
.nx-progress__bar--danger { background: var(--nx-danger); }

/* --- Alerty --- */
.nx-alert {
    display: flex; gap: var(--nx-3);
    padding: var(--nx-4) var(--nx-5);
    border-radius: var(--nx-r);
    border: 1px solid var(--nx-line-hi);
    background: var(--nx-surface);
    font-size: 13.5px;
    line-height: 1.6;
}
.nx-alert svg { width: 18px; height: 18px; margin-top: 1px; }
.nx-alert--info   { border-color: rgba(56, 189, 248, .3); background: rgba(56, 189, 248, .08); }
.nx-alert--info svg { color: var(--nx-info); }
.nx-alert--warn   { border-color: rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .08); }
.nx-alert--warn svg { color: var(--nx-warn); }
.nx-alert--danger { border-color: rgba(240, 68, 56, .3);  background: rgba(240, 68, 56, .08); }
.nx-alert--danger svg { color: var(--nx-danger); }
.nx-alert--ok     { border-color: rgba(34, 197, 94, .3);  background: rgba(34, 197, 94, .08); }
.nx-alert--ok svg { color: var(--nx-ok); }
.nx-alert ul { margin: var(--nx-2) 0 0; padding-left: var(--nx-5); }

/* --- Pusty stan --- */
.nx-empty { text-align: center; padding: var(--nx-12) var(--nx-6); }
.nx-empty__icon {
    width: 56px; height: 56px; margin: 0 auto var(--nx-4);
    display: grid; place-items: center;
    border-radius: var(--nx-r-lg);
    background: var(--nx-tint); color: var(--nx-brand-hi);
}
.nx-empty__icon svg { width: 26px; height: 26px; }
.nx-empty p { color: var(--nx-text-dim); margin-top: var(--nx-2); }

/* --- Powitanie na pustym pulpicie --- */
.nx-welcome {
    padding: var(--nx-6) var(--nx-8);
    margin-bottom: var(--nx-5);
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r-lg);
    background:
        radial-gradient(560px 240px at 88% -40%, var(--nx-tint-hi), transparent 70%),
        var(--nx-surface);
}
.nx-welcome h1 { font-size: 26px; letter-spacing: -.02em; }
.nx-welcome p { color: var(--nx-text-dim); font-size: 14px; margin-top: var(--nx-2); max-width: 64ch; line-height: 1.6; }

@media (max-width: 700px) {
    .nx-welcome { padding: var(--nx-5); }
    .nx-welcome h1 { font-size: 22px; }
}

/* --- Kafelki oferty na pustym pulpicie --- */
.nx-offer { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--nx-4); }
.nx-offer__card {
    display: flex; align-items: center; gap: var(--nx-4);
    padding: var(--nx-4) var(--nx-5);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    background: var(--nx-surface);
    transition: border-color .18s var(--nx-ease), transform .18s var(--nx-ease), box-shadow .18s var(--nx-ease);
}
.nx-offer__card:hover { border-color: var(--nx-brand); transform: translateY(-2px); box-shadow: var(--nx-shadow); }
.nx-offer__ic {
    width: 46px; height: 46px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r);
    background: var(--nx-surface-2);
}
.nx-offer__ic img { width: 28px; height: 28px; object-fit: contain; }
.nx-offer__name { font-size: 14.5px; font-weight: 650; }
.nx-offer__price { color: var(--nx-text-dim); font-size: 12.5px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.nx-offer__go { margin-left: auto; color: var(--nx-text-mute); transition: transform .18s var(--nx-ease), color .18s var(--nx-ease); }
.nx-offer__go svg { width: 18px; height: 18px; display: block; }
.nx-offer__card:hover .nx-offer__go { color: var(--nx-brand-hi); transform: translateX(3px); }

/* --- Kroki onboardingu --- */
.nx-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--nx-4); }
.nx-step {
    padding: var(--nx-6);
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    display: flex; flex-direction: column;
    transition: border-color .2s var(--nx-ease), transform .2s var(--nx-ease);
}
.nx-step:hover { border-color: var(--nx-line-hi); transform: translateY(-2px); }
.nx-step__no {
    width: 30px; height: 30px; margin-bottom: var(--nx-4);
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-tint); color: var(--nx-brand-hi);
    font-size: 13px; font-weight: 700;
}
.nx-step p { color: var(--nx-text-dim); margin: var(--nx-2) 0 var(--nx-5); flex: 1; font-size: 13.5px; }

/* --- Tabela --- */
.nx-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.nx-table th {
    text-align: left; padding: var(--nx-3) var(--nx-4);
    color: var(--nx-text-mute); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    border-bottom: 1px solid var(--nx-line);
}
.nx-table td { padding: var(--nx-4); border-bottom: 1px solid var(--nx-line); }
.nx-table tr:last-child td { border-bottom: 0; }
.nx-table tbody tr { transition: background .16s var(--nx-ease); }
.nx-table tbody tr:hover { background: var(--nx-surface-2); }

/* --- Formularze --- */
.nx-field { margin-bottom: var(--nx-4); }
.nx-label { display: block; margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--nx-text-dim); }
.nx-input, .nx-select, .nx-textarea {
    width: 100%;
    padding: 9px var(--nx-3);
    background: var(--nx-bg-soft);
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r-btn);
    color: var(--nx-text);
    font-family: inherit; font-size: 13.5px;
    transition: border-color .16s var(--nx-ease), box-shadow .16s var(--nx-ease);
}
.nx-input:focus, .nx-select:focus, .nx-textarea:focus {
    outline: none;
    border-color: var(--nx-brand);
    box-shadow: 0 0 0 3px var(--nx-tint);
}
.nx-input::placeholder { color: var(--nx-text-mute); }

/* Własna strzałka listy rozwijanej - natywna siedzi przyklejona do krawędzi
   i w każdej przeglądarce wygląda inaczej. */
.nx-select {
    appearance: none; -webkit-appearance: none;
    padding-right: 32px;
    background-repeat: no-repeat;
    background-position: right 11px center;
    background-size: 13px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA4B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    cursor: pointer;
}
[data-nx-theme="light"] .nx-select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566076' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* --- Awatar --- */
.nx-avatar { width: 34px; height: 34px; border-radius: var(--nx-r-full); border: 1px solid var(--nx-line-hi); }

/* ------------------------------------------------------- 6. KARTY USŁUG */

.nx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--nx-4); }

.nx-svc {
    position: relative;
    display: flex; flex-direction: column;
    padding: var(--nx-5);
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    overflow: hidden;
    transition: border-color .2s var(--nx-ease), transform .2s var(--nx-ease), box-shadow .2s var(--nx-ease);
}
.nx-svc::after {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 2px;
    background: var(--nx-text-mute);
    opacity: .8;
}
.nx-svc--ok::after     { background: linear-gradient(90deg, var(--nx-ok), transparent); }
.nx-svc--warn::after   { background: linear-gradient(90deg, var(--nx-warn), transparent); }
.nx-svc--danger::after { background: linear-gradient(90deg, var(--nx-danger), transparent); }
.nx-svc:hover { border-color: var(--nx-line-hi); transform: translateY(-2px); box-shadow: var(--nx-shadow); }

.nx-svc__head { display: flex; align-items: center; gap: var(--nx-3); margin-bottom: var(--nx-4); }
.nx-svc__icon {
    width: 40px; height: 40px; flex: none;
    border-radius: var(--nx-r); overflow: hidden;
    background: var(--nx-surface-2);
    display: grid; place-items: center;
}
.nx-svc__icon img { width: 26px; height: 26px; object-fit: contain; }
.nx-svc__name { font-size: 14.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-svc__meta { color: var(--nx-text-mute); font-size: 12px; margin-top: 1px; }

.nx-svc__body { flex: 1; }
.nx-svc__row { display: flex; align-items: center; justify-content: space-between; gap: var(--nx-3); font-size: 13px; }
.nx-svc__row + .nx-svc__row { margin-top: 7px; }
.nx-svc__row dt { color: var(--nx-text-mute); }
.nx-svc__row dd { margin: 0; font-weight: 600; }

.nx-svc__foot { margin-top: var(--nx-5); display: flex; gap: var(--nx-2); }
.nx-svc__foot .nx-btn { flex: 1; }

/* --------------------------------------------------------------- 7. TOASTY */

.nx-toasts {
    position: fixed; top: var(--nx-4); right: var(--nx-4);
    display: flex; flex-direction: column; gap: var(--nx-2);
    z-index: 200;
    max-width: min(420px, calc(100vw - 32px));
}
.nx-toast {
    display: flex; align-items: flex-start; gap: var(--nx-3);
    padding: var(--nx-4);
    border-radius: var(--nx-r);
    background: var(--nx-surface-2);
    border: 1px solid var(--nx-line-hi);
    box-shadow: var(--nx-shadow-lg);
    font-size: 13.5px;
    animation: nx-toast-in .3s var(--nx-ease);
}
.nx-toast svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.nx-toast__tekst { flex: 1; min-width: 0; line-height: 1.5; }
/* Kolor tła zamiast samej ikony - komunikat ma być czytelny kątem oka */
.nx-toast--ok {
    background: linear-gradient(rgba(34, 197, 94, .12), rgba(34, 197, 94, .12)), var(--nx-surface-2);
    border-color: rgba(34, 197, 94, .38);
}
.nx-toast--ok svg { color: var(--nx-ok); }
.nx-toast--danger {
    background: linear-gradient(rgba(240, 68, 56, .12), rgba(240, 68, 56, .12)), var(--nx-surface-2);
    border-color: rgba(240, 68, 56, .38);
}
.nx-toast--danger svg { color: var(--nx-danger); }
.nx-toast__close { margin-left: auto; background: none; border: 0; color: var(--nx-text-mute); cursor: pointer; padding: 0; line-height: 1; }
.nx-toast__close:hover { color: var(--nx-text); }
.nx-toast.is-gone { animation: nx-toast-out .25s var(--nx-ease) forwards; }

@keyframes nx-toast-in  { from { opacity: 0; transform: translateX(16px); } }
@keyframes nx-toast-out { to   { opacity: 0; transform: translateX(16px); height: 0; padding: 0; margin: 0; border-width: 0; } }

/* ---------------------------------------------- 8. NARZĘDZIA / RESPONSYWNOŚĆ */

.nx-muted { color: var(--nx-text-dim); }
.nx-mute2 { color: var(--nx-text-mute); }
.nx-mono  { font-family: var(--nx-mono); font-size: .92em; }
.nx-nums  { font-variant-numeric: tabular-nums; }
.nx-hide  { display: none !important; }

.nx-section { margin-top: var(--nx-8); }
.nx-section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--nx-3); margin-bottom: var(--nx-4); }
.nx-section__head h2 { display: flex; align-items: center; gap: var(--nx-3); }

.nx-preview-pill {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 10px;
    border-radius: var(--nx-r-full);
    background: var(--nx-tint);
    border: 1px solid rgba(33, 111, 237, .3);
    color: var(--nx-brand-hi);
    font-size: 11.5px; font-weight: 650;
}
.nx-preview-pill a { color: var(--nx-text-dim); text-decoration: underline; text-underline-offset: 2px; }
.nx-preview-pill a:hover { color: var(--nx-text); }

@media (max-width: 1100px) {
    :root { --nx-side-w: 240px; }
}

@media (max-width: 900px) {
    .nx-side { transform: translateX(-100%); box-shadow: var(--nx-shadow-lg); }
    body.nx-side-open .nx-side { transform: none; }
    .nx-main { margin-left: 0; }
    .nx-content { padding: var(--nx-5) var(--nx-4) var(--nx-10); }
    .nx-top { padding: 0 var(--nx-4); }
}

@media (min-width: 901px) {
    .nx-only-mobile { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
    .nx *, .nx *::before, .nx *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .nx-wrap > * { animation: none !important; }
}

/* ============================================================== 9. PORTFEL */

/* --- Saldo jako nagłówek karty (nie osobny szeroki pasek) --- */
.nx-card__balance {
    padding: var(--nx-5);
    border-bottom: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg) var(--nx-r-lg) 0 0;
    background: radial-gradient(420px 200px at 88% -70%, var(--nx-tint-hi), transparent 72%);
}
.nx-balance__label {
    display: flex; align-items: center; gap: var(--nx-2);
    color: var(--nx-text-dim);
    font-size: 11.5px; font-weight: 650;
    text-transform: uppercase; letter-spacing: .08em;
}
.nx-balance__value {
    margin-top: var(--nx-2);
    font-size: 34px; font-weight: 700; letter-spacing: -.03em;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
}
.nx-balance__value small { font-size: 15px; font-weight: 600; color: var(--nx-text-dim); margin-left: 6px; }

/* Drobna metryka w nagłówku karty (np. sumy wpłat obok tytułu) */
.nx-card__meta { margin-left: auto; color: var(--nx-text-dim); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* --- Układ dwukolumnowy strony --- */
.nx-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: var(--nx-5); align-items: start; }

/* --- Krok formularza --- */
.nx-step-head { display: flex; align-items: center; gap: var(--nx-3); margin-bottom: var(--nx-4); }
.nx-step-num {
    width: 22px; height: 22px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-full);
    background: var(--nx-tint); color: var(--nx-brand-hi);
    font-size: 11.5px; font-weight: 700;
}
.nx-step-head h3 { font-size: 14.5px; }

/* --- Szybkie kwoty --- */
.nx-chips { display: flex; flex-wrap: wrap; gap: var(--nx-2); }
.nx-chip {
    padding: 7px 14px;
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r-btn);
    background: transparent;
    color: var(--nx-text);
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    transition: background-color .14s var(--nx-ease), border-color .14s var(--nx-ease), color .14s var(--nx-ease);
}
.nx-chip:hover { background: var(--nx-surface-2); }
.nx-chip.is-active { background: var(--nx-tint); border-color: var(--nx-brand); color: var(--nx-brand-hi); }

/* --- Pole kwoty z sufiksem --- */
.nx-amount { position: relative; max-width: 260px; }
.nx-amount input {
    padding-right: 52px;
    font-size: 20px; font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.nx-amount__unit {
    position: absolute; right: var(--nx-3); top: 50%; transform: translateY(-50%);
    color: var(--nx-text-mute); font-size: 13px; font-weight: 650;
    pointer-events: none;
}

/* --- Metoda płatności (radio jako karta) --- */
.nx-methods { display: grid; gap: var(--nx-3); }
.nx-method { display: block; cursor: pointer; }
.nx-method input { position: absolute; opacity: 0; width: 0; height: 0; }
.nx-method__box {
    display: flex; align-items: center; gap: var(--nx-4);
    padding: var(--nx-4);
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r);
    background: var(--nx-surface-2);
    transition: border-color .14s var(--nx-ease), background-color .14s var(--nx-ease);
}
.nx-method:hover .nx-method__box { border-color: var(--nx-text-mute); }
.nx-method input:checked + .nx-method__box {
    border-color: var(--nx-brand);
    background: var(--nx-tint);
}
.nx-method input:focus-visible + .nx-method__box { outline: 2px solid var(--nx-brand-hi); outline-offset: 2px; }

.nx-method__radio {
    width: 18px; height: 18px; flex: none;
    border: 2px solid var(--nx-line-hi);
    border-radius: 50%;
    position: relative;
}
.nx-method input:checked + .nx-method__box .nx-method__radio { border-color: var(--nx-brand); }
.nx-method input:checked + .nx-method__box .nx-method__radio::after {
    content: ""; position: absolute; inset: 3px;
    border-radius: 50%; background: var(--nx-brand);
}
.nx-method__name { display: block; font-size: 14px; font-weight: 600; }
.nx-method__desc { display: block; color: var(--nx-text-dim); font-size: 12.5px; margin-top: 2px; }
.nx-method__marks { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }

/* --- Logotypy metod płatności ---
   Oryginalne wektory operatorów, hostowane u nas w /nx/img (żadnych hotlinków).
   Każdy siedzi na białym kaflu, bo BLIK, Visa i paysafecard mają ciemny tusz
   i na ciemnym motywie zlewałyby się z tłem. Wysokość wspólna, szerokość z proporcji. */
.nx-mark {
    display: block;
    height: 30px; width: auto;
    padding: 5px 8px;
    box-sizing: border-box;
    background: #FFFFFF;
    border-radius: 5px;
    box-shadow: 0 0 0 1px rgba(16, 24, 40, .12);
}

/* --- Podsumowanie płatności --- */
.nx-summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--nx-4);
    flex-wrap: wrap;
    padding: var(--nx-4) var(--nx-5);
    border-radius: var(--nx-r);
    background: var(--nx-surface-2);
    border: 1px solid var(--nx-line);
}
.nx-summary__value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.nx-summary__note { color: var(--nx-text-dim); font-size: 12.5px; margin-top: 2px; }

/* --- Lista nadchodzących płatności / historii --- */
.nx-tx { display: flex; align-items: center; gap: var(--nx-3); padding: var(--nx-3) 0; border-bottom: 1px solid var(--nx-line); }
.nx-tx:last-child { border-bottom: 0; }
.nx-tx__icon {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface-3);
    color: var(--nx-text-dim);
}
.nx-tx__icon svg { width: 16px; height: 16px; }
.nx-tx__icon--in { background: rgba(34, 197, 94, .12); color: var(--nx-ok); }
.nx-tx__main { min-width: 0; flex: 1; }
.nx-tx__title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-tx__meta { color: var(--nx-text-mute); font-size: 12px; margin-top: 1px; }
.nx-tx__amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nx-tx__amount--in { color: var(--nx-ok); }
.nx-tx__akcje { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }

@media (max-width: 640px) {
    .nx-tx { flex-wrap: wrap; row-gap: var(--nx-2); }
    .nx-tx__icon { order: -1; }
    .nx-tx__main { flex: 1 1 calc(100% - 34px - var(--nx-3)); }
    /* akcje schodzą pod nazwę - inaczej ściskają ją do jednej litery */
    .nx-tx__akcje { flex: 1 1 100%; justify-content: flex-start; }
    .nx-tx__title { white-space: normal; }
}
[data-nx-theme="light"] .nx-tx__amount--in { color: #15803D; }

/* ========================================================== 10. ZAMÓWIENIE */

/* --- Siatka pakietów --- */
.nx-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: var(--nx-4); }

.nx-plan {
    display: flex; flex-direction: column;
    background: var(--nx-surface);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    overflow: hidden;
    transition: border-color .2s var(--nx-ease), transform .2s var(--nx-ease), box-shadow .2s var(--nx-ease);
}
.nx-plan:hover { border-color: var(--nx-line-hi); transform: translateY(-2px); box-shadow: var(--nx-shadow); }

/* Pakiet polecany - obramowanie w kolorze marki, świecąca krecha u góry i plakietka */
.nx-plan--rec {
    border-color: var(--nx-brand);
    box-shadow: 0 0 0 1px var(--nx-brand), 0 18px 40px -24px rgba(33, 111, 237, .75);
    background:
        radial-gradient(420px 160px at 50% -30%, var(--nx-tint), transparent 70%),
        var(--nx-surface);
}
.nx-plan--rec::before {
    content: "";
    position: absolute; inset: 0 0 auto 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--nx-brand-hi), transparent);
}
.nx-plan--rec:hover { border-color: var(--nx-brand-hi); box-shadow: 0 0 0 1px var(--nx-brand-hi), 0 22px 46px -22px rgba(33, 111, 237, .85); }
.nx-plan--rec .nx-plan__foot { background: var(--nx-tint); border-top-color: rgba(33, 111, 237, .28); }
.nx-plan { position: relative; }

.nx-plan__flag {
    position: absolute; top: var(--nx-3); right: var(--nx-3);
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px;
    border-radius: var(--nx-r-full);
    background: var(--nx-brand);
    color: var(--nx-brand-ink);
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
}
.nx-plan__flag svg { width: 11px; height: 11px; }

.nx-plan__head { display: flex; align-items: center; gap: var(--nx-3); padding: var(--nx-5) var(--nx-5) var(--nx-3); }
.nx-plan__icon {
    width: 40px; height: 40px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r);
    background: var(--nx-surface-2);
}
.nx-plan__icon img { width: 26px; height: 26px; object-fit: contain; }
.nx-plan__name { font-size: 15.5px; font-weight: 650; }
.nx-plan__desc { padding: 0 var(--nx-5) var(--nx-4); color: var(--nx-text-dim); font-size: 12.5px; line-height: 1.55; }

.nx-plan__specs { padding: 0 var(--nx-5) var(--nx-4); display: grid; gap: 7px; }
.nx-spec { display: flex; align-items: center; gap: var(--nx-3); font-size: 13px; }
.nx-spec svg { width: 15px; height: 15px; color: var(--nx-text-mute); }
.nx-spec__name { color: var(--nx-text-dim); }
.nx-spec__value { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }

.nx-plan__foot {
    margin-top: auto;
    padding: var(--nx-4) var(--nx-5);
    border-top: 1px solid var(--nx-line);
    background: var(--nx-bg-soft);
    display: flex; align-items: center; gap: var(--nx-3);
}
.nx-plan__price { font-size: 21px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.nx-plan__price small { display: block; font-size: 11.5px; font-weight: 500; color: var(--nx-text-mute); letter-spacing: 0; }
.nx-plan__foot .nx-btn { margin-left: auto; }

/* --- Segmentowany wybór (okres rozliczenia) --- */
.nx-seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: var(--nx-2); }
.nx-seg button, .nx-seg a {
    display: block; width: 100%;
    padding: var(--nx-3);
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r-btn);
    background: transparent;
    color: var(--nx-text);
    font-family: inherit; text-align: center;
    cursor: pointer;
    transition: background-color .14s var(--nx-ease), border-color .14s var(--nx-ease);
}
.nx-seg button:hover, .nx-seg a:hover { background: var(--nx-surface-2); }
.nx-seg button.is-active, .nx-seg a.is-active { border-color: var(--nx-brand); background: var(--nx-tint); }
.nx-seg__label { display: block; font-size: 13px; font-weight: 650; }
.nx-seg__price { display: block; margin-top: 3px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.nx-seg__note  { display: block; margin-top: 1px; font-size: 11px; color: var(--nx-text-mute); font-variant-numeric: tabular-nums; }
.nx-seg button.is-active .nx-seg__price, .nx-seg a.is-active .nx-seg__price { color: var(--nx-brand-hi); }
.nx-seg__save {
    display: inline-block; margin-top: 6px;
    padding: 1px 8px;
    border-radius: var(--nx-r-full);
    background: rgba(34, 197, 94, .14);
    color: #4ADE80;
    font-size: 10.5px; font-weight: 700;
}
[data-nx-theme="light"] .nx-seg__save { color: #15803D; }
/* Okres bez rabatu - ta sama wysokość co plakietka, ale bez krzyczenia kolorem */
.nx-seg__save--base { background: var(--nx-surface-3); color: var(--nx-text-mute); font-weight: 600; }
[data-nx-theme="light"] .nx-seg__save--base { color: var(--nx-text-mute); }

/* --- Dodatki z licznikiem (+/-) --- */
.nx-addon {
    display: flex; align-items: center; gap: var(--nx-4);
    padding: var(--nx-4) 0;
    border-bottom: 1px solid var(--nx-line);
    flex-wrap: wrap;
}
.nx-addon:first-child { padding-top: 0; }
.nx-addon:last-child { padding-bottom: 0; border-bottom: 0; }
.nx-addon__icon {
    width: 36px; height: 36px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface-2);
    color: var(--nx-text-dim);
}
.nx-addon__icon svg { width: 17px; height: 17px; }
.nx-addon--on .nx-addon__icon { background: var(--nx-tint); color: var(--nx-brand-hi); }
/* Każdy zasób ma swój kolor od razu, nie dopiero po dokupieniu - inaczej lista
   dodatków jest jednolicie szara i nic z niej nie wyskakuje. */
.nx-addon[data-nx-addon="cpu"] .nx-addon__icon     { background: var(--nx-tint);              color: var(--nx-brand-hi); }
.nx-addon[data-nx-addon="disk"] .nx-addon__icon    { background: rgba(167, 139, 250, .14);    color: #A78BFA; }
.nx-addon[data-nx-addon="backups"] .nx-addon__icon { background: rgba(34, 197, 94, .13);      color: #4ADE80; }
[data-nx-theme="light"] .nx-addon[data-nx-addon="disk"] .nx-addon__icon    { color: #7C3AED; }
[data-nx-theme="light"] .nx-addon[data-nx-addon="backups"] .nx-addon__icon { color: #15803D; }
/* Wybrana wartość na kolor marki - widać, w których wierszach coś dokupiono */
.nx-addon--on .nx-stepper__value { color: var(--nx-brand-hi); }
.nx-addon__main { flex: 1; min-width: 160px; }
.nx-addon__name { font-size: 13.5px; font-weight: 650; }
.nx-addon__desc { color: var(--nx-text-mute); font-size: 12px; margin-top: 1px; }
.nx-addon__price { min-width: 90px; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13.5px; }
.nx-addon__price--zero { color: var(--nx-text-mute); font-weight: 500; }

.nx-stepper { display: flex; align-items: center; gap: var(--nx-2); }
.nx-stepper button {
    width: 30px; height: 30px; flex: none;
    display: grid; place-items: center;
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r-btn);
    background: transparent;
    color: var(--nx-text);
    font-family: inherit; font-size: 16px; line-height: 1;
    cursor: pointer;
    transition: background-color .14s var(--nx-ease), border-color .14s var(--nx-ease);
}
.nx-stepper button:hover:not(:disabled) { background: var(--nx-surface-2); border-color: var(--nx-text-mute); }
.nx-stepper button:disabled { opacity: .35; cursor: default; }
.nx-stepper__value {
    min-width: 76px; text-align: center;
    font-size: 13.5px; font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* --- Animacje przy dobieraniu dodatków --- */
@keyframes nx-bump {
    0%   { transform: scale(1); }
    35%  { transform: scale(1.07); }
    100% { transform: scale(1); }
}
.nx-bump { animation: nx-bump .28s var(--nx-ease); }

.nx-stepper__value { display: inline-block; }
/* Aktywny dodatek znaczymy samą ikoną i cienką kreską z lewej - pas gradientu przez
   całą szerokość wiersza wyglądał jak przypadkowa plama, nie jak zaznaczenie. */
.nx-addon { position: relative; }
.nx-addon--on::before {
    content: "";
    position: absolute; left: -12px; top: 12px; bottom: 12px;
    width: 2px; border-radius: 2px;
    background: var(--nx-brand);
}
.nx-addon__icon { transition: background-color .2s var(--nx-ease), color .2s var(--nx-ease); }
.nx-addon__price { transition: color .2s var(--nx-ease); }
.nx-result__value em { display: inline-block; transition: opacity .2s var(--nx-ease); }
.nx-bill__row, .nx-bill__total dd { will-change: auto; }

/* --- Wynikowe parametry serwera --- */
.nx-result { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--nx-3); }
.nx-result__item { padding: var(--nx-3) var(--nx-4); border-radius: var(--nx-r); background: var(--nx-surface-2); }
.nx-result__label {
    display: flex; align-items: center; gap: 6px;
    color: var(--nx-text-mute);
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
}
.nx-result__label svg { width: 13px; height: 13px; }
.nx-result__value { margin-top: 3px; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nx-result__value em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--nx-brand-hi); }

/* ============================================== ZARZĄDZANIE SERWEREM (nx)
   Całe zarządzanie siedzi w jednej ramce: na górze pasek serwera, po lewej szyna
   z narzędziami, po prawej treść. Wszystko rozdzielają włoskowe linie, nie odstępy
   - widok czyta się wtedy jako jedna powierzchnia, a nie zestaw luźnych kart. */

.nx-sv {
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r-lg);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-sm);
    overflow: hidden;
}

/* Pasek serwera - dwa wiersze: tożsamość i moc, pod linią połączenie i usługa */
.nx-srv { border-bottom: 1px solid var(--nx-line); }
.nx-srv__top,
.nx-srv__bottom {
    display: flex; align-items: center; gap: var(--nx-4);
    flex-wrap: wrap;
    padding: var(--nx-4) var(--nx-5);
}
.nx-srv__bottom { justify-content: space-between; padding-top: 9px; padding-bottom: 9px; border-top: 1px solid var(--nx-line); }
.nx-srv__id { display: flex; align-items: center; gap: var(--nx-3); min-width: 0; margin-right: auto; }
.nx-srv__icon {
    width: 40px; height: 40px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface-2);
}
.nx-srv__icon img { width: 24px; height: 24px; object-fit: contain; }
.nx-srv__name { font-size: 17px; font-weight: 650; display: flex; align-items: center; gap: var(--nx-2); }
.nx-srv__pen {
    display: grid; place-items: center;
    width: 24px; height: 24px;
    border: 1px solid var(--nx-line); border-radius: var(--nx-r-btn);
    background: transparent; color: var(--nx-text-mute);
    cursor: pointer; transition: color .14s var(--nx-ease), border-color .14s var(--nx-ease);
}
.nx-srv__pen svg { width: 12px; height: 12px; }
.nx-srv__pen:hover { color: var(--nx-text); border-color: var(--nx-line-hi); }
.nx-srv__meta { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; color: var(--nx-text-mute); font-size: 12px; margin-top: 3px; }
.nx-srv__meta b { color: var(--nx-text-dim); font-weight: 650; }

/* Połączenie (lewo) i sprawy usługi (prawo) w dolnym wierszu */
.nx-srv__conn { display: flex; align-items: center; gap: var(--nx-2); flex-wrap: wrap; }
.nx-srv__svc { display: flex; align-items: center; gap: var(--nx-3); flex-wrap: wrap; }
.nx-srv__exp { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.nx-srv__exp span { color: var(--nx-text-mute); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.nx-srv__exp b { font-size: 14.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nx-srv__exp--bad { color: var(--nx-danger); }

/* Przyciski mocy - kolor mówi, co robią, zanim przeczytasz etykietę */
.nx-pw { display: flex; gap: var(--nx-2); flex-wrap: wrap; }
.nx-pw__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 18px;
    border: 0; border-radius: var(--nx-r-btn);
    color: #fff;
    font-family: inherit; font-size: 14px; font-weight: 650;
    cursor: pointer;
    transition: filter .14s var(--nx-ease), opacity .14s var(--nx-ease);
}
.nx-pw__btn svg { width: 15px; height: 15px; }
.nx-pw__btn:disabled { opacity: .38; cursor: not-allowed; }
.nx-pw__btn:not(:disabled):hover { filter: brightness(1.12); }
.nx-pw--start   { background: #16A34A; }
.nx-pw--stop    { background: #DC2626; }
.nx-pw--restart { background: #0E8FB4; }
.nx-pw--kill    { background: #7F1D1D; }

/* Chip z adresem - etykieta nad wartością, całość klikalna (kopiuj / edytuj) */
.nx-chip {
    display: inline-flex; flex-direction: column; gap: 3px;
    padding: 6px 13px;
    border: 1px solid var(--nx-line); border-radius: var(--nx-r-btn);
    background: var(--nx-surface-2);
    color: var(--nx-text);
    font-family: inherit; text-align: left; text-decoration: none;
    cursor: pointer; transition: border-color .14s var(--nx-ease);
}
.nx-chip:hover { border-color: var(--nx-line-hi); }
.nx-chip.is-copied { border-color: var(--nx-ok); }
.nx-chip__lbl {
    display: inline-flex; align-items: center; gap: 5px;
    color: var(--nx-text-mute);
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; line-height: 1;
}
.nx-chip__lbl svg { width: 11px; height: 11px; color: var(--nx-brand-hi); }
/* Adres bez monospace: przy tym rozmiarze wygląda jak wklejony z terminala.
   Równe cyfry zostają, żeby nie skakał przy zmianie portu. */
.nx-chip b { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 650; line-height: 1.15; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.nx-chip b svg { width: 13px; height: 13px; color: var(--nx-text-mute); }
.nx-chip--set b { color: var(--nx-brand-hi); }

/* Chip akcji usługi (auto-przedłużanie, przedłuż) */
.nx-chip2 {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    /* Rownia wysokosc niezaleznie od znacznika: <button> bierze z przegladarki
       `line-height: normal`, a <span>/<a> dziedzicza line-height strony - bez tego
       pasek uslugi mieszal kafle 36 i 39 px. */
    min-height: 38px; line-height: 1.25;
    padding: 8px 14px;
    border: 1px solid var(--nx-line); border-radius: var(--nx-r-btn);
    background: var(--nx-surface-2);
    color: var(--nx-text-dim);
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    cursor: pointer; transition: border-color .14s var(--nx-ease), color .14s var(--nx-ease);
}
.nx-chip2 svg { width: 14px; height: 14px; }
.nx-chip2 b { font-weight: 750; }
.nx-chip2:hover { border-color: var(--nx-line-hi); color: var(--nx-text); }
.nx-chip2.is-on { border-color: rgba(34, 197, 94, .32); color: var(--nx-ok); }
.nx-chip2--cta { border-color: transparent; background: var(--nx-brand); color: var(--nx-brand-ink); font-weight: 700; }
/* Termin kasacji plików - ostrzeżenie, nie akcja, więc sam kolor bez wypełnienia. */
.nx-chip2--ostrzega { border-color: rgba(245, 158, 11, .38); color: #F59E0B; }
.nx-chip2--ostrzega:hover { border-color: rgba(245, 158, 11, .55); color: #FBBF24; }
.nx-chip2--ostrzega b { color: inherit; }
.nx-chip2--cta:hover { border-color: transparent; background: var(--nx-brand-lo); color: var(--nx-brand-ink); }

/* Menu „Zarządzaj usługą" - rzeczy robione raz na kilka tygodni */
.nx-drop { position: relative; }
.nx-drop__chev { transition: transform .18s var(--nx-ease); }
.nx-drop.is-open .nx-drop__chev { transform: rotate(180deg); }
.nx-drop__list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
    min-width: 232px;
    padding: var(--nx-1);
    border: 1px solid var(--nx-line-hi); border-radius: var(--nx-r);
    background: var(--nx-surface-2);
    box-shadow: var(--nx-shadow-lg);
    display: none;
}
.nx-drop.is-open .nx-drop__list { display: block; }

/* Na wąskim ekranie menu wyrównane do prawej krawędzi przycisku wyjeżdżało
   poza lewą krawędź strony - tam trzymamy je przy lewej i przycinamy do okna. */
@media (max-width: 560px) {
    .nx-drop__list {
        left: 0; right: auto;
        min-width: 0; width: max-content;
        max-width: calc(100vw - 2 * var(--nx-4));
    }
}
.nx-drop__item {
    display: flex; align-items: center; gap: var(--nx-3);
    width: 100%;
    padding: 9px var(--nx-3);
    border: 0; border-radius: var(--nx-r-sm);
    background: transparent;
    color: var(--nx-text-dim);
    font-family: inherit; font-size: 13px; font-weight: 550;
    text-align: left; cursor: pointer;
    transition: background-color .14s var(--nx-ease), color .14s var(--nx-ease);
}
.nx-drop__item svg { width: 15px; height: 15px; flex: none; }
/* Każda pozycja ma swój kolor ikony - menu przestaje być szarą listą */
.nx-drop__item svg { padding: 4px; border-radius: 6px; box-sizing: content-box; }
.nx-drop__item:nth-child(1) svg { color: var(--nx-brand-hi); background: var(--nx-tint); }
.nx-drop__item:nth-child(2) svg { color: var(--nx-info);     background: rgba(56, 189, 248, .12); }
.nx-drop__item:nth-child(3) svg { color: #A78BFA;            background: rgba(167, 139, 250, .14); }
.nx-drop__item--danger svg    { color: var(--nx-danger);    background: rgba(240, 68, 56, .12); }
[data-nx-theme="light"] .nx-drop__item:nth-child(3) svg { color: #7C3AED; }
.nx-drop__item:hover { background: var(--nx-surface-3); color: var(--nx-text); }
.nx-drop__item--danger:hover { color: var(--nx-danger); }
.nx-drop__sep { height: 1px; margin: var(--nx-1) 0; background: var(--nx-line); }

/* Lista pakietów w modalu zmiany pakietu */
.nx-pkgs { display: grid; gap: var(--nx-2); }
.nx-pkg {
    display: flex; align-items: center; gap: var(--nx-3);
    padding: var(--nx-3) var(--nx-4);
    border: 1px solid var(--nx-line); border-radius: var(--nx-r);
    cursor: pointer;
    transition: border-color .14s var(--nx-ease), background-color .14s var(--nx-ease);
}
.nx-pkg:hover { border-color: var(--nx-line-hi); }
.nx-pkg input { accent-color: var(--nx-brand); flex: none; }
.nx-pkg:has(input:checked) { border-color: var(--nx-brand); background: var(--nx-tint); }
.nx-pkg.is-current { cursor: default; background: var(--nx-surface-2); }
.nx-pkg__body { flex: 1; min-width: 0; }
.nx-pkg__name { display: flex; align-items: center; gap: var(--nx-2); flex-wrap: wrap; font-size: 13.5px; font-weight: 650; }
.nx-pkg__specs { display: flex; align-items: center; gap: var(--nx-3); flex-wrap: wrap; margin-top: 5px; }
.nx-pkg__price { font-size: 14px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nx-pkg__price small { color: var(--nx-text-mute); font-size: 11.5px; font-weight: 500; }

/* Kierunek zmiany ceny - kolor mówi to szybciej niż liczba */
.nx-pkg__delta { font-size: 11px; font-weight: 700; }
.nx-pkg__delta--down { color: var(--nx-ok); }
.nx-pkg__delta--up { color: var(--nx-warn); }

/* Parametry pakietu: ikona bierze kolor zasobu, liczba zostaje neutralna */
.nx-spec { display: inline-flex; align-items: center; gap: 5px; color: var(--nx-text-dim); font-size: 12px; font-weight: 550; }
.nx-spec svg { width: 13px; height: 13px; }
.nx-spec--ram svg    { color: var(--nx-brand-hi); }
.nx-spec--cpu svg    { color: var(--nx-info); }
.nx-spec--disk svg   { color: #A78BFA; }
.nx-spec--backup svg { color: var(--nx-ok); }
[data-nx-theme="light"] .nx-spec--disk svg { color: #7C3AED; }

/* Pigułka stanu - kolor i kropka jadą z websocketu */
.nx-state {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 5px 12px;
    border-radius: var(--nx-r-full);
    background: var(--nx-surface-3);
    color: var(--nx-text-dim);
    font-size: 12px; font-weight: 650;
    white-space: nowrap;
}
.nx-state__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.nx-state__up { color: var(--nx-text-mute); font-weight: 550; font-variant-numeric: tabular-nums; }
.nx-state__up:empty { display: none; }
.nx-state--on   { background: rgba(34, 197, 94, .14);  color: #4ADE80; }
.nx-state--off  { background: rgba(240, 68, 56, .14);  color: #FF7A70; }
.nx-state--busy { background: rgba(245, 158, 11, .14); color: #FBBF24; }
.nx-state--on .nx-state__dot { animation: nx-pulse 2s var(--nx-ease) infinite; }
@keyframes nx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
[data-nx-theme="light"] .nx-state--on   { color: #15803D; }
[data-nx-theme="light"] .nx-state--off  { color: #B42318; }
[data-nx-theme="light"] .nx-state--busy { color: #B45309; }

/* Nawigacja wewnątrz serwera - narzędzia bez schowka „Narzędzia", każde jednym
   kliknięciem. Szyna ma własne tło i linię działową, więc widać, gdzie kończy się
   nawigacja, a zaczyna treść - bez robienia z niej osobnej karty. */
.nx-sv__body { display: grid; grid-template-columns: 228px minmax(0, 1fr); align-items: stretch; }
.nx-sv__nav {
    padding: var(--nx-4) var(--nx-3);
    border-right: 1px solid var(--nx-line);
    background: var(--nx-surface);
}
.nx-sv__main { min-width: 0; padding: var(--nx-5); }
/* Karty w środku ramki nie potrzebują cienia - nie unoszą się nad tłem strony */
.nx-sv__main .nx-card { box-shadow: none; }
.nx-sv__group + .nx-sv__group { margin-top: var(--nx-5); }
.nx-sv__label {
    padding: 0 var(--nx-3) var(--nx-2);
    color: var(--nx-text-mute);
    font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .09em;
}
.nx-sv__link {
    display: flex; align-items: center; gap: var(--nx-3);
    width: 100%;
    padding: 8px var(--nx-3);
    margin-bottom: 2px;
    border: 0; border-radius: var(--nx-r-sm);
    background: transparent;
    color: var(--nx-text-dim);
    font-family: inherit; font-size: 13px; font-weight: 550;
    text-align: left; cursor: pointer;
    transition: background-color .14s var(--nx-ease), color .14s var(--nx-ease);
}
.nx-sv__link svg { width: 16px; height: 16px; flex: none; opacity: .8; }
.nx-sv__link:hover { background: var(--nx-surface-2); color: var(--nx-text); }
.nx-sv__link.is-active { background: var(--nx-tint); color: var(--nx-text); font-weight: 650; }
.nx-sv__link.is-active svg { color: var(--nx-brand-hi); opacity: 1; }
.nx-sv__link .nx-tab__count { margin-left: auto; }
/* Odnośnik do osobnej strony dostaje strzałkę, żeby było jasne, że opuszczasz widok */
.nx-sv__out { margin-left: auto; opacity: .45; }
.nx-sv__out svg { width: 13px; height: 13px; }

/* Pas zużycia nad konsolą. Linie działowe robi 1px odstępu w siatce na tle linii -
   dzięki temu przy zawijaniu kolumn nie zostają wiszące krawędzie. */
.nx-usage {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-bottom: var(--nx-4);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r);
    background: var(--nx-line);
    overflow: hidden;
}
.nx-usage__cell { padding: var(--nx-4); min-width: 0; background: var(--nx-surface); }
.nx-usage__cell canvas {
    display: block; width: 100%; height: 60px; margin-top: 7px;
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface-2);
}
.nx-usage__foot { display: flex; align-items: baseline; justify-content: space-between; gap: var(--nx-2); margin-top: var(--nx-4); font-size: 12.5px; color: var(--nx-text-dim); }
.nx-usage__specs { display: flex; flex-wrap: wrap; gap: var(--nx-2) var(--nx-3); margin-top: var(--nx-4); }

@media (max-width: 860px) {
    .nx-usage { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1200px) {
    .nx-sv__body { grid-template-columns: minmax(0, 1fr); }
    .nx-sv__nav {
        display: flex; gap: var(--nx-4); overflow-x: auto;
        padding: var(--nx-3);
        border-right: 0; border-bottom: 1px solid var(--nx-line);
    }
    .nx-sv__group + .nx-sv__group { margin-top: 0; }
    .nx-sv__group { display: flex; align-items: center; gap: var(--nx-2); }
    .nx-sv__label { display: none; }
    .nx-sv__link { width: auto; white-space: nowrap; margin-bottom: 0; }
    .nx-sv__split { grid-template-columns: minmax(0, 1fr); }
}

/* Prosty box wewnątrz ramki - tylko obrys, bez własnego tła i cienia,
   żeby nie budować karty w karcie */
.nx-box { border: 1px solid var(--nx-line); border-radius: var(--nx-r); }
.nx-box__head {
    display: flex; align-items: center; gap: var(--nx-2);
    padding: 10px var(--nx-4);
    border-bottom: 1px solid var(--nx-line);
    color: var(--nx-text-dim);
    font-size: 12.5px; font-weight: 650;
}
.nx-box__head svg { width: 14px; height: 14px; opacity: .7; }
.nx-box__body { padding: var(--nx-4); }
.nx-box__foot { display: flex; gap: var(--nx-2); padding: var(--nx-3) var(--nx-4); border-top: 1px solid var(--nx-line); }

/* Mierniki zużycia - etykieta, liczby, cienki pasek */
.nx-meter + .nx-meter { margin-top: var(--nx-4); }
.nx-meter__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--nx-2); margin-bottom: 7px; font-size: 12.5px; }
.nx-meter__name { color: var(--nx-text-dim); }
.nx-meter__val { font-weight: 650; font-variant-numeric: tabular-nums; }
.nx-meter__val small { color: var(--nx-text-mute); font-weight: 500; }

/* Dane serwera - wiersze rozdzielone włoskową linią */
.nx-fact { display: flex; align-items: center; justify-content: space-between; gap: var(--nx-3); padding: 9px 0; font-size: 13px; }
.nx-fact + .nx-fact { border-top: 1px solid var(--nx-line); }
.nx-fact > span:first-child { color: var(--nx-text-dim); }
.nx-fact > span:last-child { font-weight: 600; text-align: right; }

/* Konsola - jedyne wgłębienie w widoku, dlatego ciemniejsze tło strony */
.nx-term {
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r);
    background: var(--nx-bg);
    overflow: hidden;
}
.nx-term__head {
    display: flex; align-items: center; gap: var(--nx-2);
    padding: 10px var(--nx-4);
    border-bottom: 1px solid var(--nx-line);
    color: var(--nx-text-dim);
    font-size: 12.5px; font-weight: 650;
}
.nx-term__head svg { width: 14px; height: 14px; opacity: .7; }
/* Wysokość musi być zadana - dopasowanie xterm liczy z niej liczbę wierszy,
   a przy kontenerze rosnącym od treści zwijało konsolę do jednej linii. */
/* Nad konsolą leży pas zużycia, więc zostawiamy mu miejsce w rachunku wysokości. */
.nx-term__screen { padding: var(--nx-3) var(--nx-4); height: clamp(260px, calc(100vh - 505px), 660px); overflow: hidden; }
/* Wewnętrzny kontener bez paddingu - z jego wymiarów xterm liczy kolumny i wiersze */
.nx-term__screen > div { height: 100%; }
.nx-term__screen .terminal,
.nx-term__screen .xterm { height: 100%; }
.nx-term__screen .xterm-viewport { background: transparent !important; }
/* Wiersz komend - czytelnie oddzielony od logów i reagujący na skupienie,
   żeby było widać, że to miejsce do pisania, a nie kolejna linia konsoli. */
.nx-term__cmd {
    display: flex; align-items: center; gap: var(--nx-3);
    padding: 10px var(--nx-4);
    border-top: 1px solid var(--nx-line);
    background: var(--nx-bg-soft);
    transition: background-color .14s var(--nx-ease);
}
.nx-term__cmd:focus-within { background: var(--nx-surface-2); }
.nx-term__cmd > svg { width: 13px; height: 13px; flex: none; color: var(--nx-brand-hi); }
.nx-term__cmd input {
    flex: 1; min-width: 0;
    border: 0; background: transparent;
    color: var(--nx-text);
    font-family: var(--nx-mono); font-size: 13px;
}
.nx-term__cmd input:focus { outline: none; }
.nx-term__cmd input::placeholder { color: var(--nx-text-mute); }
.nx-term__hint { flex: none; color: var(--nx-text-mute); font-size: 11px; white-space: nowrap; }
.nx-term__hint kbd {
    padding: 1px 5px; margin: 0 1px;
    border: 1px solid var(--nx-line-hi); border-radius: 4px;
    background: var(--nx-surface);
    font-family: inherit; font-size: 10.5px;
}
@media (max-width: 760px) { .nx-term__hint { display: none; } }

/* W jasnym motywie konsola też jest jasna - tło z tokenów, a kolory logów
   przestawia xterm (paleta ANSI dobrana pod jasne tło, patrz management/index). */
[data-nx-theme="light"] .nx-term__screen .xterm-viewport { background: transparent !important; }

/* --- Menedżer plików (w zakładce, bez osobnej strony) --- */
.nx-files { position: relative; border: 1px solid var(--nx-line); border-radius: var(--nx-r); overflow: hidden; }

/* Warstwa „upuść pliki" - leży na całym menedżerze, ale tylko przy przeciąganiu.
   `pointer-events: none`, żeby nie przechwytywała zdarzeń przed strefą pod nią. */
.nx-files__drop {
    position: absolute; inset: 0; z-index: 5;
    display: none; align-items: center; justify-content: center;
    background: rgba(8, 12, 18, .9);
    border: 2px dashed var(--nx-brand);
    border-radius: var(--nx-r);
    pointer-events: none;
}
.nx-files.jest-nad .nx-files__drop { display: flex; }
.nx-files__drop-in { text-align: center; padding: var(--nx-4); }
.nx-files__drop-in svg { width: 34px; height: 34px; margin-bottom: var(--nx-2); color: var(--nx-brand-hi, var(--nx-brand)); }
.nx-files__drop-in b { display: block; font-size: 14px; font-weight: 650; }
.nx-files__drop-in span { display: block; margin-top: 4px; color: var(--nx-text-mute); font-family: var(--nx-mono, monospace); font-size: 12px; }
.nx-files__bar {
    display: flex; align-items: center; gap: var(--nx-4); flex-wrap: wrap;
    padding: var(--nx-3) var(--nx-4);
    border-bottom: 1px solid var(--nx-line);
    background: var(--nx-bg-soft);
}
.nx-files__tools { display: flex; align-items: center; gap: var(--nx-2); margin-left: auto; flex-wrap: wrap; }

/* Ścieżka jako klikalne okruszki - powrót wyżej bez przycisku „wstecz" */
.nx-crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; }
.nx-crumb {
    padding: 3px 7px;
    border: 0; border-radius: var(--nx-r-btn);
    background: transparent;
    color: var(--nx-text-dim);
    font-family: var(--nx-mono); font-size: 12.5px;
    cursor: pointer; transition: background-color .14s var(--nx-ease), color .14s var(--nx-ease);
}
.nx-crumb:hover { background: var(--nx-surface-2); color: var(--nx-text); }
.nx-crumb:last-of-type { color: var(--nx-text); font-weight: 650; }
.nx-crumb__sep { color: var(--nx-text-mute); font-size: 12px; }

.nx-files__sel {
    display: flex; align-items: center; gap: var(--nx-3);
    padding: var(--nx-2) var(--nx-4);
    border-bottom: 1px solid var(--nx-line);
    background: var(--nx-tint);
    font-size: 13px;
}
.nx-files__sel b { font-variant-numeric: tabular-nums; }
.nx-files__sel .nx-btn { margin-left: 0; }
.nx-files__sel > :nth-child(2) { margin-left: auto; }

.nx-files__wrap { max-height: min(62vh, 640px); overflow: auto; }
.nx-files__table th { position: sticky; top: 0; z-index: 1; background: var(--nx-surface); }
.nx-files__table td { padding: 9px var(--nx-4); }
.nx-files__table input[type="checkbox"] { accent-color: var(--nx-brand); }
.nx-files__state { padding: var(--nx-8) var(--nx-4); text-align: center; color: var(--nx-text-mute); font-size: 13px; }

.nx-file__name {
    display: inline-flex; align-items: center; gap: var(--nx-3);
    max-width: 100%; padding: 0;
    border: 0; background: transparent;
    color: var(--nx-text);
    font-family: inherit; font-size: 13.5px; text-align: left;
    cursor: pointer;
}
.nx-file__name svg { width: 16px; height: 16px; flex: none; color: var(--nx-text-mute); }
.nx-file__name.is-dir svg { color: var(--nx-brand-hi); }
.nx-file__name.is-dir span { font-weight: 600; }
.nx-file__name:hover span { text-decoration: underline; }

/* Akcje wiersza podpisane słowem - ikony przy pliku bywały zgadywanką */
.nx-file__acts { text-align: right; white-space: nowrap; }
.nx-file__act {
    padding: 4px 9px; margin-left: 4px;
    border: 1px solid var(--nx-line-hi); border-radius: var(--nx-r-btn);
    background: var(--nx-surface-2); color: var(--nx-text-dim);
    font-family: inherit; font-size: 12px; font-weight: 550;
    cursor: pointer; transition: background-color .14s var(--nx-ease), color .14s var(--nx-ease), border-color .14s var(--nx-ease);
}
.nx-file__act:hover { background: var(--nx-surface-3); border-color: var(--nx-text-mute); color: var(--nx-text); }
.nx-file__act--danger:hover { background: rgba(240, 68, 56, .1); border-color: rgba(240, 68, 56, .45); color: var(--nx-danger); }

/* --- Ustawienia gry --- */
.nx-set__group + .nx-set__group { margin-top: var(--nx-6); padding-top: var(--nx-5); border-top: 1px solid var(--nx-line); }
.nx-set__title { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--nx-text-mute); margin-bottom: var(--nx-4); }
.nx-set__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--nx-4) var(--nx-5); }

/* --- Instalator pluginów i modów --- */
.nx-inst__bar { display: flex; gap: var(--nx-2); flex-wrap: wrap; margin-bottom: var(--nx-4); }
.nx-inst__bar .nx-input { flex: 1; min-width: 200px; }
.nx-inst__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--nx-3); }
.nx-inst {
    display: flex; align-items: flex-start; gap: var(--nx-3);
    padding: var(--nx-3);
    border: 1px solid var(--nx-line); border-radius: var(--nx-r);
    transition: border-color .14s var(--nx-ease);
}
.nx-inst:hover { border-color: var(--nx-line-hi); }
.nx-inst__ic {
    width: 40px; height: 40px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface-2);
    overflow: hidden;
}
.nx-inst__ic img { width: 100%; height: 100%; object-fit: cover; }
.nx-inst__main { flex: 1; min-width: 0; }
.nx-inst__name { font-size: 13.5px; font-weight: 650; }
.nx-inst__desc {
    color: var(--nx-text-dim); font-size: 12px; line-height: 1.5; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nx-inst__meta { color: var(--nx-text-mute); font-size: 11.5px; margin-top: 4px; }
.nx-inst .nx-btn { flex: none; }

/* Pasek stron pod wynikami wyszukiwania */
.nx-pager { display: flex; align-items: center; justify-content: center; gap: var(--nx-4); margin-top: var(--nx-5); }

/* --- Gotowe paczki pluginów (katalog produktu) --- */
.nx-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--nx-3); }
.nx-pack {
    display: flex; flex-direction: column;
    border: 1px solid var(--nx-line); border-radius: var(--nx-r);
    background: var(--nx-surface-2);
    overflow: hidden;
    transition: border-color .14s var(--nx-ease), transform .14s var(--nx-ease);
}
.nx-pack:hover { border-color: var(--nx-line-hi); transform: translateY(-2px); }
.nx-pack__img {
    height: 104px;
    background: linear-gradient(135deg, var(--nx-surface-3), var(--nx-surface-2));
    border-bottom: 1px solid var(--nx-line);
}
/* Grafiki paczek to logotypy - kadrujemy je z góry, bo napis siedzi w środku kafelka. */
.nx-pack__img img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.nx-pack__body { padding: var(--nx-3); flex: 1; }
.nx-pack__name { font-size: 13px; font-weight: 650; }
.nx-pack__desc {
    color: var(--nx-text-dim); font-size: 11.5px; line-height: 1.45; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nx-pack__specs { margin-top: var(--nx-2); display: grid; gap: 2px; }
.nx-pack__spec { display: flex; justify-content: space-between; gap: var(--nx-3); font-size: 11px; }
.nx-pack__spec span { color: var(--nx-text-mute); }
.nx-pack__spec strong { font-weight: 600; }
.nx-pack__foot {
    display: flex; flex-wrap: wrap; gap: var(--nx-2); padding: var(--nx-2) var(--nx-3);
    border-top: 1px solid var(--nx-line);
}
.nx-pack__foot .nx-btn { flex: 1; justify-content: center; }
/* Powód blokady bierze całą szerokość i idzie nad przyciskiem - inaczej łamie się na słupek.
   Na czerwono, bo szara linijka ginęła w stopce kafelka. */
.nx-pack__lock {
    flex: 1 1 100%; order: -1; display: flex; align-items: center; gap: 6px;
    padding: 5px 8px; border-radius: var(--nx-r-sm);
    border: 1px solid rgba(240, 68, 56, .3); background: rgba(240, 68, 56, .08);
    color: var(--nx-danger); font-size: 11.5px; font-weight: 600; line-height: 1.35;
}
.nx-pack__lock svg { width: 14px; height: 14px; flex: none; }

/* Podpowiedź pod polem formularza */
.nx-field__hint { margin: 5px 0 0; color: var(--nx-text-mute); font-size: 11.5px; line-height: 1.5; }

/* ============================================================ LOGOWANIE ===
   Strony auth: jedna karta na środku. Rytm pionowy trzymają trzy odstępy -
   nagłówek 28 px, pola 18 px między sobą, stopka odcięta linią. */
.nx-auth__pane {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--nx-5);
    padding: var(--nx-8) var(--nx-5);
}
.nx-auth__box {
    width: 100%; max-width: 396px;
    padding: 30px 28px;
    border: 1px solid var(--nx-line); border-radius: var(--nx-r-lg);
    background: var(--nx-surface);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}
.nx-auth__logo { display: flex; margin-bottom: 26px; }
.nx-auth__logo img { height: 26px; display: block; }
.nx .nx-auth__title { margin: 0 0 8px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; }
.nx .nx-auth__sub { margin: 0 0 28px; color: var(--nx-text-dim); font-size: 13px; line-height: 1.6; }

.nx-auth__form { display: grid; gap: 18px; }
.nx-auth__form .nx-field { margin: 0; }
.nx-auth__form .nx-label { display: block; margin-bottom: 7px; }
.nx-auth__form .nx-input { width: 100%; }
.nx .nx-auth__form .nx-field__hint { margin-top: 7px; }
.nx-auth__form .nx-check { font-size: 13px; }

.nx-auth__submit { width: 100%; justify-content: center; height: 42px; font-size: 14px; margin-top: 2px; }
/* Odnośnik pod przyciskiem - wyśrodkowany, bez własnego marginesu (odstęp daje grid) */
.nx .nx-auth__pod { margin: -4px 0 0; text-align: center; font-size: 13px; }

.nx-auth__foot {
    margin-top: 26px; padding-top: 18px;
    border-top: 1px solid var(--nx-line);
    color: var(--nx-text-dim); font-size: 13px; text-align: center;
}
/* Wejście karty - strona nie wskakuje, tylko się wyłania */
@keyframes nx-auth-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.nx-auth__box { animation: nx-auth-in .3s var(--nx-ease) both; }
.nx-auth__pane > .nx-auth__copy { animation: nx-auth-in .3s var(--nx-ease) .07s both; }

/* Kółko w przycisku na czas wysyłki formularza */
.nx-auth__submit .nx-spin {
    border-color: rgba(255, 255, 255, .35); border-top-color: #fff;
    width: 13px; height: 13px; margin-right: 8px; vertical-align: -2px;
}
.nx-auth__submit[disabled] { opacity: .85; cursor: progress; }

@media (prefers-reduced-motion: reduce) {
    .nx-auth__box, .nx-auth__pane > .nx-auth__copy { animation: none; }
}

.nx .nx-auth__copy { margin: 0; color: var(--nx-text-mute); font-size: 11px; text-align: center; }
.nx-auth__copy a { color: inherit; text-decoration: none; border-bottom: 1px dotted currentColor; }

@media (max-width: 560px) {
    .nx-auth__pane { padding: var(--nx-5) var(--nx-4); }
    .nx-auth__box { padding: var(--nx-5) var(--nx-4); border-radius: var(--nx-r); }
}

/* Logo zależne od motywu: białe na ciemnym, czarne na jasnym.
   Dwa obrazki zamiast podmiany w JS - działa też, zanim skrypty wstaną. */
.nx img.nx-logo--light { display: none; }
[data-nx-theme="light"] .nx img.nx-logo--dark { display: none; }
[data-nx-theme="light"] .nx img.nx-logo--light { display: block; }

/* --- Wejście zakładki ---
   Panele przełączają się atrybutem `hidden`, więc animacja odtwarza się sama przy
   każdym pokazaniu. Krótka i drobna: ma zmiękczyć przeskok, a nie spowalniać klikanie. */
@keyframes nx-tab-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}
[data-nx-tabpanel]:not([hidden]) { animation: nx-tab-in .22s var(--nx-ease) both; }

/* Karty w środku dochodzą chwilę po panelu - daje wrażenie układania się treści */
[data-nx-tabpanel]:not([hidden]) > .nx-card { animation: nx-tab-in .28s var(--nx-ease) .04s both; }

/* --- Treść dociągana po wczytaniu zakładki ---
   Listy pluginów, paczek, silników, ustawień czy plików wstawia JS dopiero po
   odpowiedzi serwera. Bez tego wskakiwały gotowe; teraz wchodzą tak samo jak
   reszta panelu, ze schodkiem, żeby było widać kolejność. */
[data-nx-packs-list] > *,
[data-nx-inst-results] > *,
[data-nx-eng-list] > .nx-engine,
[data-nx-java-list] > .nx-engine,
[data-nx-backups-list] > .nx-tx,
[data-nx-set-body] .nx-set__group,
[data-nx-perms-list] > *,
[data-nx-file-list] > tr,
[data-nx-alloc-list] > tr {
    animation: nx-tab-in .24s var(--nx-ease) both;
}

/* Schodek tylko dla pierwszych pozycji - przy setce plików czekanie byłoby męczące */
[data-nx-packs-list] > *:nth-child(1), [data-nx-inst-results] > *:nth-child(1),
[data-nx-eng-list] > *:nth-child(1), [data-nx-java-list] > *:nth-child(1),
[data-nx-backups-list] > *:nth-child(1), [data-nx-set-body] .nx-set__group:nth-child(1),
[data-nx-perms-list] > *:nth-child(1), [data-nx-file-list] > tr:nth-child(1),
[data-nx-alloc-list] > tr:nth-child(1) { animation-delay: 0ms; }

[data-nx-packs-list] > *:nth-child(2), [data-nx-inst-results] > *:nth-child(2),
[data-nx-eng-list] > *:nth-child(2), [data-nx-java-list] > *:nth-child(2),
[data-nx-backups-list] > *:nth-child(2), [data-nx-set-body] .nx-set__group:nth-child(2),
[data-nx-perms-list] > *:nth-child(2), [data-nx-file-list] > tr:nth-child(2),
[data-nx-alloc-list] > tr:nth-child(2) { animation-delay: 25ms; }

[data-nx-packs-list] > *:nth-child(3), [data-nx-inst-results] > *:nth-child(3),
[data-nx-eng-list] > *:nth-child(3), [data-nx-java-list] > *:nth-child(3),
[data-nx-backups-list] > *:nth-child(3), [data-nx-set-body] .nx-set__group:nth-child(3),
[data-nx-perms-list] > *:nth-child(3), [data-nx-file-list] > tr:nth-child(3),
[data-nx-alloc-list] > tr:nth-child(3) { animation-delay: 50ms; }

[data-nx-packs-list] > *:nth-child(4), [data-nx-inst-results] > *:nth-child(4),
[data-nx-eng-list] > *:nth-child(4), [data-nx-java-list] > *:nth-child(4),
[data-nx-backups-list] > *:nth-child(4), [data-nx-set-body] .nx-set__group:nth-child(4),
[data-nx-perms-list] > *:nth-child(4), [data-nx-file-list] > tr:nth-child(4),
[data-nx-alloc-list] > tr:nth-child(4) { animation-delay: 75ms; }

[data-nx-packs-list] > *:nth-child(n+5), [data-nx-inst-results] > *:nth-child(n+5),
[data-nx-eng-list] > *:nth-child(n+5), [data-nx-java-list] > *:nth-child(n+5),
[data-nx-backups-list] > *:nth-child(n+5), [data-nx-set-body] .nx-set__group:nth-child(n+5),
[data-nx-perms-list] > *:nth-child(n+5), [data-nx-file-list] > tr:nth-child(n+5),
[data-nx-alloc-list] > tr:nth-child(n+5) { animation-delay: 100ms; }

/* Kółko przy „Wczytywanie…". Siedzi w treści placeholdera, więc znika samo,
   gdy JS podmieni tekst na wynik albo na komunikat o błędzie. */
@keyframes nx-obrot { to { transform: rotate(360deg) } }
.nx-spin {
    display: inline-block; width: 12px; height: 12px; margin-right: 7px; vertical-align: -1px;
    border: 2px solid var(--nx-line-hi); border-top-color: var(--nx-brand);
    border-radius: 50%;
    animation: nx-obrot .7s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    [data-nx-tabpanel]:not([hidden]),
    [data-nx-tabpanel]:not([hidden]) > .nx-card,
    [data-nx-packs-list] > *, [data-nx-inst-results] > *,
    [data-nx-eng-list] > *, [data-nx-java-list] > *,
    [data-nx-backups-list] > *, [data-nx-set-body] .nx-set__group,
    [data-nx-perms-list] > *, [data-nx-file-list] > tr, [data-nx-alloc-list] > tr { animation: none; }
    .nx-spin { animation-duration: 1.6s; }
}

/* Numer usługi w menu - szary, tuż za nazwą; kropka stanu zostaje przy krawędzi */
.nx-nav__id {
    flex: none;
    color: var(--nx-text-mute); font-size: 11px;
    font-variant-numeric: tabular-nums;
}
.nx-nav__sub-link .nx-nav__text { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-nav__sub-link .nx-nav__id { margin-left: 2px; }
.nx-nav__sub-link .nx-dot { margin-left: auto; }

/* Wypunktowanie z ptaszkami (np. co daje moduł) */
.nx-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--nx-3); }
.nx-lista li { display: flex; gap: var(--nx-3); align-items: flex-start; font-size: 13.5px; line-height: 1.55; }
.nx-lista li > span {
    flex: none; width: 22px; height: 22px; display: grid; place-items: center;
    border-radius: 50%; background: rgba(34, 197, 94, .13); color: var(--nx-ok);
}
.nx-lista li svg { width: 13px; height: 13px; }

/* --- Lista serwerów graczy: niskie wiersze na całą szerokość --- */
.nx-srv-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.nx-srv-row {
    display: flex; align-items: center; gap: var(--nx-4);
    min-width: 0;
    padding: 10px var(--nx-4);
    border: 1px solid var(--nx-line); border-radius: var(--nx-r);
    background: var(--nx-surface);
    transition: border-color .14s var(--nx-ease), background-color .14s var(--nx-ease);
}
.nx-srv-row:hover { border-color: var(--nx-line-hi); background: var(--nx-surface-2); }

/* Kropka statusu zamiast plakietki - przy wierszu wystarczy jeden punkt */
.nx-srv-row__dot {
    width: 8px; height: 8px; flex: none; border-radius: 50%;
    background: var(--nx-text-mute);
}
.nx-srv-row__dot.is-online { background: var(--nx-ok); box-shadow: 0 0 0 3px rgba(34, 197, 94, .15); }

.nx-srv-row__main { flex: 1; min-width: 0; }
.nx-srv-row__top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nx-srv-row__name {
    font-size: 13.5px; font-weight: 650;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nx-srv-row__desc {
    margin-top: 2px;
    color: var(--nx-text-dim); font-size: 12px; line-height: 1.4;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nx-srv-row__players {
    flex: none; min-width: 74px; text-align: right;
    font-size: 12.5px; color: var(--nx-text-mute); font-variant-numeric: tabular-nums;
}
.nx-srv-row__players b { color: var(--nx-text); font-weight: 650; }
.nx-srv-row__off { font-size: 12px; }
.nx-srv-row .nx-srv-card__ip { flex: none; width: 230px; }
.nx-srv-row__dc { flex: none; width: 86px; display: flex; justify-content: flex-end; }
/* Flaga zgłoszenia: ledwo widoczna, wychodzi z cienia dopiero po najechaniu na wiersz */
.nx-srv-row__flaga {
    flex: none; width: 28px; height: 28px;
    display: grid; place-items: center;
    padding: 0; border: 0; border-radius: var(--nx-r-sm);
    background: none; color: var(--nx-text-mute);
    opacity: 0; cursor: pointer;
    transition: opacity .14s var(--nx-ease), color .14s var(--nx-ease), background-color .14s var(--nx-ease);
}
.nx-srv-row__flaga svg { width: 15px; height: 15px; }
.nx-srv-row:hover .nx-srv-row__flaga { opacity: .55; }
.nx-srv-row__flaga:hover { opacity: 1; color: var(--nx-danger); background: var(--nx-surface-3); }
.nx-srv-row__flaga:focus-visible { opacity: 1; }

/* Na wąskim ekranie wiersz łamie się na dwa poziomy zamiast ściskać adres */
@media (max-width: 860px) {
    .nx-srv-row { flex-wrap: wrap; gap: var(--nx-2) var(--nx-3); }
    .nx-srv-row__main { flex: 1 1 100%; order: -1; min-width: 0; }
    .nx-srv-row .nx-srv-card__ip { flex: 1 1 auto; width: auto; min-width: 0; }
    .nx-srv-row__ver { display: none; }
    .nx-srv-row__players { min-width: 0; text-align: left; }
    /* flaga na dotyku nie ma najechania, więc po prostu jest widoczna */
    .nx-srv-row__flaga { opacity: .45; }
}

@media (max-width: 560px) {
    .nx-srv-row { padding: var(--nx-3); }
    .nx-srv-row__dot { order: -2; }
    .nx-srv-row__main { flex: 1 1 auto; }
    .nx-srv-row__desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .nx-srv-row .nx-srv-card__ip { flex: 1 1 100%; }
    .nx-srv-row__dc { width: auto; }
}
/* Adres jako przycisk: całe pole kopiuje, więc musi wyglądać na klikalne */
.nx-srv-card__ip {
    flex: 1; min-width: 0;
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border: 1px solid var(--nx-line); border-radius: var(--nx-r-btn);
    background: var(--nx-surface-2); color: var(--nx-text);
    font-family: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums;
    cursor: pointer; transition: border-color .14s var(--nx-ease), color .14s var(--nx-ease);
}
.nx-srv-card__ip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-srv-card__ip svg { width: 13px; height: 13px; flex: none; color: var(--nx-text-mute); }
.nx-srv-card__ip:hover { border-color: var(--nx-line-hi); }
.nx-srv-card__ip.is-copied { border-color: var(--nx-ok); color: var(--nx-ok); }
.nx-srv-card__ip.is-copied svg { color: var(--nx-ok); }

/* --- Plakietka „Teraz" w nagłówku karty (aktualnie używana wersja) --- */
.nx-now {
    display: inline-flex; align-items: center; gap: var(--nx-2);
    padding: 6px 12px;
    border: 1px solid var(--nx-brand); border-radius: var(--nx-r-btn);
    background: var(--nx-tint);
}
.nx-now__lbl {
    color: var(--nx-text-mute);
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; line-height: 1;
    /* rozstrzelenie dokleja pusty odstęp za ostatnią literą - zdejmujemy go,
       inaczej przerwa przed wersją wygląda szerzej niż margines przy krawędzi */
    margin-right: -.07em;
}
/* line-height w pełnych pikselach: przy 13,5 px wysokość plakietki wypadała na pół piksela
   i krawędź robiła się rozmyta */
.nx-now b { color: var(--nx-brand-hi); font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; line-height: 14px; }

/* --- Aktualnie zainstalowany silnik (zakładka „Wersja i silnik") --- */
.nx-eng-now {
    display: flex; align-items: center; gap: var(--nx-3);
    padding: var(--nx-3) var(--nx-4);
    margin-bottom: var(--nx-4);
    border: 1px solid var(--nx-brand); border-radius: var(--nx-r);
    background: var(--nx-tint);
}
.nx-eng-now.is-unknown { border-color: var(--nx-line); background: var(--nx-surface-2); }
.nx-eng-now__ic {
    position: relative;
    width: 44px; height: 44px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface-2);
    overflow: hidden;
}
.nx-eng-now.is-unknown .nx-eng-now__ic { background: var(--nx-surface-3); }
.nx-eng-now__ic b { color: var(--nx-text-dim); font-size: 17px; font-weight: 700; }
.nx-eng-now__ic img { position: absolute; inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); object-fit: contain; }
.nx-eng-now__lbl {
    display: block;
    color: var(--nx-text-mute);
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
}
.nx-eng-now__name { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-top: 4px; }
.nx-eng-now__name b { color: var(--nx-brand-hi); font-size: 16px; font-weight: 750; letter-spacing: -.01em; }
.nx-eng-now.is-unknown .nx-eng-now__name b { color: var(--nx-text); }
.nx-eng-now__ver { color: var(--nx-text-dim); font-size: 13px; font-weight: 600; }
.nx-eng-now__badges { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }

/* --- Ostrzeżenie przed reinstalacją (modale instalacji paczek) --- */
.nx-warn {
    border: 1px solid rgba(245, 158, 11, .3);
    border-radius: var(--nx-r);
    background: rgba(245, 158, 11, .08);
    padding: var(--nx-3) var(--nx-4);
}
.nx-warn__head {
    display: flex; align-items: center; gap: var(--nx-2);
    font-size: 13px; font-weight: 650;
}
.nx-warn__head svg { width: 16px; height: 16px; flex: none; color: var(--nx-warn); }
.nx-warn__list { margin: var(--nx-2) 0 0; padding-left: 26px; display: grid; gap: 4px; }
.nx-warn__list li { color: var(--nx-text-dim); font-size: 12.5px; line-height: 1.5; }
.nx-warn__list li strong { color: var(--nx-text); font-weight: 650; }
.nx-warn__tip {
    margin-top: var(--nx-3); padding-left: 2px;
    color: var(--nx-text-mute); font-size: 12px; line-height: 1.6;
}

/* Notka nad wynikami (np. paczka już wgrana na serwer) */
.nx-note {
    padding: var(--nx-3) var(--nx-4); margin-bottom: var(--nx-4);
    border: 1px solid var(--nx-line); border-radius: var(--nx-r);
    background: var(--nx-surface-2);
    color: var(--nx-text-dim); font-size: 12.5px;
}

/* --- Katalog silników --- */
.nx-engines { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: var(--nx-2); margin-top: var(--nx-2); }
.nx-engine {
    display: flex; align-items: center; gap: var(--nx-3);
    padding: var(--nx-3);
    border: 1px solid var(--nx-line); border-radius: var(--nx-r);
    background: transparent; color: var(--nx-text);
    font-family: inherit; text-align: left;
    cursor: pointer; transition: border-color .14s var(--nx-ease), background-color .14s var(--nx-ease);
}
.nx-engine:hover { border-color: var(--nx-line-hi); background: var(--nx-surface-2); }
.nx-engine.is-active { border-color: var(--nx-brand); background: var(--nx-tint); }

/* Logo na kafelku; pod spodem litera, gdy silnik nie ma swojego znaku */
.nx-engine__ic {
    position: relative;
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface-2);
    overflow: hidden;
}
.nx-engine__ic b { color: var(--nx-text-dim); font-size: 14px; font-weight: 700; }
.nx-engine__ic img { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); object-fit: contain; }
.nx-engine__body { min-width: 0; }
.nx-engine__name { display: block; font-size: 13.5px; font-weight: 650; }
.nx-engine__badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.nx-engine.is-active .nx-engine__name { color: var(--nx-brand-hi); }
.nx-badge--mods { background: rgba(167, 139, 250, .16); color: #A78BFA; }
[data-nx-theme="light"] .nx-badge--mods { color: #6D28D9; }

/* --- Wybór uprawnień podużytkownika --- */
.nx-perm__full {
    display: flex; align-items: flex-start; gap: var(--nx-3);
    padding: var(--nx-3) var(--nx-4);
    border: 1px solid var(--nx-line-hi); border-radius: var(--nx-r);
    background: var(--nx-surface-2);
    cursor: pointer;
}
.nx-perm__full input { margin-top: 3px; accent-color: var(--nx-brand); }
.nx-perm__full b { display: block; font-size: 13.5px; }
.nx-perm__full small { display: block; color: var(--nx-text-mute); font-size: 11.5px; margin-top: 2px; line-height: 1.5; }

.nx-perm__presets { display: flex; align-items: center; gap: var(--nx-2); flex-wrap: wrap; margin: var(--nx-4) 0 var(--nx-3); }

.nx-perm__list {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 2px;
    transition: opacity .16s var(--nx-ease);
}
/* Przy „pełnym dostępie" lista jest tylko poglądowa */
.nx-perm__list.is-off { opacity: .4; pointer-events: none; }
.nx-perm {
    display: flex; align-items: center; gap: var(--nx-3);
    padding: 7px 8px;
    border-radius: var(--nx-r-sm);
    font-size: 13px; cursor: pointer;
}
.nx-perm:hover { background: var(--nx-surface-2); }
.nx-perm input { accent-color: var(--nx-brand); }

/* --- Lista osób z dostępem do usługi --- */
.nx-user { display: flex; align-items: center; gap: var(--nx-3); padding: var(--nx-3) 0; }
.nx-user + .nx-user { border-top: 1px solid var(--nx-line); }
.nx-user__ic {
    width: 34px; height: 34px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-surface-2); color: var(--nx-text-mute);
}
.nx-user__ic svg { width: 16px; height: 16px; }
.nx-user__ic--owner { background: var(--nx-tint); color: var(--nx-brand-hi); }
.nx-user__main { flex: 1; min-width: 0; }
.nx-user__mail { font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.nx-user__meta { color: var(--nx-text-mute); font-size: 12px; margin-top: 2px; }

@media (max-width: 640px) {
    .nx-user { flex-wrap: wrap; row-gap: var(--nx-2); }
    .nx-user__ic { order: -1; }
    .nx-user__main { flex: 1 1 calc(100% - 34px - var(--nx-3)); }
    .nx-user > .nx-badge { order: 1; }
    .nx-user > .nx-file__act,
    .nx-user > form { order: 2; }
}

/* Edytor pliku - zapasowe pole tekstowe, gdyby CodeMirror się nie doładował */
.nx-code {
    display: block; width: 100%;
    min-height: clamp(300px, 58vh, 620px);
    padding: var(--nx-4) var(--nx-5);
    border: 0; border-radius: 0;
    background: var(--nx-bg);
    color: var(--nx-text);
    font-family: var(--nx-mono); font-size: 12.5px; line-height: 1.65;
    resize: vertical; white-space: pre; tab-size: 4;
}
.nx-code:focus { outline: none; }

/* Motyw CodeMirror „nx" - kolory z tokenów panelu, więc działa w obu motywach
   i nie ciągniemy osobnego arkusza z CDN. */
.nx-modal .CodeMirror {
    height: clamp(300px, 58vh, 620px);
    background: var(--nx-bg); color: var(--nx-text);
    font-family: var(--nx-mono); font-size: 12.5px; line-height: 1.65;
}
.cm-s-nx .CodeMirror-gutters { background: var(--nx-bg-soft); border-right: 1px solid var(--nx-line); }
.cm-s-nx .CodeMirror-linenumber { color: var(--nx-text-mute); }
.cm-s-nx .CodeMirror-cursor { border-left: 1.6px solid var(--nx-brand-hi); }
.cm-s-nx .CodeMirror-selected { background: var(--nx-tint-hi); }
.cm-s-nx .CodeMirror-focused .CodeMirror-selected { background: var(--nx-tint-hi); }
.cm-s-nx .CodeMirror-activeline-background { background: rgba(255, 255, 255, .035); }
.cm-s-nx .CodeMirror-matchingbracket { color: var(--nx-brand-hi) !important; text-decoration: underline; }
[data-nx-theme="light"] .cm-s-nx .CodeMirror-activeline-background { background: rgba(16, 24, 40, .04); }

.cm-s-nx .cm-comment  { color: var(--nx-text-mute); font-style: italic; }
.cm-s-nx .cm-string,
.cm-s-nx .cm-string-2 { color: #7EE0A6; }
.cm-s-nx .cm-number,
.cm-s-nx .cm-atom     { color: #F5A97F; }
.cm-s-nx .cm-keyword  { color: #C4A0FF; }
.cm-s-nx .cm-def,
.cm-s-nx .cm-variable-2 { color: #7CC5FF; }
.cm-s-nx .cm-variable { color: var(--nx-text); }
.cm-s-nx .cm-property,
.cm-s-nx .cm-attribute { color: #6FD3E8; }
.cm-s-nx .cm-tag      { color: #FF8FA3; }
.cm-s-nx .cm-builtin,
.cm-s-nx .cm-qualifier { color: #C4A0FF; }
.cm-s-nx .cm-meta     { color: var(--nx-text-dim); }
.cm-s-nx .cm-operator { color: var(--nx-text-dim); }
.cm-s-nx .cm-error    { color: var(--nx-danger); }

/* Jasny motyw potrzebuje ciemniejszych odcieni, żeby tekst nie świecił */
[data-nx-theme="light"] .cm-s-nx .cm-string,
[data-nx-theme="light"] .cm-s-nx .cm-string-2 { color: #15803D; }
[data-nx-theme="light"] .cm-s-nx .cm-number,
[data-nx-theme="light"] .cm-s-nx .cm-atom     { color: #B45309; }
[data-nx-theme="light"] .cm-s-nx .cm-keyword,
[data-nx-theme="light"] .cm-s-nx .cm-builtin,
[data-nx-theme="light"] .cm-s-nx .cm-qualifier { color: #6D28D9; }
[data-nx-theme="light"] .cm-s-nx .cm-def,
[data-nx-theme="light"] .cm-s-nx .cm-variable-2 { color: #1B51B4; }
[data-nx-theme="light"] .cm-s-nx .cm-property,
[data-nx-theme="light"] .cm-s-nx .cm-attribute { color: #0E7490; }
[data-nx-theme="light"] .cm-s-nx .cm-tag { color: #BE123C; }

/* Kafelki narzędzi */
.nx-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--nx-3); }
.nx-tool {
    display: flex; align-items: center; gap: var(--nx-4);
    padding: var(--nx-4);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r);
    background: var(--nx-surface);
    transition: border-color .16s var(--nx-ease), transform .16s var(--nx-ease);
}
.nx-tool:hover { border-color: var(--nx-brand); transform: translateY(-1px); }
.nx-tool__ic {
    width: 36px; height: 36px; flex: none;
    display: grid; place-items: center;
    border-radius: var(--nx-r-sm);
    background: var(--nx-tint); color: var(--nx-brand-hi);
}
.nx-tool__ic svg { width: 17px; height: 17px; }
.nx-tool b { display: block; font-size: 13.5px; font-weight: 650; }
.nx-tool span { color: var(--nx-text-mute); font-size: 12px; }

/* Pola tylko do odczytu (SFTP, baza danych) */
.nx-copyrow { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--nx-3); align-items: center; }
.nx-copyrow + .nx-copyrow { margin-top: var(--nx-3); }
.nx-copyrow > span { color: var(--nx-text-dim); font-size: 13px; }
@media (max-width: 620px) { .nx-copyrow { grid-template-columns: minmax(0, 1fr); gap: 6px; } }

/* --- Rozmowa w zgłoszeniu (helpdesk) --- */
.nx-chat {
    display: flex; flex-direction: column; gap: var(--nx-4);
    padding: var(--nx-5);
    max-height: 60vh; overflow-y: auto;
}
.nx-msg { display: flex; gap: var(--nx-3); max-width: 80%; }
.nx-msg__avatar {
    width: 34px; height: 34px; flex: none;
    border-radius: var(--nx-r-full);
    border: 1px solid var(--nx-line-hi);
}
.nx-msg__body { min-width: 0; }
.nx-msg__author { font-size: 12px; font-weight: 650; margin-bottom: 5px; color: var(--nx-text-dim); }
.nx-msg__bubble {
    padding: var(--nx-3) var(--nx-4);
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-r);
    background: var(--nx-surface-2);
    font-size: 13.5px; line-height: 1.65;
    white-space: pre-wrap; word-break: break-word;
}
.nx-msg__meta { margin-top: 5px; color: var(--nx-text-mute); font-size: 11.5px; }

/* Odpowiedzi obsługi wyróżniamy kolorem autora, własne wiadomości stroną i tintem */
.nx-msg--staff .nx-msg__author { color: var(--nx-brand-hi); }
.nx-msg--mine { margin-left: auto; flex-direction: row-reverse; }
.nx-msg--mine .nx-msg__bubble { background: var(--nx-tint); border-color: rgba(33, 111, 237, .28); }
.nx-msg--mine .nx-msg__author,
.nx-msg--mine .nx-msg__meta { text-align: right; }

/* Załącznik graficzny w wiadomości */
.nx-msg__img {
    margin-top: var(--nx-2);
    max-width: 260px; max-height: 200px;
    width: auto; height: auto;
    border-radius: var(--nx-r-sm);
    border: 1px solid var(--nx-line-hi);
    cursor: zoom-in;
    transition: opacity .16s var(--nx-ease);
}
.nx-msg__img:hover { opacity: .85; }

.nx-reply { display: flex; gap: var(--nx-2); align-items: flex-end; }
.nx-reply .nx-textarea { flex: 1; min-height: 44px; resize: vertical; }
.nx-reply__tools { display: flex; align-items: center; gap: var(--nx-2); }

/* Nazwa wybranego załącznika obok pola odpowiedzi */
.nx-attach {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 240px;
    padding: 3px 9px;
    border-radius: var(--nx-r-full);
    background: var(--nx-tint);
    color: var(--nx-brand-hi);
    font-size: 11.5px; font-weight: 600;
}
.nx-attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-attach button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; line-height: 1; font-size: 14px; }

/* Ocena pomocy - gwiazdki na radiach, bez JS */
.nx-stars { display: flex; gap: 4px; direction: rtl; }
.nx-stars input { position: absolute; opacity: 0; width: 0; height: 0; }
.nx-stars label { cursor: pointer; color: var(--nx-line-hi); transition: color .14s var(--nx-ease); }
.nx-stars label svg { width: 26px; height: 26px; display: block; }
.nx-stars input:checked ~ label,
.nx-stars label:hover,
.nx-stars label:hover ~ label { color: #FBBF24; }

/* --- Podgląd konsoli (komendy itemshopu) --- */
.nx-console {
    margin-top: var(--nx-3);
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r);
    background: var(--nx-bg-soft);
    overflow: hidden;
}
.nx-console__head {
    display: flex; align-items: center; gap: var(--nx-2);
    padding: var(--nx-3) var(--nx-4);
    border-bottom: 1px solid var(--nx-line);
    color: var(--nx-text-dim);
    font-size: 12px; font-weight: 650;
}
.nx-console__head svg { width: 14px; height: 14px; color: var(--nx-brand-hi); }
.nx-console__lines {
    margin: 0; padding: var(--nx-3) var(--nx-4) var(--nx-3) var(--nx-8);
    max-height: 190px; overflow-y: auto;
    font-family: var(--nx-mono); font-size: 12px; line-height: 1.9;
    color: var(--nx-text);
}
.nx-console__lines li::marker { color: var(--nx-text-mute); font-size: 11px; }
.nx-console__lines:empty { display: none; }

/* --- Zakładki wewnątrz strony --- */
.nx-tabs {
    display: flex; gap: var(--nx-1);
    border-bottom: 1px solid var(--nx-line);
    margin-bottom: var(--nx-5);
    overflow-x: auto;
}
.nx-tab {
    position: relative;
    display: inline-flex; align-items: center; gap: var(--nx-2);
    padding: 10px var(--nx-4);
    border: 0; background: none;
    color: var(--nx-text-dim);
    font-family: inherit; font-size: 13.5px; font-weight: 600;
    white-space: nowrap; cursor: pointer;
    transition: color .14s var(--nx-ease);
}
.nx-tab:hover { color: var(--nx-text); }
.nx-tab svg { width: 15px; height: 15px; }
.nx-tab.is-active { color: var(--nx-text); }
.nx-tab.is-active::after {
    content: "";
    position: absolute; left: var(--nx-3); right: var(--nx-3); bottom: -1px;
    height: 2px; border-radius: 2px 2px 0 0;
    background: var(--nx-brand-hi);
}
.nx-tab__count {
    padding: 1px 7px;
    border-radius: var(--nx-r-full);
    background: var(--nx-surface-3);
    color: var(--nx-text-dim);
    font-size: 11px; font-weight: 700;
}
.nx-tab.is-active .nx-tab__count { background: var(--nx-tint); color: var(--nx-brand-hi); }

/* --- Okno modalne (np. dopłata do zamówienia) ---
   Bez backdrop-filter: rozmycie tła każe przeglądarce przeliczać całą widoczną
   stronę przy każdym jej odmalowaniu, a pod modalem leci konsola i wykresy -
   to właśnie od tego modale się kleiły. Zwykłe przyciemnienie kosztuje zero. */
.nx-modal {
    position: fixed; inset: 0; z-index: 300;
    display: grid; place-items: center;
    padding: var(--nx-5);
    background: rgba(5, 8, 14, .78);
    opacity: 0; visibility: hidden;
    transition: opacity .2s var(--nx-ease), visibility .2s;
}
.nx-modal.is-open { opacity: 1; visibility: visible; }
.nx-modal__card {
    width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    background: var(--nx-surface);
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r-lg);
    box-shadow: var(--nx-shadow-lg);
    opacity: 0; transform: scale(.94) translateY(14px);
    transition: transform .26s cubic-bezier(.2, .85, .25, 1), opacity .2s var(--nx-ease);
}
/* Bez `will-change` na karcie: promowana warstwa nie dawała tu nic (przejście trwa
   ćwierć sekundy), a potrafiła zgubić malowanie treści - złapane na zrzutach. */
.nx-modal.is-open .nx-modal__card { opacity: 1; transform: none; }
.nx-modal__head {
    display: flex; align-items: center; gap: var(--nx-3);
    padding: var(--nx-4) var(--nx-5);
    border-bottom: 1px solid var(--nx-line);
}
.nx-modal__title { font-size: 15px; font-weight: 650; }
.nx-modal__x {
    margin-left: auto;
    width: 30px; height: 30px;
    display: grid; place-items: center;
    border: 0; border-radius: var(--nx-r-btn);
    background: transparent; color: var(--nx-text-mute);
    font-size: 20px; line-height: 1; cursor: pointer;
    transition: background-color .14s var(--nx-ease), color .14s var(--nx-ease);
}
.nx-modal__x:hover { background: var(--nx-surface-2); color: var(--nx-text); }
.nx-modal__body { padding: var(--nx-5); }
.nx-modal__foot { padding: var(--nx-4) var(--nx-5); border-top: 1px solid var(--nx-line); }

/* --- Kolumna podsumowania trzymająca się przy przewijaniu --- */
.nx-sticky { position: sticky; top: calc(var(--nx-top-h) + var(--nx-4)); }

/* --- Wiersze rachunku --- */
.nx-bill { display: grid; gap: 9px; font-size: 13.5px; }
.nx-bill__row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--nx-3); }
.nx-bill__row dt { color: var(--nx-text-dim); }
.nx-bill__row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.nx-bill__total {
    margin-top: var(--nx-2); padding-top: var(--nx-3);
    border-top: 1px solid var(--nx-line);
    display: flex; align-items: baseline; justify-content: space-between; gap: var(--nx-3);
}
.nx-bill__total dt { font-weight: 650; }
.nx-bill__total dd { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* --- Publiczna strona wpłat (/portfel/{slug}) ---
   Układ poziomy: po lewej kto i za co, po prawej formularz. Celem jest zmieszczenie
   całości bez przewijania na typowym laptopie, dlatego odstępy są tu ciaśniejsze
   niż w panelu, a metody płatności leżą w rzędzie zamiast jedna pod drugą. */
.nx-tip {
    width: 100%; max-width: 1060px;
    margin: 0 auto;
    padding: var(--nx-6) var(--nx-4) var(--nx-6);
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    min-height: 100vh;
}
.nx-tip__brand { display: flex; align-items: center; justify-content: space-between; gap: var(--nx-4); margin-bottom: var(--nx-5); }
.nx-tip__brand img { height: 26px; width: auto; }
.nx-tip__grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1fr); gap: var(--nx-4); align-items: start; }
.nx-tip__body { flex: 1; }

.nx-tip__points { list-style: none; margin: 0; padding: 0; }
.nx-tip__points li { display: flex; gap: var(--nx-3); font-size: 13px; color: var(--nx-text-dim); }
.nx-tip__points li + li { margin-top: var(--nx-3); }
.nx-tip__points svg { width: 16px; height: 16px; margin-top: 1px; color: var(--nx-brand-hi); }

.nx-tip__recent { max-height: 168px; overflow-y: auto; }

/* Metody w rzędzie - kafelek zamiast wiersza, bez opisu i bez kropki radia */
.nx-methods--row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--nx-2); }
.nx-methods--row .nx-method__box {
    flex-direction: column; align-items: center; text-align: center;
    gap: 7px; padding: var(--nx-3) var(--nx-2); height: 100%;
}
.nx-methods--row .nx-method__radio { display: none; }
.nx-methods--row .nx-method__name { font-size: 12.5px; }
.nx-methods--row .nx-method__marks { margin-left: 0; justify-content: center; min-height: 30px; align-items: center; }
.nx-methods--row .nx-method__icon { width: 26px; height: 26px; color: var(--nx-text-dim); }
.nx-methods--row input:checked + .nx-method__box .nx-method__icon { color: var(--nx-brand-hi); }

/* --- Stopka strony publicznej --- */
.nx-tip__foot {
    margin-top: var(--nx-5);
    padding-top: var(--nx-4);
    border-top: 1px solid var(--nx-line);
    display: flex; flex-wrap: wrap; gap: var(--nx-3) var(--nx-5);
    align-items: flex-start; justify-content: space-between;
    color: var(--nx-text-mute); font-size: 11.5px; line-height: 1.65;
}
.nx-tip__foot a { color: var(--nx-text-dim); text-decoration: underline; text-underline-offset: 2px; }
.nx-tip__foot a:hover { color: var(--nx-text); }
.nx-tip__foot strong { color: var(--nx-text-dim); }

/* Prawa kolumna stopki: dokumenty + podpis z logo */
.nx-tip__foot-right { margin-left: auto; text-align: right; }
.nx-tip__foot-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--nx-3); margin-bottom: 7px; }
.nx-tip__foot-sign { display: flex; align-items: center; justify-content: flex-end; gap: var(--nx-2); }
.nx-tip__foot-sign a { text-decoration: none; display: block; }
.nx-tip__foot-sign img { height: 15px; width: auto; opacity: .7; transition: opacity .16s var(--nx-ease); }
.nx-tip__foot-sign a:hover img { opacity: 1; }

/* Kod BLIK - pole na środku kolumny, cyfry na środku pola */
.nx-tip-blik { margin: var(--nx-4) 0 0; text-align: center; }
.nx-tip-blik .nx-input {
    max-width: 190px; margin: 0 auto;
    text-align: center;
    font-size: 19px;
    letter-spacing: .24em;
    text-indent: .24em;   /* kompensuje odstęp doklejany za ostatnią cyfrą */
    font-variant-numeric: tabular-nums;
}

/* Odstępy strony wpłat - trzymane w klasach, żeby dało się je ścisnąć na niskich ekranach */
.nx-tip-form  { padding: var(--nx-5); }
.nx-tip-aside { padding: var(--nx-4) var(--nx-5); }
.nx-tip-step  { margin-bottom: var(--nx-3); }
.nx-tip-step--next { margin-top: var(--nx-5); }

/* Laptop 768p: dociskamy pionowe odstępy, żeby stopka nie spadła pod krawędź */
@media (max-height: 820px) {
    .nx-tip { padding-top: var(--nx-4); padding-bottom: var(--nx-3); }
    .nx-tip__brand { margin-bottom: var(--nx-3); }
    .nx-tip__brand img { height: 23px; }
    .nx-tip-form  { padding: var(--nx-4) var(--nx-5); }
    .nx-tip-aside { padding: var(--nx-3) var(--nx-5); }
    .nx-tip-step--next { margin-top: var(--nx-4); }
    .nx-tip__points li + li { margin-top: var(--nx-2); }
    .nx-tip__recent { max-height: 120px; }
    .nx-tip__foot { margin-top: var(--nx-4); padding-top: var(--nx-3); font-size: 11px; }
    .nx-card__balance { padding: var(--nx-4) var(--nx-5); }
}

@media (max-width: 860px) {
    .nx-tip { min-height: 0; }
    .nx-tip__grid { grid-template-columns: minmax(0, 1fr); }
    .nx-tip__foot { justify-content: flex-start; }
    .nx-tip__foot-right { margin-left: 0; text-align: left; }
    .nx-tip__foot-links, .nx-tip__foot-sign { justify-content: flex-start; }
}

/* --- Checkbox w linii --- */
.nx-check { display: flex; align-items: center; gap: var(--nx-3); cursor: pointer; font-size: 13.5px; color: var(--nx-text-dim); }
.nx-check input { width: 17px; height: 17px; accent-color: var(--nx-brand); cursor: pointer; }
.nx-check:hover { color: var(--nx-text); }

/* --- Sekcja linku do wpłat w karcie portfela --- */
/* Odnośnik w treści, który jest przyciskiem (otwiera modal) */
.nx-link {
    padding: 0; border: 0; background: none;
    color: var(--nx-brand-hi);
    font: inherit; text-decoration: underline; cursor: pointer;
}
.nx-link:hover { color: var(--nx-text); }
/* `.nx a { color: inherit }` z bazy wygrywa specyficznością nad `.nx-link`,
   więc odnośniki potrzebują własnej reguły - inaczej wyglądają jak zwykły tekst. */
.nx a.nx-link { color: var(--nx-brand-hi); text-decoration: underline; }
.nx a.nx-link:hover { color: var(--nx-text); }

.nx-linkbox {
    display: flex; align-items: center; gap: var(--nx-2);
    padding: var(--nx-2) var(--nx-2) var(--nx-2) var(--nx-3);
    border: 1px solid var(--nx-line-hi);
    border-radius: var(--nx-r-btn);
    background: var(--nx-bg-soft);
}
.nx-linkbox input {
    flex: 1; min-width: 0;
    border: 0; background: transparent; padding: 0;
    color: var(--nx-text);
    font-family: var(--nx-mono); font-size: 12.5px;
}
.nx-linkbox input:focus { outline: none; }

/* Pole z przyklejonym sufiksem (np. „.cldly.gg"). Osobny komponent, bo linkbox
   jest pod pola tylko do odczytu - jego mały, monospace'owy tekst daje ledwo
   widoczny kursor, a tu się pisze. */
.nx-suffix { display: flex; align-items: stretch; }
.nx-suffix .nx-input { border-radius: var(--nx-r-btn) 0 0 var(--nx-r-btn); }
.nx-suffix__tag {
    display: flex; align-items: center;
    padding: 0 var(--nx-3);
    border: 1px solid var(--nx-line-hi); border-left: 0;
    border-radius: 0 var(--nx-r-btn) var(--nx-r-btn) 0;
    background: var(--nx-surface-2);
    color: var(--nx-text-dim);
    font-size: 13px; white-space: nowrap;
}

@media (max-width: 1100px) {
    .nx-cols { grid-template-columns: minmax(0, 1fr); }
    /* Po zwinięciu kolumn saldo ma być nad formularzem, nie pod nim */
    .nx-cols > :last-child { order: -1; }
}

@media (max-width: 600px) {
    .nx-balance__value { font-size: 30px; }
}
