/*
 * CandorLims — arkusz stylów, w całości ręcznie pisany (bez Tailwind/build stepu).
 * Struktura: fonty -> tokeny (:root) -> reset -> baza -> komponenty -> utility.
 * Warstwy CSS (@layer) tylko po to, żeby drobne klasy utility (mb-4, gap-2…)
 * zawsze wygrywały z komponentami niezależnie od kolejności w pliku/specyficzności
 * — to natywna funkcja przeglądarki, nie ma tu żadnego kroku kompilacji.
 */

@layer reset, base, components, utilities;

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-variable-latin.260c81a4759b.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-variable-latin-ext.1ad231aac0a8.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-variable-latin.b058178d7f30.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-variable-latin-ext.e36841ed93d5.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', monospace;

  --spacing: 0.25rem;
  --text-xs: 0.75rem;
  --text-xs--line-height: calc(1 / 0.75);
  --text-sm: 0.875rem;
  --text-sm--line-height: calc(1.25 / 0.875);
  --text-lg: 1.125rem;
  --text-lg--line-height: calc(1.75 / 1.125);
  --font-weight-normal: 400;
  --font-weight-semibold: 600;

  --color-bg: #121316;
  --color-bg-raised: #1a1c20;
  --color-surface: #1e2126;
  --color-surface-hover: #262a31;
  /* Kontrast progów WCAG 2.1 AA sprawdzony liczbowo (formuła z 1.4.3/1.4.11):
     border/border-strong podniesione z ~1.3-1.9:1 do ~2.4-3.3:1 (obramowania pól
     formularzy to komponenty UI — wymagają min. 3:1 wobec sąsiadującego tła),
     text-faint z 3.3-3.8:1 (poniżej progu tekstu 4.5:1) do ~4.7-5.4:1. */
  --color-border: #565d6a;
  --color-border-strong: #6b7280;
  --color-text: #e7e9ec;
  --color-text-muted: #9aa1ac;
  --color-text-faint: #838a98;
  --color-accent: #4f8cff;
  --color-accent-hover: #6f9fff;
  --color-accent-muted: #23324f;
  --color-success: #34c77b;
  --color-success-muted: #17301f;
  --color-warning: #e0a930;
  --color-warning-muted: #332b12;
  --color-danger: #ef5b5b;
  --color-danger-muted: #3a1b1b;
  --color-info: #38bdf8;
  --color-info-muted: #0f2a38;
  --color-purple: #a78bfa;
  --color-purple-muted: #271f3d;
  --color-teal: #2dd4bf;
  --color-teal-muted: #0f2e2a;
  --color-rose: #fb7185;
  --color-rose-muted: #3a1a24;
}

/* --- Tryb jasny: te same tokeny, jasna paleta — przełącznik w sidebarze
   (patrz templates/base.html, themeToggle()) ustawia [data-theme] na <html>
   i zapamiętuje wybór w localStorage. --- */
:root[data-theme='light'] {
  --color-bg: #f4f5f7;
  --color-bg-raised: #ffffff;
  --color-surface: #ffffff;
  --color-surface-hover: #eceef2;
  --color-border: #ccd1d9;
  --color-border-strong: #9aa1ac;
  --color-text: #1a1c20;
  --color-text-muted: #4b5563;
  --color-text-faint: #5b6472;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-muted: #dbe6fd;
  --color-success: #15803d;
  --color-success-muted: #dcf7e3;
  --color-warning: #92650a;
  --color-warning-muted: #fbecc8;
  --color-danger: #dc2626;
  --color-danger-muted: #fbdede;
  --color-info: #0369a1;
  --color-info-muted: #dbf1fc;
  --color-purple: #7c3aed;
  --color-purple-muted: #ece3fd;
  --color-teal: #0f766e;
  --color-teal-muted: #d4f3ee;
  --color-rose: #be123c;
  --color-rose-muted: #fbdde5;
}

