/* =================================================================
   ParkingKudowa — Design System
   Merkury Zębik Sp. j. · rezerwacje.parkingkudowa.pl
   -----------------------------------------------------------------
   Single CSS file shared by both the public client (mobile-first)
   and the admin panel (desktop-first). Override-friendly: anything
   the admin needs to densify lives under `.app-admin` on <body>.
   ================================================================= */

/* ---------- Fonts (SELF-HOSTED — RODO) ---------- */
/* Manrope = humanist sans (calm, readable for older kuracjusze).
   Newsreader = warm low-contrast serif, used only for the public
   wordmark and big editorial moments. JetBrains Mono = tabular
   numbers, license plates, IDs in admin.
   Pliki .woff2 w src/public/fonts/, eliminujemy transfer IP do Google. */
@import url('/static/fonts/fonts.css');

/* =================================================================
   1. TOKENS
   ================================================================= */
:root {
  /* --- Palette: muted Nordic spruce + sandstone + amber accent ---
     Primary spruce drives CTAs on admin, links, focus rings.
     Amber is reserved for the *one* primary CTA on the public site
     and for warning states. */

  /* Sudety Blue (primary) — głęboki niebieski z wody zdrojowej.
     Skojarzenie: znak P (biały P na niebieskim), zaufanie do płatności,
     pasma gór w zimowy ranek. Sparowany z ciepłym bursztynem niżej. */
  --c-primary-50:  #eaf1f8;
  --c-primary-100: #cfdfee;
  --c-primary-200: #9ebcdb;
  --c-primary-300: #6896c4;
  --c-primary-400: #3c72a8;
  --c-primary-500: #285a8e;   /* base */
  --c-primary-600: #1f4773;
  --c-primary-700: #173758;   /* nagłówki, CTA admina, focus */
  --c-primary-800: #102842;
  --c-primary-900: #091a2d;

  /* Amber (warm accent — CTA + warning) */
  --c-amber-50:  #fbf3e6;
  --c-amber-100: #f4e1bf;
  --c-amber-200: #e9c684;
  --c-amber-300: #d9a64a;
  --c-amber-400: #c98a2e;
  --c-amber-500: #b1721f;   /* base */
  --c-amber-600: #8e5a18;
  --c-amber-700: #6a4313;

  /* Neutrals — stone, slightly warm/green-tinted so it sits with spruce */
  --c-neutral-0:   #ffffff;
  --c-neutral-50:  #f8f7f3;   /* page bg public */
  --c-neutral-100: #f1efe9;
  --c-neutral-150: #ebe9e2;
  --c-neutral-200: #ddd9cf;
  --c-neutral-300: #c2beb2;
  --c-neutral-400: #9c988c;
  --c-neutral-500: #6f6c62;
  --c-neutral-600: #4f4c44;
  --c-neutral-700: #353329;   /* body text */
  --c-neutral-800: #23221c;   /* headings */
  --c-neutral-900: #14130f;

  /* Status — semantic */
  --c-info-bg:      #e5eef6;
  --c-info-text:    #214e7a;     /* PAID */
  --c-info-border:  #b7cee4;

  --c-success-bg:   #e1efe3;
  --c-success-text: #2f6a3f;     /* ACTIVE */
  --c-success-border:#b7d5bd;

  --c-warning-bg:   #f8ecc9;
  --c-warning-text: #7a5610;     /* PENDING */
  --c-warning-border:#e6cf86;

  --c-danger-bg:    #f5dcd6;
  --c-danger-text:  #8a2e25;     /* FAILED, REFUNDED */
  --c-danger-border:#e3b3a8;

  --c-muted-bg:     #ebe9e2;
  --c-muted-text:   #55534a;     /* EXPIRED, CANCELLED */
  --c-muted-border: #d4d0c5;

  /* --- Typography --- */
  --font-sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Type scale — 5 sizes, friendly on mobile */
  --t-xs:   12px;
  --t-sm:   13px;
  --t-base: 15px;
  --t-md:   17px;
  --t-lg:   20px;
  --t-xl:   26px;
  --t-2xl:  34px;
  --t-3xl:  44px;

  --lh-tight:  1.15;
  --lh-snug:   1.3;
  --lh-normal: 1.5;
  --lh-loose:  1.65;

  /* --- Spacing (4px scale) --- */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  20px;
  --s-6:  24px;
  --s-7:  28px;
  --s-8:  32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-14: 56px;
  --s-16: 64px;
  --s-20: 80px;

  /* --- Radius (subtle, 6–14) --- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-pill: 999px;

  /* --- Elevation (very subtle, cool shadow) --- */
  --shadow-xs: 0 1px 2px rgba(15, 28, 25, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 28, 25, 0.04), 0 2px 6px rgba(15, 28, 25, 0.05);
  --shadow-md: 0 2px 4px rgba(15, 28, 25, 0.05), 0 8px 20px rgba(15, 28, 25, 0.07);
  --shadow-lg: 0 12px 32px rgba(15, 28, 25, 0.10), 0 4px 8px rgba(15, 28, 25, 0.05);

  /* --- Motion --- */
  --t-fast:  120ms cubic-bezier(.2,.7,.3,1);
  --t-base:  180ms cubic-bezier(.2,.7,.3,1);
  --t-slow:  280ms cubic-bezier(.2,.7,.3,1);

  /* --- Layout --- */
  --container-public: 720px;
  --container-admin:  1320px;
  --header-h-public:  64px;
  --header-h-admin:   56px;
  --sidebar-w-admin:  232px;

  /* Convenience aliases */
  --bg-page: var(--c-neutral-50);
  --bg-card: var(--c-neutral-0);
  --text:    var(--c-neutral-700);
  --text-strong: var(--c-neutral-800);
  --text-muted:  var(--c-neutral-500);
  --border:  var(--c-neutral-200);
  --border-strong: var(--c-neutral-300);
  --link:    var(--c-primary-700);
  --focus:   color-mix(in oklab, var(--c-primary-500) 60%, white);
}

