/* =====================================================================
   CRM Hotelowy Expert - arkusz stylow

   Paleta z witryny hotelowyexpert.pl: grafit #111 niesie tresc i sidebar,
   zloto #DDC471 (kolor logo) jest znakiem marki, butelkowa zielen #1E3A33
   jest akcentem roboczym - przyciski, zakladki, zaznaczenia.

   Dlaczego akcentem nie jest zloto: bialy napis na #DDC471 ma kontrast
   ok. 1.8:1, czyli nieczytelny. Zielen daje z biela ponad 11:1. Zloto
   zostaje tam, gdzie lezy na ciemnym tle: logo, aktywna pozycja menu,
   wyroznienia w sidebarze i na pasku zaznaczenia.

   Nazwy zmiennych (--indygo, --lawenda) zostaly z pierwowzoru, zeby nie
   przepisywac kilkuset regul - --indygo to teraz zielen, --indygo-light
   to zloto, --lawenda to krem.

   Bez zewnetrznych zasobow: fonty leza w /assets/fonts, zadnego CDN.
   ===================================================================== */

/* ---------- Roboto - tresc (plik zmienny, cala os wag) -------------- */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/roboto-var-latin-ext.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: 'Roboto';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/roboto-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Ubuntu - naglowki (400 / 500 / 700) --------------------- */
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-400-latin-ext.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: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-500-latin-ext.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: 'Ubuntu';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-700-latin-ext.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: 'Ubuntu';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/ubuntu-700-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* paleta podstawowa */
  --grafit: #111111;
  --grafit-2: #1e1e24;
  --grafit-3: #2a2a32;
  --indygo: #1e3a33;
  --indygo-deep: #152a25;
  --indygo-light: #ddc471;
  --mgla: #d9d3c0;
  --lawenda: #f6efd6;

  /* powierzchnie */
  --bg: #f7f6f1;
  --card: #fff;
  --line: #e6e6e6;
  --line-2: #f0f0f3;

  /* tekst */
  --ink: #111111;
  --ink-2: #3d3d45;
  --muted: #818183;

  /* stany */
  --ok: #12703f;
  --ok-akcent: #1f9d63;
  --ok-bg: #e4f3eb;
  --warn: #8a5300;
  --warn-akcent: #c7801a;
  --warn-bg: #faf0de;
  --err: #9b2c26;
  --err-akcent: #d0433c;
  --err-bg: #fbe6e5;
  /* Niebieski wychodzi poza zamknieta palete swiadomie. Wiadomosc
     czekajaca w kolejce musi odrozniac sie od odebranej, a lawenda
     jest tu zajeta przez pocztę przychodzącą. */
  --kolejka: #1b4f97;
  --kolejka-bg: #e6eefc;

  /* geometria - brandbook: 4 px pola i przyciski, 8 px karty */
  --r: 4px;
  --r-lg: 8px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .05);
  --shadow-lg: 0 8px 24px rgba(30, 58, 51, .18);

  /* typografia - Ubuntu niesie naglowki, Roboto cala reszte */
  --sans: 'Ubuntu', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --text: 'Roboto', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font: 15px/1.6 var(--text);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--indygo-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0; font-family: var(--sans); font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 25px; }
h2 { font-size: 16px; }

code {
  font: 13px/1.4 ui-monospace, "SFMono-Regular", Consolas, monospace;
  background: var(--line-2); padding: 2px 6px; border-radius: 4px;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }
.hide-sm { display: inline; }
.inline { display: inline; }

/* --- ikony --------------------------------------------------------- */
.ico { width: 20px; height: 20px; flex: 0 0 auto; }
.ico.sm { width: 16px; height: 16px; }
.ico.lg { width: 40px; height: 40px; }