/* --- Reset: normalizacja zachowań przeglądarki, nic wizualnego --------------- */
@layer reset {
  *, ::before, ::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
  }
  html {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
  }
  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }
  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }
  a {
    color: inherit;
    text-decoration: inherit;
  }
  b, strong {
    font-weight: bolder;
  }
  code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: 1em;
  }
  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }
  ol, ul, menu {
    list-style: none;
  }
  img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
  }
  img, video {
    max-width: 100%;
    height: auto;
  }
  button, input, select, optgroup, textarea {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
    border-radius: 0;
    background-color: transparent;
  }
  button, input:where([type='button'], [type='reset'], [type='submit']) {
    appearance: button;
    cursor: pointer;
  }
  textarea {
    resize: vertical;
  }
  ::placeholder {
    color: var(--color-text-faint);
    opacity: 1;
  }
  [hidden] {
    display: none !important;
  }
  [x-cloak] {
    display: none !important;
  }
}

/* --- Baza: wygląd całej strony ------------------------------------------------ */
@layer base {
  html {
    color-scheme: dark;
  }
  html[data-theme='light'] {
    color-scheme: light;
  }
  body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-feature-settings: "cv11", "ss01";
  }
  ::selection {
    background-color: var(--color-accent-muted);
  }
  :focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 1px;
  }
}

