/* Wspólny wygląd panelu (03.10.2026, prośba Filipa: „nowoczesny wygląd, jak helpdesk/CRM/Jira/ClickUp”).
   Ładowany na końcu <head> każdej strony, PO jej własnym <style>, więc nadpisuje kolory, czcionkę, menu,
   karty, przyciski, pola, tabele i zakładki bez przepisywania stron. Zmienne niżej czytają też style stron
   (var(--brand), var(--line) itd.), więc zmiana koloru tutaj działa wszędzie.
   Kiedy przyjdzie projekt grafika, wystarczy podmienić ten plik i public/nav.js. */
/* 04.10.2026: kolory z logo 4Parents (koral → róż, żółty, niebieski), tryb ciemny („czarna szarość”, nie czerń)
   przełączany w menu (public/theme-init.js ustawia <html data-theme>), płynne przejścia między zakładkami.
   Bez czcionki z Google Fonts — blokowała pierwsze narysowanie strony na telefonie; systemowa jest od razu. */
@view-transition { navigation: auto; }

:root {
  color-scheme: light;
  --brand: #ec4479;            /* róż z logo 4Parents (#f77062 → #fe5196) */
  --brand-2: #f77062;
  --brand-grad: linear-gradient(135deg, #f77062 0%, #fe5196 100%);
  --brand-soft: #fdebf1;
  --brand-ink: #c92a5d;
  --sun: #f7b955;              /* żółto-pomarańczowy z logo */
  --sky: #0a8ff0;              /* niebieski z logo */
  --mint: #19c58f;
  --page-gradient: #f6f7f9;
  --ink: #1b1d23;
  --ink-muted: #646a78;
  --ink-faint: #696f7e;        /* 05.10.2026: było #9aa0ad (kontrast 2,5:1), teraz ≥4,5:1 na tle i kartach */
  --line: #e6e8ee;
  --line-strong: #d5d8e0;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --hover: #f8f8fb;
  --accent: #15803d;          /* 05.10.2026: było #16a34a (biały tekst 3,3:1) */
  --accent-bg: #e8f7ee;
  --danger: #c8233f;          /* 05.10.2026: było #dc2f4b (4,0:1 na --danger-bg) */
  --danger-bg: #fdecef;
  --pending: #d97706;
  --pending-bg: #fef4e4;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.18), 0 4px 8px -4px rgba(16, 24, 40, 0.08);
  --focus: 0 0 0 3px rgba(236, 68, 121, 0.2);
  --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --heading-font: var(--font);
  /* Menu boczne */
  --sidebar-bg: #fbfbfd;
  --sidebar-hover: #f0f1f5;
  --sidebar-active: var(--brand-soft);
  --sidebar-text: #3b3f4a;
  --sidebar-text-muted: #696f7e;
  --avatar-bg: var(--brand-grad);
  --topbar-bg: rgba(255, 255, 255, 0.92);
}

/* Tryb ciemny: grafitowe szarości zamiast czerni, przygaszony tekst (mniej męczy oczy). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #ff6b97;
  --brand-soft: rgba(255, 107, 151, 0.14);
  --brand-ink: #ff8db0;
  --page-gradient: #1f2125;
  --ink: #e4e6ea;
  --ink-muted: #a2a7b1;
  --ink-faint: #959ba6;
  --line: #34373e;
  --line-strong: #43474f;
  --bg: #1f2125;
  --surface: #272a2f;
  --surface-2: #2c2f35;
  --hover: #30333a;
  --accent: #3ccf7a;
  --accent-bg: rgba(60, 207, 122, 0.14);
  --danger: #ff6b7f;
  --danger-bg: rgba(255, 107, 127, 0.14);
  --pending: #f3a73b;
  --pending-bg: rgba(243, 167, 59, 0.15);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 32px -8px rgba(0, 0, 0, 0.5), 0 4px 8px -4px rgba(0, 0, 0, 0.3);
  --focus: 0 0 0 3px rgba(255, 107, 151, 0.28);
  --sidebar-bg: #24262b;
  --sidebar-hover: #2e3137;
  --sidebar-text: #c9ccd3;
  --sidebar-text-muted: #959ba6;
  --topbar-bg: rgba(36, 38, 43, 0.92);
  /* nazwy zmiennych używane we własnych stylach stron */
  --text: var(--ink); --muted: var(--ink-muted); --border: var(--line); --card: var(--surface);
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; letter-spacing: -0.006em; }
input, select, textarea, button { font-family: var(--font); }
::selection { background: var(--brand-soft); }