/* =================================================================
   2. RESET + BASE
   ================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: var(--lh-normal);
  color: var(--text);
  background: var(--bg-page);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--text-strong); font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--link); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-primary-500); text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--c-amber-200); color: var(--c-neutral-900); }

:focus-visible {
  outline: 2px solid var(--c-primary-500);
  outline-offset: 2px;
  border-radius: 4px;
}

/* =================================================================
   3. TYPOGRAPHY HELPERS
   ================================================================= */
.h-display { font-family: var(--font-serif); font-weight: 500; font-size: var(--t-3xl); line-height: var(--lh-tight); letter-spacing: -0.015em; color: var(--text-strong); }
.h-1 { font-size: var(--t-2xl); line-height: var(--lh-tight); letter-spacing: -0.015em; }
.h-2 { font-size: var(--t-xl); line-height: var(--lh-snug); letter-spacing: -0.01em; }
.h-3 { font-size: var(--t-lg); line-height: var(--lh-snug); }
.h-4 { font-size: var(--t-md); line-height: var(--lh-snug); font-weight: 600; }
.text-sm  { font-size: var(--t-sm); }
.text-xs  { font-size: var(--t-xs); }
.text-mono{ font-family: var(--font-mono); font-feature-settings: "tnum"; letter-spacing: -0.01em; }
.text-muted { color: var(--text-muted); }
.text-strong { color: var(--text-strong); font-weight: 600; }

/* =================================================================
   4. LAYOUT PRIMITIVES
   ================================================================= */
.container { max-width: var(--container-public); margin: 0 auto; padding: 0 var(--s-5); }
.container-admin { max-width: var(--container-admin); margin: 0 auto; padding: 0 var(--s-6); }

.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--stack-gap, var(--s-4)); }
.row   { display: flex; align-items: center; gap: var(--row-gap, var(--s-3)); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.grid { display: grid; gap: var(--s-4); }

/* =================================================================
   5. BUTTONS
   -----------------------------------------------------------------
   Variants: .btn-primary  → solid spruce, default action in admin
             .btn-cta      → solid amber, the single "Zarezerwuj" CTA
                             on the public site (use sparingly)
             .btn-secondary→ outlined spruce, secondary actions
             .btn-ghost    → flat, low-priority inline actions
             .btn-danger   → muted red, destructive (anuluj / usuń)
   Sizes:    default 44px (mobile-friendly), .btn-sm 36px, .btn-lg 52px
   ================================================================= */
.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text-strong);
  --btn-border: transparent;
  --btn-bg-hover: rgba(0,0,0,0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 44px;
  padding: 0 var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--t-base);
  line-height: 1;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
  user-select: none;
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn .ico { width: 18px; height: 18px; flex: 0 0 auto; }

.btn-primary {
  --btn-bg: var(--c-primary-700);
  --btn-fg: var(--c-neutral-0);
  --btn-border: var(--c-primary-700);
  --btn-bg-hover: var(--c-primary-800);
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover { border-color: var(--c-primary-800); }

.btn-cta {
  --btn-bg: var(--c-amber-500);
  --btn-fg: var(--c-neutral-0);
  --btn-border: var(--c-amber-500);
  --btn-bg-hover: var(--c-amber-600);
  box-shadow: var(--shadow-sm);
  height: 52px;
  font-size: var(--t-md);
  padding: 0 var(--s-6);
}
.btn-cta:hover { border-color: var(--c-amber-600); }

.btn-secondary {
  --btn-bg: var(--c-neutral-0);
  --btn-fg: var(--c-primary-700);
  --btn-border: var(--border-strong);
  --btn-bg-hover: var(--c-neutral-100);
}
.btn-secondary:hover { border-color: var(--c-primary-300); }

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-border: transparent;
  --btn-bg-hover: var(--c-neutral-100);
}