/* --- Komponenty: klocki interfejsu CandorLims --------------------------------------- */
@layer components {
  .app-shell {
    min-height: 100vh;
  }
  .app-layout {
    display: flex;
    min-height: 100vh;
  }

  /* --- Sidebar (nawigacja) --------------------------------------------------- */
  .sidebar {
    --sidebar-w: 232px;
    --sidebar-w-collapsed: 60px;
    width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg-raised);
    border-right: 1px solid var(--color-border);
    height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
    overflow: hidden;
  }
  .sidebar.is-collapsed {
    width: var(--sidebar-w-collapsed);
  }
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 0.9rem;
    min-height: 3.25rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--color-text);
    text-decoration: none;
    min-width: 0;
  }
  .brand-mark {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.4rem;
    background-color: var(--color-accent-muted);
    color: var(--color-accent-hover);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
  }
  .brand-label {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
    overflow: hidden;
    white-space: nowrap;
  }
  /* Znak słowny jak na stronie informacyjnej: „Candor” pogrubione + lżejsze „Lims”. */
  .wordmark {
    font-weight: 760;
    letter-spacing: -0.03em;
  }
  .wm-sub {
    font-weight: 500;
    color: var(--color-text-muted);
    letter-spacing: -0.03em;
  }
  /* Nazwa laboratorium klienta (SystemSettings) pod nazwą produktu. */
  .brand-lab {
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .auth-brand {
    font-size: 1.5rem;
    margin: 0 0 0.1rem;
  }
  .auth-lab {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin: 0 0 0.5rem;
  }
  .sidebar-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.35rem;
    color: var(--color-text-muted);
    background: transparent;
    cursor: pointer;
  }
  .sidebar-toggle:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-text);
  }
  .sidebar.is-collapsed .sidebar-toggle svg {
    transform: rotate(180deg);
  }
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem;
    flex: 1;
    overflow-y: auto;
  }
  .nav-section-title {
    padding: 0.75rem 0.6rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-faint);
  }
  .sidebar-nav .nav-section-title:first-child {
    padding-top: 0.15rem;
  }
  .sidebar.is-collapsed .nav-section-title {
    height: 0;
    margin: 0.5rem 0.6rem;
    padding: 0;
    font-size: 0;
    color: transparent;
    overflow: hidden;
    border-top: 1px solid var(--color-border);
  }
  .sidebar.is-collapsed .nav-section-title:first-child {
    display: none;
  }
  .nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    border-radius: 0.4rem;
    font: inherit;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: none;
    white-space: nowrap;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
  }
  .nav-link:hover {
    color: var(--color-text);
    background-color: var(--color-surface-hover);
  }
  .nav-link.is-active {
    color: var(--color-text);
    background-color: var(--color-accent-muted);
  }
  .nav-icon {
    flex-shrink: 0;
    display: inline-flex;
    width: 1.15rem;
    height: 1.15rem;
  }
  .nav-icon svg {
    width: 100%;
    height: 100%;
  }
  .nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kbd-hint {
    margin-left: auto;
    border: 1px solid var(--color-border-strong);
    border-radius: 0.3rem;
    padding: 0.05rem 0.4rem;
    flex-shrink: 0;
  }
  .sidebar-footer {
    border-top: 1px solid var(--color-border);
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex-shrink: 0;
  }
  .user-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.3rem;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    padding: 0.3rem 0.6rem;
  }
  .user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  a.user-name:hover {
    color: var(--color-accent);
    cursor: pointer;
  }
  .sidebar.is-collapsed .brand-label,
  .sidebar.is-collapsed .nav-label,
  .sidebar.is-collapsed .kbd-hint,
  .sidebar.is-collapsed .user-name {
    display: none;
  }
  .sidebar.is-collapsed .nav-link {
    justify-content: center;
    padding: 0.5rem;
  }
  @media (max-width: 768px) {
    .sidebar {
      width: var(--sidebar-w-collapsed) !important;
    }
    .sidebar .brand-label,
    .sidebar .nav-label,
    .sidebar .kbd-hint,
    .sidebar .user-name {
      display: none !important;
    }
    .sidebar .nav-link {
      justify-content: center;
      padding: 0.5rem;
    }
    .sidebar .nav-section-title {
      height: 0;
      margin: 0.5rem 0.6rem;
      padding: 0;
      font-size: 0;
      color: transparent;
      overflow: hidden;
      border-top: 1px solid var(--color-border);
    }
    .sidebar .nav-section-title:first-child {
      display: none;
    }
    .sidebar-toggle {
      display: none;
    }
    .content {
      padding: 1.25rem 1rem 2.5rem;
    }
  }
  .content {
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 3rem;
  }
  .panel {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.6rem;
    padding: 1.25rem 1.5rem;
  }
  .panel--narrow {
    max-width: 26rem;
  }
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.45rem;
    border: 1px solid var(--color-border-strong);
    background-color: var(--color-surface);
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
  }
  .btn:hover {
    background-color: var(--color-surface-hover);
  }
  .btn--primary {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #0b1220;
  }
  .btn--primary:hover {
    background-color: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
  }
  .btn--danger {
    background-color: transparent;
    border-color: var(--color-danger);
    color: var(--color-danger);
  }
  .btn--danger:hover {
    background-color: var(--color-danger-muted);
  }
  .link-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.8125rem;
    padding: 0;
  }
  .link-btn:hover {
    color: var(--color-text);
  }
  .field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.875rem;
  }
  .field input, .field select, .field textarea {
    width: 100%;
  }
  .field label, label {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
  }
  input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="date"], input[type="datetime-local"], input[type="search"], input[type="file"], textarea, select {
    background-color: var(--color-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: 0.4rem;
    padding: 0.45rem 0.65rem;
    color: var(--color-text);
    font-size: 0.9rem;
    font-family: inherit;
  }
  input:focus, textarea:focus, select:focus {
    border-color: var(--color-accent);
  }
  .muted {
    color: var(--color-text-muted);
  }
  .faint {
    color: var(--color-text-faint);
  }
  .mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }
  .sample-link {
    color: var(--color-accent-hover);
    font-weight: 600;
    text-decoration: none;
  }
  .sample-link:hover {
    text-decoration: underline;
  }
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid transparent;
  }
  .badge--neutral {
    background-color: var(--color-surface-hover);
    color: var(--color-text-muted);
  }
  .badge--success {
    background-color: var(--color-success-muted);
    color: var(--color-success);
  }
  .badge--warning {
    background-color: var(--color-warning-muted);
    color: var(--color-warning);
  }
  .badge--danger {
    background-color: var(--color-danger-muted);
    color: var(--color-danger);
  }
  .badge--accent {
    background-color: var(--color-accent-muted);
    color: var(--color-accent-hover);
  }
  .badge--info {
    background-color: var(--color-info-muted);
    color: var(--color-info);
  }
  .badge--purple {
    background-color: var(--color-purple-muted);
    color: var(--color-purple);
  }
  .badge--teal {
    background-color: var(--color-teal-muted);
    color: var(--color-teal);
  }
  .badge--rose {
    background-color: var(--color-rose-muted);
    color: var(--color-rose);
  }
  .messages {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .message {
    padding: 0.6rem 0.9rem;
    border-radius: 0.45rem;
    font-size: 0.875rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
  }
  .message--success {
    border-color: var(--color-success);
    color: var(--color-success);
  }
  .message--error {
    border-color: var(--color-danger);
    color: var(--color-danger);
  }
  .message--warning {
    border-color: var(--color-warning);
    color: var(--color-warning);
  }
  .auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }
  .auth-card {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    width: 100%;
    max-width: 28rem;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 2.5rem;
  }
  .auth-card h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
  }
  .form-error {
    color: var(--color-danger);
    font-size: 0.8125rem;
  }
  .cmdk-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgb(0 0 0 / 0.5);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
  }
  .cmdk-panel {
    width: 100%;
    max-width: 34rem;
    background-color: var(--color-bg-raised);
    border: 1px solid var(--color-border-strong);
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgb(0 0 0 / 0.5);
    overflow: hidden;
  }
  .cmdk-input {
    width: 100%;
    padding: 0.9rem 1.1rem;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1rem;
  }
  .cmdk-input:focus {
    outline: none;
  }
  .cmdk-results {
    max-height: 22rem;
    overflow-y: auto;
    padding: 0.4rem;
  }
  .cmdk-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.75rem;
    border-radius: 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--color-text);
  }
  .cmdk-item.is-active {
    background-color: var(--color-surface-hover);
  }
  .cmdk-hint {
    color: var(--color-text-faint);
    font-size: 0.75rem;
  }

  /* --- Dokumentacja (apps.docs) ------------------------------------------- */
  .docs-index-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 0.75rem;
  }
  .docs-index-card {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--color-text);
  }
  .docs-index-card:hover {
    background-color: var(--color-surface-hover);
  }
  .docs-layout {
    display: grid;
    grid-template-columns: 15rem 1fr;
    gap: 1rem;
    align-items: start;
  }
  .docs-nav {
    position: sticky;
    top: 1rem;
  }
  .docs-nav-title {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-bottom: 0.25rem;
  }
  .docs-nav-link {
    display: block;
    padding: 0.35rem 0.5rem;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
  }
  .docs-nav-link:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-text);
  }
  .docs-nav-link.is-active {
    background-color: var(--color-accent-muted);
    color: var(--color-text);
    font-weight: 600;
  }
  .docs-content {
    max-width: 52rem;
    line-height: 1.65;
  }
  .docs-content h1, .docs-content h2, .docs-content h3, .docs-content h4 {
    font-weight: 600;
    line-height: 1.3;
    margin-top: 1.75rem;
    margin-bottom: 0.6rem;
  }
  .docs-content h1:first-child, .docs-content h2:first-child { margin-top: 0; }
  .docs-content h1 { font-size: 1.4rem; }
  .docs-content h2 { font-size: 1.15rem; padding-top: 0.5rem; border-top: 1px solid var(--color-border); }
  .docs-content h2:first-child { border-top: none; padding-top: 0; }
  .docs-content h3 { font-size: 1rem; }
  .docs-content p { margin-bottom: 0.9rem; }
  .docs-content ul, .docs-content ol {
    margin: 0 0 0.9rem 1.4rem;
  }
  .docs-content ul { list-style: disc; }
  .docs-content ol { list-style: decimal; }
  .docs-content li { margin-bottom: 0.3rem; }
  .docs-content a { color: var(--color-accent); text-decoration: underline; }
  .docs-content a:hover { color: var(--color-accent-hover); }
  .docs-content code {
    background-color: var(--color-surface-hover);
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.85em;
  }
  .docs-content pre {
    background-color: var(--color-bg-raised);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    overflow-x: auto;
    margin-bottom: 0.9rem;
  }
  .docs-content pre code { background: none; padding: 0; }
  .docs-content blockquote {
    border-left: 3px solid var(--color-accent);
    padding-left: 0.9rem;
    color: var(--color-text-muted);
    margin: 0 0 0.9rem;
  }
  .docs-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0.9rem;
    font-size: 0.9rem;
  }
  .docs-content th, .docs-content td {
    border: 1px solid var(--color-border);
    padding: 0.4rem 0.6rem;
    text-align: left;
  }
  .docs-content th { background-color: var(--color-surface-hover); }
  .docs-content strong { font-weight: 600; }
  .docs-content hr { border-top: 1px solid var(--color-border); margin: 1.5rem 0; }
  @media (max-width: 900px) {
    .docs-layout { grid-template-columns: 1fr; }
    .docs-nav { position: static; }
  }
}