/* --- banery globalne ---------------------------------------------- */
.banner-http, .banner-imp {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 18px; font-size: 13.5px; font-weight: 500;
}
.banner-http { background: var(--warn-bg); color: var(--warn); border-bottom: 1px solid #efdcbb; }
.banner-imp  { background: var(--grafit); color: #d9d3c0; }
.banner-imp strong { color: #fff; }

.link-btn {
  background: none; border: 0; padding: 0; margin-left: 6px;
  font: inherit; color: inherit; text-decoration: underline; cursor: pointer;
}

/* =====================================================================
   Ekran logowania
   ===================================================================== */
.login-body {
  min-height: 100vh;
  display: grid; place-items: center;
  /* Sam gradient marki: grafit, butelkowa zielen, ciemne zloto.
     Gdyby kiedys mialo tu byc zdjecie, dorzuca sie je jako warstwe posrodku:
       url("/assets/img/login-bg.jpg") center / cover no-repeat,
     ale dopiero razem z wgraniem pliku. Odwolanie do pliku, ktorego nie ma,
     wchodzilo do front controllera i psulo przekierowanie po zalogowaniu. */
  background:
    linear-gradient(180deg, rgba(17, 17, 17, .2), rgba(17, 17, 17, .5)),
    linear-gradient(135deg, #111111 0%, #1e3a33 55%, #6c644c 100%);
  padding: 24px;
}

.login-wrap { width: 100%; max-width: 430px; }

.login-card {
  background: #fffdf8;
  border-radius: 8px;
  padding: 38px 34px 26px;
  box-shadow: 0 24px 60px rgba(17, 17, 17, .35);
  text-align: center;
}

.login-logo { width: 210px; max-width: 80%; height: auto; margin: 0 auto 22px; display: block; }
.login-h1 { font-size: 20px; margin-bottom: 6px; }
.login-sub { color: var(--ink-2); font-size: 14px; margin: 0 0 18px; }

.login-card form { text-align: left; }

.field {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 0 12px;
  margin-bottom: 12px; color: var(--muted);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus-within { border-color: var(--indygo); box-shadow: 0 0 0 3px rgba(30, 58, 51, .18); }
.field input {
  flex: 1; border: 0; outline: 0; background: none;
  padding: 13px 0; font: inherit; color: var(--ink); min-width: 0;
}
.peek { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 4px; display: flex; }
.peek:hover { color: var(--ink-2); }

.login-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 4px 0 18px; font-size: 13.5px;
}
.check { display: flex; align-items: center; gap: 7px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--indygo-deep); width: 15px; height: 15px; }

.btn-primary {
  display: block; width: 100%; border: 0; cursor: pointer;
  background: var(--indygo); color: #ffffff;
  font: 700 15px/1 var(--text); padding: 14px;
  border-radius: var(--r); transition: background .15s, transform .05s;
}
.btn-primary:hover { background: #152a25; }
.btn-primary:active { transform: translateY(1px); }

.login-err, .login-warn {
  text-align: left; font-size: 13.5px; border-radius: 4px;
  padding: 10px 12px; margin: 0 0 16px;
}
.login-err { background: var(--err-bg); color: var(--err); border: 1px solid #f2cfcd; }
.login-warn {
  background: var(--warn-bg); color: var(--warn); border: 1px solid #efdcbb;
  display: flex; gap: 8px; align-items: flex-start; line-height: 1.45;
}
.login-warn .ico { margin-top: 2px; }

.pass-rules {
  margin: 0 0 16px; padding-left: 18px;
  color: var(--muted); font-size: 13px; line-height: 1.7;
}

.login-hint { font-size: 13px; color: var(--muted); margin: 16px 0 0; }
.login-foot { font-size: 12px; color: #9a9aa2; margin: 18px 0 0; }

/* =====================================================================
   Szkielet panelu
   ===================================================================== */
.shell { display: flex; min-height: 100vh; }

/* --- sidebar ------------------------------------------------------- */
.side {
  width: 244px; flex: 0 0 244px;
  background: var(--grafit); color: #d6d6e2;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}

.side-brand { padding: 22px 20px 18px; display: block; }
.side-brand img { width: 100%; max-width: 178px; height: auto; display: block; }

.side-nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.side-nav::-webkit-scrollbar { width: 6px; }
.side-nav::-webkit-scrollbar-thumb { background: #3a3a44; border-radius: 3px; }

.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; margin-bottom: 2px;
  border-radius: 4px; color: #d9d3c0;
  font-size: 14.2px; text-decoration: none;
  transition: background .13s, color .13s;
}
.side-link:hover { background: var(--grafit-2); color: #fff; text-decoration: none; }
/* Pozycja aktywna bierze zloto marki z grafitowym napisem (ok. 11:1).
   Na grafitowym tle to najmocniejszy mozliwy wskaznik, gdzie sie jest. */
.side-link.is-active { background: #ddc471; color: #111111; font-weight: 600; }
.side-link.is-active .ico { color: #111111; }
.side-link.is-active:hover { background: #e7d598; }

.side-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-top: 1px solid #2b2b33;
}
.side-user-txt { display: flex; flex-direction: column; min-width: 0; }
.side-user-txt strong { font-size: 13.5px; color: #fff; font-weight: 600; }
.side-user-txt small { font-size: 12px; color: #ddc471; }

.avatar {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 50%; background: var(--indygo); color: #ffffff;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; letter-spacing: .02em;
}
.avatar.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 11.5px; }

/* --- glowna kolumna ----------------------------------------------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.top {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 24px; position: sticky; top: 0; z-index: 20;
}

.top-search {
  flex: 1; max-width: 460px;
  display: flex; align-items: center; gap: 9px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 4px; padding: 0 12px; color: var(--muted);
}
.top-search:focus-within { border-color: var(--indygo); background: #fff; }
.top-search input {
  flex: 1; border: 0; outline: 0; background: none;
  padding: 9px 0; font: inherit; color: var(--ink); min-width: 0;
}

.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.top-icon { position: relative; color: var(--ink-2); display: flex; padding: 6px; border-radius: 4px; }
.top-icon:hover { background: var(--bg); }
.dot {
  position: absolute; top: 0; right: 0;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 4px; background: var(--err); color: #fff;
  font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center;
}

.top-user { display: flex; align-items: center; gap: 9px; }
.top-user-txt { display: flex; flex-direction: column; line-height: 1.3; }
.top-user-txt strong { font-size: 13.5px; font-weight: 600; }
.top-user-txt small { font-size: 11.5px; color: var(--muted); }

.btn-ghost {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px solid var(--line);
  border-radius: 4px; padding: 7px 12px;
  font: 500 13.5px var(--text); color: var(--ink-2); cursor: pointer;
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); }

.burger { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.burger span { display: block; width: 20px; height: 2px; background: var(--ink-2); margin: 4px 0; border-radius: 2px; }

.page { flex: 1; padding: 24px; max-width: 1440px; width: 100%; }
.foot { padding: 18px 24px; color: var(--muted); font-size: 12.5px; }

/* --- naglowek strony ---------------------------------------------- */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px;
}
.page-head p { margin: 3px 0 0; font-size: 14px; }
.badge {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--grafit); color: #d9d3c0;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
}

/* --- komunikaty --------------------------------------------------- */
.alert { padding: 11px 14px; border-radius: 4px; font-size: 14px; margin-bottom: 18px; }
.alert-ok  { background: var(--ok-bg);  color: var(--ok);  border: 1px solid #c9e5d6; }
.alert-err { background: var(--err-bg); color: var(--err); border: 1px solid #f2cfcd; }

/* --- kategorie ---------------------------------------------------- */
.cat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.cat {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px; color: var(--ink);
  border-right: 1px solid var(--line-2);
  transition: background .13s;
}
.cat:last-child { border-right: 0; }
.cat:hover { background: #fafafd; text-decoration: none; }
.cat .ico { color: var(--ink-2); }
.cat-txt { display: flex; flex-direction: column; }
.cat-txt strong { font-size: 14.5px; font-weight: 600; }
.cat-txt small { font-size: 12.5px; color: var(--muted); }

/* --- kafle statystyk ---------------------------------------------- */
.tiles {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin-bottom: 20px;
}
.tile {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
  box-shadow: var(--shadow);
}
.tile-ico {
  width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 50%; background: #f6efd6; color: var(--indygo-deep);
  display: grid; place-items: center;
}
.tile-txt { display: flex; flex-direction: column; min-width: 0; }
.tile-txt small { font-size: 12.5px; color: var(--muted); }
.tile-txt strong { font-size: 27px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.tile-txt em { font-style: normal; font-size: 12px; }
.tile-txt em.neutral { color: var(--muted); }
.tile-txt em.warn { color: var(--warn); font-weight: 600; }
.tile.is-warn { border-color: #efdcbb; background: var(--warn-bg); }
.tile.is-warn .tile-ico { background: #f4e2c4; color: var(--warn); }

/* --- karty -------------------------------------------------------- */
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line-2);
}
.card-head a { font-size: 13px; }

.empty { padding: 26px 18px; color: var(--muted); font-size: 14px; text-align: center; margin: 0; }

/* --- lista aktywnosci --------------------------------------------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 18px; border-bottom: 1px solid var(--line-2);
}
.feed li:last-child { border-bottom: 0; }
.feed-txt { flex: 1; font-size: 13.8px; color: var(--ink-2); min-width: 0; }
.feed-txt strong { color: var(--ink); font-weight: 600; }
.feed time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* --- szybkie akcje ------------------------------------------------ */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 18px; }
.quick-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 13px; border: 1px solid var(--line);
  border-radius: 4px; background: #fafafc;
  font-size: 13.5px; font-weight: 500; color: var(--ink);
}
.quick-btn:hover { border-color: var(--indygo); background: #fbf8ee; text-decoration: none; }
.quick-btn .ico { color: var(--indygo-deep); }

.stage-note {
  margin: 0 18px 18px; padding: 13px 15px;
  background: #fbf8ee; border: 1px solid var(--line);
  border-left: 3px solid var(--indygo);
  border-radius: 4px; font-size: 13.3px; color: var(--ink-2); line-height: 1.55;
}
.stage-note strong { color: var(--ink); }

/* --- ekrany stanu (404, 403, moduly w budowie) -------------------- */
.state-box {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 46px 32px; text-align: center; max-width: 620px; margin: 10px auto;
}
.state-box .ico.lg { color: var(--indygo); margin-bottom: 14px; }
.state-box h1, .state-box h2 { font-size: 19px; margin-bottom: 8px; }
.state-box p { margin: 0 auto 10px; max-width: 460px; font-size: 14px; }
.state-box .btn-primary { max-width: 220px; margin: 18px auto 0; }

/* =====================================================================
   Responsywnosc
   ===================================================================== */
@media (max-width: 1100px) {
  .grid-2 { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .side {
    position: fixed; z-index: 60; left: 0; top: 0;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .side.is-open { transform: none; }
  .burger { display: block; }
  .page { padding: 16px; }
  .top { padding: 10px 14px; }
  .tiles, .cat-row { grid-template-columns: 1fr; }
  .cat { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .cat:last-child { border-bottom: 0; }
  .quick { grid-template-columns: 1fr; }
  .top-user-txt, .hide-sm { display: none; }
  h1 { font-size: 21px; }
}

/* =====================================================================
   Komponenty modułów (etapy 2-6)
   ===================================================================== */

.mb { margin-bottom: 18px; }
.mt { margin-top: 18px; }
.pad { padding: 16px 18px; }
.bt { border-top: 1px solid var(--line-2); }
.ta-r { text-align: right; }
.nowrap { white-space: nowrap; }
.block { display: block; }
.strong { font-weight: 600; }
.txt-warn { color: var(--warn); font-weight: 600; }
.txt-ok { color: var(--ok); font-weight: 600; }
.req { color: var(--err); font-weight: 600; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.crumbs { margin: 0 0 6px; font-size: 13px; }
.crumbs a { color: var(--muted); }
.inline-form { display: inline-block; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }

.page-head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-inline { display: inline-flex; align-items: center; gap: 7px; width: auto; }

.btn-dark {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--grafit); color: #fff; border: 0; cursor: pointer;
  font: 700 14px var(--text); padding: 10px 18px; border-radius: 4px;
}
.btn-dark:hover { background: var(--grafit-2); }

.btn-danger {
  background: #fff; color: var(--err); border: 1px solid #efc9c6; cursor: pointer;
  font: 700 13.5px var(--text); padding: 9px 16px; border-radius: 4px;
}
.btn-danger:hover { background: var(--err-bg); }

.btn-mini {
  display: inline-block; padding: 5px 10px; border-radius: 4px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  font: 500 12.5px var(--text); color: var(--ink-2); text-decoration: none;
}
.btn-mini:hover { border-color: var(--indygo); color: var(--ink); text-decoration: none; }

.alert-warn { background: var(--warn-bg); color: var(--warn); border: 1px solid #efdcbb; }
.alert-info { background: #f6efd6; color: #152a25; border: 1px solid #d6d7f0; }

/* --- znaczniki ----------------------------------------------------- */
.chip {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; line-height: 1.5;
}
.chip-ok    { background: var(--ok-bg);   color: var(--ok); }
.chip-warn  { background: var(--warn-bg); color: var(--warn); }
.chip-err   { background: var(--err-bg);  color: var(--err); }
.chip-info  { background: #f6efd6;        color: #152a25; }
.chip-muted { background: var(--line-2);  color: var(--muted); }
.chip-blue  { background: var(--kolejka-bg); color: var(--kolejka); }

.file-kind {
  display: inline-block; min-width: 34px; text-align: center;
  background: var(--grafit); color: #fff; border-radius: 4px;
  font-size: 10px; font-weight: 700; padding: 2px 5px; margin-right: 6px;
}

/* --- filtry -------------------------------------------------------- */
.filters {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 16px 18px; margin-bottom: 18px;
}
.filter-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px;
}
.filter-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* --- pola formularzy ----------------------------------------------- */
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fld > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.fld input[type="text"], .fld input[type="email"], .fld input[type="password"],
.fld input[type="search"], .fld input[type="number"], .fld input[type="date"],
.fld input[type="datetime-local"], .fld select, .fld textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 4px;
  padding: 9px 11px; font: inherit; color: var(--ink); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: 0; border-color: var(--indygo); box-shadow: 0 0 0 3px rgba(30, 58, 51, .16);
}
.fld input:disabled, .fld select:disabled { background: var(--bg); color: var(--muted); }
.fld textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
.fld input[type="file"] { padding: 8px; background: var(--bg); }

/* Pole liczbowe z wyborem jednostki obok (powierzchnia dzialki). */
/* Edycja opisu pliku rozwijana przy pozycji listy. */
.edit-row > td, .edit-row { background: var(--bg); }
.edit-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px; padding: 14px 4px;
}
.edit-form .span-2 { grid-column: span 2; }
.edit-actions { display: flex; gap: 10px; align-items: flex-end; }
.doc-akcje { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.btn-mini-err { color: var(--err); border-color: #f2d9d7; }
.btn-mini-err:hover { background: var(--err-bg); border-color: var(--err); }

@media (max-width: 700px) {
  .edit-form { grid-template-columns: 1fr; }
  .edit-form .span-2 { grid-column: span 1; }
}

/* Okno wysylki - wiersze naglowka jak w programie pocztowym. */
.mail-head { padding: 4px 18px 14px; }
.mail-row {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--line-2);
}
.mail-row > span:first-child {
  flex: 0 0 96px; font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.mail-row input, .mail-row select { border: 0; padding: 4px 0; background: none; flex: 1 1 auto; min-width: 0; }
.mail-row input:focus, .mail-row select:focus { outline: 0; box-shadow: none; }
.mail-to { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; }
.mail-to select { flex: 1 1 auto; min-width: 0; }
.mail-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }

@media (max-width: 700px) {
  .mail-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .mail-row > span:first-child { flex: none; }
}

/* Tresc wiadomosci z poczty - obcy HTML nie moze rozepchac ukladu. */
.mail-body { font-size: 14px; line-height: 1.6; overflow-x: auto; word-break: break-word; }
.mail-body img { max-width: 100%; height: auto; }
.mail-body table { max-width: 100%; border-collapse: collapse; }
.mail-body blockquote {
  margin: 10px 0; padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line); color: var(--muted);
}
.mail-body a { word-break: break-all; }
.mail-body * { max-width: 100%; }

/* Lista pozycji do zaznaczenia - co dolaczyc do wysylanej oferty. */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.pick {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px;
  background: #fff; transition: border-color .15s, background .15s;
}
.pick:hover { border-color: var(--indygo); background: #fbf8ee; }
.pick input { margin: 2px 0 0; flex: 0 0 auto; }
.pick-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick-txt strong { font-size: 13.5px; font-weight: 600; }
.pick-txt em { font-size: 11.5px; color: var(--muted); font-style: normal; }
/* Dziennik techniczny - stale odstepy, zeby kolumny sie zgadzaly. */
.log-box { max-height: 62vh; overflow: auto; padding: 4px 0; }
.log-line {
  font: 12px/1.55 ui-monospace, "SF Mono", Consolas, monospace;
  white-space: pre; padding: 2px 18px; color: var(--ink-2);
  border-left: 3px solid transparent;
}
.log-line:hover { background: var(--bg); }
.log-line.is-uwaga { color: var(--warn); border-left-color: var(--warn); background: var(--warn-bg); }
.log-line.is-blad { color: var(--err); border-left-color: var(--err); background: var(--err-bg); font-weight: 600; }

.pick.is-warn { border-color: #ebd3ae; background: var(--warn-bg); }
.pick.is-warn:hover { border-color: var(--warn); }
.pick.is-warn .pick-txt em { color: var(--warn); }
.pick.is-off { background: var(--bg); border-style: dashed; cursor: default; opacity: .65; }
.pick.is-off:hover { border-color: var(--line); background: var(--bg); }

.warn-box { border-color: #ebd3ae; background: var(--warn-bg); text-align: left; }
.warn-box strong { color: var(--warn); }

.input-unit { display: flex; gap: 8px; }
.input-unit input { flex: 1 1 auto; min-width: 0; }
.input-unit select { flex: 0 0 auto; width: auto; }
.hint { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.hint.warn-txt { color: var(--warn); font-weight: 600; }
.chk-fld .check { font-size: 13.5px; margin-top: 2px; }

.form-card { padding: 0; }
.form-card fieldset { border: 0; border-bottom: 1px solid var(--line-2); margin: 0; padding: 18px; }
.form-card fieldset:last-of-type { border-bottom: 0; }
.form-card legend { font-size: 13px; font-weight: 700; color: var(--grafit); text-transform: uppercase; letter-spacing: .04em; padding: 0; }

/* Odstep wewnetrzny karty daje zwykle <fieldset>. Formularze bez sekcji
   (wiadomosci, zadania, kalendarz) zostawaly bez niego i pola dotykaly
   krawedzi karty. */
.form-card.slim,
.form-card:not(:has(fieldset)) { padding: 18px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 12px; }
.form-grid .span-2 { grid-column: span 2; }
.form-card.slim > .form-grid:first-of-type,
.form-card:not(:has(fieldset)) > .form-grid:first-of-type { margin-top: 0; }

.form-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 18px; border-top: 1px solid var(--line-2); background: #fafafc;
}
.form-card.slim .form-actions,
.form-card:not(:has(fieldset)) .form-actions { border: 0; background: none; padding: 16px 0 0; }

/* --- dopisanie rekordu bez opuszczania formularza -------------------- */
.fld-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.lnk-mini {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 3px 11px; cursor: pointer; font-family: inherit;
  font-size: 11.5px; font-weight: 600; line-height: 1.4; color: var(--grafit);
  transition: background .15s, border-color .15s, color .15s;
}
.lnk-mini:hover { border-color: var(--indygo); color: var(--indygo-deep); background: #fbf8ee; }
.lnk-mini:focus-visible { outline: 2px solid var(--indygo); outline-offset: 1px; }
.lnk-mini.is-open { background: var(--grafit); border-color: var(--grafit); color: #fff; }

.quick-add {
  border: 1px dashed var(--line); border-radius: var(--r-lg);
  background: var(--bg); padding: 14px 16px; margin-top: 16px;
}
.quick-add-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.quick-add-head strong { font-size: 13px; color: var(--grafit); }
.quick-add-head a { font-size: 12px; }
.quick-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.quick-add-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 8px; }
.quick-add-msg { margin: 12px 0 0; font-size: 13px; min-height: 0; }
.quick-add-msg:empty { display: none; }
.quick-add-msg.is-ok { color: var(--ok); }
.quick-add-msg.is-err { color: var(--err); }

.danger-zone {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: #fff; border: 1px solid #f2d9d7; border-radius: var(--r-lg);
  padding: 16px 18px; margin-top: 18px;
}
.danger-zone p { margin: 2px 0 0; }

/* --- tabele -------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fafafd; }
.tbl .th-sort { color: var(--muted); }
.tbl .th-sort:hover { color: var(--ink); text-decoration: none; }
.row-late { background: #f7f2f0; }
.user-cell { display: flex; align-items: center; gap: 9px; }

/* --- paginacja ----------------------------------------------------- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 16px; flex-wrap: wrap;
}
.pg-info { font-size: 13px; color: var(--muted); }
.pg-links { display: flex; gap: 5px; flex-wrap: wrap; }
.pg-item {
  display: inline-block; padding: 7px 12px; border-radius: 4px;
  border: 1px solid var(--line); background: #fff;
  font-size: 13px; color: var(--ink-2); text-decoration: none;
}
.pg-item:hover { border-color: var(--indygo); text-decoration: none; }
.pg-item.is-active { background: var(--indygo); color: #fff; border-color: var(--indygo); }
.pg-item.is-off { opacity: .4; }

/* --- listy definicji ----------------------------------------------- */
.deflist { margin: 0; padding: 6px 18px 16px; }
.deflist > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--line-2);
}
.deflist > div:last-child { border-bottom: 0; }
.deflist dt { font-size: 13px; color: var(--muted); flex: 0 0 auto; }
.deflist dd { margin: 0; font-size: 13.8px; text-align: right; min-width: 0; word-break: break-word; }

.note-box {
  margin: 0 18px 18px; padding: 13px 15px;
  background: #fbf8ee; border-left: 3px solid var(--indygo); border-radius: 4px; font-size: 13.5px;
}
.note-box p { margin: 6px 0 0; color: var(--ink-2); }

/* --- listy skrocone ------------------------------------------------ */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 18px; border-bottom: 1px solid var(--line-2); font-size: 13.6px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list li.col { flex-direction: column; align-items: stretch; gap: 6px; }

.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-list li {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
}
.notif-list li:last-child { border-bottom: 0; }
.notif-list li.is-new { background: #fbf8ee; border-left: 3px solid var(--indygo); }
.notif-list time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* --- paski postępu ------------------------------------------------- */
.bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--indygo); border-radius: 3px; }
.bar-lg { height: 10px; }
.bar-thin { height: 4px; margin-top: 4px; max-width: 90px; }

/* --- kafle wariantowe ---------------------------------------------- */
.tiles-3 { grid-template-columns: repeat(3, 1fr); }
.tiles-4 { grid-template-columns: repeat(4, 1fr); }
.tile-sm { font-size: 19px !important; }

/* --- wykres słupkowy ----------------------------------------------- */
.chart {
  display: flex; align-items: flex-end; gap: 4px;
  height: 190px; padding: 18px 18px 8px;
}
/* min-width: 0 jest tu konieczne. Bez niego kolumna nie kurczy sie ponizej
   szerokosci swojego podpisu, trzydziesci slupkow nie miesci sie w karcie,
   a karta ma overflow: hidden - wykres tracil koncowke, czyli dzisiaj. */
.chart-col {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  height: 100%; justify-content: flex-end;
}
.chart-bar {
  width: 100%; max-width: 34px;
  background: linear-gradient(180deg, var(--indygo) 0%, #152a25 100%);
  border-radius: 4px 4px 0 0; min-height: 3px;
}
.chart-col small { font-size: 11px; color: var(--muted); white-space: nowrap; min-height: 14px; }

.donut-total { text-align: center; margin: 0 0 14px; }
.donut-total strong { display: block; font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.donut-total small { color: var(--muted); font-size: 12.5px; }
.legend { list-style: none; margin: 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13.5px; }
.legend-lbl { flex: 1; }
.legend-val { color: var(--muted); font-size: 12.5px; }
.dot-c { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.dot-0 { background: var(--grafit); }
.dot-1 { background: var(--indygo); }
.dot-2 { background: #ddc471; }
.dot-3 { background: #d9d3c0; }

/* --- karty ofert --------------------------------------------------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.offer-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow);
  color: var(--ink); transition: border-color .15s, transform .1s;
}
.offer-card:hover { border-color: var(--indygo); text-decoration: none; transform: translateY(-1px); }
.offer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.offer-type { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.offer-card h3 { font-size: 15.5px; margin-bottom: 4px; }
.offer-price { font-size: 17px; font-weight: 700; color: var(--indygo-deep); margin: 10px 0 6px; }
.offer-meta { display: flex; gap: 9px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0; }

/* --- zakładki ------------------------------------------------------ */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 14px 18px 0; border-bottom: 1px solid var(--line-2); }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  font: 700 13.5px var(--text); color: var(--muted); padding: 8px 12px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--grafit); border-bottom-color: var(--indygo); }
.tab-panel { display: none; padding: 16px 18px; }
.tab-panel.is-active { display: block; }
.form-card .tab-panel { padding: 16px 0 0; }

.subtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.subtab {
  padding: 10px 16px; font-size: 14px; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent;
}
.subtab:hover { color: var(--ink); text-decoration: none; }
.subtab.is-active { color: var(--grafit); font-weight: 600; border-bottom-color: var(--indygo); }

/* --- kalendarz ----------------------------------------------------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-h {
  padding: 10px; text-align: center; font-size: 11.5px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
}
.cal-d {
  min-height: 96px; padding: 6px; border-right: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px;
}
.cal-d:nth-child(7n+7) { border-right: 0; }
.cal-d.is-empty { background: #fafafd; }
.cal-d.is-today { background: #fbf8ee; }
.cal-n { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; }
.cal-d.is-today .cal-n { color: var(--indygo-deep); }
.cal-add { opacity: 0; font-size: 15px; line-height: 1; color: var(--muted); padding: 0 3px; }
.cal-d:hover .cal-add { opacity: 1; }
.cal-ev {
  display: block; background: var(--grafit); color: #fff; border-radius: 4px;
  padding: 3px 5px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-ev:hover { background: var(--grafit-2); text-decoration: none; }
.cal-ev b { color: var(--mgla); margin-right: 3px; }

/* Termin kontaktu z karty klienta. Grafit jest zajety przez wydarzenia,
   wiec przypomnienie dostaje indygo - ten sam akcent, ktory w calym
   panelu oznacza "nasze dzialanie". Termin przekroczony przechodzi na
   kolor ostrzezenia, tak jak zalegly termin zadania na dashboardzie. */
.cal-ev.is-contact { background: var(--indygo); color: #fff; }
.cal-ev.is-contact:hover { background: var(--indygo-deep); }
.cal-ev.is-contact b { color: var(--mgla); }
.cal-ev.is-contact.is-late { background: var(--warn-bg); color: var(--warn); border: 1px solid #efdcbb; padding: 2px 4px; }
.cal-ev.is-contact.is-late:hover { background: #f6e7ca; }
.cal-ev.is-contact.is-late b { color: var(--warn-akcent); }

.cal-legend {
  display: flex; flex-wrap: wrap; gap: 16px;
  padding: 12px 16px; border-top: 1px solid var(--line-2);
  font-size: 12px; color: var(--muted);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-key { width: 11px; height: 11px; border-radius: 3px; background: var(--grafit); flex: 0 0 11px; }
.cal-key.is-contact { background: var(--indygo); }
.cal-key.is-contact.is-late { background: var(--warn-bg); border: 1px solid #efdcbb; }

/* --- pozostałe ----------------------------------------------------- */
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.log {
  background: var(--grafit); color: #dcdce6; padding: 14px; border-radius: 4px;
  font: 12px/1.6 ui-monospace, Consolas, monospace; overflow-x: auto; max-height: 320px;
}
.tbl-map select { min-width: 190px; }
details summary { cursor: pointer; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }

/* =====================================================================
   Wersja mobilna: tabele zamieniają się w karty
   ===================================================================== */
@media (max-width: 1100px) {
  .grid-3 { grid-template-columns: 1fr; }
  .tiles-3, .tiles-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .tiles-3, .tiles-4 { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head-side { justify-content: flex-start; }
  .danger-zone { flex-direction: column; align-items: stretch; gap: 12px; }
  .filter-grid { grid-template-columns: 1fr; }
  .quick-add-grid { grid-template-columns: 1fr; }

  /* Tabela przestaje być tabelą - każdy wiersz to osobna karta,
     a nagłówki kolumn wracają jako etykiety z atrybutu data-label. */
  .table-wrap { overflow: visible; }
  .tbl, .tbl thead, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; }
  .tbl thead { display: none; }
  .tbl tr {
    border: 1px solid var(--line); border-radius: 8px;
    padding: 6px 2px; margin: 0 0 12px; background: #fff;
  }
  .tbl tbody tr:hover { background: #fff; }
  .tbl td { border: 0; padding: 7px 14px; display: flex; gap: 12px; align-items: flex-start; }
  .tbl td::before {
    content: attr(data-label);
    flex: 0 0 40%; max-width: 40%;
    font-size: 11.5px; font-weight: 700; color: var(--muted);
    text-transform: uppercase; letter-spacing: .03em; padding-top: 2px;
  }
  .tbl td:not([data-label]) { display: none; }
  .tbl td.ta-r { text-align: left; }
  .tbl td.nowrap { white-space: normal; }

  .deflist > div { flex-direction: column; gap: 2px; }
  .deflist dd { text-align: left; }

  /* Kalendarz: z siatki miesięcznej na listę dni z wydarzeniami. */
  .cal { grid-template-columns: repeat(7, 1fr); }
  .cal-d { min-height: 58px; padding: 3px; }
  .cal-ev { font-size: 0; padding: 3px; }
  .cal-ev b { font-size: 9px; }
  .cal-add { display: none; }

  .pager { flex-direction: column; align-items: stretch; gap: 10px; }
  .subtabs { overflow-x: auto; flex-wrap: nowrap; }
  .subtab { white-space: nowrap; }
  .chart { height: 150px; gap: 5px; padding: 14px 10px 6px; }
  .notif-list li { flex-direction: column; gap: 4px; }
}

@media (max-width: 460px) {
  .tbl td { flex-direction: column; gap: 2px; }
  .tbl td::before { max-width: 100%; flex-basis: auto; }
  .cal-h { font-size: 9.5px; padding: 6px 2px; }
}

/* --- diagnostyka i integracje (etapy 7-8) -------------------------- */
.diag { list-style: none; margin: 0; padding: 0; }
.diag li {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 15px 18px; border-bottom: 1px solid var(--line-2);
}
.diag li:last-child { border-bottom: 0; }
.diag-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 11px; margin-top: 5px; }
.diag-ok   .diag-dot { background: var(--ok-akcent); }
.diag-warn .diag-dot { background: var(--warn-akcent); }
.diag-err  .diag-dot { background: var(--err-akcent); }
.diag-info .diag-dot { background: #ddc471; }
.diag-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.diag-txt strong { font-size: 14.5px; }
.diag-val { font-size: 13.5px; color: var(--ink-2); }
.diag-err .diag-val { color: var(--err); font-weight: 600; }
.diag-warn .diag-val { color: var(--warn); font-weight: 600; }
.diag-hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }

.tab-badge {
  display: inline-block; min-width: 18px; margin-left: 6px; padding: 1px 6px;
  border-radius: 4px; background: var(--err); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center;
}

.token-box {
  font: 13px/1.5 ui-monospace, Consolas, monospace;
  background: var(--grafit); color: #d9d3c0;
  padding: 12px 14px; border-radius: 4px; margin: 10px 0 0;
  word-break: break-all; user-select: all;
}

.rodo-row { padding: 6px 0; gap: 18px; align-items: flex-start; }
.rodo-row.bt { border-top: 1px solid var(--line-2); margin-top: 12px; padding-top: 16px; }
.rodo-row p { margin: 3px 0 0; max-width: 60ch; }

/* --- zaznaczanie i akcje zbiorcze ---------------------------------- */
.col-check { width: 34px; }
.col-check input { width: 16px; height: 16px; accent-color: var(--indygo-deep); cursor: pointer; }
.tbl tr.is-picked { background: #fbf8ee; }

.bulkbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--grafit); color: #e9e9f6;
  padding: 12px 16px; border-radius: var(--r-lg) var(--r-lg) 0 0;
  font-size: 13.5px; position: sticky; top: 62px; z-index: 15;
}
.bulk-count strong { color: var(--indygo-light); font-size: 15px; }
.bulk-act { display: flex; align-items: center; gap: 6px; }
.bulkbar select {
  border: 1px solid #3a3a44; border-radius: 4px; padding: 7px 9px;
  background: #26262e; color: #e9e9f6; font: inherit; max-width: 200px;
}
.bulkbar .btn-ghost { border-color: #3a3a44; color: #e9e9f6; background: transparent; }
.bulkbar .btn-ghost:hover { background: #26262e; color: #fff; }
.bulkbar .bulk-del { border-color: #5b2a26; color: #f0a9a4; background: transparent; }
.bulkbar .bulk-del:hover { background: #3a1b18; color: #fff; }
.bulkbar a { color: var(--indygo-light); }
.bulkbar + .card { border-top-left-radius: 0; border-top-right-radius: 0; }

@media (max-width: 780px) {
  .bulkbar { position: static; border-radius: var(--r-lg); flex-direction: column; align-items: stretch; }
  .bulk-act { flex-direction: column; align-items: stretch; }
  .bulkbar select { max-width: none; }
  /* Zaznaczanie dziala takze na telefonie - komorka staje sie pierwszym
     wierszem karty, z etykieta jak pozostale pola. */
  .col-check { width: auto; }
}

/* --- galeria zdjęć oferty ------------------------------------------ */
.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; padding: 16px 18px;
}
.gal-item {
  margin: 0; position: relative; border: 1px solid var(--line);
  border-radius: 8px; overflow: hidden; background: var(--bg);
}
.gal-item.is-cover { border-color: var(--indygo); box-shadow: 0 0 0 2px rgba(30, 58, 51, .22); }
.gal-item img { display: block; width: 100%; height: 118px; object-fit: cover; }
.gal-badge {
  position: absolute; top: 7px; left: 7px;
  background: var(--indygo); color: #ffffff;
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
}
.gal-item figcaption {
  display: flex; gap: 5px; flex-wrap: wrap;
  padding: 7px; background: #fff; border-top: 1px solid var(--line-2);
}

.offer-thumb { display: block; margin: -16px -18px 12px; }
.offer-thumb img { display: block; width: 100%; height: 150px; object-fit: cover; }

@media (max-width: 460px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gal-item img { height: 96px; }
}

/* --- szybka notatka na karcie podmiotu ----------------------------- */
.quicknote { padding: 14px 18px; border-bottom: 1px solid var(--line-2); background: #fafafc; }
.quicknote textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 4px;
  padding: 10px 12px; font: inherit; resize: vertical; min-height: 62px; background: #fff;
}
.quicknote textarea:focus {
  outline: 0; border-color: var(--indygo); box-shadow: 0 0 0 3px rgba(30, 58, 51, .16);
}
.quicknote-row { display: flex; align-items: flex-end; gap: 10px; margin-top: 9px; flex-wrap: wrap; }
.quicknote-row select, .qn-date input {
  border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; font: inherit; background: #fff;
}
.qn-date { display: flex; flex-direction: column; gap: 3px; }
.qn-date span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.quicknote-row button { margin-left: auto; }

@media (max-width: 780px) {
  .quicknote-row { flex-direction: column; align-items: stretch; }
  .quicknote-row button { margin-left: 0; }
  .quicknote-row select, .qn-date input { width: 100%; }
}

/* --- przełącznik zakresu dat na dashboardzie ----------------------- */
.daterange {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 12px 16px; margin-bottom: 18px;
}
.dr-presets { display: flex; gap: 4px; flex-wrap: wrap; }
.dr-btn {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); background: #fff;
}
.dr-btn:hover { border-color: var(--indygo); text-decoration: none; }
.dr-btn.is-active { background: var(--indygo); color: #fff; border-color: var(--indygo); font-weight: 600; }
.dr-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.dr-form label { display: flex; flex-direction: column; gap: 3px; }
.dr-form span { font-size: 11px; color: var(--muted); font-weight: 600; }
.dr-form input {
  border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; font: inherit; background: #fff;
}
.dr-info { margin-left: auto; font-size: 12.5px; color: var(--muted); }

@media (max-width: 780px) {
  .daterange { flex-direction: column; align-items: stretch; }
  .dr-presets { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .dr-btn { white-space: nowrap; }
  .dr-form { flex-direction: column; align-items: stretch; }
  .dr-form input, .dr-form button { width: 100%; }
  .dr-info { margin-left: 0; }
}

/* --- raport duplikatów --------------------------------------------- */
.sec-title { font-size: 15px; margin: 22px 0 12px; color: var(--ink-2); }
.dup-group { margin-bottom: 16px; }
.dup-group input[type="radio"], .dup-group input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--indygo-deep); cursor: pointer;
}
.dup-chip {
  display: inline-block; margin: 0 6px 4px 0; padding: 3px 9px;
  background: var(--line-2); border-radius: 999px; font-size: 12.5px;
}

/* --- pozycja pliku na karcie klienta ------------------------------- */
.doc-line { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.doc-line a { word-break: break-word; }

/* --- kafle klikalne i nowe zgłoszenia ------------------------------ */
a.tile { color: var(--ink); }
a.tile:hover { border-color: var(--indygo); text-decoration: none; }
a.tile.is-on { border-color: var(--indygo); box-shadow: 0 0 0 2px rgba(30, 58, 51, .16); }
.tbl tr.row-new { background: #fbf8ee; }
.tbl tr.row-new td:first-child { box-shadow: inset 3px 0 0 var(--indygo); }

/* =====================================================================
   Tryb prezentacji - "Ukryj dane"

   Wlaczany przyciskiem w pasku gornym, pamietany w localStorage. Sluzy
   do pokazywania systemu na ekranie, gdy w sali siedzi ktos, kto nie ma
   prawa widziec nazw klientow, kwot ani kontaktow.

   Zasada: rozmywamy cale komorki z danymi, a nie pojedyncze pola -
   inaczej przy kazdej nowej kolumnie trzeba by pamietac o dopisaniu
   klasy, a zapomniana kolumna to wyciek. Wyjatki sa trzy i wszystkie
   celowe:
     - komorki z przyciskami zostaja ostre, bo trzeba w nie klikac,
     - komorka z elementem .jawna rozmywa sie tylko czesciowo (nazwa
       zachowuje pierwsza litere - da sie powiedziec "ten na L"),
     - naglowki tabel i etykiety pol zostaja, bo pokazuja, o czym mowa.

   To zaslona na ekran, nie zabezpieczenie danych: tresc nadal jest
   w kodzie strony. Do prezentacji wystarczy, do ochrony przed kims,
   kto ma dostep do przegladarki - nie.
   ===================================================================== */
.top-icon .ukryj-txt { font-size: 13.5px; font-weight: 500; margin-left: 6px; }
#ukryjDane { background: none; border: 0; cursor: pointer; font: inherit; align-items: center; }
#ukryjDane[aria-pressed="true"] { background: var(--indygo); color: #fff; }
#ukryjDane[aria-pressed="true"]:hover { background: var(--indygo-deep); }

html.dane-ukryte .poufne,
html.dane-ukryte .tbl tbody td:not(.col-check):not(:has(button)):not(:has(.btn-mini)):not(:has(.jawna)),
html.dane-ukryte .deflist dd:not(:has(.jawna)),
html.dane-ukryte .tile-txt strong,
html.dane-ukryte .donut-total strong,
html.dane-ukryte .legend-val,
html.dane-ukryte .legend-lbl,
html.dane-ukryte .offer-price,
html.dane-ukryte .offer-card h3,
html.dane-ukryte .feed-txt,
html.dane-ukryte .mini-list li,
html.dane-ukryte .notif-list li p,
html.dane-ukryte .mail-body,
html.dane-ukryte .mail-row input,
html.dane-ukryte .quicknote textarea,
html.dane-ukryte .page-head p.muted,
html.dane-ukryte .side-user-txt,
html.dane-ukryte .top-user-txt,
html.dane-ukryte .cal-ev,
html.dane-ukryte .prose,
html.dane-ukryte .log-box,
html.dane-ukryte .diag-val {
  filter: blur(5px);
  user-select: none;
}

/* Nazwa wlasna: pierwsza litera zostaje, reszta znika. */
html.dane-ukryte .jawna { filter: none; }

/* Pola formularzy - inaczej dane widac przy edycji rekordu. */
html.dane-ukryte .fld input:not([type="checkbox"]):not([type="radio"]),
html.dane-ukryte .fld textarea,
html.dane-ukryte .field input {
  filter: blur(5px);
}
html.dane-ukryte .fld input:focus,
html.dane-ukryte .fld textarea:focus {
  filter: none;   /* to, co wlasnie wpisujesz, musisz widziec */
}

/* Pasek stanu, zeby nie dalo sie zapomniec o wlaczonym trybie. */
html.dane-ukryte body::after {
  content: "Dane ukryte - tryb prezentacji";
  position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%);
  z-index: 200; pointer-events: none;
  background: var(--indygo); color: #fff;
  font: 600 12.5px var(--text); letter-spacing: .02em;
  padding: 7px 16px; border-radius: 999px;
  box-shadow: var(--shadow-lg);
}
