﻿/* NanoSoftWeb – powłoka aplikacji: menu boczne lub górne, górny pasek, szablony A–F */
/* .ns-paleta-jasna / -ciemna / -terminal / -grafit-* / -koral-* – podgląd palety niezależnie od bieżącego motywu (miniatury w Ustawienia → Wygląd) */
:root,
.ns-paleta-jasna {
    --ns-brand: #1565c0;
    --ns-brand-dark: #0d47a1;
    --ns-brand-soft: #e3f0fc;
    --ns-bg: #f4f6f9;
    --ns-surface: #ffffff;
    --ns-border: #e2e8f0;
    --ns-hover: #f1f5f9;
    --ns-text: #1f2937;
    --ns-text-soft: #334155;
    --ns-text-muted: #64748b;
    --ns-heading: #0f172a;
    --ns-navy: #10263f;
    --ns-navy-hover: #18344f;
    --ns-navy-line: #1d3a5a;
    --ns-navy-text: #c5d3e3;
    --ns-navy-muted: #6b85a3;
    /* Kolory stanu (np. rozliczenie wizyty) – tylko do oznaczania stanu, nie do linków i przycisków */
    --ns-ok: #2e7d32;
    --ns-danger: #c62828;
    --ns-danger-soft: #fde4e4;
    --ns-warn: #b45309;
    /* Wypełnienia z białym tekstem (przyciski, aktywna pozycja menu, awatar). Osobno od --ns-brand,
       bo w ciemnym motywie akcent tekstu jest jasny, a tło przycisku musi zostać ciemne pod biały tekst */
    --ns-fill: #1565c0;
    --ns-fill-hover: #0d47a1;
    --ns-on-fill: #ffffff;
    --ns-brand-line: #b6d4f2;
    --ns-subtle: #f8fafc;
    --ns-alt: #fafbfc;
    --ns-line: #eef2f6;
    --ns-faint: #94a3b8;
    --ns-input-border: #cbd5e1;
    --ns-navy-icon: #a9bdd4;
    --ns-tooltip: #0f172a;
    --ns-focus-ring: rgba(21, 101, 192, .15);
    --ns-shadow: rgba(15, 23, 42, .15);
    --ns-scrim: rgba(15, 23, 42, .45);
    --ns-side-w: 240px;
    --ns-side-w-collapsed: 68px;
    --ns-rail-w: 68px;
    --ns-panel-w: 220px;
    --ns-topbar-h: 56px;
    /* Palety ozdobne (ns-ozdobna): tęcza ramki pola z fokusem */
    --ns-tecza: linear-gradient(100deg, #38bdf8 0%, #6366f1 8%, #a855f7 16%, #ec4899 25%, #f97316 33%, #facc15 41%, #4ade80 50%, #38bdf8 58%, #6366f1 66%, #a855f7 75%, #ec4899 83%, #f97316 91%, #38bdf8 100%);
    --ns-tecza-cien: rgba(99, 102, 241, .14);
}

/* Ciemny motyw kolorów (Code/Motyw.cs, niezależny od szablonu menu). Reguły tylko dla ciemnego – w ciemny.css */
body.ns-dark,
.ns-paleta-ciemna {
    color-scheme: dark;
    --ns-brand: #64a8f0;
    --ns-brand-dark: #9cc7f5;
    --ns-brand-soft: #16304d;
    --ns-bg: #0d1724;
    --ns-surface: #132133;
    --ns-border: #22344a;
    --ns-hover: #1a2b40;
    --ns-text: #dbe4ee;
    --ns-text-soft: #c5d3e3;
    --ns-text-muted: #8aa0b8;
    --ns-heading: #f1f5f9;
    --ns-navy: #091320;
    --ns-navy-hover: #15263a;
    --ns-navy-line: #1b2d42;
    --ns-navy-text: #c5d3e3;
    --ns-navy-muted: #6b85a3;
    --ns-ok: #4ade80;
    --ns-danger: #f87171;
    --ns-danger-soft: #3a1d26;
    --ns-warn: #fbbf24;
    --ns-fill: #1f6fcc;
    --ns-fill-hover: #2a7cdb;
    --ns-brand-line: #2b5a8a;
    --ns-subtle: #172739;
    --ns-alt: #162538;
    --ns-line: #1d2e43;
    --ns-faint: #6b819a;
    --ns-input-border: #2c425c;
    --ns-navy-icon: #8aa0b8;
    --ns-tooltip: #2a3f57;
    --ns-focus-ring: rgba(100, 168, 240, .25);
    --ns-shadow: rgba(0, 0, 0, .45);
    --ns-scrim: rgba(0, 0, 0, .6);
    --ns-tecza-cien: rgba(99, 102, 241, .22);
}

/* Terminal: ciemna paleta (body ma też ns-dark – reguły z ciemny.css), prawie czarne tło i zielone akcenty.
   Po bloku ns-dark – ta sama specyficzność, więc nadpisuje jego tokeny. */
body.ns-paleta-terminal,
.ns-paleta-terminal {
    color-scheme: dark;
    --ns-brand: #00ff9c;
    --ns-brand-dark: #e6fff4;
    --ns-brand-soft: #0b2a1f;
    --ns-bg: #05070a;
    --ns-surface: #0b1117;
    --ns-border: #163a2c;
    --ns-hover: #0f161d;
    --ns-text: #b9ccc2;
    --ns-text-soft: #b9ccc2;
    --ns-text-muted: #6f857b;
    --ns-heading: #e6fff4;
    --ns-navy: #090e13;
    --ns-navy-hover: #0f161d;
    --ns-navy-line: #163a2c;
    --ns-navy-text: #b9ccc2;
    --ns-navy-muted: #688073;
    --ns-ok: #13b579;
    --ns-danger: #ff4d5e;
    --ns-danger-soft: #2a0f15;
    --ns-warn: #f5c542;
    --ns-fill: #0b7a52;
    --ns-fill-hover: #13b579;
    --ns-on-fill: #e6fff4;
    --ns-brand-line: #1f5a41;
    --ns-subtle: #090e13;
    --ns-alt: #0f161d;
    --ns-line: #12261e;
    --ns-faint: #688073;
    --ns-input-border: #287052;
    --ns-navy-icon: #6f857b;
    --ns-tooltip: #17212b;
    --ns-focus-ring: rgba(0, 255, 156, .25);
    --ns-shadow: rgba(0, 0, 0, .6);
    --ns-scrim: rgba(0, 0, 0, .7);
}

/* Grafit: neutralne szarości (zinc) z akcentem indygo; przyciski grafitowe zamiast kolorowych.
   Jasna – na tokenach z :root (bez ns-dark); ciemna – z ns-dark (reguły z ciemny.css), po bloku ns-dark. */
body.ns-paleta-grafit-jasna,
.ns-paleta-grafit-jasna {
    color-scheme: light;
    --ns-brand: #4f46e5;
    --ns-brand-dark: #3730a3;
    --ns-brand-soft: #eef2ff;
    --ns-bg: #fafafa;
    --ns-surface: #ffffff;
    --ns-border: #e5e5e5;
    --ns-hover: #f4f4f5;
    --ns-text: #171717;
    --ns-text-soft: #404040;
    --ns-text-muted: #737373;
    --ns-heading: #0a0a0a;
    --ns-navy: #18181b;
    --ns-navy-hover: #27272a;
    --ns-navy-line: #27272a;
    --ns-navy-text: #d4d4d8;
    --ns-navy-muted: #71717a;
    --ns-ok: #047857;
    --ns-danger: #dc2626;
    --ns-danger-soft: #fee2e2;
    --ns-warn: #b45309;
    --ns-fill: #18181b;
    --ns-fill-hover: #3f3f46;
    --ns-on-fill: #ffffff;
    --ns-brand-line: #c7d2fe;
    --ns-subtle: #fafafa;
    --ns-alt: #fafafa;
    --ns-line: #f0f0f0;
    --ns-faint: #a3a3a3;
    --ns-input-border: #d4d4d4;
    --ns-navy-icon: #a1a1aa;
    --ns-tooltip: #18181b;
    --ns-focus-ring: rgba(79, 70, 229, .15);
    --ns-shadow: rgba(0, 0, 0, .08);
    --ns-scrim: rgba(0, 0, 0, .4);
}

body.ns-paleta-grafit-ciemna,
.ns-paleta-grafit-ciemna {
    color-scheme: dark;
    --ns-brand: #a5b4fc;
    --ns-brand-dark: #c7d2fe;
    --ns-brand-soft: #1f1d3a;
    --ns-bg: #0a0a0b;
    --ns-surface: #18181b;
    --ns-border: #2b2b2e;
    --ns-hover: #232326;
    --ns-text: #e4e4e7;
    --ns-text-soft: #d4d4d8;
    --ns-text-muted: #a8a8ae;
    --ns-heading: #f2f2f3;
    --ns-navy: #111113;
    --ns-navy-hover: #1c1c1f;
    --ns-navy-line: #232326;
    --ns-navy-text: #d4d4d8;
    --ns-navy-muted: #71717a;
    --ns-ok: #34d399;
    --ns-danger: #f87171;
    --ns-danger-soft: #3a1a1d;
    --ns-warn: #fbbf24;
    --ns-fill: #3f3f46;
    --ns-fill-hover: #52525b;
    --ns-on-fill: #fafafa;
    --ns-brand-line: #3730a3;
    --ns-subtle: #141416;
    --ns-alt: #1c1c1f;
    --ns-line: #1f1f22;
    --ns-faint: #71717a;
    --ns-input-border: #3f3f46;
    --ns-navy-icon: #a8a8ae;
    --ns-tooltip: #27272a;
    --ns-focus-ring: rgba(165, 180, 252, .25);
    --ns-shadow: rgba(0, 0, 0, .5);
    --ns-scrim: rgba(0, 0, 0, .6);
}

/* Koral: neutralne tła (prawie biel / prawie czerń) z koralowo-różowym akcentem; przycisk ciemniejszy od
   akcentu (#E0335F), żeby biały napis był czytelny. Jasna – bez ns-dark; ciemna – z ns-dark (ciemny.css). */
body.ns-paleta-koral-jasna,
.ns-paleta-koral-jasna {
    color-scheme: light;
    --ns-brand: #d62e5a;
    --ns-brand-dark: #a8214a;
    /* prawie neutralne – różowe tło myliłoby się z --ns-danger-soft (stan, np. zaległa wizyta) */
    --ns-brand-soft: #f6f1f3;
    --ns-bg: #f7f7f7;
    --ns-surface: #ffffff;
    --ns-border: #e6e6e6;
    --ns-hover: #f5f5f5;
    --ns-text: #1a1a1a;
    --ns-text-soft: #3a3a3a;
    --ns-text-muted: #6b6b6b;
    --ns-heading: #1a1a1a;
    --ns-navy: #1a1a1a;
    --ns-navy-hover: #2a2a2a;
    --ns-navy-line: #2a2a2a;
    --ns-navy-text: #e0e0e0;
    --ns-navy-muted: #8a8a8a;
    --ns-ok: #16a34a;
    --ns-danger: #dc2626;
    --ns-danger-soft: #fee2e2;
    --ns-warn: #b45309;
    --ns-fill: #e0335f;
    --ns-fill-hover: #c42a53;
    --ns-on-fill: #ffffff;
    --ns-brand-line: #ffc2cf;
    --ns-subtle: #f7f7f7;
    --ns-alt: #fafafa;
    --ns-line: #f0f0f0;
    --ns-faint: #a3a3a3;
    --ns-input-border: #d9d9d9;
    --ns-navy-icon: #a3a3a3;
    --ns-tooltip: #1a1a1a;
    --ns-focus-ring: rgba(255, 77, 141, .18);
    --ns-shadow: rgba(0, 0, 0, .08);
    --ns-scrim: rgba(0, 0, 0, .4);
}

body.ns-paleta-koral-ciemna,
.ns-paleta-koral-ciemna {
    color-scheme: dark;
    --ns-brand: #ff6a73;
    --ns-brand-dark: #ff9aa0;
    --ns-brand-soft: #201b1d;
    --ns-bg: #070708;
    --ns-surface: #121214;
    --ns-border: #26262a;
    --ns-hover: #1a1a1d;
    --ns-text: #f0f0f0;
    --ns-text-soft: #d0d0d0;
    --ns-text-muted: #999999;
    --ns-heading: #f7f7f7;
    --ns-navy: #0e0e10;
    --ns-navy-hover: #1a1a1d;
    --ns-navy-line: #1e1e21;
    --ns-navy-text: #d0d0d0;
    --ns-navy-muted: #777777;
    --ns-ok: #47cd89;
    --ns-danger: #f87171;
    --ns-danger-soft: #3a1a1d;
    --ns-warn: #fbbf24;
    --ns-fill: #e0335f;
    --ns-fill-hover: #f04670;
    --ns-on-fill: #ffffff;
    --ns-brand-line: #6b2a35;
    --ns-subtle: #0e0e10;
    --ns-alt: #141416;
    --ns-line: #1a1a1c;
    --ns-faint: #666666;
    --ns-input-border: #333336;
    --ns-navy-icon: #999999;
    --ns-tooltip: #26262a;
    --ns-focus-ring: rgba(255, 106, 115, .25);
    --ns-shadow: rgba(0, 0, 0, .5);
    --ns-scrim: rgba(0, 0, 0, .6);
}

body {
    background: var(--ns-bg);
    color: var(--ns-text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.ns-shell { display: flex; min-height: 100vh; }
.ns-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Menu boczne (C, D; w E tylko szuflada mobilna) ---------- */
.ns-side {
    position: sticky;
    top: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: var(--ns-side-w);
    height: 100vh;
    overflow: hidden;
    transition: width .2s ease;
}
.ns-logo {
    display: block;
    flex-shrink: 0;
    margin: 12px;
    padding: 8px 10px;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}
.ns-logo img { display: block; width: auto; max-width: none; height: 40px; }
.ns-nav { flex: 1; overflow-x: hidden; overflow-y: auto; padding-bottom: 8px; }
.ns-group {
    padding: 14px 20px 6px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.ns-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 20px);
    margin: 1px 10px;
    padding: 9px 14px;
    border: 0;
    border-radius: 7px;
    background: none;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.3;
    text-align: left;
    white-space: nowrap;
    text-decoration: none !important;
    cursor: pointer;
}
.ns-item:focus { outline: none; }
.ns-item:focus-visible { outline: 2px solid var(--ns-brand); outline-offset: 1px; }
.ns-ico { flex-shrink: 0; width: 18px; height: 18px; }
.ns-label { overflow: hidden; text-overflow: ellipsis; }
.ns-chev { margin-left: auto; font-size: 11px; opacity: .6; transition: transform .15s ease; }
.ns-sub.is-open > .ns-item .ns-chev { transform: rotate(90deg); }
.ns-children { display: none; }
.ns-sub.is-open > .ns-children { display: block; }
.ns-child { padding-left: 44px; font-size: 13px; }
.ns-side-foot { flex-shrink: 0; padding: 8px 0; }
.ns-collapse .ns-ico { transition: transform .2s ease; }

/* C – jasne menu; to samo dla szuflady mobilnej w E i A */
.theme-c .ns-side, .theme-e .ns-side, .theme-a .ns-side { background: var(--ns-surface); border-right: 1px solid var(--ns-border); }
.theme-c .ns-group, .theme-e .ns-group, .theme-a .ns-group { color: var(--ns-faint); }
.theme-c .ns-side .ns-item, .theme-e .ns-side .ns-item, .theme-a .ns-side .ns-item { color: var(--ns-text-soft); }
.theme-c .ns-side .ns-item:hover, .theme-e .ns-side .ns-item:hover, .theme-a .ns-side .ns-item:hover { background: var(--ns-hover); color: var(--ns-heading); }
.theme-c .ns-side .ns-item.is-active, .theme-e .ns-side .ns-item.is-active, .theme-a .ns-side .ns-item.is-active { background: var(--ns-brand-soft); color: var(--ns-brand-dark); font-weight: 600; }
.theme-c .ns-side .ns-item.is-parent-active, .theme-e .ns-side .ns-item.is-parent-active, .theme-a .ns-side .ns-item.is-parent-active { color: var(--ns-brand-dark); font-weight: 600; }
.theme-c .ns-side-foot, .theme-e .ns-side-foot, .theme-a .ns-side-foot { border-top: 1px solid var(--ns-line); }

/* D – ciemne menu; to samo dla szuflady mobilnej w F i B */
.theme-d .ns-side, .theme-f .ns-side, .theme-b .ns-side { background: var(--ns-navy); }
.theme-d .ns-group, .theme-f .ns-group, .theme-b .ns-group { color: var(--ns-navy-muted); }
.theme-d .ns-side .ns-item, .theme-f .ns-side .ns-item, .theme-b .ns-side .ns-item { color: var(--ns-navy-text); }
.theme-d .ns-side .ns-item:hover, .theme-f .ns-side .ns-item:hover, .theme-b .ns-side .ns-item:hover { background: var(--ns-navy-hover); color: var(--ns-on-fill); }
.theme-d .ns-side .ns-item.is-active, .theme-f .ns-side .ns-item.is-active, .theme-b .ns-side .ns-item.is-active { background: var(--ns-fill); color: var(--ns-on-fill); font-weight: 600; }
.theme-d .ns-side .ns-item.is-parent-active, .theme-f .ns-side .ns-item.is-parent-active, .theme-b .ns-side .ns-item.is-parent-active { color: var(--ns-on-fill); font-weight: 600; }
.theme-d .ns-side-foot, .theme-f .ns-side-foot, .theme-b .ns-side-foot { border-top: 1px solid var(--ns-navy-line); }

/* E i F – pasek ikon i panel podstron (desktop); E jasny, F ciemny */
.ns-rail, .ns-panel { display: none; }
.theme-e .ns-side, .theme-f .ns-side { display: none; }
.theme-e .ns-rail, .theme-f .ns-rail {
    position: sticky;
    top: 0;
    z-index: 1002;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    gap: 4px;
    width: var(--ns-rail-w);
    height: 100vh;
    padding: 12px 0;
}
.theme-f .ns-rail { background: var(--ns-navy); }
.theme-e .ns-rail { background: var(--ns-surface); border-right: 1px solid var(--ns-border); }
.ns-rail .ns-logo { width: 44px; height: 44px; margin: 0 0 12px; padding: 0; border-radius: 50%; }
.ns-rail .ns-logo img { height: 44px; }
.ns-ri {
    position: relative;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--ns-navy-icon);
    cursor: pointer;
}
.ns-ri:hover, .ns-ri:focus, .ns-ri.is-open { background: var(--ns-navy-hover); color: var(--ns-on-fill); outline: none; }
.ns-ri.is-active { background: var(--ns-fill); color: var(--ns-on-fill); }
/* Jasny pasek (E) – kolory jak pozycje menu C */
.theme-e .ns-ri { color: var(--ns-text-muted); }
.theme-e .ns-ri:hover, .theme-e .ns-ri:focus, .theme-e .ns-ri.is-open { background: var(--ns-hover); color: var(--ns-heading); }
.theme-e .ns-ri.is-active { background: var(--ns-brand-soft); color: var(--ns-brand-dark); }
.theme-e .ns-ri:focus-visible { box-shadow: inset 0 0 0 2px var(--ns-brand); }
.ns-ri .ns-ico { width: 20px; height: 20px; }
.ns-tip {
    position: absolute;
    top: 50%;
    left: 54px;
    z-index: 40;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--ns-tooltip);
    color: var(--ns-on-fill);
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity .12s ease;
}
.ns-ri:hover .ns-tip, .ns-ri:focus .ns-tip { opacity: 1; }
/* Panel wysuwa się nad treść (nad górnym paskiem, pod paskiem ikon) – treść nie zmienia szerokości.
   Zamyka go wybór pozycji (nowa strona), klik obok, Esc lub przycisk ‹ (shell.js). */