/* --- Utility: drobne, wielokrotnego użytku klasy layoutu ---------------------- */
@layer utilities {
  .flex { display: flex; }
  .grid { display: grid; }
  .flex-col { flex-direction: column; }
  .flex-wrap { flex-wrap: wrap; }
  .items-baseline { align-items: baseline; }
  .items-center { align-items: center; }
  .items-end { align-items: flex-end; }
  .justify-between { justify-content: space-between; }

  .gap-1 { gap: calc(var(--spacing) * 1); }
  .gap-2 { gap: calc(var(--spacing) * 2); }
  .gap-3 { gap: calc(var(--spacing) * 3); }
  .gap-4 { gap: calc(var(--spacing) * 4); }

  .mt-1 { margin-top: calc(var(--spacing) * 1); }
  .mt-2 { margin-top: calc(var(--spacing) * 2); }
  .mt-4 { margin-top: calc(var(--spacing) * 4); }
  .mb-2 { margin-bottom: calc(var(--spacing) * 2); }
  .mb-3 { margin-bottom: calc(var(--spacing) * 3); }
  .mb-4 { margin-bottom: calc(var(--spacing) * 4); }
  .mb-6 { margin-bottom: calc(var(--spacing) * 6); }

  .py-1 { padding-block: calc(var(--spacing) * 1); }
  .py-2 { padding-block: calc(var(--spacing) * 2); }
  .py-3 { padding-block: calc(var(--spacing) * 3); }
  .pr-3 { padding-right: calc(var(--spacing) * 3); }

  .w-full { width: 100%; }
  .min-w-0 { min-width: 0; }

  .border-t { border-top: 1px solid; }
  .border-b { border-bottom: 1px solid; }
  .truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .text-left { text-align: left; }
  .text-right { text-align: right; }
  .text-lg { font-size: var(--text-lg); line-height: var(--text-lg--line-height); }
  .text-sm { font-size: var(--text-sm); line-height: var(--text-sm--line-height); }
  .text-xs { font-size: var(--text-xs); line-height: var(--text-xs--line-height); }
  .font-normal { font-weight: var(--font-weight-normal); }
  .font-semibold { font-weight: var(--font-weight-semibold); }
}

/* Poza warstwami @layer celowo — musi wygrywać zawsze przy druku, np. nad sidebarem. */
@media print {
  .sidebar, .no-print {
    display: none !important;
  }
  .content {
    max-width: none;
    padding: 0;
  }
}