/* ---------- układ i menu boczne ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--sidebar-bg); color: var(--sidebar-text); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 10px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.sidebar-brand .icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none; font-size: 12px; font-weight: 700; letter-spacing: -0.02em;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(236, 68, 121, 0.35);
}
.sidebar-brand { justify-content: space-between; }
.sidebar-brand .logo { display: block; min-width: 0; }
.sidebar-brand .logo img { display: block; height: 38px; width: auto; }
.sidebar-brand .logo small { display: block; font-weight: 500; font-size: 11.5px; color: var(--sidebar-text-muted); margin: 3px 0 0 2px; }
.sidebar-brand span { font-weight: 650; font-size: 14.5px; color: var(--ink); line-height: 1.15; }
.sidebar-brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--sidebar-text-muted); }
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; }
.sidebar .nav-group {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--sidebar-text-muted);
  padding: 16px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); text-decoration: none; font-size: 13.5px; font-weight: 500; line-height: 20px;
  transition: background-color .12s, color .12s;
}
.nav-item svg { width: 17px; height: 17px; flex: none; color: var(--sidebar-text-muted); transition: color .12s; }
.nav-item[hidden] { display: none; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--ink); }
.nav-item:hover svg { color: var(--ink-muted); }
.nav-item.active { background: var(--sidebar-active); color: var(--brand-ink); font-weight: 600; }
.nav-item.active svg { color: var(--brand); }
.sidebar-spacer { flex: 1; min-height: 16px; }
.sidebar-user { border-top: 1px solid var(--line); padding: 12px 4px 0; margin-top: 10px; }
.user-row { display: flex; align-items: center; gap: 8px; padding: 0 4px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--avatar-bg); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px;
}
.user-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Wyloguj i przełącznik trybu: małe ikony obok nazwy osoby (Filip: „przycisk wyloguj jest strasznie duży”). */
.sidebar .logout-link, .icon-btn {
  display: inline-flex !important; align-items: center; justify-content: center; flex: none; gap: 0;
  width: 30px; height: 30px; padding: 0 !important; margin: 0 !important; border-radius: var(--radius-sm);
  background: transparent !important; border: 0 !important; color: var(--ink-faint) !important; font-size: 0 !important;
  text-decoration: none; cursor: pointer; box-shadow: none !important; min-height: 0 !important;
}
.sidebar .logout-link svg, .icon-btn svg { width: 17px; height: 17px; }
.sidebar .logout-link:hover, .icon-btn:hover { background: var(--sidebar-hover) !important; color: var(--ink) !important; }
.sidebar-version { color: var(--ink-faint); font-size: 11px; padding: 8px 10px 0; text-align: left; }

.content { flex: 1; min-width: 0; background: var(--bg); padding: 28px 36px 80px; position: relative; overflow-x: hidden; }
.blob { display: none !important; }
/* Kolorowe „kleksy” z materiałów 4Parents — delikatnie w tle, nie zasłaniają treści. */
.content { background: url(/img/blobs-footer.svg) right -40px bottom -20px / 520px auto no-repeat fixed, var(--bg); }
:root[data-theme="dark"] .content { background-image: none; }

.breadcrumb { color: var(--ink-faint); font-size: 12.5px; margin-bottom: 6px; }
.page { max-width: 1240px; margin: 0 auto; }
.content > .page { padding-top: 0; padding-left: 0; padding-right: 0; }

/* ---------- nagłówki i teksty ---------- */
h1, .content h1 { font-family: var(--font); font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; margin: 0 0 4px; }
.page > .sub, .content .page > .sub, .page > p.sub { color: var(--ink-muted); font-size: 13.5px; margin: 0 0 20px; }
.page > .sub a { color: var(--brand) !important; }
h2 { letter-spacing: -0.01em; }
a { color: var(--brand); }
.muted { color: var(--ink-muted); }
.hint, .status-line { color: var(--ink-muted); }
.empty { color: var(--ink-faint); }