.theme-e .ns-panel.is-open, .theme-f .ns-panel.is-open {
    position: fixed;
    top: 0;
    bottom: 0;
    left: var(--ns-rail-w);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    width: var(--ns-panel-w);
    overflow-y: auto;
    background: var(--ns-surface);
    border-right: 1px solid var(--ns-border);
    box-shadow: 8px 0 30px var(--ns-shadow);
    animation: ns-panel-in .16s ease-out;
}
@keyframes ns-panel-in { from { opacity: 0; transform: translateX(-12px); } }
.ns-psec { display: none; }
.ns-psec.is-open { display: block; }
.ns-ptitle { display: flex; align-items: center; padding: 18px 10px 8px 20px; color: var(--ns-heading); font-size: 14px; font-weight: 700; }
.ns-pclose { margin-left: auto; padding: 2px 8px; border: 0; border-radius: 6px; background: none; color: var(--ns-text-muted); font-size: 18px; line-height: 1; cursor: pointer; }
.ns-pclose:hover { background: var(--ns-hover); }
.ns-panel .ns-item { color: var(--ns-text-soft); }
.ns-panel .ns-item:hover { background: var(--ns-hover); color: var(--ns-heading); }
.ns-panel .ns-item.is-active { background: var(--ns-brand-soft); color: var(--ns-brand-dark); font-weight: 600; }