.btn-danger {
  --btn-bg: var(--c-neutral-0);
  --btn-fg: var(--c-danger-text);
  --btn-border: var(--c-danger-border);
  --btn-bg-hover: var(--c-danger-bg);
}

.btn-sm { height: 36px; padding: 0 var(--s-4); font-size: var(--t-sm); border-radius: var(--r-sm); }
.btn-lg { height: 52px; padding: 0 var(--s-6); font-size: var(--t-md); }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }

/* =================================================================
   6. CARDS
   ================================================================= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-7) var(--s-8);
}
.card + .card,
.card-stack > * + * { margin-top: var(--s-6); }
.card-tight { padding: var(--s-5); }
.card > * + * { margin-top: var(--s-4); }
.card > h2, .card > h3, .card > .card-title { margin-bottom: var(--s-3); }
.card-hover { transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.card-hover:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.card-section + .card-section { margin-top: var(--s-6); padding-top: var(--s-6); border-top: 1px solid var(--border); }
.card-title { font-size: var(--t-md); font-weight: 700; color: var(--text-strong); }
.card-subtitle { font-size: var(--t-sm); color: var(--text-muted); margin-top: 2px; }

/* =================================================================
   7. FORMS
   -----------------------------------------------------------------
   form-row wraps label + input + optional hint/error. All inputs are
   ≥44px tall for thumb-friendly tap on mobile.
   ================================================================= */
.form-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--s-5); }
.form-row-inline { flex-direction: row; align-items: center; gap: var(--s-3); }
.form-stack > * + * { margin-top: var(--s-5); }
fieldset.form-row,
.form-group { margin-bottom: var(--s-6); }

.label {
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 6px;
}
.label .required { color: var(--c-danger-text); font-weight: 700; }
.label .optional { font-weight: 400; color: var(--text-muted); }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: var(--t-base);
  line-height: 1.4;
  color: var(--text-strong);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
}
.input::placeholder { color: var(--c-neutral-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--c-neutral-400); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-primary-500);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary-500) 18%, transparent);
}
.input[aria-invalid="true"], .select[aria-invalid="true"] {
  border-color: var(--c-danger-text);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-danger-text) 14%, transparent);
}
.textarea { min-height: 120px; resize: vertical; line-height: var(--lh-normal); }

.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'><path d='M4 6l4 4 4-4' stroke='%234f4c44' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.input-plate {
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: var(--t-md);
}

.hint { font-size: var(--t-xs); color: var(--text-muted); }
.field-error { font-size: var(--t-xs); color: var(--c-danger-text); font-weight: 600; display: flex; align-items: center; gap: 4px; }