/* ---------- karty ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card h2 { font-size: 15px; font-weight: 600; color: var(--ink); }

/* Kafelki z liczbami na górze zakładek */
.stat-card {
  border-left: 1px solid var(--line) !important; position: relative; padding: 14px 16px 14px 18px; overflow: hidden;
  transition: border-color .12s, box-shadow .12s, background-color .12s;
}
.stat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); opacity: .9; }
.stat-card.warn::before, .stat-card.inactive::before, .stat-card.late::before { background: var(--danger); }
.stat-card.ok::before, .stat-card.active::before { background: var(--accent); }
.stat-card.total::before { background: var(--ink-faint); }
.stat-card.remind::before { background: var(--pending); }
.stat-card.mine-out::before { background: var(--brand-2); }
.stat-card[onclick]:hover, .stat-card[data-tab]:hover { border-color: var(--line-strong) !important; box-shadow: var(--shadow-lg); background: var(--surface); }
.stat-num { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--ink-muted); margin-top: 3px; }

/* ---------- przyciski ---------- */
.btn, button.btn, a.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 500; line-height: 18px; padding: 6px 12px; min-height: 32px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04); cursor: pointer; text-decoration: none;
  transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.btn:hover { background: var(--hover); border-color: var(--line-strong); }
.btn:focus-visible, button:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.primary, button.primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 1px 3px rgba(236, 68, 121, 0.35); }
.btn.primary:hover { background: var(--brand-grad); border-color: transparent; filter: brightness(0.95); }
.btn.good { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); border-color: #f3b5c0; }
.btn-sm, .btn.btn-sm { font-size: 12px; padding: 3px 9px; min-height: 26px; }
.btn:disabled, button:disabled { opacity: .55; cursor: default; }

/* ---------- pola formularzy ---------- */
input[type=text], input[type=email], input[type=search], input[type=password], input[type=number], input[type=url],
input[type=date], input[type=month], input[type=time], input[type=datetime-local], input[type=tel], input:not([type]),
select, textarea {
  font-family: var(--font); color: var(--ink); background-color: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--ink-faint); }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); }
.field label { color: var(--ink-muted); font-weight: 500; }

/* ---------- tabele ---------- */
table { border-collapse: collapse; }
th {
  font-size: 11.5px; font-weight: 600; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
}
td { border-bottom: 1px solid var(--line); }
tbody tr { transition: background-color .08s; }
tbody tr:hover > td { background: var(--hover); }

