/* CRM Structura360 – system wizualny.
   Układ: jasny pasek boczny + górny pasek z wyszukiwarką + jasny obszar treści. */
:root {
  --bg: #f3f5f8; --card: #fff; --text: #1b2430; --muted: #687385; --border: #e3e7ed; --border-strong: #cfd6df;
  --accent: #264257; --accent-hover: #1b3142; --accent-soft: #e8eff5; --brand: #264257; --link: #2b6590;
  --side-bg: #f7f9fb; --side-text: #3d4a5c; --side-active: #264257; --side-hover: #eef2f6; --side-active-bg: #e3edf6;
  --ok: #18794e; --ok-bg: #e5f5ec; --warn: #95600a; --warn-bg: #fff3d9;
  --bad: #b42318; --bad-bg: #fdecea; --info: #3d4a5c; --info-bg: #edf0f4;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .14);
  --radius: 10px;
}
/* Zawsze jasny motyw (bez automatycznego trybu ciemnego). */
:root { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 600; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
h3 { font-size: 12px; margin: 0 0 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.block { display: block; }
p { margin: 0 0 8px; }
p.muted { margin: 0; }
[hidden] { display: none !important; }

/* ===== Układ aplikacji ===== */
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; padding: 14px 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand); font-weight: 700; font-size: 15px; padding: 4px 8px 18px; }
.brand-mark { width: 32px; height: 32px; border-radius: 7px; display: block; object-fit: cover;
  flex: none; }
.brand .label small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px; color: var(--side-text);
  text-decoration: none; font-weight: 500; position: relative; }
.sidebar a:hover { background: var(--side-hover); color: var(--side-active); text-decoration: none; }
.sidebar a.active { background: var(--side-active-bg); color: var(--side-active); font-weight: 600; }
.sidebar a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.sidebar svg { width: 19px; height: 19px; flex: none; }
.sidebar .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff;
  font-size: 11.5px; font-weight: 700; text-align: center; line-height: 19px; }
.sidebar .side-bottom { margin-top: auto; border-top: 1px solid var(--border); padding-top: 8px; }
.sidebar .side-foot { font-size: 11.5px; padding: 8px; opacity: .7; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 10px 24px; }
.search { position: relative; flex: 1; max-width: 560px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding: 8px 12px 8px 34px; font-size: 14px; border-radius: 8px; background: var(--bg); }
.search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; max-height: 420px; overflow: auto; }
.search-results h3 { padding: 6px 8px 2px; margin: 0; }
.search-results a { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 6px; color: var(--text); }
.search-results a:hover, .search-results a.sel { background: var(--bg); text-decoration: none; }
.search-results .empty { padding: 10px 8px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; background: none; padding: 4px; }
.me:hover { background: var(--bg); }
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.lang-switch button { background: none; color: var(--muted); border: 0; border-radius: 0; padding: 5px 9px; font-size: 12px; font-weight: 600; }
.lang-switch button + button { border-left: 1px solid var(--border-strong); }
.lang-switch button:hover { background: var(--bg); }
.lang-switch button.on { background: var(--accent-soft); color: var(--accent); }

.dropdown { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30; }
.menu button { display: flex; width: 100%; gap: 10px; align-items: flex-start; background: none; color: var(--text); font-weight: 600;
  padding: 8px 10px; border-radius: 6px; text-align: left; }
.menu button:hover { background: var(--bg); }
.menu button svg { width: 17px; height: 17px; margin-top: 1px; color: var(--accent); flex: none; }
.menu small { display: block; color: var(--muted); font-weight: 400; }

.page { padding: 20px 24px 40px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .sub { color: var(--muted); font-size: 13px; width: 100%; margin-top: -8px; }
.page-head .actions { margin: 0 0 0 auto; }

/* ===== Elementy ===== */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head .link-more { margin-left: auto; font-size: 13px; }

button, a.button { font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 14px; border: 1px solid transparent; border-radius: 8px;
  background: var(--accent); color: #fff; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1.2; }
button:hover, a.button:hover { background: var(--accent-hover); text-decoration: none; }
button:disabled { opacity: .6; cursor: wait; }
button.secondary, a.button.secondary { background: var(--card); color: var(--text); border-color: var(--border-strong); }
button.secondary:hover, a.button.secondary:hover { background: var(--bg); }
button.ghost { background: none; color: var(--muted); padding: 6px 8px; }
button.ghost:hover { background: var(--bg); color: var(--text); }
button.link { background: none; border: 0; padding: 0 4px; color: var(--accent); font-weight: 400; text-decoration: underline; }
button.link:hover { background: none; }
.btn-add svg { width: 16px; height: 16px; }

input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--border-strong);
  border-radius: 8px; padding: 7px 10px; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[aria-invalid] { border-color: var(--bad); }
textarea { resize: vertical; width: 100%; }

.badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--info-bg); color: var(--info);
  white-space: nowrap; display: inline-block; line-height: 1.5; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.k-realizacja { margin-top: 6px; }