/* Checkbox / radio — custom but native-feeling */
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--t-fast);
}
.check:hover { background: var(--c-neutral-100); }
.check input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--border-strong); border-radius: 4px; flex: 0 0 auto; margin-top: 2px; cursor: pointer; position: relative; background: var(--bg-card); }
.check input:checked { background: var(--c-primary-700); border-color: var(--c-primary-700); }
.check input:checked::after { content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.check input[type="radio"] { border-radius: 50%; }
.check input[type="radio"]:checked::after { left: 4px; top: 4px; width: 8px; height: 8px; background: white; border: 0; border-radius: 50%; transform: none; }
.check .check-label { font-size: var(--t-sm); line-height: var(--lh-snug); color: var(--text); }

/* Segmented control / tabs */
.segmented {
  display: inline-flex;
  background: var(--c-neutral-100);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 8px 14px;
  border-radius: 7px;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented button:hover { color: var(--text-strong); }
.segmented button[aria-pressed="true"], .segmented button.is-active {
  background: var(--bg-card);
  color: var(--text-strong);
  box-shadow: var(--shadow-xs);
}

.tabs {
  display: flex;
  gap: var(--s-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-5);
}
.tabs a, .tabs button {
  padding: 12px var(--s-4);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--text-muted);
  border: 0;
  background: transparent;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tabs a:hover, .tabs button:hover { color: var(--text-strong); text-decoration: none; }
.tabs a.is-active, .tabs button.is-active { color: var(--c-primary-700); border-bottom-color: var(--c-primary-700); }

/* =================================================================
   8. BADGES / STATUS PILLS
   -----------------------------------------------------------------
   Naming maps 1:1 to backend status enum.
   ================================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge.no-dot::before { display: none; }

.badge-pending  { background: var(--c-warning-bg); color: var(--c-warning-text); border-color: var(--c-warning-border); }
.badge-paid     { background: var(--c-info-bg);    color: var(--c-info-text);    border-color: var(--c-info-border); }
.badge-active   { background: var(--c-success-bg); color: var(--c-success-text); border-color: var(--c-success-border); }
.badge-expired,
.badge-cancelled{ background: var(--c-muted-bg);   color: var(--c-muted-text);   border-color: var(--c-muted-border); }
.badge-failed,
.badge-refunded { background: var(--c-danger-bg);  color: var(--c-danger-text);  border-color: var(--c-danger-border); }

/* =================================================================
   9. ALERTS
   ================================================================= */
.alert {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid;
  align-items: flex-start;
  font-size: var(--t-sm);
  line-height: var(--lh-snug);
}
.alert .alert-icon { flex: 0 0 auto; margin-top: 1px; }
.alert .alert-title { font-weight: 700; color: var(--text-strong); margin-bottom: 2px; }
.alert-info    { background: var(--c-info-bg);    color: var(--c-info-text);    border-color: var(--c-info-border); }
.alert-success { background: var(--c-success-bg); color: var(--c-success-text); border-color: var(--c-success-border); }
.alert-warning { background: var(--c-warning-bg); color: var(--c-warning-text); border-color: var(--c-warning-border); }
.alert-error   { background: var(--c-danger-bg);  color: var(--c-danger-text);  border-color: var(--c-danger-border); }
.alert-info .alert-title    { color: var(--c-info-text); }
.alert-success .alert-title { color: var(--c-success-text); }
.alert-warning .alert-title { color: var(--c-warning-text); }
.alert-error .alert-title   { color: var(--c-danger-text); }

/* =================================================================
   10. STAT CARDS
   ================================================================= */
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.stat-label { font-size: var(--t-xs); font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-value { font-size: var(--t-2xl); font-weight: 700; color: var(--text-strong); line-height: 1.1; margin-top: var(--s-2); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--t-xs); font-weight: 600; margin-top: var(--s-2); padding: 2px 8px; border-radius: var(--r-pill); }
.stat-delta-up   { color: var(--c-success-text); background: var(--c-success-bg); }
.stat-delta-down { color: var(--c-danger-text);  background: var(--c-danger-bg); }
.stat-sub { font-size: var(--t-xs); color: var(--text-muted); margin-top: var(--s-1); }

/* =================================================================
   11. TABLE
   ================================================================= */
.table-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.table th {
  text-align: left;
  font-size: var(--t-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: var(--s-4) var(--s-5);
  background: var(--c-neutral-50);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--c-neutral-50); }
.table .td-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }
.table .td-plate { font-family: var(--font-mono); font-weight: 600; letter-spacing: 0.05em; }
.table .td-id { font-family: var(--font-mono); color: var(--text-muted); font-size: var(--t-xs); }

/* Mobile card-list — tabela zamienia sie w stos kart na waskich ekranach.
   Wymaga: <table class="table table-cards"> + kazdy <td> ma data-label="..."
   z nazwa kolumny (zastapi <thead> ktore jest schowane na mobile).
   Dziala dla wszystkich tabel z klasa .table-cards. */
@media (max-width: 720px) {
  .table-cards { border-collapse: separate; border-spacing: 0; }
  .table-cards thead { display: none; }
  .table-cards tbody,
  .table-cards tr,
  .table-cards td { display: block; width: 100%; box-sizing: border-box; }
  .table-cards tr {
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    /* Margines boczny zeby karta nie dotykala krawedzi ekranu - widac
       wyraznie ze karta sie konczy, jest oddech wizualny */
    margin: 0 var(--s-2) var(--s-3);
    background: var(--bg-card);
    padding: var(--s-4) var(--s-4);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  }
  .table-cards tr:hover td { background: transparent; }
  .table-cards tr:last-child { margin-bottom: 0; }
  /* Każda komórka jako para: label NAD wartością (label/value stack).
     To pewniejsze niż flex space-between - wartości nigdy nie wystaja
     poza ramke karty. */
  .table-cards td {
    border-bottom: 1px solid var(--c-neutral-100);
    padding: 8px 0;
    text-align: left;
    min-height: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .table-cards td:first-child { padding-top: 0; }
  .table-cards td:last-child { border-bottom: 0; padding-bottom: 0; }
  .table-cards td::before {
    content: attr(data-label);
    display: block;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
  }
  /* Komorki z `data-label=""` (np. akcje) — bez labela, wycentrowane */
  .table-cards td[data-label=""]::before { display: none; }
  .table-cards td[data-label=""] {
    text-align: center;
    padding-top: 12px;
  }
  .table-cards td.td-changes::before,
  .table-cards td.td-wide::before { margin-bottom: 6px; }
  .table-cards td.td-changes > div { text-align: left !important; width: 100%; }
  /* Wrapper tabeli na mobile - bez tla, marginesy w wierszach */
  .table-cards-wrap { background: transparent; border: 0; border-radius: 0; overflow: visible; }
}

/* Dashboard layout — bottom row stackuje sie na mobile */
.dash-bottom-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 900px) {
  .dash-bottom-row { grid-template-columns: 1fr 320px; }
}

/* =================================================================
   12. NAVBAR (admin)
   ================================================================= */
.navbar {
  height: var(--header-h-admin);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--s-6);
  gap: var(--s-6);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 700;
  font-size: var(--t-base);
  color: var(--text-strong);
  letter-spacing: -0.01em;
}
/* Pełne logo (P-square + tekst PARKING KUDOWA.PL) — używane w sidebarze, headerze, loginie */
.brand-full-logo {
  height: auto;
  max-width: 100%;
  width: 180px;
  display: block;
}
.login-form .brand-full-logo { width: 220px; }