/* ---------- Górny pasek ---------- */
.ns-topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--ns-topbar-h);
    padding: 0 20px;
    background: var(--ns-surface);
    border-bottom: 1px solid var(--ns-border);
}
.ns-burger { display: none; padding: 6px; border: 0; border-radius: 6px; background: none; color: var(--ns-text-soft); cursor: pointer; }
.ns-burger .ns-ico { width: 22px; height: 22px; }
.ns-crumb { min-width: 0; overflow: hidden; color: var(--ns-text-muted); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.ns-crumb b { color: var(--ns-heading); font-weight: 600; }
.ns-topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ns-user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--ns-text-soft); cursor: pointer; }
.ns-user-btn:hover, .ns-user.open .ns-user-btn { background: var(--ns-hover); }
.ns-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ns-fill); color: var(--ns-on-fill); font-size: 12px; font-weight: 600; }
.ns-user .dropdown-menu { min-width: 250px; padding: 6px; border-color: var(--ns-border); border-radius: 10px; box-shadow: 0 10px 30px var(--ns-shadow); }
.ns-user .dropdown-menu > li > a { padding: 8px 10px; border-radius: 6px; color: var(--ns-text-soft); }
.ns-user .dropdown-menu > li > a:hover { background: var(--ns-hover); }
.ns-user .dropdown-header { padding: 6px 10px; }
/* „Zalogowany jako” tylko tam, gdzie przycisk nie pokazuje nazwy (telefon, wąski A/B) */
.ns-user-head { display: none; }
.ns-btn { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 8px; background: var(--ns-fill); color: var(--ns-on-fill) !important; font-weight: 600; text-decoration: none !important; }
.ns-btn:hover { background: var(--ns-fill-hover); }
.ns-btn .ns-ico { width: 16px; height: 16px; }