.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700;
  color: #fff; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; border-radius: 12px; }
.person { display: inline-flex; gap: 6px; align-items: center; }

.status { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; background: var(--info-bg); }
.status.error { background: var(--bad-bg); color: var(--bad); }
.status.ok { background: var(--ok-bg); color: var(--ok); }

dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
dd.diff { background: var(--warn-bg); color: var(--warn); border-radius: 4px; padding: 0 6px; margin-left: -6px; }
dd.diff.krytyczna { background: var(--bad-bg); color: var(--bad); }
.hint { display: block; font-size: 12px; opacity: .9; }
.stack dl { grid-template-columns: 1fr; gap: 0; }
.stack dt { font-size: 12px; margin-top: 10px; }
.stack dt:first-child { margin-top: 0; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }

/* ===== Tabele ===== */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; background: var(--bg); }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 16px; }
tbody tr:last-child td { border-bottom: 0; }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover td { background: var(--bg); }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.krytyczna td { color: var(--bad); }
tr.ostrzezenie td { color: var(--warn); }
tr.nowa td { background: var(--ok-bg); }
.cell-main { font-weight: 600; color: var(--text); }
.table-foot { padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* ===== Filtry i formularze ===== */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input { width: 280px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg button { background: none; color: var(--muted); border: 0; border-radius: 0; padding: 7px 12px; font-weight: 500; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { background: var(--bg); }
.seg button.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg svg { width: 15px; height: 15px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 14px; margin-bottom: 14px; }
.grid label, label.field { font-weight: 600; font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; margin: 0; color: var(--muted); }
.grid label input, .grid label select, .grid label textarea, label.field input, label.field select { color: var(--text); font-size: 14px; font-weight: 400; width: 100%; }
.grid .wide { grid-column: 1 / -1; }
.err { color: var(--bad); font-size: 12.5px; font-weight: 400; }
.err:empty { display: none; }
fieldset.radio { border: 0; padding: 0; margin: 0 0 12px; display: flex; gap: 6px; flex-wrap: wrap; }
fieldset.radio legend { font-weight: 600; font-size: 12.5px; margin-bottom: 6px; padding: 0; color: var(--muted); }
fieldset.radio label { font-weight: 500; display: inline-flex; gap: 6px; align-items: center; margin: 0; padding: 5px 12px;
  border: 1px solid var(--border-strong); border-radius: 999px; cursor: pointer; }
fieldset.radio label:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
fieldset.radio input { margin: 0; accent-color: var(--accent); }
.subhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; }
.subhead button { margin-left: auto; padding: 5px 12px; font-size: 13px; }
.terminy { margin: -6px 0 4px; }
.ok-msg { color: var(--ok); font-weight: 600; }
label.check { display: inline-flex; gap: 8px; align-items: center; margin: 0; font-weight: 400; cursor: pointer; }
.grid label.check { flex-direction: row; color: var(--text); font-size: 14px; font-weight: 400; }
label.check input { width: 17px; height: 17px; flex: none; accent-color: var(--accent); }
.section-title { font-size: 15px; font-weight: 600; margin: 18px 0 10px; }
.form-narrow { max-width: 860px; }

/* ===== Pulpit ===== */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); }
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); }
.kpi .label { color: var(--muted); font-size: 12.5px; }
.kpi .value { font-size: 24px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .value.bad { color: var(--bad); }
.kpi .note { color: var(--muted); font-size: 12px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ===== Lista zadań ===== */
ul.zadania { list-style: none; margin: 0; padding: 0; }
ul.zadania li { padding: 9px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; align-items: start; }
ul.zadania li:last-child { border-bottom: 0; }
ul.zadania .z-title { font-weight: 600; }
ul.zadania .z-meta { grid-column: 2 / -1; color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
ul.zadania .z-when { font-size: 12.5px; white-space: nowrap; color: var(--muted); }
ul.zadania li.overdue .z-when { color: var(--bad); font-weight: 600; }
ul.zadania li.today .z-when { color: var(--warn); font-weight: 600; }
ul.zadania input[type=checkbox] { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); cursor: pointer; }
.done .z-title, .done strong { text-decoration: line-through; color: var(--muted); }
.grupa.bad { border-top: 3px solid var(--bad); }
.grupa.warn { border-top: 3px solid var(--warn); }
.grupa.accent { border-top: 3px solid var(--accent); }

/* ===== Karta rekordu (3 kolumny) ===== */
.record-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.record-head .title { min-width: 0; }
.record-head h1 { font-size: 21px; }
.record-head .meta { color: var(--muted); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 2px; }
.record-head .actions { margin: 0 0 0 auto; }
.record { display: grid; grid-template-columns: 300px minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.record > aside, .record > section { min-width: 0; }

.stages { display: flex; margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--card); }
.stages button { flex: 1; background: none; color: var(--muted); border: 0; border-radius: 0; padding: 10px 12px; font-weight: 600; justify-content: center; }
.stages button + button { border-left: 1px solid var(--border); }
.stages button:hover { background: var(--bg); }
.stages button.on.Otwarta { background: var(--accent-soft); color: var(--accent); }
.stages button.on.Wygrana { background: var(--ok-bg); color: var(--ok); }
.stages button.on.Przegrana { background: var(--bad-bg); color: var(--bad); }

.panel-form { display: grid; gap: 10px; }
.panel-form label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.panel-form input, .panel-form select { width: 100%; font-size: 14px; color: var(--text); font-weight: 400; }
.panel-form .actions { margin-top: 4px; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: -16px -16px 14px; padding: 0 12px; }
.tabs button { background: none; color: var(--muted); border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 11px 12px 9px; font-weight: 600; }
.tabs button:hover { color: var(--text); background: none; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs svg { width: 16px; height: 16px; }

.feed-filter { margin-bottom: 6px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tl:last-child { border-bottom: 0; }
.tl-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tl-icon svg { width: 16px; height: 16px; }
.tl.zadanie .tl-icon { background: var(--info-bg); color: var(--info); }
.tl.overdue .tl-icon { background: var(--bad-bg); color: var(--bad); }
.tl.done .tl-icon { background: var(--ok-bg); color: var(--ok); }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl.overdue strong { color: var(--bad); }
.tl-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.notatka { margin: 6px 0 0; white-space: pre-wrap; background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.day-sep { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 14px 0 2px; list-style: none; }

.rel-list { list-style: none; margin: 0; padding: 0; }
.rel-list li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.rel-list li:last-child { border-bottom: 0; }
.rel-list .row2 { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ===== Lejek (kanban) ===== */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(240px, 1fr)); gap: 14px; align-items: start; }
.kcol { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 160px; transition: background .15s, border-color .15s; }
.kcol.drop { background: var(--accent-soft); border-color: var(--accent); border-style: dashed; }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.kcol-head strong { font-size: 14px; }
.kcol-head .sum { margin-left: auto; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.kcol-head::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.kcol.Wygrana .kcol-head::before { background: var(--ok); }
.kcol.Przegrana .kcol-head::before { background: var(--bad); }
.kcard { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.kcard:hover { border-color: var(--border-strong); }
.kcard.dragging { opacity: .45; }
.kcard.static { cursor: pointer; }
.kanban { overflow-x: auto; }
.kcol-etap .kcol-head { flex-wrap: wrap; row-gap: 4px; }
.kcol-etap .kcol-head strong { flex: 1 1 calc(100% - 20px); line-height: 1.3; }
.kcol-etap .kcol-head .badge { margin-left: 16px; }
.kcard > .badge { margin-top: 4px; }
.kcard .k-title { font-weight: 600; color: var(--text); display: block; }
.kcard .k-client { color: var(--muted); font-size: 12.5px; }
.kcard .k-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; }
.kcard .k-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.kcard .k-foot .avatar { margin-left: auto; }
.kempty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 16px 0; }

/* ===== Wyszukiwanie po NIP ===== */
.nip-form .row { display: flex; gap: 8px; }
.nip-form input { flex: 1; font-size: 17px; padding: 9px 12px; }
.nip-form label { font-weight: 600; display: block; margin-bottom: 6px; }
.nip-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.nip-results > .status, .nip-results > .wide { grid-column: 1 / -1; margin: 0; }
.nip-results > .card { margin: 0; }
.card.crm { border-color: var(--ok); }

/* ===== Modal ===== */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 32, .45); display: grid; place-items: start center; padding: 12vh 16px 16px; z-index: 50; }
.modal { background: var(--card); border-radius: 12px; box-shadow: var(--shadow-lg); width: min(480px, 100%); padding: 18px; }
.modal h2 { font-size: 16px; }
.modal input { width: 100%; }
.modal ul { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.modal li button { width: 100%; background: none; color: var(--text); text-align: left; display: block; font-weight: 600; padding: 8px 10px; border-radius: 6px; }
.modal li button:hover { background: var(--bg); }
.modal li small { display: block; color: var(--muted); font-weight: 400; }

/* ===== Responsywność ===== */
@media (max-width: 1280px) {
  .record { grid-template-columns: 280px minmax(0, 1fr); }
  .record > .rel { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
  .record > .rel > .card { margin: 0; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: 64px minmax(0, 1fr); }
  .sidebar { padding: 14px 8px; }
  .sidebar .label, .brand .label, .sidebar .side-foot { display: none; }
  .sidebar a { justify-content: center; padding: 10px; }
  .sidebar a.active::before { left: -8px; }
  .sidebar .count { position: absolute; top: 2px; right: 2px; margin: 0; min-width: 17px; line-height: 17px; font-size: 10.5px; padding: 0 4px; }
  .brand { justify-content: center; padding: 4px 0 18px; }
  .dash { grid-template-columns: 1fr; }
  .record { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: repeat(3, 260px); overflow-x: auto; padding-bottom: 8px; }
  .me .label { display: none; }
}
@media (max-width: 640px) {
  .page { padding: 16px; }
  .topbar { padding: 8px 16px; gap: 8px; }
  .btn-add .label { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  dl { grid-template-columns: 1fr; }
  dt { margin-top: 6px; }
  .nip-results { grid-template-columns: 1fr; }
  .nip-form .row { flex-direction: column; }
  .toolbar input { width: 100%; }
  table.responsive, table.responsive thead, table.responsive tbody, table.responsive tr, table.responsive td { display: block; }
  table.responsive thead { display: none; }
  table.responsive td { border: 0; padding: 2px 16px; }
  table.responsive tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.responsive td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  td.num { text-align: left; }
}

/* Wąskie panele (prawa kolumna karty): termin pod tytułem zadania. */
.rel ul.zadania li { grid-template-columns: auto minmax(0, 1fr); }
.rel ul.zadania .z-when { grid-column: 2; grid-row: 2; }
.rel ul.zadania .z-meta { grid-row: 3; }

/* ===== Karta szansy (lewa kolumna: szansa + klient) ===== */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 6px; align-items: center; min-width: 0; }
.crumbs span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-btn { background: none; border: 0; padding: 2px 4px; color: var(--accent); font-weight: 500; font-size: 13.5px; }
.link-btn:hover { background: none; text-decoration: underline; }
.icon-btn { padding: 4px; }
.icon-btn svg { width: 18px; height: 18px; }
.deal { position: relative; }
.deal-tools { position: absolute; top: 10px; right: 8px; display: flex; align-items: center; gap: 2px; }
.deal-tools .menu { min-width: 260px; }
.deal-title { font-size: 18px; font-weight: 700; line-height: 1.3; margin: 26px 0 8px; overflow-wrap: anywhere; }
.deal-client { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--accent); }
.deal-client svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.deal-client span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.deal-pic { width: 120px; height: 120px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center;
  margin: 22px auto; color: var(--border-strong); }
.deal-pic svg { width: 58px; height: 58px; stroke-width: 1.4; }
ul.props { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
ul.props li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; align-items: start; }
ul.props li > svg { width: 18px; height: 18px; color: var(--muted); margin-top: 1px; }
ul.props li > span { overflow-wrap: anywhere; }

/* ===== Status szansy sprzedaży ===== */
.status-card h2 { padding-bottom: 12px; margin: -2px -16px 12px; padding-left: 16px; padding-right: 16px; border-bottom: 1px solid var(--border); }
.status-now { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.status-now .status-name { font-size: 15px; font-weight: 500; }
.status-now .link-btn { margin-left: auto; }
.status-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: #fdf0c8; color: #8a6a10; }
.status-ico svg { width: 15px; height: 15px; stroke-width: 2.2; }
.status-ico.Wygrana { background: var(--ok-bg); color: var(--ok); }
.status-ico.Przegrana { background: var(--bad-bg); color: var(--bad); }
.powod { margin: 8px 0 0; }
.prob { padding-top: 12px; }
.prob-label { font-size: 13px; margin-bottom: 8px; }
.prob-row { display: flex; align-items: center; gap: 12px; }
.progress { flex: 1; height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 999px; background: var(--ok); min-width: 4px; }
.progress.Przegrana span { background: var(--bad); }
.prob-row strong { min-width: 40px; text-align: right; }

/* Okno zmiany statusu */
.status-choice { display: grid; gap: 8px; margin: 6px 0 14px; }
.status-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.status-opt:hover { background: var(--bg); }
.status-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.status-opt input { margin: 0; accent-color: var(--accent); }
.status-opt small { display: block; color: var(--muted); font-size: 12.5px; }
.status-form .field { margin-bottom: 12px; color: var(--muted); }
.status-form textarea { color: var(--text); font-weight: 400; }
.proc-row { display: flex; align-items: center; gap: 12px; }
.proc-row input[type=range] { flex: 1; padding: 0; border: 0; accent-color: var(--ok); }
.proc-row input[type=range]:focus { outline-offset: 2px; }
.proc-val { min-width: 44px; text-align: right; color: var(--text); font-size: 15px; }
.k-prob { color: var(--muted); }

/* ===== Checklista procesu sprzedaży (karta szansy) ===== */
.proces { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.proces-title { font-size: 13.5px; margin-bottom: 10px; }
.etap-blok + .etap-blok { margin-top: 6px; }
.etap { width: 100%; display: flex; align-items: center; gap: 8px; background: var(--info-bg); color: var(--text); border: 0;
  border-radius: 4px; padding: 5px 10px; font-weight: 500; font-size: 13.5px; text-align: left; }
.etap:hover { background: var(--border); }
.etap svg { width: 15px; height: 15px; flex: none; }
.etap .etap-licznik { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 400; }
.etap.biezacy { background: var(--brand); color: #fff; }
.etap.biezacy .etap-licznik, .etap.biezacy .hint-ico { color: #dbe6ef; }
ul.kroki { list-style: none; margin: 6px 0 4px; padding: 0 0 0 4px; display: grid; gap: 7px; }
ul.kroki li { display: flex; align-items: flex-start; gap: 6px; font-size: 13.5px; }
ul.kroki label.check { align-items: flex-start; }
ul.kroki label.check input { margin-top: 1px; }
.hint-ico { display: inline-grid; place-items: center; color: var(--muted); cursor: help; flex: none; }
.hint-ico svg { width: 15px; height: 15px; }
.etap-label { display: inline-block; margin-top: 4px; font-size: 11.5px; color: var(--brand); background: var(--accent-soft); border-radius: 4px; padding: 1px 6px; }
.etap-label.block { display: table; }

/* ===== Ustawienia procesu ===== */
.suma-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.warn-txt { color: var(--warn); }
.nowrap { white-space: nowrap; }
.etap-ust-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.etap-nr { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12.5px; flex: none; }
.etap-ust-head .etap-nazwa { flex: 1; font-weight: 600; font-size: 15px; }
.etap-ust > input { width: 100%; margin-bottom: 10px; font-size: 13px; }
table.kroki-ust th, table.kroki-ust td { padding: 5px 6px; }
table.kroki-ust td input { width: 100%; }
table.kroki-ust input.waga, .krok-nowy input.waga { width: 72px; text-align: right; }
.krok-nowy { display: flex; gap: 8px; margin-top: 10px; }
.krok-nowy input:first-child { flex: 1; }
button.danger:hover { color: var(--bad); }
button.icon-btn:disabled { opacity: .3; cursor: default; }
.page.ustawienia { max-width: 1120px; }
table.kroki-ust { table-layout: fixed; }
table.kroki-ust th:nth-child(1) { width: 46%; }
table.kroki-ust th:nth-child(2) { width: 28%; }
table.kroki-ust th:nth-child(3) { width: 84px; }
table.kroki-ust th:nth-child(4) { width: 100px; }
table.kroki-ust th:nth-child(5) { width: 112px; }

/* ===== Okno zadania (jak w Livespace) ===== */
.modal:has(.okno-zadania) { width: min(680px, 100%); }
.okno-zadania .field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.okno-zadania .field input, .okno-zadania .field textarea { font-size: 14px; font-weight: 400; color: var(--text); width: 100%; }
.zf-head { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.zf-head small { display: block; font-size: 12px; color: var(--muted); }
.zf-head .ro { border-bottom: 1px solid var(--border-strong); padding: 3px 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.typy { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; }
.typy .typ { background: var(--info-bg); color: var(--text); border: 0; font-weight: 500; padding: 7px 12px; }
.typy .typ svg { width: 15px; height: 15px; }
.typy .typ:hover { background: var(--border); }
.typy .typ.on { background: var(--brand); color: #fff; }
.zf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.zf-data { display: flex; gap: 10px; align-items: center; }
.zf-data input[type=date] { flex: 1; }
.zf-data input[type=time] { width: 110px; flex: none; }
.zf-data label.check { color: var(--text); font-weight: 400; font-size: 14px; white-space: nowrap; }
textarea.opis-zolty { background: #fffbe0; border-color: #ece3a6; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: 16px -18px -18px; padding: 14px 18px;
  border-top: 1px solid var(--border); background: var(--bg); border-radius: 0 0 12px 12px; }
.modal-foot .link-btn { margin-right: auto; }
.typ-ico { display: inline-grid; place-items: center; color: var(--muted); margin-right: 6px; vertical-align: -2px; }
.typ-ico svg { width: 15px; height: 15px; }

/* Znaczniki kroków z wymaganiami i ich ustawienia */
.wymaga { display: inline-flex; gap: 2px; color: var(--warn); flex: none; }
.wymaga svg { width: 14px; height: 14px; }
.tl.krok .tl-icon { background: var(--accent-soft); color: var(--brand); }
.tl.krok.cofniety { opacity: .65; }
.wymaga-ust { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
table.kroki-ust td input[type=checkbox] { width: 16px; height: 16px; }
.wymaga-ust label.check { font-size: 13px; }
.wymaga-ust input:not([type=checkbox]) { width: 100%; font-size: 13px; }
table.kroki-ust th:nth-child(1) { width: 34%; }
table.kroki-ust th:nth-child(2) { width: 20%; }
table.kroki-ust th:nth-child(3) { width: 22%; }
@media (max-width: 640px) { .zf-head, .zf-row { grid-template-columns: 1fr; } .modal-foot { flex-wrap: wrap; } }
table.kroki-ust th:nth-child(4) { width: 76px; }
table.kroki-ust th:nth-child(5) { width: 96px; }
table.kroki-ust th:nth-child(6) { width: 112px; }
.okno-zadania .field input[type=checkbox] { width: 16px; height: 16px; flex: none; }

/* ===== Formularz nowej szansy ===== */
.nowa-szansa .field-block { margin-bottom: 18px; }
.field-label { display: block; font-weight: 600; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.nowa-szansa select, .nowa-szansa #klientSzukaj { width: 100%; font-size: 14px; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 25; top: calc(100% + 4px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; max-height: 340px; overflow: auto; }
.combo-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; background: none; color: var(--text);
  border: 0; border-radius: 6px; padding: 7px 10px; text-align: left; font-weight: 400; }
.combo-opt:hover, .combo-opt.sel { background: var(--bg); }
.combo-opt.boxed { border: 1px solid var(--border-strong); margin-top: 6px; }
.combo-main { font-weight: 600; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.combo-sub { font-size: 12.5px; color: var(--muted); }
.combo-info { padding: 10px; color: var(--muted); font-size: 13px; }
.nowy-klient { margin-top: 8px; padding: 12px; background: var(--bg); border-radius: 8px; }
.nowy-klient .row { display: flex; gap: 8px; }
.nowy-klient .row input { flex: 1; }
.wybrany { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 8px; }
.wybrany-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.nowa-osoba { margin-top: 10px; padding: 12px; background: var(--bg); border-radius: 8px; }
.opis-szansy { white-space: pre-wrap; }

/* ===== Maile ===== */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 26px 16px; margin-bottom: 10px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg); cursor: pointer; text-align: center; }
.dropzone:hover, .dropzone.nad { border-color: var(--accent); background: var(--accent-soft); }
.tl.mail .tl-icon { background: #eef0fb; color: #3b4fb8; }
.mail-tresc.zwiniety { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
ul.zalaczniki { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.zalaczniki li { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px; }
ul.zalaczniki svg { width: 13px; height: 13px; color: var(--muted); }
.danger-txt { color: var(--bad); }

/* ===== Skrzynka Microsoft 365 ===== */
.m365 { margin-bottom: 14px; }
.m365-info { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 8px; }
.m365-panel { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.m365-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.m365-head button { margin-left: auto; }
.m365-panel .row { display: flex; gap: 8px; margin-bottom: 6px; }
.m365-panel .row input { flex: 1; }
ul.m365-lista { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; background: var(--card); border-radius: 8px; }
ul.m365-lista li { padding: 8px 10px; border-bottom: 1px solid var(--border); }
ul.m365-lista li:last-child { border-bottom: 0; }
ul.m365-lista li.dolaczony { opacity: .55; }
ul.m365-lista label.check { align-items: flex-start; }
/* Kwota + waluta w jednym wierszu */
.kwota-waluta { display: flex; gap: 6px; }
.kwota-waluta input { flex: 1; min-width: 0; }
.kwota-waluta select { width: 86px; flex: none; }
/* Ekran logowania kontem Microsoft 365 */
.logowanie { position: fixed; inset: 0; z-index: 1000; background: var(--bg); display: grid; place-items: center; padding: 16px; }
.logowanie-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 32px; max-width: 420px; width: 100%; text-align: center; }
.logowanie-box h1 { margin: 12px 0 6px; font-size: 22px; }
.logowanie-logo { width: 56px; height: 56px; border-radius: 12px; }
.logowanie-box button { margin-top: 12px; width: 100%; justify-content: center; text-align: center; }
.logowanie-box .status { text-align: left; }
.logowanie-box { position: relative; }
.logowanie-box .lang-switch { position: absolute; top: 12px; right: 12px; }
.logowanie-box .lang-switch button { margin-top: 0; width: auto; }
/* Treść przetłumaczona automatycznie (oryginał w podpowiedzi / pod „pokaż oryginał”) */
.przetlumaczone { text-decoration: underline dotted var(--border-strong); text-underline-offset: 3px; }
.tl-info { margin-top: 2px; }
.tl-info .link-btn { font-size: inherit; }
.blad-polaczenia { margin: 12px 24px 0; }
/* Oferty (karta szansy) */
.status.warn { background: var(--warn-bg); color: var(--warn); margin: 6px 0 0; padding: 6px 10px; }
.modal-bg:has(.modal-szeroki) { padding-top: 16px; }
.modal.modal-szeroki { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
/* Przyciski zawsze widoczne na dole przewijanego okna */
.modal.modal-szeroki .modal-foot { position: sticky; bottom: -18px; z-index: 1; }
.okno-oferty .grid textarea { width: 100%; font-size: 14px; font-weight: 400; color: var(--text); resize: vertical; }
.okno-oferty .z-pliku { background: var(--accent-soft); }
.okno-oferty .check { margin: 4px 0 10px; }
.grid .kwota-waluta input { flex: 1; min-width: 0; width: auto; }
.grid .kwota-waluta select { flex: 0 0 auto; width: auto; }
.oferta-numer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.oferta-numer a { display: inline-flex; align-items: center; gap: 4px; }
.oferta-numer svg, #ofertyPanel .rel-list svg { width: 15px; height: 15px; vertical-align: -2px; }
.oferta-biezaca .props { margin: 8px 0; }
.oferta-folder { margin: 10px 0 0; }
.oferty-akcje { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.oferty-akcje button svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 4px; }
#ofertyPanel .oferta-biezaca { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
#ofertyPanel .section-title { margin-top: 14px; }
.tabs .count { margin-left: 6px; min-width: 18px; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; line-height: 18px; text-align: center; }
/* Zamówienie z oferty */
.modal.modal-bardzo-szeroki { width: min(1100px, 100%); }
.oferty-akcje { gap: 8px; }
.oferty-akcje .akceptacja { background: var(--ok); }
.zamowienie-blok { border: 1px solid var(--ok); background: var(--ok-bg); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.zamowienie-blok svg { width: 15px; height: 15px; vertical-align: -2px; }
.zam-linki { display: flex; gap: 14px; flex-wrap: wrap; }
.okno-zamowienia .ro { color: var(--text); font-weight: 400; font-size: 14px; padding: 7px 0; }
.zam-odbiorca, .zam-towar { position: relative; }
.zam-odbiorca > span:first-of-type { color: var(--text); font-weight: 400; font-size: 14px; }
.combo-lista { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; background: var(--card); border: 1px solid var(--border-strong); border-radius: 8px;
  box-shadow: var(--shadow-lg); list-style: none; margin: 2px 0 0; padding: 4px; max-height: 260px; overflow: auto; }
.combo-lista button { width: 100%; text-align: left; background: none; color: var(--text); font-weight: 400; padding: 6px 8px; border-radius: 6px; display: block; }
.combo-lista button:hover { background: var(--bg); }
.combo-lista small { display: block; color: var(--muted); }
.zam-narzut { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.zam-narzut label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.zam-narzut label { width: max-content; }
/* Pole narzutu na szerokość etykiety (input nie poszerza etykiety) */
.zam-narzut input { width: 0; min-width: 100%; }
.zam-pozycje { width: 100%; border-collapse: collapse; font-size: 13px; }
.zam-pozycje th { text-align: left; font-size: 11.5px; color: var(--muted); text-transform: uppercase; padding: 6px; border-bottom: 1px solid var(--border); }
.zam-pozycje td { padding: 6px; vertical-align: top; border-bottom: 1px solid var(--border); }
.zam-pozycje .num { text-align: right; white-space: nowrap; }
.zam-pozycje input { width: 100%; }
.zam-pozycje textarea { width: 100%; font-size: 13px; resize: vertical; }
.zam-pozycje svg { width: 16px; height: 16px; }
.zam-suma { display: grid; gap: 4px; justify-content: end; text-align: right; margin: 10px 0; }
.zam-kroki { list-style: none; padding: 0; display: grid; gap: 8px; }
.zam-kroki li { padding-left: 24px; position: relative; }
.zam-kroki li::before { position: absolute; left: 0; font-weight: 700; }
.zam-kroki li.w-toku::before { content: '…'; color: var(--muted); }
.zam-kroki li.ok::before { content: '✓'; color: var(--ok); }
.zam-kroki li.blad::before { content: '✗'; color: var(--bad); }
.zam-kroki li.blad .small { color: var(--bad); }
.okno-zamowienia .grid label.check { flex-direction: row; align-items: center; gap: 8px; align-self: end; padding-bottom: 8px; color: var(--text); font-weight: 400; font-size: 14px; }
.okno-zamowienia .grid label.check input { width: auto; }
.zam-kroki li.test::before { content: "○"; color: var(--warn); }
.okno-zamowienia .grid.zam-numer-opis { grid-template-columns: minmax(170px, 220px) 1fr; }
@media (max-width: 640px) { .okno-zamowienia .grid.zam-numer-opis { grid-template-columns: 1fr; } }
/* Wiersz narzutu w kolumnach tabeli pozycji: narzut pod „Opis z oferty”, przycisk pod „Towar (Symfonia)” */
.zam-pozycje { table-layout: fixed; }
.zam-narzut { display: grid; grid-template-columns: 26% 1fr; align-items: end; gap: 0; }
.zam-narzut > div { padding: 0 6px; }
.zam-narzut-akcje { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .zam-narzut { grid-template-columns: 1fr; gap: 8px; } }
/* Role: akcje sprzedaży i ustawienia ukryte dla ról bez uprawnień (serwer i tak sprawdza zapisy) */
body:not(.rola-handlowiec):not(.rola-administrator) .tylko-sprzedaz { display: none !important; }
body:not(.rola-administrator) .tylko-admin { display: none !important; }
.test-roli { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); font-weight: 600; }
.test-roli select { font-size: 12px; padding: 4px 6px; border-color: var(--warn); }
.deal-status { display: flex; align-items: center; gap: 6px; margin: -2px 0 8px; }
.deal-status .status-ico svg { width: 16px; height: 16px; }
/* Koniec produkcji i faktury */
body:not(.rola-podglad):not(.rola-administrator) .tylko-produkcja { display: none !important; }
.produkcja-stan { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; }
.produkcja-stan svg { width: 15px; height: 15px; }
.produkcja-stan button svg { margin-right: 4px; vertical-align: -2px; }
#fakturyBlok .section-title { margin-top: 14px; }
.faktura { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; background: var(--card); }
.faktura-akcje { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.faktury-akcje { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.faktury-akcje button svg { width: 20px; height: 20px; margin-right: 6px; vertical-align: -5px; flex: none; }
.faktura-projekty { display: grid; gap: 6px; margin-bottom: 8px; }
body:not(.rola-handlowiec) .tylko-handlowiec { display: none !important; }
/* Pasek wczytywania (długie zapytania, odnawianie logowania) */
.wczytywanie { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 900; background: var(--accent); color: #fff;
  padding: 6px 16px 6px 34px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); }
.wczytywanie::before { content: ''; position: absolute; left: 12px; top: 50%; width: 12px; height: 12px; margin-top: -7px; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: wczytywanie-obrot .8s linear infinite; }
@keyframes wczytywanie-obrot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wczytywanie::before { animation: none; } }