/* Gdy .brand zawiera pełne logo + tekst pomocniczy ("panel administratora",
   "Poznańska · rezerwacja online" itp.) — układamy w kolumnę, żeby napis
   nie ściskał się obok 180px szerokiego logo i nie łamał się na 2 linie. */
.brand:has(.brand-full-logo) {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--c-primary-700);
  color: var(--c-neutral-0);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.nav-links { display: flex; gap: 2px; align-items: center; flex: 1; }
.nav-links a {
  padding: 8px 12px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.nav-links a:hover { color: var(--text-strong); background: var(--c-neutral-100); text-decoration: none; }
.nav-links a.is-active { color: var(--text-strong); background: var(--c-neutral-100); }

.nav-user { display: flex; align-items: center; gap: var(--s-3); }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--c-primary-100);
  color: var(--c-primary-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--t-xs);
}

/* =================================================================
   13. BREADCRUMB
   ================================================================= */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--t-sm);
  color: var(--text-muted);
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-strong); text-decoration: none; }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: var(--text-strong); font-weight: 600; }

/* =================================================================
   14. MODAL / DIALOG
   ================================================================= */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 28, 25, 0.45);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: var(--s-5);
}
.modal {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  max-width: 440px;
  width: 100%;
  overflow: hidden;
}
.modal-header { padding: var(--s-5) var(--s-5) var(--s-2); }
.modal-title { font-size: var(--t-md); font-weight: 700; color: var(--text-strong); }
.modal-body { padding: 0 var(--s-5) var(--s-5); color: var(--text); font-size: var(--t-sm); line-height: var(--lh-normal); }
.modal-footer { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: var(--s-2); background: var(--c-neutral-50); }

/* =================================================================
   15. PUBLIC SITE — header / hero / pricing tier card
   ================================================================= */
.public-header {
  height: var(--header-h-public);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.public-header .container { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; }
.wordmark-text { font-family: var(--font-serif); font-size: var(--t-lg); font-weight: 500; color: var(--text-strong); letter-spacing: -0.01em; line-height: 1; }
.wordmark-sub { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.14em; margin-top: 2px; }
.wordmark-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: var(--c-primary-700);
  color: var(--c-amber-200);
  display: flex; align-items: center; justify-content: center;
}

.hero {
  padding: var(--s-12) 0 var(--s-10);
  text-align: left;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--t-xs); font-weight: 700;
  color: var(--c-primary-600);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 4px 10px;
  background: var(--c-primary-50);
  border-radius: var(--r-pill);
  margin-bottom: var(--s-4);
}
.hero-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(32px, 7vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  text-wrap: balance;
}
.hero-title em { font-style: italic; color: var(--c-primary-700); }
.hero-sub { margin-top: var(--s-4); font-size: var(--t-md); color: var(--text); line-height: var(--lh-normal); max-width: 52ch; text-wrap: pretty; }

.tier {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: var(--s-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-card);
  gap: var(--s-3);
}
.tier-days { font-size: var(--t-sm); color: var(--text-muted); font-weight: 600; }
.tier-price { font-family: var(--font-serif); font-size: var(--t-xl); font-weight: 500; color: var(--text-strong); }
.tier-price small { font-family: var(--font-sans); font-size: var(--t-xs); color: var(--text-muted); font-weight: 600; margin-left: 4px; letter-spacing: 0.04em; }

.availability {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--t-sm); color: var(--text);
  padding: 10px var(--s-4);
  background: var(--c-success-bg);
  border: 1px solid var(--c-success-border);
  border-radius: var(--r-md);
}
.availability .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-success-text); box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-success-text) 25%, transparent); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-success-text) 25%, transparent);} 50%{box-shadow: 0 0 0 7px color-mix(in oklab, var(--c-success-text) 0%, transparent);} }

/* Step indicator (mobile form) */
.steps { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--text-muted); font-weight: 600; }
.steps .step { display: inline-flex; align-items: center; gap: 6px; }
.steps .num { width: 20px; height: 20px; border-radius: 50%; background: var(--c-neutral-200); color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 11px; }
.steps .step.is-done .num { background: var(--c-primary-700); color: white; }
.steps .step.is-current .num { background: var(--c-primary-700); color: white; box-shadow: 0 0 0 3px color-mix(in oklab, var(--c-primary-700) 25%, transparent); }
.steps .step.is-current { color: var(--text-strong); }
.steps .bar { flex: 1; height: 2px; background: var(--c-neutral-200); border-radius: 2px; }