/* ---------- zakładki ---------- */
.tabs { gap: 2px; border-bottom: 1px solid var(--line); }
.tab {
  font-family: var(--font); font-size: 13.5px; font-weight: 500; color: var(--ink-muted);
  padding: 9px 12px; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0;
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab.active { color: var(--brand-ink); border-bottom-color: var(--brand); font-weight: 600; }

/* ---------- etykiety, komunikaty ---------- */
.badge { border-radius: 999px; font-weight: 600; font-size: 11.5px; padding: 2px 8px; }
.banner, .notice { border-radius: var(--radius-sm); }

/* ---------- okna dialogowe i szuflady (różne strony) ---------- */
dialog, .modal, .drawer { border-radius: 12px; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(17, 20, 28, 0.35); backdrop-filter: blur(2px); }

/* ---------- pasek na telefonie ---------- */
.topbar { display: none; }
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40;
    background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
    padding: 10px 14px;
  }
  .topbar button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 36px; height: 36px; padding: 0; display: flex; align-items: center; justify-content: center; color: var(--ink); }
  .topbar .t-title { font-weight: 600; font-size: 15px; }
  .sidebar, .app-shell .sidebar {
    position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; height: 100%; width: 270px; padding: 14px 10px;
    flex-direction: column; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar .sidebar-nav { flex-direction: column; flex-wrap: nowrap; }
  .sidebar .sidebar-spacer, .sidebar .sidebar-user { display: block !important; }
  .sidebar .sidebar-user[style*="none"] { display: none !important; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(17, 20, 28, 0.35); z-index: 50; }
  .content { padding: 16px 14px 60px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tab { white-space: nowrap; flex: none; }
  h1, .content h1 { font-size: 20px; }
}

.topbar svg { width: 20px; height: 20px; }

/* ---------- logowanie (login.html) i pierwsze ustawienie hasła (konto.html) ---------- */
body:has(.card-right), body:has(> .card) {
  background: url(/img/blobs-right.svg) right 0 top 20px / auto 80vh no-repeat,
              url(/img/blobs-footer.svg) left bottom / min(1100px, 100%) auto no-repeat,
              radial-gradient(1200px 600px at 10% -10%, rgba(254, 81, 150, 0.10) 0%, transparent 60%), var(--bg);
}
body:has(.card-right)::before { display: none; }
body:has(.card-right) .card, body:has(> .card) > .card { border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.card-right .logo { width: 100%; }
.google-btn { border-radius: var(--radius-sm) !important; background: var(--brand-grad) !important; font-size: 14.5px !important; padding: 11px 24px !important; }
.google-btn:hover { filter: brightness(0.95); opacity: 1 !important; }
.google-btn.google-alt { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line-strong) !important; }
.google-btn.google-alt:hover { background: var(--surface-2) !important; }
.login-form input, body:has(> .card) input { border-radius: var(--radius-sm); border-color: var(--line-strong); }
.login-form input:focus, body:has(> .card) input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.footer { color: var(--ink-faint) !important; }
.footer a { color: var(--ink-muted); }

/* Teksty, które na dawnym fioletowym tle były białe (Projekty, karta klienta). */
#listView > .sub { color: var(--ink-muted); }
.detail-sub { color: var(--ink-muted); }
.detail-sub select, .detail-sub input { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.content .back { color: var(--ink-muted); opacity: 1; font-weight: 500; }
.content .back:hover { color: var(--brand); }

/* ---------- Tablety (index.html) ---------- */
.table-toolbar label { color: var(--ink-muted); font-weight: 500; }
.content button:not(.btn):not(.tab), .content select { border-color: var(--line-strong); border-radius: var(--radius-sm); }
.content button:not(.btn):not(.tab):hover { background: var(--hover); border-color: var(--line-strong); }
.btn-primary { background: var(--brand-grad) !important; border-color: transparent !important; color: #fff !important; }
.btn-primary:hover { filter: brightness(0.95); opacity: 1; }
.stat-card.total.selected, .stat-card.active.selected, .stat-card.inactive.selected { border-color: var(--line-strong) !important; box-shadow: var(--shadow-lg); }
tbody tr:not(.detail-row):hover > td { background: var(--hover); }
.name-toggle { font-weight: 600; color: var(--ink); }
.mono { color: var(--ink-muted); }
.badge.off, .badge.paused { background: var(--surface-2); color: var(--ink-muted); }
.badge.service { background: var(--pending-bg); color: #9a5b1f; }
.detail-row > td { background: var(--surface-2); }
.detail-panel { background: var(--surface-2); padding: 18px; gap: 14px; align-items: flex-start; }
.detail-block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow);
}
.detail-block h3 { color: var(--ink-faint); font-size: 11px; letter-spacing: 0.06em; }
.detail-panel input:disabled { background: var(--surface-2); color: var(--ink-muted); }
.shot-thumb img { border-radius: 6px; }
.panel-section {
  margin-top: 24px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.panel-section h2 { font-weight: 600; }
.panel-section summary { cursor: pointer; font-weight: 600; font-size: 14.5px; }
.pagination-bar button { border-radius: var(--radius-sm); }
.modal-overlay { background: rgba(17, 20, 28, 0.45); backdrop-filter: blur(2px); }
.modal-content { border-radius: 14px; box-shadow: var(--shadow-lg); }
.activity-bar { border-color: var(--line); box-shadow: var(--shadow-lg); border-radius: 12px; }
.bulk-bar { left: calc(248px + (100% - 248px) / 2); max-width: calc(100% - 248px - 48px); border-radius: 12px; box-shadow: var(--shadow-lg); }
@media (max-width: 760px) {
  .bulk-bar { left: 50%; max-width: calc(100% - 24px); }
  .detail-panel { padding: 10px; }
}

/* ---------- dzwonek z powiadomieniami (nav.js, GET /api/powiadomienia) ---------- */
.bell { position: relative; flex: none; }
.bell .icon-btn { position: relative; }
.bell-count {
  position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--brand-grad); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.bell-count[hidden], .bell-panel[hidden] { display: none; }
.bell-panel {
  position: fixed; z-index: 90; width: 320px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); text-align: left;
}
.bell-head { font-weight: 600; font-size: 13px; padding: 12px 14px 8px; color: var(--ink); border-bottom: 1px solid var(--line); }
.bell-empty { padding: 16px 14px; color: var(--ink-muted); font-size: 13px; }
.bell-item { display: grid; gap: 1px; padding: 10px 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.bell-item:last-child { border-bottom: 0; }
.bell-item:hover { background: var(--hover); }
.bell-item.new { box-shadow: inset 3px 0 0 var(--brand); }
.bell-mod { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); }
.bell-title { font-size: 13px; font-weight: 500; }
.bell-sub { font-size: 12px; color: var(--ink-muted); }
.bell-item.late .bell-sub { color: var(--danger); }

/* ---------- telefon: pasek górny ---------- */
.topbar .t-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.topbar .icon-btn { width: 36px; height: 36px; color: var(--ink-muted) !important; }
.topbar .menu-btn { color: var(--ink); }
.sidebar-user { padding: 10px 2px 0; }
/* Na telefonie menu nie animuje cienia całej strony — mniej pracy dla słabszych telefonów. */
@media (max-width: 760px) {
  .sidebar, .app-shell .sidebar { will-change: transform; transition: transform .16s ease-out; }
  .sidebar .bell { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .sidebar, .app-shell .sidebar { transition: none; }
}
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .14s; }
.sidebar { view-transition-name: panel-sidebar; }

/* ---------- tryb ciemny: miejsca, gdzie strony mają na sztywno jasne kolory ---------- */
:root[data-theme="dark"] :is(.art-body, .entry, .edit-form, .task, .version, details.call-card, .composer, .next-box, .codes, .secret,
  .detail-panel, .tile:hover, details.rivals, .merge-bar, .taskform input, .taskform select, input:disabled) {
  background: var(--surface-2); color: var(--ink);
}
:root[data-theme="dark"] :is(.mentions, .modal, body > .card, .google-alt) { background: var(--surface); color: var(--ink); border-color: var(--line); }
:root[data-theme="dark"] :is(mark, .transcript .here, .bp-row.first > .bp-name) { background: rgba(247, 185, 85, 0.28); color: inherit; }
:root[data-theme="dark"] :is(.mention, .badge.Baza, .badge.group, .badge.lock, .bp-path.current, .bp-row.current > .bp-name, .meeting.selected) {
  background: var(--brand-soft); color: var(--brand);
}
:root[data-theme="dark"] .badge { background: rgba(255, 255, 255, 0.08); color: var(--ink-muted); }
:root[data-theme="dark"] :is(.badge.Freshdesk, .badge.Synchronizacja, .st-pomysl, .st-potencjalny, .badge.low, .badge.prio-low, .badge.Tablety, .badge.uzupelniajace) {
  background: rgba(10, 143, 240, 0.16); color: #7cc0ff;
}
:root[data-theme="dark"] :is(.badge.Klienci, .badge.Sprzedaż, .badge.Oferty, .badge.service) { background: var(--pending-bg); color: #f3b866; }
:root[data-theme="dark"] .badge.Logowanie { background: rgba(25, 197, 143, 0.15); color: #5fd9b3; }
:root[data-theme="dark"] :is(.badge.Projekty, .badge.Zadania) { background: var(--accent-bg); color: var(--accent); }
:root[data-theme="dark"] :is(.badge.Użytkownicy, .badge.Uprawnienia) { background: var(--danger-bg); color: var(--danger); }
:root[data-theme="dark"] :is(.notice, .warn) { background: var(--pending-bg); color: #f3c27a; }
:root[data-theme="dark"] :is(.notice.err, .error, .banner.err, #ofertySettings .banner.err) { background: var(--danger-bg); color: #ff9aa8; }
:root[data-theme="dark"] :is(.banner.test, .banner.warn) { background: var(--pending-bg); color: #f3c27a; border-color: rgba(243, 167, 59, 0.35); }
:root[data-theme="dark"] :is(.banner.live, .banner.ok) { background: var(--accent-bg); color: #7ee0a6; border-color: rgba(60, 207, 122, 0.35); }
/* Biały tekst na jasnym zielonym/różowym w trybie ciemnym miał kontrast ~2:1 — ciemny tekst ma ponad 6:1. */
:root[data-theme="dark"] .btn.good { color: #10261a; }
:root[data-theme="dark"] .kinds button.on { color: #1b1d23; }
:root[data-theme="dark"] .bar { background: var(--line); }
:root[data-theme="dark"] tbody tr:not(.detail-row):hover { background: var(--hover); }
:root[data-theme="dark"] img.sidebar-logo, :root[data-theme="dark"] .sidebar-brand img { filter: brightness(1.05); }
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type=month]::-webkit-calendar-picker-indicator { filter: invert(0.8); }

/* Ustawienia: kategorie jako zakładki, bez ramek wokół każdej */
.settings-tabs .tab { border: 0 !important; border-bottom: 2px solid transparent !important; background: transparent; cursor: pointer; }
.settings-tabs .tab.active { border-bottom-color: var(--brand) !important; }
.sidebar-brand .logo { text-decoration: none; }

/* ---------- Tablety na telefonie (Filip, 04.10.2026: „pełne RWD w tabletach”) ----------
   Tabela tabletów zamienia się w karty: nazwa, ekran, grupa, połączenie, bateria, ostatni kontakt
   i przyciski w kilku wierszach, bez przewijania w bok. */
@media (max-width: 760px) {
  .stat-row { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px !important; }
  .stat-row .stat-card { min-width: 0 !important; padding: 10px 10px 10px 13px; }
  .stat-row .stat-num { font-size: 20px; }
  .stat-row .stat-label { font-size: 11.5px; line-height: 1.25; }

  .table-toolbar { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px !important; }
  .table-toolbar label, .table-toolbar .spacer { display: none; }
  .table-toolbar #searchBox { grid-column: 1 / -1; order: -1; width: 100% !important; min-height: 38px; }
  .table-toolbar select, .table-toolbar button { width: 100%; min-height: 38px; }

  .table-wrap:has(#deviceRows) { overflow: visible; background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
  .table-wrap:has(#deviceRows) table, .table-wrap:has(#deviceRows) tbody { display: block; width: 100%; }
  .table-wrap:has(#deviceRows) thead { display: none; }
  #deviceRows > tr:not(.detail-row) {
    display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 4px; align-items: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 12px 12px 10px; margin-top: 10px;
  }
  #deviceRows > tr:not(.detail-row) > td { display: block; border: 0; padding: 0; background: transparent !important; min-width: 0; }
  #deviceRows > tr > td.num-col, #deviceRows > tr > td.mono { display: none; }
  #deviceRows > tr > td.select-col { grid-column: 1; grid-row: 1; }
  #deviceRows > tr > td:nth-child(3) { grid-column: 2; grid-row: 1; font-size: 15px; }
  #deviceRows > tr > td.screen { grid-column: 3; grid-row: 1; }
  #deviceRows > tr > td:nth-child(4) { grid-column: 2 / -1; grid-row: 2; color: var(--ink-muted); font-size: 12.5px; }
  #deviceRows > tr > td.conn { grid-column: 2; grid-row: 3; font-size: 12.5px; }
  #deviceRows > tr > td.battery { grid-column: 3; grid-row: 3; font-size: 12.5px; font-weight: 600; }
  #deviceRows > tr > td.lastseen { grid-column: 2 / -1; grid-row: 4; font-size: 12.5px; color: var(--ink-muted); display: flex; align-items: center; gap: 6px; }
  #deviceRows > tr > td.actions {
    grid-column: 1 / -1; grid-row: 5; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px;
    border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px;
  }
  #deviceRows > tr > td.actions > * { width: 100%; min-height: 36px; margin: 0 !important; font-size: 12.5px; }
  #deviceRows > tr.detail-row { display: block; }
  #deviceRows > tr.detail-row > td { display: block; padding: 0; border: 0; }
  #deviceRows .detail-panel { flex-direction: column; gap: 10px; padding: 10px 0 !important; background: transparent; }
  #deviceRows .detail-block { min-width: 0 !important; width: 100%; }
  #deviceRows .detail-block input, #deviceRows .detail-block select { max-width: 100%; }
  .pagination-bar { justify-content: space-between; }
  .panel-section { padding: 14px; }
  .panel-section .table-wrap, .panel-section table { overflow-x: auto; display: block; }
  .modal-content { width: calc(100vw - 20px) !important; max-height: calc(100vh - 40px); overflow-y: auto; padding: 16px !important; }
  /* Pasek akcji zbiorczych: przyklejony do dołu ekranu, dwa niskie wiersze.
     Wcześniej miał jednocześnie top i bottom, więc rozciągał się na całą wysokość ekranu. */
  .bulk-bar {
    top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); width: calc(100% - 24px);
    flex-wrap: wrap; gap: 6px 12px; padding: 8px 10px;
  }
  .bulk-bar > strong { order: 1; }
  .bulk-bar > a { order: 2; font-size: 13px; }
  .bulk-bar > #bulkSelectAll { margin-left: auto; }
  .bulk-bar > .spacer { order: 3; flex-basis: 100%; height: 0; }
  .bulk-bar > select { order: 4; flex: 1 1 0; min-width: 0; min-height: 38px; }
  .bulk-bar > button { order: 5; min-height: 38px; }
  body.bulk-open main.content { padding-bottom: 110px; }
  body.bulk-open .activity-bar, body.bulk-open .panel-notices { bottom: 110px; }
  .table-toolbar .select-all-mobile {
    display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; order: -1;
    font-size: 13.5px; color: var(--ink); min-height: 32px; cursor: pointer;
  }
}
.card-right .logo::before { content: ""; display: block; height: 46px; margin: 0 auto; background: url(/img/4parents-logo.svg) center / contain no-repeat; }
:root[data-theme="dark"] body:has(.card-right) .card-right { background: var(--surface); }
.bell-foot { padding: 10px 14px 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.bell-foot .push-toggle { width: 100%; }
.bell-panel { font-weight: 400; font-size: 13px; }
.push-hint { font-weight: 400; font-size: 11.5px; color: var(--ink-muted); line-height: 1.35; }

/* Komunikaty u dołu ekranu (public/nav.js: nowa wersja panelu, wygasła sesja przy odświeżaniu w tle) */
.panel-notices { position: fixed; right: 16px; bottom: 16px; z-index: 100; display: grid; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.panel-notice { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--brand); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 13px; }
.panel-notice > span { flex: 1; min-width: 0; }
.panel-notice .icon-btn { flex: none; }

/* ---------- „Zgłoś problem” (nav.js, zglos.js) ---------- */
button.nav-item.report-btn, button.nav-item.look-btn { width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; font-size: 13.5px; font-weight: 500; }
/* Przełącznik „Nowy wygląd (beta)” (nav.js, theme-beta.css) */
.look-btn span { flex: 1; }
.look-switch { flex: none; width: 28px; height: 16px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background-color .12s; }
.look-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .12s; }
.look-btn[aria-checked="true"] .look-switch { background: var(--brand); }
.look-btn[aria-checked="true"] .look-switch::after { transform: translateX(12px); }
.report-dialog { width: min(560px, calc(100vw - 24px)); padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.report-form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.report-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 0; }
.report-head h2 { margin: 0; font-size: 17px; }
.report-body { padding: 8px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.report-body label { font-weight: 600; font-size: 13px; margin-top: 6px; }
.report-body textarea { width: 100%; box-sizing: border-box; resize: vertical; }
.report-lead, .report-tech { margin: 0; color: var(--ink-muted); font-size: 13px; }
.report-shot { border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-muted); }
.report-shot.over, .report-shot:focus-within { border-color: var(--brand); }
.report-shot img { max-width: 100%; max-height: 220px; border-radius: 6px; border: 1px solid var(--line); }
.report-shot .linkish { background: none; border: 0; padding: 0; color: var(--brand-ink); text-decoration: underline; cursor: pointer; font: inherit; }
.report-msg { margin: 4px 0 0; font-size: 13px; font-weight: 600; min-height: 1em; }
.report-mine h3 { font-size: 13px; margin: 8px 0 4px; }
.report-mine ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.report-mine li { display: flex; gap: 8px; align-items: baseline; }
.report-li { color: var(--ink-muted); }
.report-st { flex: none; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.report-st.st-poprawione { background: var(--accent-bg); color: var(--accent); border-color: transparent; }
.report-st.st-odrzucone { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.report-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; border-top: 1px solid var(--line); }
.zg-list { display: flex; flex-direction: column; gap: 10px; }
.zg-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.zg-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.zg-top select { margin-left: auto; }
.zg-opis { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; }
.zg-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-muted); align-items: baseline; }
.zg-meta pre { white-space: pre-wrap; font-size: 11.5px; margin: 4px 0 0; }
.report-dialog [hidden] { display: none !important; }
.report-head .report-x { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--ink-muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.report-head .report-x:hover { background: var(--hover); color: var(--ink); }

/* ---------- „Szukaj wszędzie” w górnym pasku (public/szukaj.js) ---------- */
.gsearch-bar { display: flex; justify-content: flex-end; margin: -12px 0 14px; position: relative; z-index: 45; }
.gsearch { position: relative; width: min(460px, 100%); }
.gsearch-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); display: flex; pointer-events: none; }
.gsearch-icon svg, .gsearch-toggle svg { width: 17px; height: 17px; }
.content .gsearch-input {
  width: 100%; height: 38px; margin: 0; padding: 0 64px 0 36px; font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; box-shadow: none;
}
.content .gsearch-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.gsearch-input::-webkit-search-cancel-button { display: none; }
.gsearch-kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 600 11px/1 var(--font); color: var(--ink-faint);
  border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--bg); pointer-events: none;
}
.gsearch-input:focus ~ .gsearch-kbd { display: none; }
.gsearch-panel {
  position: absolute; top: calc(100% + 6px); right: 0; width: min(560px, calc(100vw - 28px)); max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px 0; text-align: left;
}
.gsearch-panel[hidden] { display: none; }
.gsearch-group + .gsearch-group { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.gsearch-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px 4px;
  font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint);
}
.gsearch-count { font-variant-numeric: tabular-nums; }
.content .gsearch-clear { border: 0; background: none; padding: 0; font: inherit; color: var(--ink-muted); cursor: pointer; text-transform: none; letter-spacing: 0; }
.content .gsearch-clear:hover { background: none; color: var(--brand); }
.gsearch-opt { display: grid; gap: 1px; padding: 7px 14px; text-decoration: none; color: var(--ink); border-left: 3px solid transparent; }
.gsearch-opt.active { background: var(--hover); border-left-color: var(--brand); }
.gsearch-title { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-sub { font-size: 12px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsearch-opt.more .gsearch-title { font-size: 12.5px; color: var(--brand); }
.gsearch-opt.recent .gsearch-title { font-weight: 400; }
.gsearch-empty { padding: 14px; color: var(--ink-muted); font-size: 13px; }
@media (max-width: 760px) {
  .gsearch-bar { display: none; margin: 0; position: fixed; left: 0; right: 0; top: 57px; padding: 8px 14px; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
  body.gsearch-open .gsearch-bar { display: flex; }
  .gsearch { width: 100%; }
  .gsearch-kbd { display: none; }
  .content .gsearch-input { font-size: 16px; padding-right: 12px; } /* 16 px: iPhone nie powiększa strony przy pisaniu */
  .gsearch-panel { position: fixed; top: 111px; left: 14px; right: 14px; width: auto; max-height: calc(100vh - 130px); }
}
.gsearch-optin { display: flex; align-items: center; gap: 8px; padding: 6px 14px 8px; margin-bottom: 2px; font-size: 12.5px; color: var(--ink-muted); border-bottom: 1px solid var(--line); cursor: pointer; }
.gsearch-optin[hidden] { display: none; }
.gsearch-optin input { margin: 0; accent-color: var(--brand); }

/* ---------- podzakładki modułu (np. Klienci | Szkolenia) ---------- */
.subtabs { display: flex; margin: 0 0 16px; }
.subtabs .tab { text-decoration: none; }