/* ---------- A i B – menu górne (desktop); A jasne, B ciemne. Na telefonie szuflada jak C / D ---------- */
.ns-toplogo, .ns-topmenu { display: none; }
@media (min-width: 992px) {
    .theme-a .ns-side, .theme-b .ns-side,
    .theme-a .ns-crumb, .theme-b .ns-crumb { display: none; }
    /* Logo | menu wyśrodkowane względem całego paska | użytkownik (ukryte burger i ścieżka nie zajmują kolumn) */
    .theme-a .ns-topbar, .theme-b .ns-topbar { display: grid; grid-template-columns: 1fr auto 1fr; }
    .theme-a .ns-topbar-right, .theme-b .ns-topbar-right { justify-self: end; }
    .theme-a .ns-toplogo, .theme-b .ns-toplogo { display: block; justify-self: start; margin: 0 8px 0 0; padding: 4px 8px; border-radius: 8px; }
    .ns-toplogo img { height: 32px; }
    .theme-a .ns-topmenu, .theme-b .ns-topmenu { display: block; min-width: 0; }
}
.ns-topnav { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ns-ti {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 0;
    border-radius: 7px;
    background: none;
    font: inherit;
    font-size: 13.5px;
    line-height: 1.3;
    white-space: nowrap;
    text-decoration: none !important;
    cursor: pointer;
}
.ns-ti:focus { outline: none; }
.ns-ti:focus-visible { outline: 2px solid var(--ns-brand); outline-offset: 1px; }
.ns-ti .caret { opacity: .6; }
.ns-topnav .dropdown-menu { min-width: 220px; margin-top: 6px; padding: 6px; border-color: var(--ns-border); border-radius: 10px; box-shadow: 0 10px 30px var(--ns-shadow); }
.ns-topnav .dropdown-menu > li > a { padding: 8px 10px; border-radius: 6px; color: var(--ns-text-soft); }
.ns-topnav .dropdown-menu > li > a:hover, .ns-topnav .dropdown-menu > li > a:focus { background: var(--ns-hover); color: var(--ns-heading); }
.ns-topnav .dropdown-menu > li > a.is-active { background: var(--ns-brand-soft); color: var(--ns-brand-dark); font-weight: 600; }

/* A – kolory jak menu C */
.theme-a .ns-ti { color: var(--ns-text-soft); }
.theme-a .ns-ti:hover, .theme-a .open > .ns-ti { background: var(--ns-hover); color: var(--ns-heading); }
.theme-a .ns-ti.is-active { background: var(--ns-brand-soft); color: var(--ns-brand-dark); font-weight: 600; }
.theme-a .ns-ti.is-parent-active { color: var(--ns-brand-dark); font-weight: 600; }

/* B – cały górny pasek granatowy, kolory jak menu D */
.theme-b .ns-topbar { background: var(--ns-navy); border-bottom-color: var(--ns-navy); }
.theme-b .ns-ti, .theme-b .ns-user-btn, .theme-b .ns-burger, .theme-b .ns-crumb { color: var(--ns-navy-text); }
.theme-b .ns-crumb b { color: var(--ns-on-fill); }
.theme-b .ns-ti:hover, .theme-b .open > .ns-ti,
.theme-b .ns-user-btn:hover, .theme-b .ns-user.open .ns-user-btn { background: var(--ns-navy-hover); color: var(--ns-on-fill); }
.theme-b .ns-ti.is-active { background: var(--ns-fill); color: var(--ns-on-fill); font-weight: 600; }
.theme-b .ns-ti.is-parent-active { color: var(--ns-on-fill); font-weight: 600; }

/* Bez menu z lewej treść jest wyśrodkowana */
.theme-a .ns-content .container, .theme-b .ns-content .container { margin-left: auto; margin-right: auto; }

/* Wąski desktop: same nazwy pozycji, żeby pasek mieścił się w jednej linii */
@media (min-width: 992px) and (max-width: 1279px) {
    .ns-ti { padding: 8px 9px; }
    .ns-ti .ns-ico,
    .theme-a .ns-user-name, .theme-b .ns-user-name { display: none; }
    .theme-a .ns-user-head, .theme-b .ns-user-head { display: block; }
}

/* ---------- Treść i stopka ---------- */
.ns-content { flex: 1 0 auto; padding-bottom: 40px; }
/* Treść wyrównana do lewej krawędzi, przy menu – nie wyśrodkowana */
.ns-content .container { width: auto; max-width: 1400px; margin-left: 0; margin-right: 0; padding: 20px 28px 0; }
.ns-content .container .container { padding: 0; }
.ns-footer { padding: 12px 24px; border-top: 1px solid var(--ns-border); background: var(--ns-surface); color: var(--ns-text-muted); font-size: 12.5px; }
.ns-footer a { color: var(--ns-text-muted); }
.ns-footer a:hover { color: var(--ns-brand-dark); }
.ns-scrim { display: none; }

/* ---------- Zwinięte menu (tylko desktop, C i D) ---------- */
@media (min-width: 992px) {
    .ns-collapsed .ns-side { width: var(--ns-side-w-collapsed); }
    .ns-collapsed .ns-side .ns-label,
    .ns-collapsed .ns-side .ns-chev,
    .ns-collapsed .ns-side .ns-group,
    .ns-collapsed .ns-side .ns-children { display: none; }
    .ns-collapsed .ns-side .ns-item { justify-content: center; padding: 10px 0; }
    .ns-collapsed .ns-side .ns-logo { width: 44px; height: 44px; margin: 12px auto; padding: 0; border-radius: 50%; }
    .ns-collapsed .ns-side .ns-logo img { height: 44px; }
    .ns-collapsed .ns-collapse .ns-ico { transform: rotate(180deg); }
}

/* ---------- Telefon / wąskie okno: szuflada ---------- */
@media (max-width: 991px) {
    .ns-burger { display: inline-flex; }
    .ns-side, .theme-e .ns-side, .theme-f .ns-side, .theme-a .ns-side, .theme-b .ns-side {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1050;
        display: flex;
        width: 280px;
        height: auto;
        transform: translateX(-100%);
        transition: transform .22s ease;
    }
    .ns-drawer-open .ns-side { transform: none; box-shadow: 0 0 40px var(--ns-shadow); }
    .ns-drawer-open .ns-scrim { position: fixed; inset: 0; z-index: 1040; display: block; background: var(--ns-scrim); }
    .theme-e .ns-rail, .theme-e .ns-panel.is-open,
    .theme-f .ns-rail, .theme-f .ns-panel.is-open { display: none; }
    .ns-side-foot, .ns-user-name { display: none; }
    .ns-user-head { display: block; }
    .ns-topbar { padding: 0 12px; }
    .ns-content .container { padding: 16px 16px 0; }
}

/* Tęczowa ramka pola z fokusem w palecie ozdobnej (site.css, devexpress.css) – przesuwanie gradientu */
@keyframes ns-tecza {
    from { background-position: 0 0, 0% 50%; }
    to { background-position: 0 0, 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .ns-side, .ns-chev, .ns-collapse .ns-ico { transition: none; }
    .theme-e .ns-panel.is-open, .theme-f .ns-panel.is-open { animation: none; }
    .ns-ozdobna .form-control:focus, .ns-ozdobna [class*="dxeFocused_"] { animation: none !important; }
}

/* ---------- Powiadomienia (nsToast w shell.js) ----------
   Karta w kolorach palety; typ pokazuje ikona i pasek odliczania (--ns-kol). Prawy dolny róg, na telefonie dół ekranu.
   z-index nad oknami ASPxPopupControl (od 12000). */
.ns-toasty { position: fixed; right: 20px; bottom: 20px; z-index: 30000; display: flex; flex-direction: column; gap: 8px; width: 360px; max-width: calc(100vw - 40px); pointer-events: none; }
.ns-toast { --ns-kol: var(--ns-brand); position: relative; display: grid; grid-template-columns: 30px 1fr auto; align-items: start; gap: 12px; overflow: hidden; padding: 12px 12px 14px 14px; border: 1px solid var(--ns-border); border-radius: 10px; background: var(--ns-surface); color: var(--ns-text); box-shadow: 0 12px 28px -10px var(--ns-shadow), 0 2px 6px var(--ns-shadow); font-size: 13.5px; line-height: 1.4; pointer-events: auto; animation: ns-toast-wejscie .26s cubic-bezier(.2, .8, .2, 1) both; }
.ns-toast-sukces { --ns-kol: var(--ns-ok); }
.ns-toast-blad { --ns-kol: var(--ns-danger); }
.ns-toast-uwaga { --ns-kol: var(--ns-warn); }
.ns-toast-ik { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--ns-kol) 15%, transparent); color: var(--ns-kol); }
.ns-toast-ik svg { width: 18px; height: 18px; }
.ns-toast-tekst { min-width: 0; padding-top: 5px; overflow-wrap: anywhere; }
.ns-toast-x { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--ns-text-muted); opacity: 0; cursor: pointer; transition: opacity .15s; }
.ns-toast-x svg { width: 15px; height: 15px; }
.ns-toast:hover .ns-toast-x, .ns-toast-stale .ns-toast-x, .ns-toast-x:focus-visible { opacity: 1; }
.ns-toast-x:hover { background: var(--ns-hover); color: var(--ns-text); }
.ns-toast-x:focus-visible { outline: 2px solid var(--ns-brand); outline-offset: 1px; }
.ns-toast-czas { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--ns-kol); opacity: .55; transform-origin: left; animation: ns-toast-czas linear forwards; }
.ns-toast:hover .ns-toast-czas { animation-play-state: paused; }
.ns-toast.is-wyjscie { animation: ns-toast-wyjscie .2s ease-in forwards; }
@keyframes ns-toast-wejscie { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes ns-toast-wyjscie { to { opacity: 0; transform: translateX(24px); } }
@keyframes ns-toast-wyjscie-dol { to { opacity: 0; transform: translateY(16px); } }
@keyframes ns-toast-czas { to { transform: scaleX(0); } }
@media (max-width: 767px) {
    .ns-toasty { right: max(10px, env(safe-area-inset-right)); left: max(10px, env(safe-area-inset-left)); bottom: max(10px, env(safe-area-inset-bottom)); width: auto; max-width: none; }
    .ns-toast.is-wyjscie { animation-name: ns-toast-wyjscie-dol; }
}
@media (prefers-reduced-motion: reduce) {
    .ns-toast, .ns-toast.is-wyjscie { animation-duration: .01s; }
    .ns-toast-czas { display: none; }
}

/* ---------- Strona Ustawienia → Wygląd ---------- */
.ns-theme-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; max-width: 1000px; margin: 16px 0 20px; }
.ns-theme-card { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 14px; border: 2px solid var(--ns-border); border-radius: 12px; background: var(--ns-surface); font-weight: normal; cursor: pointer; }
.ns-theme-card:hover { border-color: var(--ns-brand-line); }
.ns-theme-card:has(input:checked) { border-color: var(--ns-brand); box-shadow: 0 0 0 3px var(--ns-focus-ring); }
.ns-theme-thumb { display: flex; height: 110px; overflow: hidden; border: 1px solid var(--ns-border); border-radius: 8px; background: var(--ns-bg); }
.ns-theme-thumb i { display: block; }
.ns-theme-thumb .s { width: 30%; }
.ns-theme-thumb .p { width: 0; }
.ns-theme-thumb .m { flex: 1; background: linear-gradient(var(--ns-surface) 0 18%, transparent 18%); }
.ns-thumb-c .s { background: var(--ns-surface); border-right: 1px solid var(--ns-border); }
.ns-thumb-d .s { background: var(--ns-navy); }
.ns-thumb-e .s, .ns-thumb-f .s { width: 9%; }
.ns-thumb-e .p, .ns-thumb-f .p { width: 24%; background: var(--ns-surface); border-right: 1px solid var(--ns-border); }
.ns-thumb-e .s { background: var(--ns-surface); border-right: 1px solid var(--ns-border); }
.ns-thumb-f .s { background: var(--ns-navy); }
.ns-thumb-a, .ns-thumb-b { flex-direction: column; }
.ns-thumb-a .s, .ns-thumb-b .s { width: 100%; height: 18%; }
.ns-thumb-a .m, .ns-thumb-b .m { background: none; }
.ns-thumb-a .s { background: var(--ns-surface); border-bottom: 1px solid var(--ns-border); }
.ns-thumb-b .s { background: var(--ns-navy); }
.ns-theme-name { display: flex; align-items: center; gap: 8px; color: var(--ns-heading); font-weight: 600; }
.ns-theme-name input { margin: 0; }
.ns-theme-desc { color: var(--ns-text-muted); font-size: 13px; }
.ns-settings-h { margin: 24px 0 0; color: var(--ns-heading); font-size: 16px; font-weight: 600; }
/* Miniatura palety kolorów: menu, pasek, karta treści – każda część w kolorach swojej palety */
.ns-kp { display: flex; flex: 1; background: var(--ns-bg); }
.ns-kp + .ns-kp { border-left: 1px solid var(--ns-border); }
.ns-kp .s { width: 30%; background: var(--ns-navy); }
.ns-kp .m { position: relative; flex: 1; background: linear-gradient(var(--ns-surface) 0 18%, transparent 18%); }
.ns-kp .m::after { content: ""; position: absolute; top: 32%; left: 12%; width: 70%; height: 46%; border: 1px solid var(--ns-border); border-radius: 4px; background: linear-gradient(var(--ns-brand) 0 0) 10px 10px / 40% 6px no-repeat, var(--ns-surface); }
.ns-badge { margin-left: auto; padding: 2px 8px; border-radius: 99px; background: var(--ns-brand-soft); color: var(--ns-brand-dark); font-size: 11px; font-weight: 600; }

/* ---------- Bootstrap w kolorach marki (zamiast jego domyślnego #337ab7) ----------
   Przyciski DevExpress mają te same kolory w devexpress.css – jeden niebieski w całej aplikacji. */
a { color: var(--ns-brand-dark); }
a:hover, a:focus { color: var(--ns-brand-dark); }
.btn-primary,
.btn-primary.disabled, .btn-primary[disabled], fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover, .btn-primary[disabled]:hover, fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus, .btn-primary[disabled]:focus, fieldset[disabled] .btn-primary:focus {
    background-color: var(--ns-fill);
    border-color: var(--ns-fill);
}
.btn-primary:hover,
.btn-primary:focus, .btn-primary.focus,
.btn-primary:active, .btn-primary.active, .open > .dropdown-toggle.btn-primary,
.btn-primary:active:hover, .btn-primary:active:focus, .btn-primary.active:hover, .btn-primary.active:focus {
    background-color: var(--ns-fill-hover);
    border-color: var(--ns-fill-hover);
}