/* Price summary footer (sticky, mobile) */
.price-bar {
  position: sticky; bottom: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--s-3) var(--s-5);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-3);
  box-shadow: 0 -6px 18px rgba(15,28,25,0.04);
}
.price-bar .price { font-family: var(--font-serif); font-size: var(--t-xl); font-weight: 500; color: var(--text-strong); }
.price-bar .price small { font-family: var(--font-sans); font-size: var(--t-xs); color: var(--text-muted); display: block; margin-bottom: -2px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* =================================================================
   16. ADMIN — sidebar layout
   ================================================================= */
.admin-shell { display: grid; grid-template-columns: var(--sidebar-w-admin) 1fr; min-height: 100vh; }
.sidebar {
  background: var(--c-neutral-100);
  border-right: 1px solid var(--border);
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: var(--s-1);
}
.sidebar .brand { margin-bottom: var(--s-5); }
.sidebar-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-muted); padding: var(--s-3) var(--s-3) 6px; }
.sidebar a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--c-neutral-600);
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.sidebar a:hover { background: var(--c-neutral-150); color: var(--text-strong); text-decoration: none; }
.sidebar a.is-active { background: var(--bg-card); color: var(--c-primary-700); box-shadow: var(--shadow-xs); }
.sidebar a .ico { width: 16px; height: 16px; opacity: 0.7; }
.sidebar a.is-active .ico { opacity: 1; color: var(--c-primary-600); }
.sidebar .role-tag { margin-top: auto; font-size: var(--t-xs); color: var(--text-muted); padding: var(--s-3); display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--border); }

.main,
.admin-main { padding: var(--s-8) var(--s-10) var(--s-16); min-width: 0; max-width: 1480px; margin: 0 auto; width: 100%; }
.main > * + *,
.admin-main > * + * { margin-top: var(--s-6); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-7); flex-wrap: wrap; }
.page-title { font-size: var(--t-xl); font-weight: 700; color: var(--text-strong); letter-spacing: -0.015em; }
.page-sub { font-size: var(--t-sm); color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; gap: var(--s-2); align-items: center; }

/* Filter row */
.filter-row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-5); }
.search {
  flex: 1; min-width: 240px; max-width: 360px;
  position: relative;
}
.search input { padding-left: 38px; height: 40px; min-height: 40px; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* KPI grid */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
  margin-bottom: var(--s-6);
}
@media (min-width: 560px) { .kpi-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1100px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* Two-column detail layout */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: var(--s-8); align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

/* Danger zone — bottom of detail pages */
.danger-zone {
  border: 1px solid var(--c-danger-border);
  background: color-mix(in oklab, var(--c-danger-bg) 50%, white);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.danger-zone .h-4 { color: var(--c-danger-text); }

/* =================================================================
   17. UTILITIES
   ================================================================= */
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); } .mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); } .mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); }
.mt-8 { margin-top: var(--s-8); } .mt-10{ margin-top: var(--s-10); }
.mb-1 { margin-bottom: var(--s-1); } .mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); } .mb-5 { margin-bottom: var(--s-5); } .mb-6 { margin-bottom: var(--s-6); }
.flex-1 { flex: 1; } .flex-0 { flex: 0 0 auto; }
.gap-1 { gap: var(--s-1); } .gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); }
.divider { height: 1px; background: var(--border); margin: var(--s-4) 0; border: 0; }
.kbd { font-family: var(--font-mono); font-size: 11px; background: var(--c-neutral-100); border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 1px 6px; border-radius: 4px; color: var(--text); }

/* Tiny inline icons (16/20). All svgs use stroke="currentColor". */
.ico { display: inline-block; vertical-align: middle; }

/* =================================================================
   18. SENIOR-FRIENDLY PUBLIC OVERRIDES
   -----------------------------------------------------------------
   Apply `.app-public` to <body> on the customer-facing site.
   Cel: kuracjusz 65+ czyta w okularach na słońcu. Większy tekst,
   większe pola, większe przyciski, mniejszy cognitive load.
   ================================================================= */
.app-public {
  font-size: 18px;
  line-height: 1.6;
  color: var(--c-neutral-800);   /* mocniejszy kontrast tekstu */
}
.app-public p { line-height: 1.6; }
.app-public .h-1 { font-size: 32px; }
.app-public .h-2 { font-size: 26px; }
.app-public .h-3 { font-size: 22px; }
.app-public .h-4 { font-size: 19px; }
.app-public .text-sm { font-size: 15px; }
.app-public .text-xs { font-size: 13px; }
.app-public .text-muted { color: var(--c-neutral-600); } /* mocniejszy "muted" */

.app-public .btn { height: 56px; font-size: 17px; padding: 0 28px; border-radius: var(--r-md); }
.app-public .btn-cta { height: 64px; font-size: 19px; padding: 0 32px; }
.app-public .btn-sm { height: 44px; font-size: 15px; padding: 0 18px; }
.app-public .btn-lg { height: 64px; font-size: 19px; padding: 0 32px; }

