/* ===== Reset / podstawy ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
/* WAŻNE: atrybut hidden musi naprawdę chować element (inaczej .modal-overlay/.login-view
   z display:flex nakładają się na stronę i blokują klikanie). */
[hidden] { display: none !important; }
:root {
  --bg: #f7f7f5;
  --panel: #ffffff;
  --ink: #37352f;
  --ink-soft: #787774;
  --line: #e9e9e7;
  --line-strong: #ddddda;
  --accent: #2383e2;
  --shadow: 0 1px 2px rgba(15,15,15,.06), 0 2px 8px rgba(15,15,15,.04);
  --radius: 10px;
}
html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
}

/* ===== Banner DEMO ===== */
.demo-banner {
  background: #fdf3d8;
  color: #7a5b14;
  text-align: center;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 500;
  border-bottom: 1px solid #f0e3b8;
}

/* ===== Logowanie ===== */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 34px 30px; width: 100%; max-width: 360px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.login-card h1 { font-size: 20px; font-weight: 700; }
.login-sub { color: var(--ink-soft); font-size: 13px; margin-bottom: 6px; }
.login-card input {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.login-card input:focus { outline: none; border-color: var(--accent); }
.login-card button {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 10px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px;
}
.login-card button:hover { filter: brightness(.96); }
.login-card .link-btn {
  background: none; color: var(--ink-soft); border: none; padding: 2px;
  font-size: 12.5px; font-weight: 500; text-decoration: underline; cursor: pointer; margin-top: 0;
}
.login-card .link-btn:hover { filter: none; color: var(--accent); }
.login-error { color: #d4493f; font-size: 12.5px; min-height: 16px; }

/* ===== Topbar ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 26px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.topbar-left { display: flex; align-items: baseline; gap: 8px; }
.logo { font-weight: 700; font-size: 16px; }
.logo-sub { color: var(--ink-soft); font-size: 13px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.ghost-btn {
  background: transparent; border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink); font-family: inherit;
}
.ghost-btn:hover { background: var(--bg); }

/* ===== Rozwijane menu w topbarze: Konto (ludzik) + Sekcje (hamburger) ===== */
.menu-wrap { position: relative; display: inline-flex; }
.notif-bell.saved { border-color: #16a34a; color: #16a34a; }
.pop-menu { position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 5px; z-index: 60; }
.pop-menu-head { font-size: 12px; font-weight: 600; color: var(--ink-soft); padding: 8px 10px 6px; }
.pop-menu-item { display: block; width: 100%; text-align: left; border: none; background: transparent; color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 500; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.pop-menu-item:hover { background: var(--bg); }
.pop-menu-item.active { background: #eef5fd; color: var(--accent); font-weight: 600; }
.section-view { padding: 28px 26px 40px; }

/* ===== Pasek widoków (Tablica / Na dziś / Archiwum) + panel zespołu ===== */
.tabs {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  padding: 8px 22px 0; background: var(--panel); border-bottom: 1px solid var(--line);
}
/* min-width:0 jest KLUCZOWE — bez niego min-width:auto blokuje kurczenie i overflow-x nigdy się nie włącza (pasek rozpycha stronę na mobile) */
.tab-modes { display: flex; gap: 2px; overflow-x: auto; min-width: 0; flex: 1 1 auto; }
/* Panel zespołu — rozwijany wybór, czyje karty widać (dostępny dla każdego) */
.owner-panel { position: relative; flex: 0 0 auto; padding-bottom: 6px; }
.owner-toggle {
  display: inline-flex; align-items: center; gap: 6px; background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 11px;
  font-size: 13px; font-family: inherit; color: var(--ink); cursor: pointer; white-space: nowrap;
}
.owner-toggle:hover { border-color: var(--ink-soft); }
.owner-toggle strong { font-weight: 600; }
.owner-toggle .caret { color: var(--ink-soft); font-size: 11px; }
.owner-pop {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 224px; z-index: 60;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow); padding: 6px;
}
.owner-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: none; border-radius: 7px; padding: 7px 9px;
  font-size: 13.5px; font-family: inherit; color: var(--ink); cursor: pointer;
}
.owner-opt:hover { background: var(--bg); }
.owner-opt.on { background: rgba(35,131,226,.08); font-weight: 600; }
.owner-check { width: 14px; flex: 0 0 auto; color: var(--accent); font-weight: 700; text-align: center; }
.owner-all { font-weight: 600; }
.owner-sep { height: 1px; background: var(--line); margin: 5px 2px; }
.owner-me { color: var(--ink-soft); font-weight: 400; }
.avatar.sm { width: 18px; height: 18px; font-size: 10px; }
.tab {
  border: none; background: transparent; padding: 8px 14px 11px; font-size: 13.5px; font-weight: 500;
  color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-family: inherit;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.tab .count { color: var(--ink-soft); font-weight: 500; margin-left: 5px; font-size: 12px; }
.tab .tab-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

/* Przełącznik układu: Kanban / Tabela (po prawej, obok „Pokaż") */
.view-switch { flex: 0 0 auto; display: inline-flex; gap: 2px; align-self: center; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; margin-bottom: 6px; }
.vs-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: transparent; color: var(--ink-soft); font-family: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; border-radius: 6px; padding: 5px 9px; white-space: nowrap; transition: background .12s ease, color .12s ease; }
.vs-btn svg { flex: 0 0 auto; }
.vs-btn:hover { color: var(--ink); }
.vs-btn.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
@media (max-width: 640px) { .vs-btn span { display: none; } .vs-btn { padding: 5px 7px; } }

/* ===== Tablica kanban ===== */
.board {
  display: flex; gap: 14px; padding: 0 26px 28px; overflow: auto; align-items: stretch;
  height: calc(100vh - 112px);
}

/* ===== Widok tabeli ===== */
.board.board-table { display: block; padding: 18px 26px 28px; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.crm-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
.crm-table thead th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 11px 16px; background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; }
.crm-table tbody td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.crm-table tbody tr:last-child td { border-bottom: none; }
.tb-row { cursor: pointer; transition: background .12s ease; }
.tb-row:hover { background: var(--bg); }
.tb-name { display: flex; flex-direction: column; gap: 1px; }
.tb-nm { font-weight: 600; color: var(--ink); }
.tb-co { font-size: 12px; color: var(--ink-soft); }
.tb-empty { color: var(--ink-soft); }
.tb-num, .tb-demo, .tb-arch { white-space: nowrap; }
.tb-arch { color: var(--ink-soft); }
.tb-team-in { display: inline-flex; align-items: center; }
.tb-fu { font-weight: 600; white-space: nowrap; }
.tb-fu.fu-overdue { color: #c0392b; }
.tb-fu.fu-today { color: #b8860b; }
.tb-fu.fu-done { color: #2e6b3e; }
.table-empty { color: var(--ink-soft); font-size: 14px; padding: 40px 0; text-align: center; }
.column { flex: 0 0 284px; display: flex; flex-direction: column; }
/* col-inner wypełnia całą wysokość kolumny → strefa upuszczania = cały słupek (drop działa też w pustym
   dole kolumny), a tło/tint pokrywa pełną wysokość. align-items:stretch na .board wyrównuje kolumny do
   najwyższej, zachowując wspólny scroll i sticky-nagłówki. */
.col-inner { display: flex; flex-direction: column; flex: 1 1 auto; border-radius: 12px; padding: 4px 8px 10px; }
.column-head {
  display: flex; align-items: center; gap: 7px; padding: 9px 6px 9px; font-size: 13px; font-weight: 600;
  position: sticky; top: 0; background: inherit; z-index: 3;
}
/* zasłoń ewentualny skrawek karty przewijającej się tuż nad nagłówkiem (karta ZAWSZE pod etapem) */
.column-head::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 12px; background: inherit; }
.col-label { letter-spacing: .005em; }
.col-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 6px; font-weight: 600; font-size: 13px; }
.add-card-btn { margin: 6px 2px 0; width: calc(100% - 4px); text-align: left; background: transparent; border: 1px dashed rgba(55,53,47,.2); border-radius: 8px; padding: 9px 12px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: inherit; transition: background .12s, border-color .12s; }
.add-card-btn:hover { background: rgba(255,255,255,.65); border-color: rgba(55,53,47,.32); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.column-head .col-count { color: var(--ink-soft); font-weight: 500; }
.column-head .add-card { margin-left: auto; border: none; background: transparent; color: var(--ink-soft);
  font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; border-radius: 5px; }
.column-head .add-card:hover { background: var(--line); color: var(--ink); }
.cards { display: flex; flex-direction: column; gap: 8px; padding: 2px; }
.cards:empty { min-height: 0; padding: 0; }
.column.drag-over { background: rgba(35,131,226,.035); border-radius: 12px; outline: 1.5px dashed rgba(35,131,226,.22); outline-offset: -3px; }
/* wskaźnik miejsca upuszczenia przy przestawianiu góra/dół w kolumnie */
.card.drop-above, .card.drop-below { position: relative; }
.card.drop-above::before, .card.drop-below::after { content: ""; position: absolute; left: 0; right: 0; height: 3px; background: var(--accent); border-radius: 3px; }
.card.drop-above::before { top: -6px; }
.card.drop-below::after { bottom: -6px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 13px; cursor: pointer; box-shadow: 0 1px 2px rgba(15,15,15,.05);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(15,15,15,.10); }
.card-ic { opacity: .38; margin-right: 5px; font-size: 12px; }
.card[draggable="true"] { cursor: grab; }
.card.dragging { opacity: .45; }
.card-title { font-weight: 600; font-size: 13.5px; margin-bottom: 3px; line-height: 1.3; }
.card-stars { color: #e0a93c; font-size: 11.5px; letter-spacing: 1px; margin-left: 6px; white-space: nowrap; }
.card-company { color: var(--ink-soft); font-size: 12.5px; margin-bottom: 6px; line-height: 1.35; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--ink-soft); font-size: 12px; }
.card-meta .chip { display: inline-flex; align-items: center; gap: 4px; }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; color: var(--ink-soft); font-size: 12px; }
.card-owner { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; }
.avatar {
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,15,15,.32); display: flex;
  align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 50; overflow-y: auto;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
}
.modal {
  background: var(--panel); border-radius: 14px; width: 100%; max-width: 640px;
  position: relative; box-shadow: 0 10px 40px rgba(0,0,0,.18); padding: 36px 40px 30px;
}
/* pasek akcji karty (poprzedni / następny / zamknij) — prawy górny róg */
.modal-actions { position: absolute; top: 14px; right: 16px; display: flex; align-items: center; gap: 6px; z-index: 5; }
.modal-nav-btn {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft);
  border-radius: 8px; font-size: 19px; line-height: 1; cursor: pointer; font-family: inherit;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.modal-nav-btn:hover { background: var(--bg); color: var(--ink); border-color: var(--ink-soft); }
.modal-nav-btn:disabled { opacity: .3; cursor: default; background: #fff; color: var(--ink-soft); border-color: var(--line); }
.modal-close {
  width: 30px; height: 30px; border: none; background: transparent;
  font-size: 26px; line-height: 1; color: var(--ink-soft); cursor: pointer;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.modal-close:hover { color: var(--ink); background: var(--bg); }
.modal h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.modal .modal-sub { color: var(--ink-soft); font-size: 12.5px; margin-bottom: 18px; }
.modal input.title-input { font-size: 24px; font-weight: 700; border: none; width: 100%; font-family: inherit; color: var(--ink); }
.modal input.title-input:focus { outline: none; }

.props { display: grid; grid-template-columns: 150px 1fr; gap: 2px 10px; margin: 14px 0 6px; }
.prop-label { color: var(--ink-soft); font-size: 13px; padding: 8px 6px; display: flex; align-items: center; gap: 7px; }
.prop-value { padding: 4px 0; }
.prop-value input, .prop-value select, .prop-value textarea {
  width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 7px 8px; font-size: 13.5px;
  font-family: inherit; color: var(--ink); background: transparent;
}
.prop-value input:hover, .prop-value select:hover, .prop-value textarea:hover { background: var(--bg); }
.prop-value input:focus, .prop-value select:focus, .prop-value textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.prop-value.readonly { padding: 7px 8px; font-size: 13.5px; color: var(--ink); }
.prop-value a { color: var(--accent); text-decoration: none; }

/* wiersz Google Maps: pole + przyciski otwórz/kopiuj (jak w Notion) */
.maps-cell { display: flex; align-items: center; gap: 6px; }
.maps-cell input { flex: 1 1 auto; min-width: 0; width: auto; }
.maps-cell .maps-link { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 8px; }
.maps-btn {
  flex: 0 0 auto; cursor: pointer; border: 1px solid var(--line, #e6e3dd); background: #fff;
  color: var(--ink-soft); border-radius: 6px; padding: 6px 9px; font-size: 12.5px; font-family: inherit;
  white-space: nowrap; transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.maps-btn:hover { background: var(--bg); color: var(--ink); }
.maps-btn.ok { color: #1a7f37; border-color: #1a7f37; background: #eaf6ec; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 500; }

.section-divider { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.notes-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }

.comments-wrap { margin-top: 8px; }
.comment { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.comment:first-of-type { border-top: none; }
.comment-main { flex: 1; }
.comment-head { font-size: 12.5px; margin-bottom: 2px; }
.comment-head .c-author { font-weight: 600; }
.comment-head .c-time { color: var(--ink-soft); margin-left: 8px; font-size: 11.5px; }
.comment-body { font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; }
.add-comment { display: flex; gap: 8px; margin-top: 12px; position: relative; }
.add-comment input { flex: 1; border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; font-size: 13.5px; font-family: inherit; }
.add-comment input:focus { outline: none; border-color: var(--accent); }
/* nakładka podświetlająca @claude podczas pisania (input nietknięty, tło pod spodem) */
.add-comment .hl-wrap { position: relative; flex: 1; display: flex; }
.add-comment .hl-wrap > #new-comment { flex: 1; background: transparent; position: relative; z-index: 1; }
.hl-backdrop { position: absolute; inset: 0; z-index: 0; background: #fff; border: 1px solid transparent; border-radius: 8px; padding: 9px 11px; font-size: 13.5px; font-family: inherit; white-space: pre; overflow: hidden; color: transparent; pointer-events: none; }
.hl-backdrop .hl-claude { background: #FF6A00; border-radius: 4px; }
.add-comment button { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 0 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; }

/* ===== Zdjęcia: komentarze + notatki ===== */
.comment-img { display: block; max-width: 220px; max-height: 220px; border-radius: 8px; margin-top: 6px; cursor: zoom-in; object-fit: cover; }
.attach-btn { flex: 0 0 auto; background: transparent; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 15px; line-height: 1; padding: 0 10px; cursor: pointer; color: var(--ink); }
.attach-btn:hover { background: var(--bg); }
.attach-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.attach-preview img { max-height: 56px; max-width: 90px; border-radius: 6px; object-fit: cover; }
.attach-preview .attach-remove { border: none; background: var(--bg); border-radius: 50%; width: 20px; height: 20px; line-height: 20px; text-align: center; cursor: pointer; color: var(--ink-soft); font-size: 11px; padding: 0; }
.attach-uploading { font-size: 12.5px; color: var(--ink-soft); }
.note-img-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.note-img-item { position: relative; }
.note-img-item img { display: block; width: 72px; height: 72px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); cursor: zoom-in; }
.note-attach-row { margin-top: 8px; display: flex; align-items: center; gap: 8px; }

.readonly-note { background: #fbf3e4; color: #7a5b14; font-size: 12px; padding: 7px 10px; border-radius: 7px; margin-bottom: 14px; }
.save-row { margin-top: 12px; display: flex; justify-content: flex-end; gap: 8px; }
.primary-btn { background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 9px 18px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.primary-btn:hover { filter: brightness(.96); }
/* „Przenieś do archiwum" — neutralne (to NIE jest usuwanie) */
#delete-card { color: var(--ink-soft); border-color: var(--line-strong); }
#delete-card:hover { background: var(--bg); color: var(--ink); }
.danger-btn { background: #d4493f; }
.danger-btn:hover { filter: brightness(.95); }
.confirm-del { color: #a8362f; font-size: 13.5px; display: inline-flex; align-items: center; }

/* ===== Karta klienta NA CAŁY EKRAN (dwukolumnowa: lewo=dane+notatka, prawo=komentarze) =====
   Włącza się TYLKO dla głównego widoku karty (klasa .modal-full dodawana w openModal);
   Kosz i proste dialogi zostają w małym modalu. */
.modal-overlay:has(.modal-full) { align-items: stretch; padding: 0; }
.modal.modal-full {
  max-width: 100vw; width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0;
  padding: 0; display: flex; flex-direction: column; overflow: hidden;
}
.modal.modal-full #modal-body { flex: 1 1 auto; min-height: 0; display: flex; width: 100%; justify-content: center; }
/* na pełnym ekranie karta jest wyśrodkowana (max-width 1500) — przyklej pasek akcji do PRAWEJ KRAWĘDZI karty
   (a nie ekranu), żeby nie „odlatywał" w pusty pas po oddaleniu/na szerokim monitorze */
.modal.modal-full .modal-actions { right: max(16px, calc((100vw - 1500px) / 2 + 16px)); z-index: 5; background: var(--bg); padding: 3px; border-radius: 10px; }
/* max-width + wyśrodkowanie: po oddaleniu (szeroki/zoom-out viewport) karta nie rozłazi się na całą szerokość,
   tylko trzyma czytelną szerokość wyśrodkowaną (ramka pojawia się tylko gdy jest miejsce po bokach). */
.cm { display: grid; grid-template-columns: minmax(0,1fr) clamp(380px, 34%, 540px); width: 100%; max-width: 1500px; min-height: 0; box-shadow: 0 0 0 1px var(--line); }
/* lewa kolumna — przewijalna */
.cm-left { min-width: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 22px 28px 18px; }
.cm-name { font-size: 21px; font-weight: 700; margin: 0 0 1px; }
.modal.modal-full input.title-input.cm-name { font-size: 21px; width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 3px 7px; margin-left: -7px; box-sizing: border-box; transition: background .12s ease, border-color .12s ease; }
.modal.modal-full input.title-input.cm-name:hover { background: var(--bg); }
.modal.modal-full input.title-input.cm-name:focus { background: var(--panel); border-color: var(--accent); }
/* nagłówek sekcji „Notatki" — spójny z nagłówkami grup */
.cm-left .cm-notes .notes-label { font-size: 11px; letter-spacing: .07em; padding-bottom: 7px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
/* ── Karta: właściwości w 2 grupach (Kontakt | Sprzedaż), pola „inline" jak w Notion ── */
/* Nagłówek karty: imię + znaczek partnera (lewa) + gwiazdki i stepper etapu (prawa) w jednej linii */
.cm-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cm-head .cm-name-wrap { flex: 1 1 220px; min-width: 0; display: flex; align-items: center; gap: 4px; }
.cm-head .cm-name { flex: 0 1 auto; min-width: 0; margin: 0; }
.modal.modal-full .cm-head input.title-input.cm-name { width: auto; max-width: 100%; }
.cm-head .stars { flex: 0 0 auto; }
.cm-props { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 0; align-items: start; margin: 20px 0 6px; max-width: 820px; }
.cm-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cm-group:first-child { padding-right: 36px; }
.cm-group + .cm-group { border-left: 1px solid var(--line); padding-left: 36px; }
.cm-row { display: grid; grid-template-columns: 24px minmax(0,1fr); align-items: center; gap: 8px; min-height: 34px; }
.cm-row > .k { display: flex; align-items: center; justify-content: center; color: var(--ink-soft); opacity: .8; cursor: default; }
.cm-row > .k svg { display: block; }
.cm-row > .v { min-width: 0; display: flex; align-items: center; }
/* pola „bez ramki" — wyglądają jak tekst; ramka i tło dopiero przy najechaniu / edycji */
.cm-row input, .cm-row select { width: 100%; font-size: 13.5px; font-family: inherit; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 5px 7px; box-sizing: border-box; cursor: pointer; }
.cm-row input { cursor: text; }
.cm-row input:hover, .cm-row select:hover { background: var(--bg); }
.cm-row input:focus, .cm-row select:focus { outline: none; background: var(--panel); border-color: var(--accent); cursor: text; }
.cm-row input::placeholder { color: #c4c4c2; }
.cm-row .prop-value.readonly { font-size: 13.5px; color: var(--ink); padding: 5px 7px; }
.cm-row .v.maps-cell, .cm-row .v.demo-cell { gap: 4px; }
.cm-row .v.maps-cell { flex-wrap: nowrap; }
.cm-row .v.demo-cell { flex-wrap: wrap; }
.cm-row .v.maps-cell > input, .cm-row .v.demo-cell > input { flex: 1 1 auto; min-width: 0; }
.cm-row .v.demo-cell .demo-input { flex: 1 1 100%; }
.cm-row .v.demo-cell .demo-row { margin-left: 0; }
/* przyciski w wierszach karty (link / ↗ / ⧉ / Poproś o demo) — JEDEN rozmiar, żeby nic nie odstawało */
.cm-row .v .maps-btn, .cm-row .v .ghost-btn { padding: 5px 10px; font-size: 12.5px; border-radius: 7px; }
/* „Nadaj token" (admin, etap „Umowa wysłana") — zielony akcent tokena partnera */
.grant-token { color: #1a7f37; border-color: #b7d6ab; }
.grant-token:hover { background: #eef6ea; }
.demo-link { font-weight: 500; white-space: nowrap; }
@media (max-width: 760px) {
  .cm-props { grid-template-columns: 1fr; gap: 14px 0; }
  .cm-group:first-child { padding-right: 0; }
  .cm-group + .cm-group { border-left: none; padding-left: 0; }
}
/* Ocena gwiazdkowa 1–3 (mniejsze, spokojniejsze) */
.stars { display: inline-flex; gap: 4px; align-items: center; }
.stars .star { background: transparent; border: none; padding: 0; cursor: pointer; font-size: 18px; line-height: 1; color: #dcdcd8; font-family: inherit; transition: color .12s ease, transform .1s ease; }
.stars button.star:hover { transform: scale(1.12); }
.stars .star.on { color: #e0a93c; }
.stars.readonly .star { cursor: default; }

/* Znaczek partnera (zielona weryfikacja) — przy imieniu na kafelku, w tabelach i na karcie */
.partner-mark { display: inline-flex; align-items: center; flex: 0 0 auto; vertical-align: -2px; margin-left: 5px; position: relative; }
.partner-mark svg { display: block; }
.cm-head .partner-mark { margin-left: 0; }
.cm-head .partner-mark.clickable { cursor: pointer; }
/* podgląd tokena po kliknięciu znaczka: od kiedy partner + sprzedane usługi */
.token-pop { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); z-index: 60; min-width: 260px; max-width: 340px; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow); padding: 10px 12px; cursor: default; }
.token-head { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink); padding-bottom: 7px; margin-bottom: 5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.token-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; font-size: 12.5px; padding: 3px 0; }
.token-svc { font-weight: 500; }
.token-meta { color: var(--ink-soft); white-space: nowrap; }
.token-empty { color: var(--ink-soft); font-size: 12.5px; }
/* Baza partnerów: kolumna Rejestracja + ⚙ ustawienia (menu z opcją zdjęcia tokena, fixed przy zębatce) */
.tb-since { white-space: nowrap; color: var(--ink); }
.tb-actions { text-align: right; white-space: nowrap; width: 44px; }
.tb-gear-pop { position: fixed; min-width: 230px; z-index: 80; }
.pop-menu-item.pop-danger { color: #a8362f; }
.pop-menu-item.pop-danger:hover { background: #fdecea; }

/* Stepper etapu lejka: ‹ Status › — jeden kontrolek (wspólna ramka, strzałki oddzielone cienką linią) */
.cm-stage { display: inline-flex; align-items: stretch; flex: 0 0 auto; margin: 0; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); overflow: hidden; }
.cm-stage .stage-select { min-width: 210px; font-size: 13.5px; font-weight: 600; font-family: inherit; color: var(--ink); background: transparent; border: none; padding: 8px 10px; cursor: pointer; text-align: center; text-align-last: center; box-sizing: border-box; transition: background .14s ease; }
.cm-stage .stage-select:hover { background: var(--bg); }
.cm-stage .stage-select:focus { outline: none; background: var(--bg); }
.stage-arrow { width: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; line-height: 1; color: var(--ink-soft); background: transparent; border: none; cursor: pointer; font-family: inherit; transition: background .14s ease, color .14s ease; }
.stage-arrow:first-child { border-right: 1px solid var(--line); }
.stage-arrow:last-child { border-left: 1px solid var(--line); }
.stage-arrow:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.stage-arrow:disabled { opacity: .3; cursor: default; }
/* karta tylko-do-odczytu: sam pill statusu, bez ramki steppera */
.cm-stage-ro { border: none; background: transparent; overflow: visible; }
/* Pole na notatkę — wypełnia całą szerokość lewej kolumny (bez max-width), żeby po oddaleniu
   nie zostawała pusta „luka" między notatką a panelem komentarzy po prawej. */
.cm-notes { display: flex; flex-direction: column; flex: 1 1 auto; margin-top: 18px; }
/* Notatka: widok z KLIKALNYMI linkami (klik w tekst = edycja, klik w link/zdjęcie = otwiera) */
.notes-view { min-height: 140px; flex: 1 1 auto; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13.5px; line-height: 1.5; font-family: inherit; white-space: pre-wrap; word-break: break-word; cursor: text; box-sizing: border-box; overflow-y: auto; }
.notes-view:hover { border-color: var(--line-strong); }
.notes-view .note-link { color: var(--accent); text-decoration: underline; cursor: pointer; }
.notes-view .note-link:hover { filter: brightness(.9); }
.notes-view .notes-empty { color: var(--ink-soft); }
.notes-view.readonly { cursor: default; min-height: 0; }
.notes-view .note-inline-img { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); margin: 4px 0; cursor: zoom-in; }
/* Edytor notatek (contenteditable) — zdjęcia wklejane/wstawiane DOKŁADNIE w miejscu kursora,
   z przeciąganiem za rożek do zmiany rozmiaru (jak w Wordzie/Notion). */
.notes-edit { min-height: 140px; flex: 1 1 auto; border: 1px solid var(--accent); border-radius: 8px; padding: 9px 11px; font-size: 13.5px; line-height: 1.5; font-family: inherit; word-break: break-word; cursor: text; box-sizing: border-box; overflow-y: auto; outline: none; }
.notes-edit div { min-height: 1.4em; }
.note-img-wrap { position: relative; display: block; width: fit-content; max-width: 100%; margin: 6px 0; }
.note-img-wrap img { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.note-img-wrap[data-uploading] img { opacity: .5; }
.note-img-handle { position: absolute; right: -5px; bottom: -5px; width: 14px; height: 14px; border-radius: 4px; background: var(--accent); border: 2px solid var(--bg); cursor: nwse-resize; opacity: 0; transition: opacity .15s; }
.note-img-wrap:hover .note-img-handle { opacity: 1; }
/* Zakładki Notatki / Usługi nad polem notatki */
.notes-tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.notes-tab { background: none; border: none; padding: 5px 10px 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.notes-tab:hover { color: var(--ink); }
.notes-tab.on { color: var(--ink); border-bottom-color: var(--accent); }
.notes-pane { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
/* Widok „Usługi" — lista usług z checkboxem i kwotą */
.services-pane { gap: 8px; }
.svc-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; transition: border-color .12s, background .12s; }
.svc-item.on { border-color: var(--accent); background: #eef5fd; }
.svc-check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.svc-cb { width: 18px; height: 18px; cursor: pointer; accent-color: #cfceca; flex: none; }
.svc-cb:checked { accent-color: var(--accent); }
.svc-item.on .svc-cb { box-shadow: 0 0 0 3px rgba(35,131,226,.20); border-radius: 4px; }
.svc-name { font-weight: 500; }
.svc-price { display: flex; align-items: center; gap: 5px; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
.svc-price-input { width: 78px; text-align: right; border: 1px solid var(--line-strong); border-radius: 7px; padding: 6px 8px; font-size: 13.5px; font-family: inherit; -moz-appearance: textfield; appearance: textfield; }
.svc-price-input::-webkit-outer-spin-button, .svc-price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.svc-price-input:focus { outline: none; border-color: var(--accent); }
.svc-period { border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 7px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); cursor: pointer; }
.svc-period:focus { outline: none; border-color: var(--accent); }
.svc-fixed { font-weight: 600; }
.svc-total { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; padding: 11px 13px; border-top: 1px solid var(--line); font-size: 14px; }
.svc-total-lbl { color: var(--ink-soft); font-weight: 500; }
.svc-total-amt { font-weight: 700; font-size: 15px; color: var(--ink); }
/* Etap „Umowa podpisana"+ : usługi zamrożone (zielone, tylko podgląd — bez edycji i bez odklikania) */
.services-pane.locked .svc-item.on { border-color: #6aa84f; background: #eef6ea; }
.services-pane.locked .svc-cb:checked { accent-color: #6aa84f; }
.services-pane.locked .svc-item.on .svc-cb { box-shadow: 0 0 0 3px rgba(106,168,79,.22); }
.services-pane.locked .svc-total-amt { color: #3d6b2e; }
.services-pane.locked .svc-price-input:disabled, .services-pane.locked .svc-period:disabled,
.svc-item.sold .svc-price-input:disabled, .svc-item.sold .svc-period:disabled { background: #f6f6f4; color: var(--ink); -webkit-text-fill-color: var(--ink); opacity: 1; cursor: default; }
/* usługa SPRZEDANA (sold_at) — trwale aktywna: zielona i zablokowana niezależnie od etapu karty */
.svc-item.sold { border-color: #6aa84f; background: #eef6ea; }
.svc-item.sold .svc-cb:checked { accent-color: #6aa84f; box-shadow: 0 0 0 3px rgba(106,168,79,.22); border-radius: 4px; }
.svc-item.sold .svc-check { cursor: default; }
.svc-active-tag { color: #3d6b2e; background: #fff; border: 1px solid #b7d6ab; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
/* Pasek admina w zakładce Usługi: odblokowanie edycji mimo etapu lejka */
.svc-admin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.svc-admin-edit-btn { font-size: 12.5px; }
.svc-admin-edit-btn.on { border-color: var(--accent); color: var(--accent); background: #eef5fd; }
.svc-admin-hint { font-size: 12px; color: var(--ink-soft); }
/* ===== Checklista wdrożeniowa (zakładka na karcie) ===== */
.checklist-pane { background: #fff; gap: 14px; padding: 6px 2px 12px; }
.chk-item { display: flex; flex-direction: column; gap: 5px; }
.chk-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.chk-hint { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.chk-answer { width: 100%; box-sizing: border-box; resize: none; overflow: hidden; min-height: 34px; font-family: inherit; font-size: 13.5px; line-height: 1.45; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; transition: border-color .14s ease, background .14s ease; }
.chk-answer:hover { border-color: var(--line-strong); }
.chk-answer:focus { outline: none; border-color: var(--accent); background: #fff; }
.chk-answer::placeholder { color: #c4c4c2; }
.chk-answer:disabled { background: #f6f6f4; color: var(--ink); opacity: 1; }
/* segment „Zapłacił": pełna kwota / zadatek / inne — jeden kontrolek jak stepper etapu */
.chk-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.chk-seg { display: inline-flex; align-self: flex-start; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--panel); }
.chk-seg-btn { font-family: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); background: transparent; border: none; padding: 7px 14px; cursor: pointer; transition: background .12s ease, color .12s ease; }
.chk-seg-btn + .chk-seg-btn { border-left: 1px solid var(--line); }
.chk-seg-btn:hover { background: var(--bg); color: var(--ink); }
.chk-seg-btn.on { background: #eef5fd; color: var(--accent); font-weight: 600; }
.chk-check { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; align-self: flex-start; }
.chk-check input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.chk-sep { border-top: 1px solid var(--line); margin: 3px 0; }
/* „Checklista gotowa" — na dole checklisty przy etapie „Umowa podpisana"; aktywny po wypełnieniu całości */
.chk-done-row { display: flex; margin-top: 6px; }
.chk-done-btn { flex: 1 1 auto; font-family: inherit; font-size: 13.5px; font-weight: 600; padding: 10px 16px; border-radius: 9px; border: 1px solid #b7d6ab; background: #fff; color: #1a7f37; cursor: pointer; transition: background .14s ease, opacity .14s ease; }
.chk-done-btn:hover:not(:disabled) { background: #eef6ea; }
.chk-done-btn:disabled { opacity: .45; cursor: default; }
.svc-cur { color: var(--ink-soft); }
.svc-retired { color: var(--ink-soft); font-weight: 400; font-size: 11.5px; }     /* dopisek przy usłudze ukrytej-a-zaznaczonej — jak .owner-me */
/* kwota poniżej minimum: pole na czerwono + limit obok (kolor jak .login-error) */
.svc-price-input.bad, .svc-price-input.bad:focus { border-color: #d4493f; }
.svc-min-warn { color: #d4493f; font-size: 12px; white-space: nowrap; }
/* PRAWA kolumna — komentarze/czat */
.cm-right { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); background: var(--bg); }
.cm-right .comments-wrap { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 20px 4px; margin: 0; }
/* zostaw miejsce u góry na pasek ‹ › × (prawy górny róg), żeby nie nachodził na belkę/komentarze */
.modal.modal-full .cm-right .comments-wrap { padding-top: 54px; }
.cm-right .add-comment { flex: 0 0 auto; padding: 12px 20px 16px; margin: 0; border-top: 1px solid var(--line); background: var(--panel); }

/* ===== Zamówienie (zakładka na karcie) =====
   Ten sam język co Checklista i Usługi: sekcje bez ramek, pola na tle --bg,
   ramka dopiero na hover i focus. Formularz jest długi, więc panel przewija
   się sam, a nie rozpycha karty. */
.order-pane { background: #fff; gap: 0; padding: 6px 2px 12px; overflow-y: auto; }
.zam-intro { font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); margin-bottom: 10px; }
/* Czyj numer zobaczy klient — widoczne przed wysłaniem, nie po */
.zam-opiekun { font-size: 12.5px; line-height: 1.5; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; margin-bottom: 16px; }
.zam-opiekun.brak { background: #fff8e6; border-color: #ecdca8; color: #7a5d10; }
.zam-sec { margin-bottom: 20px; }
.zam-sec h4 { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 10px; }
.zam-field { margin-bottom: 11px; position: relative; }
.zam-field:last-child { margin-bottom: 0; }
.zam-field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 5px; }
.zam-field label .opt { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.zam-field input, .zam-field select, .zam-field textarea {
  width: 100%; box-sizing: border-box; font-family: inherit; font-size: 13.5px; line-height: 1.45;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; transition: border-color .14s ease, background .14s ease;
}
.zam-field textarea { min-height: 54px; resize: vertical; }
.zam-field input:hover, .zam-field select:hover, .zam-field textarea:hover { border-color: var(--line-strong); }
.zam-field input:focus, .zam-field select:focus, .zam-field textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
.zam-field input::placeholder, .zam-field textarea::placeholder { color: #c4c4c2; }
.zam-two { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
@media (max-width: 560px) { .zam-two { grid-template-columns: 1fr; } }
.zam-hint { font-size: 12px; color: var(--ink-soft); margin-top: 5px; line-height: 1.45; }

/* Kwota: sufiks „zł" w polu, cyfry monospaced, żeby kolumny się zgadzały */
.zam-kwota-pole input { padding-right: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.zam-suf { position: absolute; right: 11px; bottom: 9px; font-size: 12px; color: var(--ink-soft); pointer-events: none; }

.zam-poz { border: 1px solid var(--line); border-radius: 9px; padding: 13px; margin-bottom: 9px; background: #fff; }
/* Nazwa pozycji jest stała — ten sam produkt ma się nazywać tak samo w każdym
   zamówieniu, więc to napis, nie pole. */
.zam-poz-nazwa { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 11px; }
.zam-zakres-staly { font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); margin-bottom: 11px; }

/* Kwota i jej przeliczenie w jednej linii — brutto ma być widoczne od razu
   obok wpisywanego netto, a nie dopiero w podsumowaniu na dole. */
.zam-cena { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.zam-cena .zam-field { margin-bottom: 0; width: 170px; flex: none; }
.zam-brutto { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; padding-bottom: 9px; }

.zam-przelacznik { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.zam-przelacznik input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.zam-poz-abo #zam-abo-tresc { margin-top: 11px; }
.zam-poz-abo.off { background: var(--bg); }
.zam-poz-abo.off .zam-przelacznik { color: var(--ink-soft); }

.zam-suma { margin-top: 12px; background: #eef5fd; border: 1px solid #cfe2f7; border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.55; color: var(--ink); }
.zam-suma b { font-variant-numeric: tabular-nums; }
.zam-suma.pusta { background: var(--bg); border-color: var(--line); color: var(--ink-soft); }
.zam-harmonogram { color: var(--ink-soft); font-size: 12.5px; }


.zam-akcje { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; padding-top: 2px; }
.zam-msg { font-size: 12.5px; color: var(--ink-soft); }
.zam-msg.bad { color: #c0392b; }

/* Wystawione zamówienia — stan sprawy przed formularzem */
.zam-lista { display: grid; gap: 9px; margin-bottom: 16px; }
.zam-lista:empty { display: none; }
.zam-lista-blad { font-size: 12.5px; color: #c0392b; }
.zam-karta { border: 1px solid var(--line); border-radius: 9px; padding: 12px 13px; background: #fff; }
.zam-karta-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.zam-nr { font-size: 13.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.zam-kwota { margin-left: auto; font-size: 13.5px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.zam-stan { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.zam-stan.ok     { background: #eaf6ea; color: #2b6b2e; border: 1px solid #cfe4cf; }
.zam-stan.czeka  { background: #fff8e6; color: #7a5d10; border: 1px solid #ecdca8; }
.zam-stan.martwe { background: var(--bg); color: var(--ink-soft); border: 1px solid var(--line-strong); }
.zam-karta-adres { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }
.zam-slad { list-style: none; padding: 0; margin: 9px 0 0; display: grid; gap: 3px; font-size: 12.5px; color: var(--ink-soft); }
.zam-slad li { display: flex; gap: 8px; }
.zam-slad li span { margin-left: auto; font-variant-numeric: tabular-nums; color: #a3a3a1; }
.zam-slad li.zle { color: #c0392b; font-weight: 500; }
.zam-raty-stan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; line-height: 1.5; color: var(--ink-soft); }
.zam-raty-stan.ok { color: #2b6b2e; }
.zam-raty-stan.czeka { color: #7a5d10; }
/* Zaległość i wstrzymanie: ten sam układ, mocniejszy sygnał niż zwykłe „czeka" -
   zaległość jest do załatwienia telefonem, wstrzymanie to stan świadomie
   wybrany przez handlowca. */
.zam-raty-stan.zalegly { color: #a4342c; }

/* Przedmiot zamówienia i zaakceptowane dokumenty - ten sam język wizualny co
   tabela transz, bo to sąsiadujące ze sobą fakty o tej samej umowie. */
.zam-pozycje { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12.5px; }
.zam-pozycje th { text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-soft); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.zam-pozycje th:last-child, .zam-poz-kwota { text-align: right; white-space: nowrap; }
.zam-pozycje td { padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.zam-poz-opis { color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.zam-poz-okres { color: var(--ink-soft); font-weight: 400; }
.zam-poz-suma td { border-bottom: 0; border-top: 2px solid var(--line); font-weight: 600; }

.zam-dokumenty { margin-top: 12px; }
.zam-dokumenty ul { list-style: none; margin: 5px 0 0; padding: 0; font-size: 12.5px; line-height: 1.9; }
.zam-dokumenty li { color: var(--ink-soft); }
.zam-dokumenty li b { color: var(--ink); font-weight: 600; }
.zam-dok-sha { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  color: var(--ink-soft); opacity: .7; margin-left: 4px; }
.zam-raty-stan.wstrzymany { color: var(--ink-soft); }
.zam-rata2-btn, .zam-start-btn { font-size: 12px; }
.zam-start-pole { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); }
.zam-start-pole input { font: inherit; padding: 4px 7px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: none; }
.zam-transze { width: 100%; border-collapse: collapse; margin-top: 9px; font-size: 12px; color: var(--ink-soft); }
.zam-transze th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: #a3a3a1; padding: 0 8px 5px 0; border-bottom: 1px solid var(--line); }
.zam-transze td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.zam-transze tr:last-child td { border-bottom: 0; }
.zam-transze th:last-child, .zam-transze td:last-child { padding-right: 0; text-align: right; }
.zam-tr-ok { color: #2b6b2e; }
.zam-tr-czeka { color: #7a5d10; }
.zam-tr-pozniej { color: #a3a3a1; }

.zam-karta-link { margin-top: 9px; font-size: 12px; }
.zam-karta-link a { color: var(--accent); word-break: break-all; }
.zam-nowe { width: 100%; font-family: inherit; font-size: 12.5px; background: none; border: 1px dashed var(--line-strong); border-radius: 8px; padding: 9px 12px; cursor: pointer; color: var(--ink-soft); }
.zam-nowe:hover { border-color: var(--accent); color: var(--accent); }

/* ===== Sekcja Zamówienia (przegląd wszystkich) ===== */
.zam-tb-licznik { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.zam-tb-licznik b { color: var(--ink); font-variant-numeric: tabular-nums; }
.zam-tb-nr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.zam-tb-kwota { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zam-tb-strzalka { display: inline-block; color: var(--ink-soft); font-size: 17px; line-height: 1; transition: transform .15s ease; }
.zam-tb-row.rozwiniety .zam-tb-strzalka { transform: rotate(90deg); color: var(--accent); }
.zam-tb-row { cursor: pointer; }

/* Szczegóły pod wierszem: przebieg sprawy i adresy, bez wychodzenia z listy */
.zam-tb-szczegoly td { background: var(--bg); padding: 0 !important; }
.zam-tb-panel { padding: 16px 18px 18px; display: grid; gap: 14px; }
.zam-tb-kolumny { display: grid; gap: 20px; }
@media (min-width: 720px) { .zam-tb-kolumny { grid-template-columns: 1fr 1fr; } }
.zam-tb-etykieta { display: block; font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); margin-bottom: 3px; }
.zam-tb-etykieta ~ .zam-tb-etykieta { margin-top: 11px; }
.zam-tb-panel p { font-size: 13px; color: var(--ink); margin: 0; }
.zam-tb-url a { color: var(--accent); word-break: break-all; }
.zam-tb-karta { justify-self: start; font-size: 12.5px; }
.zam-tb-raty { width: 100%; max-width: 380px; border-collapse: collapse; font-size: 12.5px; }
.zam-tb-raty td { padding: 5px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.zam-tb-raty tr:last-child td { border-bottom: 0; }
.zam-tb-raty td:last-child { text-align: right; font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ===== Belka follow-upu nad czatem — ten sam kształt co stepper etapu (ramka, radius 9px) ===== */
.fu-bar { flex: 0 0 auto; margin: 16px 20px 0; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel); }
.modal.modal-full .cm-right .fu-bar { margin-top: 54px; }
.modal.modal-full .cm-right .fu-bar + .comments-wrap { padding-top: 14px; }
/* wyrównanie do PIERWSZEJ linii (daty): ikonka, ✓ i strzałka trzymają się linii daty, notatka schodzi niżej */
.fu-bar-head { display: flex; align-items: flex-start; gap: 9px; padding: 7px 12px; min-height: 38px; box-sizing: border-box; cursor: pointer; user-select: none; border-radius: 8px; transition: background .14s ease; }
.fu-bar-head .fu-bar-ic { margin-top: 4px; }
.fu-bar-head .rm-act { margin-top: -1px; }
.fu-bar-head .fu-bar-chev { margin-top: 4px; }
.fu-bar-head:hover { background: var(--bg); }
.fu-bar-head.ro { cursor: default; }
.fu-bar-head.ro:hover { background: transparent; }
.fu-bar.open .fu-bar-head { border-radius: 8px 8px 0 0; }
.fu-bar-ic { display: flex; flex: 0 0 auto; color: var(--ink-soft); }
/* ustawiony follow-up → belka świeci na pomarańczowo (od razu widać, że termin jest) */
.fu-bar.is-set { border-color: #e6c46a; background: #fffaf0; }
.fu-bar.is-set .fu-bar-ic { color: #b0852c; }
.fu-bar.is-set .fu-bar-head:hover { background: #fbf3df; }
.fu-bar.is-set .fu-bar-body { border-top-color: #efe2c4; }
.fu-bar.is-set .fu-bar-body input:hover { background: #fbf3df; }
.fu-bar.is-overdue .fu-bar-ic { color: #c0392b; }
.fu-bar-label { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 3px 0; font-size: 13px; color: var(--ink); overflow: hidden; }
.fu-bar-line { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.fu-bar-label strong { font-weight: 600; }
.fu-bar-empty { font-weight: 600; font-size: 12.5px; color: var(--ink-soft); }
/* notatka follow-upu — osobna linia pod datą, wyraźny odstęp, ta sama czcionka co pola karty */
.fu-bar-note { font-size: 13.5px; line-height: 1.45; color: var(--ink); max-width: 100%; white-space: normal; overflow-wrap: break-word; }
.fu-bar-chev { display: flex; flex: 0 0 auto; color: var(--ink-soft); transition: transform .15s ease; }
.fu-bar.open .fu-bar-chev { transform: rotate(180deg); }
.fu-bar-body { padding: 8px 12px 10px; border-top: 1px solid var(--line); }
.fu-bar-row { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.fu-bar-row input[type="date"] { flex: 1 1 auto; min-width: 0; }
.fu-bar-row input[type="time"] { flex: 0 0 auto; width: 92px; }
.fu-bar-body input { font-size: 13px; font-family: inherit; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 5px 7px; box-sizing: border-box; transition: background .14s ease, border-color .14s ease; }
.fu-bar-body input:hover { background: var(--bg); }
.fu-bar-body input:focus { outline: none; background: var(--panel); border-color: var(--accent); }
.fu-bar-body input::placeholder { color: #c4c4c2; }
.fu-bar-body #fu-note { display: block; width: 100%; }

@media (max-width: 860px) {
  .modal.modal-full { height: 100vh; max-height: 100vh; }
  .cm { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .cm-right { border-left: none; border-top: 1px solid var(--line); max-height: 42vh; }
  /* w układzie pionowym pasek ‹ › × jest nad lewą kolumną (góra ekranu), nie nad komentarzami — nie rezerwuj miejsca */
  .modal.modal-full .cm-right .comments-wrap { padding-top: 16px; }
  .modal.modal-full .cm-right .fu-bar { margin: 12px 16px 0; }
  .modal.modal-full .cm-right .fu-bar + .comments-wrap { padding-top: 12px; }
}

/* ===== Mobile: KOMPLETNY redesign w bloku „📱 MOBILE" na KOŃCU pliku (2026-07-19) ===== */

/* ===== v2: wyszukiwarka, nowa karta, demo, @mention, toast ===== */
.topbar-center { flex: 1; display: flex; justify-content: center; padding: 0 16px; }
.search { width: 100%; max-width: 420px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 7px 12px; font-size: 13.5px; font-family: inherit; background: var(--bg); }
.search:focus { outline: none; border-color: var(--accent); background: #fff; }
.primary-btn.sm { padding: 6px 12px; font-size: 13px; }

.chip-due { color: #c0392b; font-weight: 600; }
.chip-overdue { color: #c0392b; font-weight: 700; }
.chip-today { color: #b8860b; font-weight: 600; }
.chip-demo { color: #8a5a00; background: #fbe7c9; padding: 1px 6px; border-radius: 10px; }
.chip-demo-done { color: #2e6b3e; background: #d7eede; padding: 1px 6px; border-radius: 10px; }
.chip-building { color: #1d5fb5; background: #d8e8fb; padding: 1px 6px; border-radius: 10px; font-weight: 600; }
/* licznik otwarć dema: szary = ktoś zaglądał, pomarańczowy = klient sam rozniósł link */
.chip-views { color: #5b6470; background: #eceef1; padding: 1px 6px; border-radius: 10px; font-variant-numeric: tabular-nums; }
.chip-views-hot { color: #9a4a10; background: #fdead4; font-weight: 650; }

/* wiersz „Otwarcia" w karcie klienta */
.dv-cell { display: block; }
.dv-stats { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 9px; font-size: 13px; line-height: 1.5; }
.dv-stats.dv-hot { border-left-color: #e08a3c; }
.dv-line { color: var(--ink); }
.dv-last { color: var(--ink-soft); font-size: 12px; margin-top: 1px; }
.dv-tip { color: #9a4a10; font-size: 12.5px; margin-top: 3px; }
.dv-none { color: var(--ink-soft); font-size: 12.5px; line-height: 1.45; }

/* „Poproś o demo" / status demo — w jednej linii z polem „Demo (link)", dosunięte do prawej krawędzi */
.maps-cell .demo-row { flex: 0 0 auto; margin-left: auto; display: inline-flex; align-items: center; }
.demo-btn { color: var(--ink-soft); border-color: var(--line-strong); }
.demo-btn:hover { background: var(--bg); color: var(--ink); }
.demo-flag { font-size: 13px; color: #8a5a00; background: #fbe7c9; padding: 6px 10px; border-radius: 8px; display: inline-block; }

/* ===== Pole „Umowa" na karcie klienta (przycisk + gotowe PDF-y) ===== */
.cm-row .v.umowa-cell { flex-wrap: wrap; gap: 6px; }
.umowa-dl { border: 0; background: none; font: inherit; color: var(--accent); cursor: pointer;
            padding: 7px 8px; border-radius: 6px; text-align: left; }
.umowa-dl:hover { background: #eef5fd; text-decoration: underline; }
.umowa-wait { font-size: 13px; color: var(--ink-soft); padding: 7px 4px; }
.umowa-bad  { font-size: 13px; color: #c0392b; padding: 7px 4px; cursor: help; }
.umowa-sep  { color: var(--line-strong); }
.umowa-new  { white-space: nowrap; text-decoration: none; }
/* „docx" obok gotowej umowy — ten sam plik do edycji, więc celowo drobniejszy niż PDF */
.umowa-docx { font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
              color: var(--ink-soft); padding: 7px 5px; }


.no-comments { color: var(--ink-soft); font-size: 13px; padding: 6px 0; }
.mention { color: var(--accent); font-weight: 600; }
.mention-claude { color:#fff; background:#FF6A00; font-weight:800; padding:1px 7px; border-radius:999px; box-shadow:0 0 0 2px rgba(255,106,0,.25); }

/* ===== Composer (pod feedem): komentarz + tryb „Follow-up" ===== */
.composer { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--panel); padding: 10px 16px 14px; }
.composer .add-comment { margin-top: 0; padding: 0; border-top: none; background: none; }
/* ===== Sekcje prawego panelu: „Przypomnienia" + „Komentarze" ===== */
.feed-section + .feed-section { margin-top: 20px; }
.feed-section-head { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 6px; }
.feed-section-head .cm-cc { font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: 4px; }
.feed-item .comment-head { display: flex; align-items: center; }
.feed-item .c-author { font-weight: 600; }
/* badge terminu (dziś / zaległe) + małe przyciski-ikonki — używane w belce follow-upu */
.rm-badge { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.rm-today { background: #fff3d6; color: #8a6d1a; }
.rm-overdue { background: #fdecea; color: #c0392b; }
.rm-act { cursor: pointer; width: 26px; height: 26px; flex: 0 0 auto; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--ink-soft); font-family: inherit; font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center; transition: background .14s ease, color .14s ease, border-color .14s ease; }
.rm-act:hover { background: var(--bg); color: var(--ink); }
#fu-del:hover { color: #c0392b; }
.rm-done:hover { background: #1a7f37; border-color: #1a7f37; color: #fff; }
/* awatar opiekuna na karcie tablicy (obok handlowca) */
.card-owner { display: inline-flex; align-items: center; }
.avatar.avatar-sec { margin-right: -5px; box-shadow: 0 0 0 1.5px var(--panel); }
/* chip follow-upu „zrobiony" na tablicy */
.chip-fu-done { color: #1a7f37; background: #eaf6ec; padding: 1px 6px; border-radius: 10px; }

.mention-pop { position: absolute; bottom: calc(100% + 4px); left: 0; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; min-width: 210px; z-index: 60; }
.mention-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.mention-item.active, .mention-item:hover { background: var(--bg); }
.mention-item-claude { font-weight: 700; }
.mi-claude-tag { margin-left: auto; font-size: 11px; color: #FF6A00; font-weight: 700; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%) translateY(20px); background: #37352f; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== delikatne animacje (Notion-feel) ===== */
@keyframes crmFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes crmModalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes crmFlash { 0% { box-shadow: 0 0 0 0 rgba(35,131,226,0); } 35% { box-shadow: 0 0 0 2px rgba(35,131,226,.16); } 100% { box-shadow: 0 0 0 0 rgba(35,131,226,0); } }
.modal-overlay:not([hidden]) { animation: crmFadeIn .12s ease; }
.modal { animation: crmModalIn .2s cubic-bezier(.2,.8,.2,1); }
.card.flash { animation: crmFlash .7s ease; }
.tab, .add-card, .ghost-btn, .primary-btn, .chip { transition: background .12s ease, color .12s ease, border-color .12s ease; }
.add-card { opacity: 0; transition: opacity .12s ease, background .12s ease; }
.column:hover .add-card { opacity: 1; }
@media (hover: none) { .add-card { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ===== Archiwum (chowanie / przywracanie) ===== */
.card.archived { opacity: .62; }
.card.archived:hover { opacity: .85; }
.archive-banner { background: #eef0f3; color: #4a4843; padding: 9px 12px; border-radius: 8px; font-size: 13px; margin: 4px 0 16px; }
.archive-actions { display: flex; gap: 8px; align-items: center; }
.archive-head { padding: 4px 2px 16px; color: var(--ink-soft); font-size: 13.5px; }
.archive-list { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.archive-list .card { width: 280px; cursor: pointer; }
.empty-archive { padding: 70px 20px; text-align: center; color: var(--ink-soft); font-size: 15px; }

/* ===== POWIADOMIENIA (@oznaczenia) ===== */
.notif-wrap{position:relative;display:inline-flex}
.notif-bell{position:relative;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;border-radius:10px;border:1px solid var(--line,#e3e6ea);background:#fff;color:#3a4250;cursor:pointer;transition:background .15s,border-color .15s,color .15s}
.notif-bell:hover{background:#f4f6f8;color:#111}
.notif-bell.has-unread{color:#e1251b;border-color:#f3c6c2}
.notif-badge{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#e1251b;color:#fff;font-size:11px;font-weight:700;line-height:18px;text-align:center;box-shadow:0 0 0 2px #fff}
.notif-panel{position:absolute;top:46px;right:0;width:360px;max-width:92vw;max-height:70vh;overflow:auto;background:#fff;border:1px solid var(--line,#e3e6ea);border-radius:14px;box-shadow:0 20px 50px -18px rgba(20,28,40,.45);z-index:1000}
.notif-head{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--line,#eef1f4);position:sticky;top:0;background:#fff}
.notif-head strong{font-size:15px}
.notif-readall{border:0;background:none;color:#2563eb;font-size:13px;font-weight:600;cursor:pointer}
.notif-readall:hover{text-decoration:underline}
.notif-list{display:flex;flex-direction:column}
.notif-item{display:block;width:100%;text-align:left;border:0;border-bottom:1px solid #f1f3f6;background:#fff;padding:12px 16px;cursor:pointer;transition:background .12s}
.notif-item:hover{background:#f7f9fb}
.notif-item.unread{background:#fef6f5}
.notif-item.unread:hover{background:#fdeeec}
.notif-it-top{font-size:13px;color:#5a6472;margin-bottom:3px}
.notif-who{font-weight:700;color:#1f2733}
.notif-cli{font-weight:600;color:#2563eb}
.notif-it-body{font-size:13.5px;color:#222;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.notif-it-time{font-size:11.5px;color:#9aa3af;margin-top:4px}
.notif-empty{padding:24px 18px;color:#7a838f;font-size:13.5px;line-height:1.5;text-align:center}

/* ===== Panel admina (sekcja) — komponenty wzorowane 1:1 na istniejących ===== */
.admin-title { font-size: 20px; font-weight: 700; }
.admin-banner { background: #fbf3e4; color: #7a5b14; font-size: 13px; padding: 9px 12px; border-radius: 8px; margin-top: 12px; }   /* jak .readonly-note */
.admin-tabs { margin: 16px 0 14px; }
.admin-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.admin-person { display: flex; align-items: center; gap: 8px; }
.admin-person .owner-me { font-size: 12px; }
.admin-role { border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 7px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); cursor: pointer; }   /* jak .svc-period */
.admin-role:focus { outline: none; border-color: var(--accent); }
.admin-role:disabled { background: #f6f6f4; color: var(--ink-soft); cursor: default; }
/* Telefon handlowca — ten sam kształt kontrolki co rola obok */
.admin-phone { width: 140px; border: 1px solid var(--line-strong); border-radius: 7px; padding: 5px 8px; font-size: 13px; font-family: inherit; background: #fff; color: var(--ink); }
.admin-phone:focus { outline: none; border-color: var(--accent); }
.admin-phone:disabled { background: #f6f6f4; color: var(--ink-soft); cursor: default; }
.admin-hint { margin-top: 10px; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.admin-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.maps-btn.tb-danger { color: #a8362f; }
.maps-btn.tb-danger:hover { background: #fdecea; border-color: #e8b7b2; color: #a8362f; }
.chip-blocked { color: #a8362f; background: #fdecea; padding: 1px 6px; border-radius: 10px; }   /* jak .chip-demo-done, w czerwieni */
/* matryca ról: nagłówki grup jak nagłówek tabeli, checkboxy .svc-cb wyśrodkowane */
.admin-matrix thead th:not(:first-child), .admin-cb-cell { text-align: center; }
.admin-cb-cell .svc-cb { vertical-align: middle; }
.admin-grp-row td { background: var(--bg); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); padding: 8px 16px; }
.admin-note { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 10.5px; color: var(--ink-soft); margin-top: 1px; }
/* mały modal „Dodaj użytkownika" — pola jak w karcie logowania */
.admin-form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.admin-field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--ink-soft); }
.admin-field input, .admin-field select { border: 1px solid var(--line-strong); border-radius: 8px; padding: 9px 11px; font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; width: 100%; }
.admin-field input:focus, .admin-field select:focus { outline: none; border-color: var(--accent); }
.admin-field input:disabled { background: #f6f6f4; color: var(--ink-soft); cursor: default; }   /* klucz usługi w edycji (niezmienny) — jak .admin-role:disabled */
/* pola liczbowe bez strzałek — ten sam wzorzec co .svc-price-input na karcie */
.admin-field input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.admin-field input[type="number"]::-webkit-outer-spin-button, .admin-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ============================================================
   📱 MOBILE (≤700px) — kompletny redesign na telefon (2026-07-19)
   Zasada: desktop NIETKNIĘTY (wszystko w tym media query).
   Tablica = JEDEN etap naraz (pasek chipów + swipe — logika w app.js:
   renderMobileStageBar/setMobileStage), karta klienta = zakładki
   Karta/Czat (cm-mtabs w openModal), pola dotykowe ≥44px,
   inputy 16px (iOS przestaje przybliżać ekran przy tapnięciu w pole).
   ============================================================ */
.m-only { display: none; }                    /* elementy tylko-mobilne (np. „📞 Zadzwoń" na karcie) */
/* desktop: numer na kafelku wygląda jak dotąd, tap w niego = klik w kafelek (link nieaktywny) */
.chip-tel { color: inherit; text-decoration: none; pointer-events: none; }

@media (max-width: 700px) {
  .m-only { display: inline-flex; align-items: center; text-decoration: none; }
  /* telefon KLIKALNY: tap w numer na kafelku = dzwonienie (capture w app.js nie otwiera wtedy karty) */
  .chip-tel { pointer-events: auto; color: var(--accent); font-weight: 600; padding: 3px 0; }

  /* ---- Topbar: zwarty; szukajka w osobnym wierszu na pełną szerokość ---- */
  .topbar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .logo-sub { display: none; }
  .topbar-center { order: 3; flex-basis: 100%; padding: 0; }
  .search { max-width: none; padding: 10px 14px; border-radius: 10px; }
  .topbar-right { gap: 8px; margin-left: auto; }

  /* „+ Nowa karta" = pływający okrągły przycisk na dole po prawej (pod kciukiem);
     na telefonie dodaje kartę do AKTUALNIE oglądanego etapu (app.js) */
  #new-card-btn { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 40;
    width: 58px; height: 58px; border-radius: 50%; padding: 0; font-size: 0;
    box-shadow: 0 6px 20px rgba(35,131,226,.45); display: flex; align-items: center; justify-content: center; }
  #new-card-btn::after { content: "＋"; font-size: 27px; font-weight: 500; line-height: 1; }

  /* ---- Pasek widoków: jeden przewijany wiersz (bez zawijania) ---- */
  .tabs { flex-wrap: nowrap; align-items: center; gap: 8px; padding: 4px 12px 0; }
  .tab { padding: 10px 10px 12px; font-size: 13px; }
  .vs-btn span { display: none; }
  .vs-btn { padding: 7px 9px; }
  .owner-toggle { padding: 8px 10px; }
  .owner-pop { max-width: calc(100vw - 24px); }

  /* ---- Tablica: JEDEN etap naraz ---- */
  .board.m-one { display: block; height: auto; overflow: visible; padding: 0 12px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .m-stagebar { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto;
    padding: 10px 2px; margin: 0 -4px; background: var(--bg); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .m-stagebar::-webkit-scrollbar { display: none; }
  .m-chip { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; border: 1px solid var(--line-strong);
    background: var(--panel); color: var(--ink-soft); border-radius: 999px; padding: 9px 13px; font-size: 13px;
    font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap; }
  .m-chip .m-cnt { font-weight: 600; opacity: .65; font-size: 12px; }
  .m-chip.on { border-color: transparent; }
  .board.m-one .column { display: none; }
  .board.m-one .column.m-on { display: flex; width: 100%; flex-basis: auto; }
  .board.m-one .col-inner { padding: 6px 10px 12px; }
  .board.m-one .column-head { display: none; }   /* etap+licznik już pokazuje aktywny chip */
  .board.m-one .cards { gap: 10px; }
  .board.m-one .card { padding: 14px 15px; border-radius: 12px; }
  .board.m-one .card-title { font-size: 15px; }
  .board.m-one .card-company { font-size: 13.5px; }
  .board.m-one .card-meta { font-size: 13.5px; }
  .board.m-one .card-foot { font-size: 12.5px; flex-wrap: wrap; }
  .board.m-one .add-card-btn { padding: 13px 14px; font-size: 14px; }

  /* ---- Widok tabeli / Archiwum: tabela przewija się w poziomie WEWNĄTRZ ramki ---- */
  .board.board-table { padding: 12px 12px 90px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ---- Karta klienta: pełny ekran + zakładki Karta / Czat ---- */
  .modal.modal-full { height: 100dvh; max-height: 100dvh; }
  .modal.modal-full #modal-body { display: block; }
  .cm { display: flex; flex-direction: column; height: 100dvh; max-width: none; box-shadow: none; }
  .cm-mtabs { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; padding: 10px 118px 8px 12px;
    border-bottom: 1px solid var(--line); background: var(--panel); }
  .cm-mtab { flex: 0 0 auto; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink-soft);
    font-family: inherit; font-size: 13.5px; font-weight: 600; border-radius: 999px; padding: 8px 16px; cursor: pointer; }
  .cm-mtab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
  .cm-mtab .m-cnt { opacity: .75; }
  .modal.modal-full .modal-actions { top: 9px; right: 10px; }

  /* domyślnie widać KARTĘ (dane) na pełną wysokość; czat po tapnięciu w zakładkę */
  .cm-left { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .cm-right { display: none; }
  .cm.chat-on .cm-left { display: none; }
  .cm.chat-on .cm-right { display: flex; flex: 1 1 auto; min-height: 0; max-height: none; border-top: none; border-left: none; }
  .cm.chat-on .cm-right .fu-bar { margin: 12px 12px 0; }
  .cm.chat-on .cm-right .fu-bar + .comments-wrap { padding-top: 12px; }
  .cm.chat-on .cm-right .comments-wrap { padding: 12px 14px 4px; }
  .cm-right .composer { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .add-comment button { min-height: 44px; }

  /* nagłówek karty: imię na całą szerokość, stepper etapu pod spodem na 100% */
  .cm-head { gap: 10px; }
  .cm-head .cm-name-wrap { flex: 1 1 100%; }
  .cm-name { font-size: 18px; }
  .modal.modal-full input.title-input.cm-name { font-size: 18px; }
  .cm-stage { display: flex; width: 100%; }
  .cm-stage .stage-select { min-width: 0; flex: 1 1 auto; }
  .stage-arrow { width: 44px; }
  .cm-props { margin: 14px 0 4px; }
  .cm-row { min-height: 44px; }
  .cm-row .v .maps-btn, .cm-row .v .ghost-btn { padding: 8px 12px; }

  /* iOS: pole z fontem <16px = automatyczny zoom przy tapnięciu → wymuś 16px wszędzie */
  input, select, textarea { font-size: 16px !important; }

  /* mały modal (Archiwum / dialogi) */
  .modal:not(.modal-full) { padding: 26px 18px 22px; }
  .props { grid-template-columns: 1fr; }
  .prop-label { padding-bottom: 0; }

  /* powiadomienia: panel na (prawie) całą szerokość ekranu */
  .notif-panel { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; max-width: none; }

  /* sekcje: Baza partnerów / Panel admina */
  .section-view { padding: 16px 12px 60px; }
}