.app-public .input,
.app-public .select,
.app-public .textarea {
  min-height: 56px;
  font-size: 18px;
  padding: 14px 16px;
  border-width: 1.5px;
}
.app-public .label { font-size: 16px; margin-bottom: 8px; }
.app-public .form-row { margin-bottom: var(--s-5); }
.app-public .hint { font-size: 14px; }

.app-public .check { padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); }
.app-public .check + .check { margin-top: 8px; }
.app-public .check input { width: 24px; height: 24px; margin-top: 0; }
.app-public .check input[type="checkbox"]:checked::after { left: 7px; top: 2px; width: 7px; height: 13px; }
.app-public .check .check-label { font-size: 16px; line-height: 1.5; }

.app-public .badge { font-size: 13px; padding: 5px 14px; }

/* Telefon zawsze widoczny, BARDZO duży w hero i CTA bottom */
.tel-cta {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 22px;
  color: var(--c-primary-700);
  letter-spacing: -0.01em;
  white-space: nowrap;
  background: white;
  padding: 14px 22px;
  border-radius: var(--r-md);
  border: 2px solid var(--c-primary-200);
  transition: all var(--t-fast);
  text-decoration: none;
}
.tel-cta:hover { background: var(--c-primary-50); border-color: var(--c-primary-400); text-decoration: none; }
.tel-cta .ico { color: var(--c-amber-500); }
.tel-cta-lg { font-size: 28px; padding: 18px 28px; }

/* =================================================================
   19. RESPONSIVE — admin panel mobile
   ================================================================= */

/* Mobile top bar i overlay — domyślnie ukryte (desktop) */
.admin-mobile-bar { display: none; }
.admin-overlay { display: none; }
.admin-burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: 44px; height: 44px;
  padding: 12px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  flex-shrink: 0;
}
.admin-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-strong);
  border-radius: 1px;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.admin-burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.admin-burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.admin-burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 720px) {
  /* Bezpiecznik globalny — na mobile NIGDY nie chcemy horyzontalnego scrolla
     calej strony. Pojedyncze elementy (np. segmented) moga scrollowac
     wewnetrznie, ale body nie. */
  body.app-admin { overflow-x: hidden; }
  .admin-main { overflow-x: hidden; min-width: 0; max-width: 100%; }

  .container-admin { padding: 0 var(--s-4); }
  .admin-shell { grid-template-columns: 1fr; min-height: 100vh; }
  .main,
  .admin-main { padding: var(--s-5) var(--s-4) var(--s-10); }
  .admin-main { padding-top: calc(56px + var(--s-5)); /* sticky bar 56px + oddech */ }
  .detail-grid { grid-template-columns: 1fr; }

  /* Page head — na mobile zawijamy i page-actions idzie pod tytul */
  .page-head { flex-direction: column; align-items: stretch; gap: var(--s-3); }
  .page-sub { word-break: break-word; }
  .page-actions { flex-wrap: wrap; }
  .page-actions .btn { flex: 1 1 auto; }

  /* Filter row na mobile — wszystko zawija się w pionie */
  .filter-row { gap: var(--s-2); flex-wrap: wrap; width: 100%; }
  .filter-row > * { min-width: 0; max-width: 100%; }
  .filter-row .search { width: 100%; min-width: 0; }
  .filter-row .search input { width: 100%; min-width: 0; }

  /* Segmented filtry — zawijaj buttony w kilka rzędów (zamiast scroll w bok).
     6 filtrów (Wszystkie/Oczekuje/Opłacona/Aktywna/Wygasła/Anulowana) nie
     zmieści sie w jednym rzędzie na 360px, więc zawijamy. */
  .segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    padding: 4px;
    box-sizing: border-box;
  }
  .segmented button {
    flex: 1 1 auto;
    padding: 7px 10px;
    font-size: 12px;
    white-space: nowrap;
    min-width: 0;
  }

  /* "Wyczyść" link w filter-row — na mobile zajmuje pełną szerokość pod
     pozostałymi filtrami zamiast wystawac z margin-left:auto */
  .filter-row > div[style*="margin-left:auto"],
  .filter-row .filter-clear {
    margin-left: 0 !important;
    width: 100%;
    text-align: center;
  }

  /* Table-wrap na mobile bez ramki/zaokrąglenia (cards same z ramką) */
  .table-cards.table { background: transparent; max-width: 100%; }
  .table-wrap:has(.table-cards) { background: transparent; border: 0; border-radius: 0; padding: 0; overflow: visible; }
  .table-cards tr { box-sizing: border-box; max-width: 100%; }

  /* Komorki z monospace zawartoscia (PK numery, tablice) - lamia sie zeby
     mieszcza sie w karcie zamiast wymuszac scroll horyzontalny */
  .table-cards td.text-mono,
  .table-cards td.td-id,
  .table-cards td.td-plate,
  .table-cards td .text-mono {
    overflow-wrap: anywhere;
    word-break: break-all;
    min-width: 0;
  }
  .table-cards td { min-width: 0; }

  /* Mobile top bar — sticky */
  .admin-mobile-bar {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    height: 56px;
    padding: 0 var(--s-3);
    background: white;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }
  .admin-mobile-title {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }
  .admin-mobile-title strong {
    font-size: 15px;
    color: var(--text-strong);
  }

  /* Sidebar jako drawer z lewej */
  .sidebar {
    display: flex;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    max-width: 80vw;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.25s ease-out;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    padding-top: var(--s-5);
  }
  .sidebar.is-open {
    transform: translateX(0);
  }

  /* Touch targety w sidebar — większe */
  .sidebar a {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 15px;
  }
  .sidebar a .ico {
    width: 20px;
    height: 20px;
  }

  /* Overlay za drawer */
  .admin-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
    z-index: 55;
  }
  .admin-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  /* Tabele admin — horizontal scroll na mobile */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table {
    min-width: 640px;  /* wymuś scroll horizontal zamiast zniekształceń */
    font-size: 13px;
  }
  .table th,
  .table td {
    padding: 8px 10px;
    white-space: nowrap;
  }

  /* Filter row — stackuje się */
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-row .search {
    max-width: none;
  }
  .filter-row .segmented {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Page head — stack tytuł i action button */
  .page-head {
    flex-direction: column;
    align-items: stretch;
  }
  .page-actions {
    flex-wrap: wrap;
  }
  .page-actions .btn {
    flex: 1 1 auto;
    min-height: 44px;
  }
}

/* =================================================================
   PATCH — brakujace klasy uzywane w layoutach public/admin EJS
   ================================================================= */

/* Layouts: utility row/gap */
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }

/* Public header brand sub-text used in layouts/public.ejs */
.brand-name { font-weight: 700; color: var(--text-strong); font-size: 15px; line-height: 1.2; }
.brand-sub { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 2px; line-height: 1; }
.public-header .brand { gap: var(--s-3); }
.public-header .brand-mark { width: 36px; height: 36px; border-radius: 9px; font-size: 14px; }

/* Public-header tel CTA — mniejsza wersja zeby zmiescila sie w nawigacji.
   Nadpisuje wieksza .tel-cta z app-public hero. */
.public-header .tel-cta {
  font-size: 14px;
  padding: 8px 14px;
  gap: 8px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  border-width: 1px;
}
.tel-cta .tel-ico { color: var(--c-amber-500); display: inline-flex; }
.tel-cta .tel-num { letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* Big tel band above footer */
.big-tel-band { background: var(--c-primary-700); padding: var(--s-8) 0; margin-top: var(--s-10); }
.big-tel { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: var(--s-2); color: white; text-align: center; }
.big-tel-label { font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; opacity: 0.7; }
.big-tel-num { font-family: var(--font-mono); font-size: clamp(28px, 5vw, 36px); font-weight: 700; color: var(--c-amber-200); letter-spacing: 0.06em; }
.big-tel-num:hover { color: var(--c-amber-300); text-decoration: none; }

/* Public footer */
.public-footer { background: var(--c-neutral-100); border-top: 1px solid var(--border); padding: var(--s-8) 0 var(--s-5); color: var(--text); font-size: var(--t-sm); }
.public-footer strong { color: var(--text-strong); }
.public-footer a { color: var(--text); }
.public-footer a:hover { color: var(--c-primary-700); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-6); line-height: 1.6; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links a { font-weight: 500; }
.footer-bottom { margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }

/* Main wrapper in public layout — auto centering */
.app-public main { display: block; }

/* ============================================================
   ADMIN LOGIN SCREEN
   Layout: mobile single column (form only), desktop 2-column
   (form 60% + brand/quote 40%). Pełna wysokość viewport,
   bez sidebar — widok przed autoryzacją.
   ============================================================ */

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--c-neutral-100);
}

.login-form {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: var(--s-8) var(--s-5);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Brand/quote po prawej — ukryty na mobile */
.login-side {
  display: none;
}

.login-side .ls-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--c-amber-500);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s-6);
}
.login-side .ls-quote {
  font-family: var(--font-serif, var(--font-sans));
  font-size: 28px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: white;
  max-width: 380px;
}
.login-side .ls-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

@media (min-width: 900px) {
  .login-wrap {
    grid-template-columns: 3fr 2fr;
  }
  .login-form {
    padding: var(--s-10) var(--s-8);
    max-width: 520px;
    margin: 0 auto;
  }
  .login-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--s-10) var(--s-8);
    background: linear-gradient(135deg, var(--c-primary-700) 0%, var(--c-primary-800, #102842) 100%);
    color: white;
  }
}

